-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsurveillance.vql
More file actions
123 lines (109 loc) · 3.79 KB
/
surveillance.vql
File metadata and controls
123 lines (109 loc) · 3.79 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package hu.bme.mit.inf.dslreasoner.domains.surveillance.queries;
import "http://www.example.org/surveillance"
import "http://www.eclipse.org/emf/2002/Ecore"
import java hu.bme.mit.inf.querytransformation.query.KGate
import java hu.bme.mit.inf.dslreasoner.domains.surveillance.utilities.Coordinate
import java hu.bme.mit.inf.dslreasoner.domains.surveillance.utilities.SurveillanceHelper
/**
* Event definitions
*/
@BasicEvent(probability=probability)
pattern targetToShoot(trg: UnidentifiedObject, probability: EDouble){
find targettableObject(trg, probability);
}
pattern targettableObject(trg: UnidentifiedObject, confidence: EDouble){
UnidentifiedObject.confidence(trg,confidence);
UnidentifiedObject.speed(trg,speed);
check(confidence > 0.65);
check(SurveillanceHelper.spd30(speed));
}
@BasicEvent(probability=probability)
pattern gunshot(from: Drone, to: UnidentifiedObject, probability: java Double){
neg find killed(to);
Drone.position(from, dp);
find targettableObject(to,_);
UnidentifiedObject.position(to,tp);
check(SurveillanceHelper.dst1000(dp,tp));
UnidentifiedObject.speed(to,speed);
UnidentifiedObject.confidence(to, confidence);
probability == eval(SurveillanceHelper.shotProbability(dp,tp,speed,confidence));
}
/*
pattern gunshot_mirror1(from: Drone, to: UnidentifiedObject, probability: java Double){
neg find killed(to);
Drone.position(from, dp);
find targettableObject(to,_);
UnidentifiedObject.position(to,tp);
//check(SurveillanceHelper.dst1000(dp,tp));
UnidentifiedObject.speed(to,speed);
UnidentifiedObject.confidence(to, confidence);
probability == eval(SurveillanceHelper.shotProbability(dp,tp,speed,confidence));
}
pattern gunshot_mirror2(from: Drone, to: UnidentifiedObject, probability: java Double){
neg find killed(to);
Drone.position(from, dp);
find targettableObject(to,_);
UnidentifiedObject.position(to,tp);
check(SurveillanceHelper.dst1000(dp,tp));
UnidentifiedObject.speed(to,speed);
UnidentifiedObject.confidence(to, confidence);
probability == 0.0;//eval(SurveillanceHelper.shotProbability(dp,tp,speed,confidence));
}
pattern gunshot_mirror3(from: Drone, to: UnidentifiedObject, probability: java Double){
neg find killed(to);
Drone.position(from, dp);
find targettableObject(to,_);
UnidentifiedObject.position(to,tp);
//check(SurveillanceHelper.dst1000(dp,tp));
UnidentifiedObject.speed(to,speed);
UnidentifiedObject.confidence(to, confidence);
probability == 0.0;//eval(SurveillanceHelper.shotProbability(dp,tp,speed,confidence));
}*/
/*pattern allDrones(from: Drone){
Drone(from);
}
pattern allUnidentifiedObject(to: UnidentifiedObject){
UnidentifiedObject(to);
}*/
pattern killed(object: UnidentifiedObject){
Shot.probability(s,p);
Shot.at(s,object);
check(p>0.95);
}
/**
* Interface pattern for SurveillanceRunner to make objects move
*/
/*pattern move(o: MovingObject, c: java Coordinate){
MovingObject.position(o, from);
MovingObject.speed(o, speed);
MovingObject.angle(o, angle);
c == eval(SurveillanceHelper.move(from,speed,angle,1));
}*/
/*
@Weight(lhsname="p",
class="hu.bme.mit.inf.dslreasoner.domains.surveillance.utilities.SurveillanceHelper",
function="P"
)
pattern shoot(d: Drone, at: UnidentifiedObject, p: java Double){
p == KGate find attempt(d,at);
}*/
/**
* Assess probability of elimination
* + add shot for next iteration
*/
pattern attempt(from: Drone, to: UnidentifiedObject){
find gunshot(from, to, _);
find targetToShoot(to,_);
}
@Weight(lhsname="probability",
class="hu.bme.mit.inf.dslreasoner.domains.surveillance.utilities.SurveillanceHelper",
function="P"
)
pattern elimination(target: UnidentifiedObject, probability: java Double){
probability == KGate find attempt(_, target);
}
/*pattern stochasticCount(cnt: java Integer){
cnt1 == count find elimination(_,_);
cnt2 == count find attempt(_,_);
cnt == eval(cnt1+cnt2);
}*/