aboutsummaryrefslogtreecommitdiffstats
path: root/Domains/crossingScenario/queries/crossingScenarioQueries.vql
diff options
context:
space:
mode:
Diffstat (limited to 'Domains/crossingScenario/queries/crossingScenarioQueries.vql')
-rw-r--r--Domains/crossingScenario/queries/crossingScenarioQueries.vql166
1 files changed, 103 insertions, 63 deletions
diff --git a/Domains/crossingScenario/queries/crossingScenarioQueries.vql b/Domains/crossingScenario/queries/crossingScenarioQueries.vql
index ee7c0b34..352c77c0 100644
--- a/Domains/crossingScenario/queries/crossingScenarioQueries.vql
+++ b/Domains/crossingScenario/queries/crossingScenarioQueries.vql
@@ -11,6 +11,14 @@ import "http://www.eclipse.org/emf/2002/Ecore"
11//} 11//}
12 12
13////////////// 13//////////////
14//CrossingScenario
15/////////////
16
17//TODO Hard-code xSize?
18//TODO Hard-code ySize?
19//TODO Hard-code maxTime?
20
21//////////////
14//Lane 22//Lane
15////////////// 23//////////////
16 24
@@ -154,71 +162,103 @@ pattern define_referenceCoord_laneWithPrevHasCorrectRefCoord(l:Lane) {
154//Lane+Actor 162//Lane+Actor
155////////////// 163//////////////
156 164
165/////////Actor (a) on vertical lane (l) must have a.xPos=[l.rc, l.rc + l.nw]
166@Constraint(severity = "error", key = {a}, message = "this defines the placedOn relation for vertical lanes")
167pattern define_placedOn_actorOnVerticalLane(a : Actor, vl:Lane_Vertical) {
168 Actor.placedOn(a, vl);
169 Actor.xPos(a, x);
170 Lane.referenceCoord(vl, r);
171 check(x <= r);
172} or {
173 Actor.placedOn(a, vl);
174 Actor.xPos(a, x);
175 Lane.referenceCoord(vl, r);
176 Lane.numWidth(vl, w);
177 check(x >= (r + w));
178}
157 179
158////@Constraint(severity = "error", key = {a}, message = "this defines the placedOn relation for vertical lanes") 180@Constraint(severity = "error", key = {a}, message = "this defines the placedOn relation for vertical lanes")
159////pattern actorOnVerticalLane(a : Actor) { 181pattern define_placedOn_actorOnHorizLane(a : Actor, hl:Lane_Horizontal) {
160//// Actor.placedOn(a, l); 182 Actor.placedOn(a, hl);
161//// Lane.orientation(l, Orientation::Vertical); 183 Actor.yPos(a, y);
162//// Actor.xPos(a, x); 184 Lane.referenceCoord(hl, r);
163//// Lane.referenceCoord(l, r); 185 check(y <= r);
164//// check(x <= r); 186} or {
165////} or { 187 Actor.placedOn(a, hl);
166//// Actor.placedOn(a, l); 188 Actor.yPos(a, y);
167//// Lane.orientation(l, Orientation::Vertical); 189 Lane.referenceCoord(hl, r);
168//// Actor.xPos(a, x); 190 Lane.numWidth(hl, w);
169//// Lane.referenceCoord(l, r); 191 check(y >= (r + w));
170//// Lane.numWidth(l, w); 192}
171//// check(x >= (r + w)); 193
172////} 194//////////////
173//// 195//Actor
174////@Constraint(severity = "error", key = {a}, message = "this defines the placedOn relation for horizontal lanes") 196//////////////
175////pattern actorOnHorizontalLane(a : Actor) { 197
176//// Actor.placedOn(a, l); 198////TODO
177//// Lane.orientation(l, Orientation::Horizontal); 199/////////xPos of every actor mmust be within bounds defined in CS
178//// Actor.yPos(a, y); 200//@Constraint(severity="error", key={l}, message="1 Actor")
179//// Lane.referenceCoord(l, r); 201//pattern define_actor_xPosWithinCSbounds(cs:CrossingScenario, a:Actor) {
180//// check(y <= r); 202//
181////} or { 203//}
182//// Actor.placedOn(a, l);
183//// Lane.orientation(l, Orientation::Horizontal);
184//// Actor.yPos(a, y);
185//// Lane.referenceCoord(l, r);
186//// Lane.numWidth(l, w);
187//// check(y >= (r + w));
188////}
189//
190////@Constraint(severity = "error", key = {a}, message = "this defines the placedOn relation")
191////pattern actorOnLane(a : Actor) {
192//// find actorOnVerticalLane(a);
193////// neg find actorOnHorizontalLane(a);
194////}
195////
196////private pattern actorOnVerticalLane(a : Actor) {
197//// Actor.placedOn(a, l);
198//// Lane.orientation(l, Orientation::Vertical);
199//// Actor.xPos(a, x);
200//// Lane.referenceCoord(l, r);
201//// Lane.numWidth(l, w);
202//// check(x >= r);
203//// check(x <= (r + w));
204////}
205//
206////@Constraint(severity = "error", key = {l}, message = "this defines the placedOn relation")
207////pattern widthSpec(l : Lane) {
208//// Lane.numWidth(l, w);
209//// check(w != 5);
210////}
211//
212////private pattern actorOnHorizontalLane(a : Actor) {
213//// Actor.placedOn(a, l);
214//// Lane.orientation(l, Orientation::Vertical);
215//// Actor.yPos(a, y);
216//// Lane.referenceCoord(l, r);
217//// Lane.widthNum(l, w);
218//// check(y >= r);
219//// check(y <= (r + w));
220////}
221// 204//
205////TODO
206/////////yPos of every actor mmust be within bounds defined in CS
207//@Constraint(severity="error", key={l}, message="2 Actor")
208//pattern define_actor_yPosWithinCSbounds(cs:CrossingScenario, a:Actor) {
209//
210//}
211
212
213/////////pedestrian-width (3)
214pattern define_actor_pedestrianWidth(p:Pedestrian) {
215 Pedestrian.width(p, 1.0);
216}
217
218/////////pedestrian-width (4)
219pattern define_actor_pedestrianLength(p:Pedestrian) {
220 Pedestrian.length(p, 1.0);
221}
222
223/////////actor-width (5)
224pattern define_actor_actorWidth(a:Actor) {
225 Actor.placedOn(a, l);
226 Lane_Vertical(l);
227 Actor.width(p, 1.0);
228} or {
229 Actor.placedOn(a, l);
230 Lane_Horizontal(l);
231 Actor.width(p, 3.0);
232}
233
234/////////actor-width (6)
235pattern define_actor_actorLength(a:Actor) {
236 Actor.placedOn(a, l);
237 Lane_Vertical(l);
238 Actor.length(p, 3.0);
239} or {
240 Actor.placedOn(a, l);
241 Lane_Horizontal(l);
242 Actor.length(p, 1.0);
243}
244
245
246/////////xSpeed of actor on verticalLane is 0
247@Constraint(severity="error", key={a}, message="7 Actor")
248pattern define_actor_actorOnVertLaneHasxSpeed0(a:Actor, vl:Lane_Vertical) {
249 Actor.placedOn(a, vl);
250 Actor.xSpeed(a, xSpeed);
251 check(xSpeed != 0);
252}
253
254/////////ySpeed of actor on horizontalLane is 0
255@Constraint(severity="error", key={a}, message="8 Actor")
256pattern define_actor_actorOnHoriLaneHasySpeed0(a:Actor, hl:Lane_Horizontal) {
257 Actor.placedOn(a, hl);
258 Actor.ySpeed(a, ySpeed);
259 check(ySpeed != 0);
260}
261
222//////////////// 262////////////////
223////CollisionExists 263////CollisionExists
224//////////////// 264////////////////