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

The objective of the Memory-Turn-Limit behavior is to avoid vehicle
turns that may cross back on its own path and risk damage to the towed
equipment. Its configuration is determined by the two parameters
described below which combine to set a vehicle turn radius
limit. However, it is not strictly described by a limited turn radius;
it stores a time-stamped history of recent recorded headings and
maintains a {\em heading average}, and forms its objective function on
a range deviation from that average. This behavior merely expresses a
preference for a particular heading. If other behaviors also have a
heading preference, coordination/compromise will take place through
the multi-objective optimization process. The following parameters are
defined for this behavior:

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

\input{includes/bhv_all_properties}

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

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

  \bvar{memory\_time}: &amp; The duration of time for which the heading
  history is maintained and heading average calculated. The default
  value is -1, indicating that the parameter is un-set. In this case
  the behavior will not produce an objective function. \\

  \bvar{turn\_range}: &amp; The range of heading valuesdeviating from the
  current heading average outside of which the behavior reflects sharp
  penalty in its objective function. The default value is -1,
  indicating that the parameter is un-set. In this case the behavior
  will not produce an objective function. \\


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

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

\begin{fileverb}
Behavior = BHV_MemoryTurnLimit
{
  // General Behavior Parameters
  // ---------------------------
  name         = mem_turn_limit       // default
  pwt          = 100                  // default
  condition    = MODE=TRANSITING      // example
  condition    = ARRAY=connected      // example
  updates      = MEM_TURN_UPDATES     // example

  // Parameters specific to this behavior
  // ------------------------------------
         memory_time = 60             // example (seconds)
          turn_range = 30             // example (degrees)
}
\end{fileverb}
\end{listing}



%=====================================================================
\subsection{Calculation of the Heading History}

The heading history is maintained locally in the behavior by storing
the currently observed heading and keeping a queue of n recent
headings within the \bvar{memory\_time} threshold. The heading average
calculation below handles the issue of angle wrap in a set of n
headings $h_0 \ldots h_{n-1}$ where each heading is in the range $[0,359]$.

\begin{equation*}
\text{heading\_avg} = \text{atan2}{(s,c)} \cdot 180/\pi,
\end{equation*}

\noindent 
where s and c are given by:

\begin{equation*}
s = \sum_{k=0}^{n-1} \sin{(h_k \pi / 180))}, \;\;\;\;\;\; 
c = \sum_{k=0}^{n-1} \cos{(h_k \pi / 180))}.
\end{equation*}

\noindent
The vehicle turn radius $r$ is not explicitly a parameter of the 
behavior, but is given by:

\begin{equation*}
r = v/((u/180)\pi),
\end{equation*}

\noindent
where $v$ is the vehicle speed and $u$ is the turn rate given by:

\begin{equation*}
u = \text{\bsvarr{turn\_range}} / \text{\bsvarr{memory\_time}}.
\end{equation*}

\noindent
The same turn radius is possible with different pairs of values for
\bvar{turn\_range} and \bvar{memory\_time}. However, larger values of
\bvar{turn\_range} allow sharper initial turns but temper the turn
rate after the initial sharper turn has been achieved.

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

The only variable published by this behavior is \mvar{MEM\_TURN\_AVG} which 
indicates the present heading average, rounded to the nearest integer.

%=====================================================================
\subsection{The MemoryTurnLimit Objective Function}

A Rendering of the MemoryTurnLimit Objective Function

\begin{figure}[H]
  \centering 
  \includegraphics[width=0.8\textwidth]{figures/mtl_zaic.png}
  \caption{{\bf The MemoryTurnLimit objective function}: The objective
    function produced by the MemoryTurnLimit behavior is defined over
    possible heading values. Depicted here is an objective function
    formed when the recent heading history is 225 degrees and the
    \bvar{turn\_range} parameter is set to 30 degrees. The resulting
    objective function highly favors headings in the range of 190-240
    degrees. One the right is a "birds-eye" view of the function,
    and on the right the function is viewed at an angle to appreciate
    the 3D quality of the function. Higher (red) values correspond to
    higher utility.}
\label{mtlof_fig}
\end{figure}








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