-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.ujshop
76 lines (64 loc) · 1.49 KB
/
search.ujshop
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
(defdomain search (
(:attachments (closest ?circle ?to ?out_circle ?in_dir ?out_dir ?goal))
(:operator (!move ?agent ?from ?to)
()
((at ?agent ?from))
((at ?agent ?to))
)
(:operator (!!visit ?agent ?point)
()
()
((visited ?agent ?point))
)
(:operator (!!unvisit ?agent ?point)
()
((visited ?agent ?point))
()
)
(:method (forward ?agent ?goal)
base
((at ?agent ?goal))
()
search
(
(at ?agent ?start)
(call search-circular ?agent ?start ?goal)
)
((apply-plan ?agent ?start 0 (call plan-size)))
)
(:method (apply-plan ?agent ?from ?index ?size)
index-equals-size
((call = ?index ?size))
()
get-next-action
((assign ?to (call plan-position ?index)))
(
(!move ?agent ?from ?to)
(apply-plan ?agent ?to (call + ?index 1) ?size)
)
)
(:method (forward-attachments ?agent ?goal)
clockwise
((at ?agent ?start))
((loop ?agent ?start ?start clock ?goal))
counter-clockwise
((at ?agent ?start))
((loop ?agent ?start ?start counter ?goal))
)
(:method (loop ?agent ?from ?circle ?in_dir ?goal)
base
((call visible ?from ?circle ?goal))
((!move ?agent ?from ?goal))
recursion
(
(closest ?circle ?to ?out_circle ?in_dir ?out_dir ?goal)
(not (visited ?agent ?to))
)
(
(!move ?agent ?from ?to)
(!!visit ?agent ?from)
(loop ?agent ?to ?out_circle ?out_dir ?goal)
(!!unvisit ?agent ?from)
)
)
))