-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmission-sequence.sysml
More file actions
75 lines (64 loc) · 2.86 KB
/
Copy pathmission-sequence.sysml
File metadata and controls
75 lines (64 loc) · 2.86 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// A lunar mission as behavior: an action flow that spends a delta-v budget and
// skips the landing when it runs short, and the phases as a clocked state machine.
package MissionSequence {
private import ScalarValues::*;
private import ISQ::*;
private import SI::*;
// Three phases with no order between them: well-formed, but asked to
// perform it the runtime has nowhere to begin.
action def LunarMissionUnordered {
action outbound;
action lunarOps;
action returnJourney;
}
// The phases in order, each burn drawing on one budget. A decision after
// lunar orbit insertion checks what is left before committing to a landing.
action def LunarMission {
in budget :> ISQ::speed;
attribute remaining :> ISQ::speed = budget;
out landed : Boolean = false;
out returned : Boolean = false;
first start;
then action translunarInjection assign remaining := remaining - 3150 ['m/s'];
then action lunarOrbitInsertion assign remaining := remaining - 900 ['m/s'];
then decide landingGo;
if remaining >= 3970 ['m/s'] then descent;
else transEarthInjection;
action descent assign remaining := remaining - 2100 ['m/s'];
then action surfaceOperations assign landed := true;
then action ascent assign remaining := remaining - 1870 ['m/s'];
then transEarthInjection;
action transEarthInjection assign remaining := remaining - 1000 ['m/s'];
then action splashdown assign returned := true;
then done;
}
// An object performs the flight with its own budget; the runtime runs the
// action on the object, reading the binding from it.
part def Flight {
attribute budget :> ISQ::speed;
perform action mission : LunarMission { in budget = Flight::budget; }
}
part apollo11 : Flight { attribute :>> budget = 9500 ['m/s']; }
part apollo8 : Flight { attribute :>> budget = 5500 ['m/s']; }
// The phases as modes on the mission clock, in seconds; the executor fires
// the transitions as they fall due.
state def MissionPhases {
entry; then prelaunch;
state prelaunch;
state translunarCoast;
state lunarOrbit;
state onSurface;
state transEarthCoast;
state recovered;
transition first prelaunch accept after 9000 [s] then translunarCoast;
transition first translunarCoast accept after 270000 [s] then lunarOrbit;
transition first lunarOrbit accept after 100000 [s] then onSurface;
transition first onSurface accept after 78000 [s] then transEarthCoast;
transition first transEarthCoast accept after 245000 [s] then recovered;
transition first recovered then done;
}
part def Mission {
exhibit state phases : MissionPhases;
}
part mission : Mission;
}