-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbehavior.sysml
48 lines (39 loc) · 1.39 KB
/
behavior.sysml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package VehicleBehavior {
state def VehicleStates {
entry state off;
state running {
entry state idle;
state moving {
state accelerating;
state cruising;
state braking;
transition accelerating to cruising when targetSpeedReached;
transition cruising to braking when brakePedalPressed;
transition braking to accelerating when acceleratorPressed;
}
transition idle to moving.accelerating when acceleratorPressed;
transition moving to idle when vehicleStopped;
}
transition off to running.idle when ignitionOn if fuelAvailable;
transition running to off when ignitionOff;
// State behaviors
state action off {
exit action disengageParking;
}
state action running {
entry action startEngine;
do action monitorSystems;
exit action shutdownEngine;
}
// Event definitions
event ignitionOn;
event ignitionOff;
event acceleratorPressed;
event brakePedalPressed;
event targetSpeedReached;
event vehicleStopped;
}
part vehicle {
exhibit state vehicleStates : VehicleStates;
}
}