-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelevator-routing-instance.lp
More file actions
41 lines (31 loc) · 960 Bytes
/
Copy pathelevator-routing-instance.lp
File metadata and controls
41 lines (31 loc) · 960 Bytes
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
%Problem instance for: elevator-routing
%maximum number of time steps allowed, and maximum number of people in one elevator at once
%both can be overwritten with the -c command at runtime
#const steps=8.
#const m=2.
% establish four passengers
person(p0).
person(p1).
person(p2).
person(p3).
% establish two lifts
lift(a).
lift(b).
% establish 5 floors
floor(0..5).
% NOTE: having a passenger 'spawn in' at a time != 0 is theorectically possible, but has not been tested
% set starting locations of passengers
% syntax: at ({passenger}, {starting_floor}, {time_step})
at(p0,2,0).
at(p1,2,0).
at(p2,2,0).
at(p3, 5, 0).
% set starting locations of lifts
% syntax: at({lift}, {starting_floor}, {time_step})
at(a,0,0).
at(b,0,0).
% goal state:
goal(T):- at(p0,5,T), at(p1,3,T), at(p2,4,T), at(p3, 1, T).
%some other sample goals
%goal(T) :- at(p0, 5, T), at(p1, 3, T), at(p2, 5, T).
%goal(T) :- at(p0, 5, T), at(p1, 5, T), at(p2, 5, T), at(p3, 1, T).