aboutsummaryrefslogtreecommitdiffstats
path: root/Domains/traffic.scenarios.simplified/queries/simpleScenarioQueries.vql
diff options
context:
space:
mode:
Diffstat (limited to 'Domains/traffic.scenarios.simplified/queries/simpleScenarioQueries.vql')
-rw-r--r--Domains/traffic.scenarios.simplified/queries/simpleScenarioQueries.vql78
1 files changed, 78 insertions, 0 deletions
diff --git a/Domains/traffic.scenarios.simplified/queries/simpleScenarioQueries.vql b/Domains/traffic.scenarios.simplified/queries/simpleScenarioQueries.vql
new file mode 100644
index 00000000..a59715c7
--- /dev/null
+++ b/Domains/traffic.scenarios.simplified/queries/simpleScenarioQueries.vql
@@ -0,0 +1,78 @@
1package queries
2
3import "http://www.example.com/simpleScenario"
4
5
6//lanes and lane+widths are in simpleScenarioBoundingBox
7
8// actor coords within simpleScenarioBoundingBox
9
10//@Constraint(severity = "error", key = {a}, message = "this defines the placedOn relation for vertical lanes")
11//pattern actorOnVerticalLane(a : Actor) {
12// Actor.placedOn(a, l);
13// Lane.orientation(l, Orientation::Vertical);
14// Actor.xPos(a, x);
15// Lane.referenceCoord(l, r);
16// check(x <= r);
17//} or {
18// Actor.placedOn(a, l);
19// Lane.orientation(l, Orientation::Vertical);
20// Actor.xPos(a, x);
21// Lane.referenceCoord(l, r);
22// Lane.widthNum(l, w);
23// check(x >= (r + w));
24//}
25//
26//@Constraint(severity = "error", key = {a}, message = "this defines the placedOn relation for horizontal lanes")
27//pattern actorOnHorizontalLane(a : Actor) {
28// Actor.placedOn(a, l);
29// Lane.orientation(l, Orientation::Horizontal);
30// Actor.yPos(a, y);
31// Lane.referenceCoord(l, r);
32// check(y <= r);
33//} or {
34// Actor.placedOn(a, l);
35// Lane.orientation(l, Orientation::Horizontal);
36// Actor.yPos(a, y);
37// Lane.referenceCoord(l, r);
38// Lane.widthNum(l, w);
39// check(y >= (r + w));
40//}
41
42@Constraint(severity = "error", key = {a}, message = "this defines the placedOn relation")
43pattern actorOnLane(a : Actor) {
44 find actorOnVerticalLane(a);
45// neg find actorOnHorizontalLane(a);
46}
47
48private pattern actorOnVerticalLane(a : Actor) {
49 Actor.placedOn(a, l);
50 Lane.orientation(l, Orientation::Vertical);
51 Actor.xPos(a, x);
52 Lane.referenceCoord(l, r);
53 Lane.widthNum(l, w);
54 check(x >= r);
55 check(x <= (r + w));
56}
57
58@Constraint(severity = "error", key = {l}, message = "this defines the placedOn relation")
59pattern widthSpec(l : Lane) {
60 Lane.widthNum(l, w);
61 check(w != 5);
62}
63
64@Constraint(severity = "error", key = {l}, message = "this defines the placedOn relation")
65pattern refSpec(l : Lane) {
66 Lane.referenceCoord(l, w);
67 check(w != 2);
68}
69
70private pattern actorOnHorizontalLane(a : Actor) {
71 Actor.placedOn(a, l);
72 Lane.orientation(l, Orientation::Vertical);
73 Actor.yPos(a, y);
74 Lane.referenceCoord(l, r);
75 Lane.widthNum(l, w);
76 check(y >= r);
77 check(y <= (r + w));
78} \ No newline at end of file