-
Notifications
You must be signed in to change notification settings - Fork 0
/
answers.txt
87 lines (61 loc) · 2.69 KB
/
answers.txt
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
PART 1
Task 1.1
PREDICATES:
Road(A, B) -- A and B are connected by a road
**Road(A, B) implies Road(B, A) (roads are bidirectional routes)
Air(A, B) -- A and B are connected by a directed air route A=>B
Agent.At(A) -- The agent is at A
Car.At(A) -- The car is at A
Agent.Visited(A) -- The agent has visited A
INITIAL STATE:
Agent.At(E) ∧ Car.At(E) ∧ ¬Agent.Visited(D)
GOAL STATE:
Agent.At(E) ∧ Agent.Visited(D)
Task 1.2
Drive(A, B) -- Drive from A to B
PRECON: Agent.At(A) ∧ Car.At(A) ∧ Road(A, B)
EFFECT: ¬Agent.At(A) ∧ ¬Car.At(A) ∧ Agent.At(B) ∧ Car.At(B)
Fly(A, B) -- Fly from A to B
PRECON: Agent.At(A) ∧ Air(A, B)
EFFECT: ¬Agent.At(A) ∧ Agent.At(B)
Visit(A) -- Visit A
PRECON: Agent.At(A) ∧ ¬Agent.Visited(A)
EFFECT: Agent.Visited(A)
Task 1.3
BACKWARD STATE SPACE SEARCH
Algorithm which starts at the goal state and ends at the initial state.
BACKWARDS STEPS
Initial state = Agent.At(B) ∧ Car.At(A) ∧ Agent.Visited(B)
Goal state = Agent.At(E) ∧ Car.At(E) ∧ ¬Agent.Visited(B)
0: ¬Visit(B) -- Action which completes part of the goal state
1: Fly(B, A) -- Action which brings our agent closer to the goal state
2: Drive(A, E) -- Action which brings our agent to the complete goal state
Upon finding a path in a backwards state space search, the path must be reversed
and negated where appropriate.
eg. Drive(A,B) -> Drive(B,A) and ¬Visit(B) -> Visit(B)
**Parameters reversed for dynamic actions, state negated for static actions.
So the solution is:
0: Drive(E, A)
1: Fly(A, B)
2: Visit(B)
PART 4
CREATING AN EFFECTIVE PLANNER WHICH ACCOUNTS FOR A TRAVELLER'S PREFERENCES:
First we must identify possible preferences we can cater for;
1) Monetary cost (cost heuristic)
2) Length of the journey (distance heuristic)
3) Ease/comfort of the journey (number of transport changes)
4) Environmental factor (emission heuristic)
All these preferences will have to be interpreted as their own metric values
within the planner using heuristics in order to compare preference-based route
costs.
In order for a traveller to prioritize their preferences, we could allow them to
create a custom prioritized preference list. We can then use this prioritization
to calculate the final-search-metric.
Given prioritized preferences (A,B,C,D) we must be able to optimise the search
appropriately. In order to do this we must equate the final-search-metric in a
way which adds appropriate weightings to the different prioritized preference
metrics:
final-search-metric = 4*metric_A + 3*metric_B + 2*metric_C + metric_D
Finally, all we must do is add the final search metric into the :metric section
of the problem definition.
(:metric minimize (final-search-metric))