Skip to content

Commit 27fa6ee

Browse files
MariannaSpyrakoudelaray
authored andcommitted
Minor modifications in planning_angelic_search.ipynb and knowledge_FOIL.ipynb notebooks (#949)
* Minor modifications in planning_angelic_search.ipynb and knowledge_FOIL.ipynb notebooks.
1 parent 4c7e110 commit 27fa6ee

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

knowledge_FOIL.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -587,10 +587,10 @@
587587
"cell_type": "markdown",
588588
"metadata": {},
589589
"source": [
590-
"The algorithm produced almost the recursive rule: \n",
590+
"The algorithm produced something close to the recursive rule: \n",
591591
" $$ Reach(x,y) \\Leftrightarrow [Conn(x,y)] \\: \\lor \\: [\\exists \\: z \\: \\: Reach(x,z) \\, \\land \\, Reach(z,y)]$$\n",
592592
" \n",
593-
"This is because the size of the example is small. "
593+
"This happened because the size of the example is small. "
594594
]
595595
}
596596
],

planning.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,7 @@ def simple_blocks_world_graphplan():
11441144
return GraphPlan(simple_blocks_world()).execute()
11451145

11461146

1147+
11471148
class HLA(Action):
11481149
"""
11491150
Define Actions for the real-world (that may be refined further), and satisfy resource
@@ -1363,9 +1364,8 @@ def angelic_search(problem, hierarchy, initialPlan):
13631364
guaranteed = problem.intersects_goal(pes_reachable_set)
13641365
if guaranteed and Problem.making_progress(plan, initialPlan):
13651366
final_state = guaranteed[0] # any element of guaranteed
1366-
#print('decompose')
13671367
return Problem.decompose(hierarchy, problem, plan, final_state, pes_reachable_set)
1368-
(hla, index) = Problem.find_hla(plan, hierarchy) # there should be at least one HLA/Angelic_HLA, otherwise plan would be primitive.
1368+
hla, index = Problem.find_hla(plan, hierarchy) # there should be at least one HLA/Angelic_HLA, otherwise plan would be primitive.
13691369
prefix = plan.action[:index]
13701370
suffix = plan.action[index+1:]
13711371
outcome = Problem(Problem.result(problem.init, prefix), problem.goals , problem.actions )
@@ -1442,8 +1442,8 @@ def find_hla(plan, hierarchy):
14421442
hla = plan.action[i]
14431443
index = i
14441444
break
1445-
return (hla, index)
1446-
1445+
return hla, index
1446+
14471447
def making_progress(plan, initialPlan):
14481448
"""
14491449
Prevents from infinite regression of refinements

planning_angelic_search.ipynb

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
"- problem is of type Problem \n",
1212
"- hierarchy is a dictionary consisting of all the actions. \n",
1313
"- initialPlan is an approximate description(optimistic and pessimistic) of the agents choices for the implementation. <br>\n",
14-
" It is a nested list, containing sequence a of actions with their optimistic and pessimistic\n",
15-
" description "
14+
" initialPlan contains a sequence of HLA's with angelic semantics"
1615
]
1716
},
1817
{

0 commit comments

Comments
 (0)