Skip to content

Commit

Permalink
Remove unnecessary splitting of source code lines
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Jan 18, 2022
1 parent b04fc7a commit f2104c8
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions chapters/statemachines.tex
Expand Up @@ -272,9 +272,7 @@ \subsection{State Activation}\label{state-activation}
\begin{lstlisting}[language=modelica]
Integer immediate =
max(
if t[i].immediate and t[i].from == selectedState and c[i]
then i
else 0
if t[i].immediate and t[i].from == selectedState and c[i] then i else 0
for i in 1 : size(t, 1));
\end{lstlisting}

Expand All @@ -285,9 +283,7 @@ \subsection{State Activation}\label{state-activation}
\begin{lstlisting}[language=modelica]
Integer delayed =
max(
if not t[i].immediate and t[i].from == nextState and c[i]
then i
else 0
if not t[i].immediate and t[i].from == nextState and c[i] then i else 0
for i in 1 : size(t, 1));
\end{lstlisting}

Expand All @@ -300,9 +296,7 @@ \subsection{State Activation}\label{state-activation}
\begin{lstlisting}[language=modelica]
Integer nextState =
if active then
(if fired > 0
then t[fired].to
else selectedState)
(if fired > 0 then t[fired].to else selectedState)
else
previous(nextState);
\end{lstlisting}
Expand Down Expand Up @@ -371,15 +365,11 @@ \subsection{Semantics Summary}\label{semantics-summary}
// For strong (immediate) and weak (delayed) transitions
Integer immediate =
max(
if (t[i].immediate and t[i].from == selectedState and c[i])
then i
else 0
if (t[i].immediate and t[i].from == selectedState and c[i]) then i else 0
for i in 1 : size(t, 1));
Integer delayed =
max(
if (not t[i].immediate and t[i].from == nextState and c[i])
then i
else 0
if (not t[i].immediate and t[i].from == nextState and c[i]) then i else 0
for i in 1 : size(t, 1));
Integer fired = max(previous(delayed), immediate);
output Integer activeState =
Expand Down

0 comments on commit f2104c8

Please sign in to comment.