21   The Timer Behavior


21.1 Configuration Parameters
21.2 Variables Published


The Timer behavior is a somewhat unique behavior in that it never produces an objective function. It has virtually no functionality beyond what is derived from the parent IvPBehavior class. It can be used to set a timer between the observation of one or more events (with condition flags) and the posting of one or more events (with end flags). The duration, duration_status, duration_idle_decay, condition, runflag and endflag parameters are all defined generally for behaviors. There are no additional parameters defined for this behavior.

21.1   Configuration Parameters    [top]


Listing 21.1 - Configuration Parameters Common to All Behaviors.

activeflag:A MOOS variable-value pair posted when the behavior is in the active state. Section 6.5.4.
condition:Specifies a condition that must be met for the behavior to be running. Section 6.5.1.
duration:Time in behavior will remain running before declaring completion. Section 7.2.6.
duration_idle_decay:When true, duration clock is running even when in the idle state. Section 7.2.6.
duration_reset:A variable-pair such as MY_RESET=true, that will trigger a duration reset. See Section 7.2.6.
duration_status:The name of a MOOS variable to which the vehicle duration status is published. Section 7.2.6.
endflag:A MOOS variable-value pair posted when the behavior has completed. Section 6.5.4.
idleflag:A MOOS variable-value pair posted when the behavior is in the idle state. Section 6.5.4.
inactiveflag:A MOOS variable-value posted when the behavior is not in the active state. Section 6.5.4.
name:The (unique) name of the behavior. Section 7.2.2.
nostarve:Allows a behavior to assert a maximum staleness for a MOOS variable Section 7.2.9.
perpetual:If true allows the behavior to to run even after it has completed. Section 7.2.7.
post_mapping:Re-direct behavior output normally to one MOOS variable to another instead. Section 7.2.4.
priority:The priority weight of the behavior. Section 7.2.3.
pwt:Same as priority.
runflag:A MOOS variable and a value posted when a behavior has met its conditions. Section 6.5.4.
spawnflag:A MOOS variable and a value posted when a behavior is spawned. Section 6.5.4.
templating:Turns a behavior into a template for spawning behaviors dynamically. Section 7.7.
updates:A MOOS variable from which behavior parameter updates are read dynamically. Section 7.2.5.

Listing 21.2 - Example Configuration Block.

 Behavior = BHV_Timer
 {
   // General Behavior Parameters
   // ---------------------------
   name         = bhv_timer            // default
   condition    = WAIT_REQUEST=true    // example
   duration     = 120                  // example
   idleflag     = WAITING=false        // example
   runflag      = WAITING=true         // example
   runflag      = WAITED=false         // example
   endflag      = WAITED=true          // example
   updates      = TIMER_UPDATES        // example

   // Parameters specific to this behavior
   // ------------------------------------
   // None
 }

21.2   Variables Published    [top]


This behavior publishes two variables for monitoring and logging performance - TIMER_IDLE, TIMER_RUNNING.


Page built from LaTeX source using the texwiki program.