<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%=====================================================================
\section{The PeriodicSpeed Behavior}
%=====================================================================
\wikisec{grp=bhvsolo, file=BehaviorPeriodicSpeed,short=PeriodicSpeed Behavior}
\index{IvP Behaviors Implemented!\var{BHV\_PeriodicSpeed}}
\index{PeriodicSpeed Behavior}
\label{bhv_periodic_spd}

This behavior will periodically influence the speed of the vehicle
while remaining neutral at other times. The timing is specified by a
given period in which the influence is on (busy), and a period
specifying when the influence if off (lazy), as depicted in Figure
\ref{periodic_speed_fig}.

\vspace{0.2in}
\begin{figure}[H]
  \centering 
  \includegraphics[width=0.82\textwidth]{figs_bhvs/periodic_speed.png}
  \caption{{\bf Busy and Lazy Modes:} In the busy mode the behavior
    will produce an objective function defined over speed that will
    potentially influence the speed of the vehicle. In the lazy mode,
    it simply will not produce an objective function.}
  \label{periodic_speed_fig}
\end{figure}
\vspace{0.1in}

It was conceived for use on an AUV equipped with an acoustic modem to
periodically slow the vehicle to reduce self-noise and reduce
communication difficulty. One can also specify a flag (a MOOS variable
and value) to be posted at the start of the period to prompt an
outside action such as the start of communication attempts.

%=======================================================================
\subsection{Configuration Parameters}

\input{includes/bhv_all_properties}

\vspace{0.15in}
\begin{listing}{Configuration Parameters for the Periodic Speed Behavior}
\label{lst_bhv_periodic_speed}
\small
\renewcommand{\arraystretch}{1.15}
\begin{longtable}{rp{0.76\textwidth}} 

  {\bf Parameter} &amp; {\bf Description} \\  

  \bvar{basewidth}: &amp; The width of the ZAIC basewidth, in m/sec, in
  the IvP function. \\ 

  \bvar{initially\_busy}: &amp; If true the initial state is busy.  The
  default is false. \\

  \bvar{peakwidth}: &amp; The width of the ZAIC peakwidth, in m/sec in the
  IvP function. \\

  \bvar{period\_busy}: &amp; The duration of the busy period, in
  seconds. \\

  \bvar{period\_lazy}: &amp; The duration of the lazy period, in
  seconds. \\

  \bvar{period\_speed}: &amp; The desired speed, in m/sec, in the IvP
  function. \\

  \bvar{reset\_upon\_running}: &amp; Initial conditions reset upon
  entering the running state. Default is \var{true}.\\

  \bvar{summit\_delta}: &amp; The extent of the ZAIC summit delta in the
  IvP function. \\

\end{longtable}
\end{listing}
\normalsize

\vspace{0.15in}
\begin{listing}{Example Configuration Block}
\label{lst_bhv_periodic_speed_ex}

\begin{fileverb}
Behavior = BHV_PeriodicSpeed
{
  // General Behavior Parameters
  // ---------------------------
  name         = transit            // example
  pwt          = 100                // default
  condition    = MODE==TRANSITING   // example
  updates      = PSPD_UPDATES       // example

  // Parameters specific to this behavior
  // ------------------------------------
           basewidth = 0            // default
      initially_busy = false        // default
           peakwidth = 0            // default
         period_busy = 0            // default
         period_lazy = 0            // default
        period_speed = 0            // default
  reset_upon_running = true         // default
        summit_delta = 25           // default
}
\end{fileverb}
\end{listing}


%=======================================================================
\subsection{Variables Published}

\vspace{0.15in}
\begin{listing}{Variables Published the Periodic Speed Behavior}
\label{lst_bhv_periodic_speed_pub}
\small
\renewcommand{\arraystretch}{1.15}
\begin{longtable}{rp{0.76\textwidth}} 

  {\bf Variable} &amp; {\bf Description} \\  

  \mvar{PS\_PENDING\_BUSY}: &amp; Publishes the amount of time in seconds
  until the behavior reaches the busy mode. During the busy mode this
  value is zero, and it resets to the value given by the
  \bvar{period\_lazy} parameter upon transitioning into the lazy
  mode. \\

  \mvar{PS\_PENDING\_LAZY}: &amp; Publishes the amount of time in seconds
  until the behavior reaches the lazy mode. During the lazy mode this
  value is zero, and it resets to the value given by
  \bvar{period\_busy} upon transitioning back into the busy mode. To
  reduce posting volume, the values posted will be rounded to the
  nearest second until less than one second remains, after which
  fractions are posted. \\

  \mvar{PS\_BUSY\_COUNT}: &amp; Thi variable is posted by the behavior
  each time it enters the busy mode. The value is an integer
  indicating the number of times it has entered the busy mode, posting
  zero initially.\\

\end{longtable}
\end{listing}
\normalsize


%=======================================================================
\subsection{State Transition Policy and Initial Condition Parameters}

The behavior alternates between one of two modes, the busy mode or the
lazy mode. In the former, it will produce an objective function over
the {\em speed} decision variable, and in the latter mode it will
simply refrain from producing the objective function.  Note that these
modes are different from the general behavior run states described in
Section \ref{sec_run_states}. If this behavior is idle, i.e., has not
met the conditions for being in the running state, it will not
generate an objective function regardless of whether it is in the busy
or lazy mode.

\pskip

When the behavior enters the busy mode, it resets a timer which counts
down from \bvar{period\_busy} seconds, after which it enters the lazy
mode.  When it enters the lazy mode, it resets a timer which counts
down from \bvar{period\_lazy} seconds, after which it goes back to the
busy mode. By default the behavior is initially in the lazy mode, but
it can be configured in the opposite manner by setting
\bvar{initially\_busy} to \var{true}.

\pskip

By default, when \bvar{reset\_upon\_running} is true, each time the
behavior enters the running state, the busy/lazy mode is set to its
initial value, and all timers are reset to their initial values. This
is true regardless of whether it is entering the running state upon
initial helm engagement, or due to transitioning from the idle
state. This can be changed by setting \bvar{reset\_upon\_running} to
false. In this case the timers are counting down immediately upon helm
engagement and continue to do so regardless of the behavior run state.


%\subsubsection{Coordinating the BHV\_PeriodicSpeed Behavior with Other
%  Activities}

</pre></body></html>