You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// member feature CC1_snapshots :>> ExtendedOccurrences::ExtendedOccurrence::snapshots featured by CC1;
8
+
//}
9
+
10
+
// portions are not variable
11
+
portion :>> startShot {
12
+
var feature :>> x = 0;
13
+
//member feature :>> CC1::x featured by CC1_startShot_snapshots = 0 {
14
+
// member feature CC1_startShot_snapshots :>> CC1_snapshots featured by CC1::startShot;
15
+
//}
16
+
}
17
+
18
+
portion t :> timeSlices {
19
+
var feature y;
20
+
//member feature y featured by CC1_t_snapshots {
21
+
// member feature CC1_t_snapshots :>> ExtendedOccurrences::ExtendedOccurrence::snapshots featured by CC1::t;
22
+
//}
23
+
portion :>> startShot {
24
+
var feature :>> x = 0;
25
+
//member feature :>> CC1::x featured by CC1_t_startShot_snapshots = 0 {
26
+
// member feature CC1_t_startShot_snapshots :>> CC1_snapshots featured by CC1::t::startShot;
27
+
//}
28
+
var feature :>> y = 1;
29
+
//member feature :>> CC1::t::y featured by CC1_t_startShot_snapshots = 1 {
30
+
// member feature CC1_t_startShot_snapshots :>> CC1_t_snapshots featured by CC1::t::startShot;
31
+
//}
32
+
}
33
+
portion t1 :> timeSlices {
34
+
portion :>> startShot {
35
+
var feature :>> x = 2;
36
+
//member feature :>> CC1::x featured by CC1_t_t1_startShot_snapshots = 2 {
37
+
// member feature CC1_t_t1_startShot_snapshots :>> CC1_snapshots featured by CC1::t::t1::startShot;
38
+
//}
39
+
var feature :>> y = 3;
40
+
//member feature :>> CC1::t::y featured by CC1_t_t1_startShot_snapshots = 3 {
41
+
// member feature CC1_t_t1_startShot_snapshots :>> CC1_t_snapshots featured by CC1::t::t1::startShot;
42
+
//}
43
+
}
44
+
}
45
+
}
46
+
}
47
+
48
+
private import ScalarValues::Boolean;
49
+
private import ScalarValues::Real;
50
+
51
+
class Car :> ExtendedOccurrence {
52
+
var feature driver : Person [0..1];
53
+
//member feature driver : Person [0..1] featured by Car_snapshots {
54
+
// member feature Car_snapshots :>> ExtendedOccurrences::ExtendedOccurrence::snapshots featured by Car;
55
+
//}
56
+
var feature speed : Real [1];
57
+
//member feature speed : Real [1] featured by Car_snapshots {
58
+
// member feature Car_snapshots :>> ExtendedOccurrences::ExtendedOccurrence::snapshots featured by Car;
59
+
//}
60
+
61
+
// bind the current speed to the current speed of the current driver
62
+
// var binding driver.speed = speed;
63
+
//member connector : Links::SelfLink featured by Car_snapshots {
64
+
// :>> that : Car_snapshots;
65
+
// end feature :>> thisThing references that.driver.while{interval = Car_snapshots::self}.speed;
66
+
// end feature :>> thisThing references that.driver.at{timeslices = Car_snapshots::self.moment}.speed;
67
+
// end feature :>> sameThing references that.speed;
68
+
// member feature Car_snapshots :>> ExtendedOccurrences::ExtendedOccurrence::snapshots featured by Car;
69
+
//}
70
+
71
+
portion operated [0..*] :> timeSlices {
72
+
var feature :>> driver [1];
73
+
//member feature :>> Car::driver [1] featured by Car_operated_snapshots {
74
+
// member feature Car_operated_snapshots :>> Car_snapshots featured by Car::operated;
75
+
76
+
// var feature :>> isLicensed = true;
77
+
// member feature isLicensed1 :>> Person::isLicensed featured by Car_operated_driver_snapshots = true {
78
+
// member feature Car_operated_driver_snapshots :>> Person_snapshots featured by Car::operated::driver;
79
+
// }
80
+
//}
81
+
82
+
//portion :>> snapshots {
83
+
// public import operated;
84
+
//}
85
+
}
86
+
87
+
var feature engine [1];
88
+
//member feature engine [1] featured by Car_snapshots {
89
+
// member feature Car_snapshots :>> ExtendedOccurrences::ExtendedOccurrence::snapshots featured by Car;
90
+
//}
91
+
92
+
var feature transmission [1];
93
+
//member feature transmission [1] featured by Car_snapshots {
94
+
// member feature Car_snapshots :>> ExtendedOccurrences::ExtendedOccurrence::snapshots featured by Car;
95
+
//}
96
+
97
+
var connector drive from engine to transmission;
98
+
//member connector drive featured by Car_snapshots from engine to transmission {
99
+
// member feature Car_snapshots :>> ExtendedOccurrences::ExtendedOccurrence::snapshots :> engine::Car_snapshots, transmission::Car_snapshots featured by Car;
100
+
//}
101
+
102
+
portion inOperable [0..1] :> timeSlices;
103
+
104
+
// successions are not variable
105
+
succession first operated then inOperable;
106
+
}
107
+
108
+
class Person :> ExtendedOccurrence {
109
+
var feature isLicensed : Boolean[0..1];
110
+
//member feature isLicensed : Boolean[0..1] featured by Person_snapshots {
111
+
// member feature Person_snapshots :>> ExtendedOccurrences::ExtendedOccurrence::snapshots featured by Person;
112
+
//}
113
+
var feature speed : Real[1];
114
+
//member feature speed : Real[1] featured by Person_snapshots {
115
+
// member feature Person_snapshots :>> ExtendedOccurrences::ExtendedOccurrence::snapshots featured by Person;
116
+
//}
117
+
}
118
+
119
+
struct Car1 :> ExtendedOccurrence { // May or may not be a life
120
+
var feature driver : Person [0..1];
121
+
//member feature driver : Person [0..1] featured by Car_snapshots {
122
+
// member feature Car_snapshots :>> ExtendedOccurrences::ExtendedOccurrence::snapshots featured by Car1;
123
+
//}
124
+
125
+
// :>> timeSlices : Car; <-- Don't do this!
126
+
127
+
portion :>> startShot { // Not a kind of Car!
128
+
var feature :>> driver [0];
129
+
//member feature :>> driver : Person [0] featured by Car_startShot_snapshots {
130
+
// member feature Car_startShot_snapshots :>> Car_snapshots featured by Car1::startShot;
131
+
//}
132
+
}
133
+
134
+
succession first startShot then driven;
135
+
136
+
portion driven :> timeSlices {
137
+
var feature :>> driver [1];
138
+
// No conflict with multiplicity! (driven just can't be startshot)
139
+
//member feature :>> driver : Person [1] featured by Car_driven_snapshots {
140
+
// member feature Car_driven_snapshots :>> Car_snapshots featured by Car1::driven;
0 commit comments