Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 38a3844

Browse files
ltfschoennorvig
authored andcommitted
Fix incorrect abbreviation from PDLL to PDDL (Planning Domain Definition Language) (aimacode#475)
1 parent 1cd6428 commit 38a3844

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

planning.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
from logic import FolKB
77

88

9-
class PDLL:
9+
class PDDL:
1010
"""
11-
PDLL used to define a search problem.
11+
Planning Domain Definition Language (PDDL) used to define a search problem.
1212
It stores states in a knowledge base consisting of first order logic statements.
1313
The conjunction of these logical statements completely defines a state.
1414
"""
@@ -140,7 +140,7 @@ def goal_test(kb):
140140
effect_rem = [expr("At(p, f)")]
141141
fly = Action(expr("Fly(p, f, to)"), [precond_pos, precond_neg], [effect_add, effect_rem])
142142

143-
return PDLL(init, [load, unload, fly], goal_test)
143+
return PDDL(init, [load, unload, fly], goal_test)
144144

145145

146146
def spare_tire():
@@ -181,7 +181,7 @@ def goal_test(kb):
181181
leave_overnight = Action(expr("LeaveOvernight"), [precond_pos, precond_neg],
182182
[effect_add, effect_rem])
183183

184-
return PDLL(init, [remove, put_on, leave_overnight], goal_test)
184+
return PDDL(init, [remove, put_on, leave_overnight], goal_test)
185185

186186

187187
def three_block_tower():
@@ -219,7 +219,7 @@ def goal_test(kb):
219219
moveToTable = Action(expr('MoveToTable(b, x)'), [precond_pos, precond_neg],
220220
[effect_add, effect_rem])
221221

222-
return PDLL(init, [move, moveToTable], goal_test)
222+
return PDDL(init, [move, moveToTable], goal_test)
223223

224224

225225
def have_cake_and_eat_cake_too():
@@ -248,7 +248,7 @@ def goal_test(kb):
248248
effect_rem = []
249249
bake_cake = Action(expr('Bake(Cake)'), [precond_pos, precond_neg], [effect_add, effect_rem])
250250

251-
return PDLL(init, [eat_cake, bake_cake], goal_test)
251+
return PDDL(init, [eat_cake, bake_cake], goal_test)
252252

253253

254254
class Level():
@@ -408,17 +408,17 @@ class Graph:
408408
Used in graph planning algorithm to extract a solution
409409
"""
410410

411-
def __init__(self, pdll, negkb):
412-
self.pdll = pdll
413-
self.levels = [Level(pdll.kb, negkb)]
414-
self.objects = set(arg for clause in pdll.kb.clauses + negkb.clauses for arg in clause.args)
411+
def __init__(self, pddl, negkb):
412+
self.pddl = pddl
413+
self.levels = [Level(pddl.kb, negkb)]
414+
self.objects = set(arg for clause in pddl.kb.clauses + negkb.clauses for arg in clause.args)
415415

416416
def __call__(self):
417417
self.expand_graph()
418418

419419
def expand_graph(self):
420420
last_level = self.levels[-1]
421-
last_level(self.pdll.actions, self.objects)
421+
last_level(self.pddl.actions, self.objects)
422422
self.levels.append(last_level.perform_actions())
423423

424424
def non_mutex_goals(self, goals, index):
@@ -436,8 +436,8 @@ class GraphPlan:
436436
Returns solution for the planning problem
437437
"""
438438

439-
def __init__(self, pdll, negkb):
440-
self.graph = Graph(pdll, negkb)
439+
def __init__(self, pddl, negkb):
440+
self.graph = Graph(pddl, negkb)
441441
self.nogoods = []
442442
self.solution = []
443443

@@ -524,9 +524,9 @@ def goal_test(kb, goals):
524524

525525

526526
def spare_tire_graphplan():
527-
pdll = spare_tire()
527+
pddl = spare_tire()
528528
negkb = FolKB([expr('At(Flat, Trunk)')])
529-
graphplan = GraphPlan(pdll, negkb)
529+
graphplan = GraphPlan(pddl, negkb)
530530

531531
# Not sure
532532
goals_pos = [expr('At(Spare, Axle)'), expr('At(Flat, Ground)')]
@@ -573,4 +573,4 @@ def goal_test(kb):
573573
effect_rem = [expr("At(actor, loc)")]
574574
go = Action(expr("Go(actor, to)"), [precond_pos, precond_neg], [effect_add, effect_rem])
575575

576-
return PDLL(init, [hit, go], goal_test)
576+
return PDDL(init, [hit, go], goal_test)

tests/test_planning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ def test_have_cake_and_eat_cake_too():
7373

7474

7575
def test_graph_call():
76-
pdll = spare_tire()
76+
pddl = spare_tire()
7777
negkb = FolKB([expr('At(Flat, Trunk)')])
78-
graph = Graph(pdll, negkb)
78+
graph = Graph(pddl, negkb)
7979

8080
levels_size = len(graph.levels)
8181
graph()

0 commit comments

Comments
 (0)