Skip to content

Commit

Permalink
Use scalable graphics for hierarchical state machine
Browse files Browse the repository at this point in the history
Also updating the other state machine figure with the same style.
  • Loading branch information
henrikt-ma committed Sep 7, 2020
1 parent 682391b commit c556f8a
Show file tree
Hide file tree
Showing 6 changed files with 2,424 additions and 117 deletions.
24 changes: 14 additions & 10 deletions chapters/statemachines.tex
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,16 @@ \subsection{Merging Connections to Multiple Outputs}\label{merging-connections-t

\subsection{Example}\label{example}

\begin{example}
Consider the following hierarchical state machine:

\includegraphics[width=5.34375in,height=5.72917in]{statemachine2}
\begin{figure}[H]
\begin{center}
\includegraphics{hierarchical-statemachine}
\end{center}
\caption{Example of a hierarchical state machine.}
\label{fig:hierarchical-statemachine}
\end{figure}

The model demonstrates the following properties:
\begin{example}
Consider the hierarchical state machine in \cref{fig:hierarchical-statemachine}. The model demonstrates the following properties:
\begin{itemize}
\item
\lstinline!state1! is a meta state with two parallel state machines in it.
Expand All @@ -484,19 +488,19 @@ \subsection{Example}\label{example}
\lstinline!outer!. The top level declares \lstinline!v! as \lstinline!inner! and gives the start value.
\item
\lstinline!count! is defined with a start value in \lstinline!state1!. It is reset when
a reset transition (v\textgreater{}=20) is made to \lstinline!state1!.
a reset transition (\lstinline!v >= 20!) is made to \lstinline!state1!.
\item
\lstinline!stateX! declares the local variable \lstinline!w! to be equal to \lstinline!v! declared
as \lstinline!inner input!.
\item
\lstinline!stateY! declares a local counter \lstinline!j!. It is reset at start and as a
consequence of the reset transition (v\textgreater{}=20) to \lstinline!state1!:
When the reset transition ($v\ge 20$) fires, then the variables of the
consequence of the reset transition (\lstinline!v >= 20!) to \lstinline!state1!:
When the reset transition (\lstinline!v >= 20!) fires, then the variables of the
active states are reset immediately (so \lstinline!count! from \lstinline!state1!, and \lstinline!i!
from \lstinline!stateX!). The variables of other states are only reset at the time
instants when these states become active. So \lstinline!j! in \lstinline!StateY! is reset to
0, when the transition \lstinline!stateX.i! \textgreater{} 20 fires (after \lstinline!state1!
became active again, so after the reset transition $v\ge 20$).
0, when the transition \lstinline!stateX.i > 20! fires (after \lstinline!state1!
became active again, so after the reset transition \lstinline!v >= 20!).
\item
Synchronizing the exit from the two parallel state machines of
\lstinline!state1! is done by checking that \lstinline!stated! and \lstinline!stateY! are active using the
Expand Down
Binary file added media/hierarchical-statemachine.pdf
Binary file not shown.
Loading

0 comments on commit c556f8a

Please sign in to comment.