forked from bountin/EWBS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paths.abductive.dl
More file actions
79 lines (73 loc) · 1.37 KB
/
s.abductive.dl
File metadata and controls
79 lines (73 loc) · 1.37 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
% OUTPUT DEMANDED GENERATOR
c(S,odg,0) :- substation(S),
c(S,ig,not_running),
not ab(S).
c(S,odg,0) :- substation(S),
c(S,ig,running),
c(S,il,L),
p(S,ipext,E),
L < E,
not ab(S).
c(S,odg,DIFF) :- substation(S),
c(S,ig,running),
c(S,il,L),
p(S,ipext,E),
L >= E,
DIFF = L - E,
not ab(S).
% OUTPUT POWER BATTERY
p(S,opb,DIFF) :- substation(S),
c(S,il,L),
p(S,ipext,E),
L <= E,
DIFF = E - L,
not ab(S).
p(S,opb,0) :- substation(S),
c(S,il,L),
p(S,ipext,E),
L > E,
not ab(S).
% OUTPUT DEMANDED BATTERY
c(S,odb,0) :- substation(S),
c(S,ig,running),
not ab(S).
c(S,odb,0) :- substation(S),
c(S,il,L),
p(S,ipext,E),
L <= E,
not ab(S).
c(S,odb,D) :- substation(S), normal_demanded_battery_power(S,D), ok(S).
c(S,odb,X) :- substation(S), normal_demanded_battery_power(S,D), X = D * 2, bad_battery_control(S).
normal_demanded_battery_power(S,DIFF) :- substation(S),
c(S,ig,not_running),
c(S,il,L),
p(S,ipext,E),
L > E,
DIFF = L - E,
not ab(S).
% OUTPUT POWER SYSTEM
p(S,ops,P) :- substation(S),
c(S,il,L),
adjl(L,ADJL),
powsum(S,P),
ADJL > P,
not ab(S).
p(S,ops,ADJL) :- substation(S),
c(S,il,L),
adjl(L,ADJL),
powsum(S,P),
ADJL <= P,
not ab(S).
% HELPING PREDICATES
powsum(S,POWER) :- substation(S),
p(S,ipext,IN),
p(S,ipg,G),
p(S,ipb,B),
p(S,opb,OPB),
SUM1 = G + B,
SUM2 = SUM1 + IN,
POWER = SUM2 - OPB.
adjl(L,ADJ) :-
X = L * 3,
ADJ = X / 2,
#int(L).