Skip to content

Commit

Permalink
Final touches on the Automotive scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
joukestoel committed Jan 12, 2021
1 parent 82ea726 commit bfe9bcc
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/paper/els/Actuators.rebel
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ spec DirectionLights

bright -> blinkLeft::bright: startBlinkLeft;
bright -> hazardLightsOn::bright: startHazardLights;
bright -> off: stopFlashBlink;
bright -> off: stopFlashBlink, stop;
}

flashBlinkRight {
Expand All @@ -142,7 +142,7 @@ spec DirectionLights
dark -> dark: restartFlashBlinking::dark;
bright -> bright: restartFlashBlinking::bright;

bright -> off: stopFlashBlink;
bright -> off: stopFlashBlink, stop;
bright -> blinkRight::bright: startBlinkRight;
bright -> hazardLightsOn::bright: startHazardLights;
}
Expand Down
51 changes: 50 additions & 1 deletion examples/paper/els/Scenario6.rebel
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,42 @@ spec Scenario6
// Pitman arm
this.p is neutral;


event doStep14()
pre: // Event
this.p.startTipBlinkRight(),
// Sensors
this.s.key = KeyState[IN_IGNITION_ON],
// Time
Timer[NOW].timepast = 9001,
// Direction lights
this.d.left = 0,
this.d.right = 0,
this.d.cycle = 0,
// Pitman arm
this.p is neutral;
post: this.d.right' = 100,
this.d.left' = 0,
this.d.cycle' = 0,
this.d' is flashBlinkRight::bright,
this.p' is tipBlinkingRight;

event doStep15()
pre: // Event
this.p.releaseArm(),
// Sensors
this.s.key = KeyState[IN_IGNITION_ON],
// Time
Timer[NOW].timepast = 10800,
// Direction lights
this.d is blinkRight,
this.d.left = 0,
this.d.right = 0,
//this.d.cycle = 4,
// Pitman arm
this.p is tipBlinkingRight;



states:
initial -> step1: doStep1;
step1 -> step2: doStep2;
Expand All @@ -215,6 +250,8 @@ spec Scenario6
step10 -> step11: doStep11;
step11 -> step12: doStep12;
step12 -> step13: doStep13;
step13 -> step14: doStep14;
step14 -> step15: doStep15;

config StartConfig =
s: KeyOnlySensor mocks SensorValues,
Expand Down Expand Up @@ -272,4 +309,16 @@ run UpToStep12 from AfterStep10 in max 2 steps expect trace;

assert UpToStep13 = exists s:Scenario6 | eventually s is step13;
run UpToStep13 from AfterStep10 in max 4 steps expect trace;

config AfterStep13 =
s: KeyOnlySensor mocks SensorValues,
d: DirectionLights is flashBlinkLeft::bright with left = 100, right = 0, cycle = 0, sensors = s, lastBlinkAt = 8000,
p: PitmanArm is neutral with dirLights = d, sensors = s,
scen6: Scenario6 is step13 with s = s, d = d, p = p;

assert UpToStep14 = exists s:Scenario6 | eventually s is step14;
run UpToStep14 from AfterStep13 in max 3 steps expect trace;

assert UpToStep15 = exists s:Scenario6 | eventually s is step15;
run UpToStep15 from AfterStep13 in max 6 steps expect trace;

Binary file modified examples/paper/els/ValidationSequence_v1.8.numbers
Binary file not shown.

0 comments on commit bfe9bcc

Please sign in to comment.