tweak presence detection
[svn42.git] / go / r3-eventbroker_zmq / metamovement.go
index b274092..8efda88 100644 (file)
@@ -4,13 +4,20 @@ package main
 
 import (
     "time"
-    //~ "./brain"
     pubsub "github.com/tuxychandru/pubsub"
     "container/ring"
     r3events "svn.spreadspace.org/realraum/go.svn/r3events"
     )
 
 
+/// Movement Meta Event Injector:
+///     threshold number of movements within gran_duration*granularity seconds -> SomethingReallyIsMoving{True}
+///     No movement within 3 hours but movement within the last 6 hours -> SomethingReallyIsMoving{False}
+///
+/// Thus SomethingReallyIsMoving{True} fires regularly, but at most every gran_duration seconds
+/// While SomethingReallyIsMoving{False} fires only once to assure us that everybody might really be gone
+
+
 func MetaEventRoutine_Movement(ps *pubsub.PubSub, granularity, gran_duration int , threshold uint32) {
     var last_movement int64
     movement_window := ring.New(granularity+1)