Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added failing test for state machines
- Loading branch information
1 parent
91a80a7
commit 8aeeac1
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
simulation/modelica/statemachines/ConferenceTut1DeadEnd.mo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
model ConferenceTut1DeadEnd "ConferenceTut1 example but without returning transition" | ||
inner Integer i(start=0); | ||
model State1 | ||
outer output Integer i; | ||
equation | ||
i = previous(i) + 2; | ||
end State1; | ||
State1 state1; | ||
model State2 | ||
outer output Integer i; | ||
equation | ||
i = previous(i) - 1; | ||
end State2; | ||
State2 state2; | ||
equation | ||
initialState(state1); | ||
transition( | ||
state1, | ||
state2, | ||
i > 10, | ||
immediate=false); | ||
end ConferenceTut1DeadEnd; |
16 changes: 16 additions & 0 deletions
16
simulation/modelica/statemachines/ConferenceTut1DeadEnd.mos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// name: ConferenceTut1DeadEnd | ||
// keywords: state machines | ||
// status: correct | ||
// | ||
|
||
loadFile("ConferenceTut1DeadEnd.mo"); | ||
echo(false); | ||
simulate(ConferenceTut1DeadEnd, startTime=0, stopTime=30, numberOfIntervals = 0); getErrorString(); | ||
echo(true); | ||
val(i,30.0); | ||
|
||
// Result: | ||
// true | ||
// true | ||
// -13.0 | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters