Meets Specifications Brilliant Learner, By carefully going through the project and through the reports, I am personally impressed with the diligent implementation of the required functions and well-written report. Great work done.:clap::clap: Now, it is time to move on to more challenging and interesting part of Udacity AI nanodegree. I wish you all the best and it was my pleasure reviewing this awesome project.
Recommendations. Here are some links to very good materials that I believe will help increase the student's knowledge on Planning Search.
This link gives an insight into what is Automated Planning and Scheduling. This link will enhance your understanding of State Space Planning. The links below provide more information on Planning Agent.
http://users.csc.calpoly.edu/~fkurfess/Courses/580/Slides/Planning-Agents.pdf. http://artificialintelligence-notes.blogspot.com/2010/11/algorithem-simple-planning-agent.html. http://homepage.cs.uiowa.edu/~hzhang/c145/notes/10-Planning-6p.pdf. http://www.cs.ox.ac.uk/people/michael.wooldridge/pubs/ker95/subsubsectionstar3_3_1_1.html. Planning Problem Representation The problems and class methods in the my_air_cargo_problems.py module are correctly represented.
Great work. All the problems and class methods in the my_air_cargo_problems.py module are correctly represented.
An optimal sequence of actions is identified for each problem in the written report.
Good work. The report clearly identifies an optimal sequence of actions for each problem.
Automated Heuristics Automated heuristics “ignore-preconditions” and “level-sum” (planning graph) are correctly implemented.
Excellent. The automated heuristics ignore-preconditions and level-sum are correctly implemented.
Performance Comparison At least three uninformed planning algorithms (including breadth- and depth-first search) are compared on all three problems, and at least two automatic heuristics are used with A* search for planning on all three problems including “ignore-preconditions” and “level-sum” from the Planning Graph.
Sensational work. In the report, a clear comparison of three uninformed planning algorithms(BFS, DFS and UCS) is provided. The report also compares the performance of A-star search used with ignore-preconditions and level-sum automatic heuristics.
A brief report lists (using a table and any appropriate visualizations) and verbally describes the performance of the algorithms on the problems compared, including the optimality of the solutions, time elapsed, and the number of node expansions required.
Great presentation of results using well organized and labeled tables and graphs. The report also explicitly and verbally describes the performance of the algorithms in terms of optimality, time elapsed and node expansions, on the three problems.
The report explains the reason for the observed results using at least one appropriate justification from the video lessons or from outside resources (e.g., Norvig and Russell’s textbook).
👍 Great work in the report. The reasons for the observed results are explicitly explained in the report with appropriate justification from outside resources.
Research Review The report includes a summary of at least three key developments in the field of AI planning and search.
Well written research review On Distributed Multi-Agent Planning.
Recommendation. Please, check documents below for more information on other key developments in the field of AI planning and search.
Fast Planning Through Planning Graph Analysis (Blum, Furst, 1997) Planning for Conjunctive Goals (Chapman,1987). https://www.ics.uci.edu/~dechter/papers/paginated_binders/PART%25201.pdf. Planning as satisfiability. CIRCA: The Cooperative Intelligent Real-time Control Architecture (1993) by Musliner, David John. Fast-Forward (FF) Planner - uni-saarland.de.
This project includes skeletons for the classes and functions needed to solve deterministic logistics planning problems for an Air Cargo transport system using a planning search agent. With progression search algorithms like those in the navigation problem from lecture, optimal plans for each problem will be computed. Unlike the navigation problem, there is no simple distance heuristic to aid the agent. Instead, you will implement domain-independent heuristics.
- Part 1 - Planning problems:
- READ: applicable portions of the Russel/Norvig AIMA text
- GIVEN: problems defined in classical PDDL (Planning Domain Definition Language)
- TODO: Implement the Python methods and functions as marked in
my_air_cargo_problems.py
- TODO: Experiment and document metrics
- Part 2 - Domain-independent heuristics:
- READ: applicable portions of the Russel/Norvig AIMA text
- TODO: Implement relaxed problem heuristic in
my_air_cargo_problems.py
- TODO: Implement Planning Graph and automatic heuristic in
my_planning_graph.py
- TODO: Experiment and document metrics
- Part 3 - Written Analysis
- Python 3.4 or higher
- Starter code includes a copy of companion code from the Stuart Russel/Norvig AIMA text.
"Artificial Intelligence: A Modern Approach" 3rd edition chapter 10 or 2nd edition Chapter 11 on Planning, available on the AIMA book site sections:
- The Planning Problem
- Planning with State-space Search
All problems are in the Air Cargo domain. They have the same action schema defined, but different initial states and goals.
- Air Cargo Action Schema:
Action(Load(c, p, a),
PRECOND: At(c, a) ∧ At(p, a) ∧ Cargo(c) ∧ Plane(p) ∧ Airport(a)
EFFECT: ¬ At(c, a) ∧ In(c, p))
Action(Unload(c, p, a),
PRECOND: In(c, p) ∧ At(p, a) ∧ Cargo(c) ∧ Plane(p) ∧ Airport(a)
EFFECT: At(c, a) ∧ ¬ In(c, p))
Action(Fly(p, from, to),
PRECOND: At(p, from) ∧ Plane(p) ∧ Airport(from) ∧ Airport(to)
EFFECT: ¬ At(p, from) ∧ At(p, to))
- Problem 1 initial state and goal:
Init(At(C1, SFO) ∧ At(C2, JFK)
∧ At(P1, SFO) ∧ At(P2, JFK)
∧ Cargo(C1) ∧ Cargo(C2)
∧ Plane(P1) ∧ Plane(P2)
∧ Airport(JFK) ∧ Airport(SFO))
Goal(At(C1, JFK) ∧ At(C2, SFO))
- Problem 2 initial state and goal:
Init(At(C1, SFO) ∧ At(C2, JFK) ∧ At(C3, ATL)
∧ At(P1, SFO) ∧ At(P2, JFK) ∧ At(P3, ATL)
∧ Cargo(C1) ∧ Cargo(C2) ∧ Cargo(C3)
∧ Plane(P1) ∧ Plane(P2) ∧ Plane(P3)
∧ Airport(JFK) ∧ Airport(SFO) ∧ Airport(ATL))
Goal(At(C1, JFK) ∧ At(C2, SFO) ∧ At(C3, SFO))
- Problem 3 initial state and goal:
Init(At(C1, SFO) ∧ At(C2, JFK) ∧ At(C3, ATL) ∧ At(C4, ORD)
∧ At(P1, SFO) ∧ At(P2, JFK)
∧ Cargo(C1) ∧ Cargo(C2) ∧ Cargo(C3) ∧ Cargo(C4)
∧ Plane(P1) ∧ Plane(P2)
∧ Airport(JFK) ∧ Airport(SFO) ∧ Airport(ATL) ∧ Airport(ORD))
Goal(At(C1, JFK) ∧ At(C3, JFK) ∧ At(C2, SFO) ∧ At(C4, SFO))
AirCargoProblem.get_actions
method includingload_actions
andunload_actions
sub-functionsAirCargoProblem.actions
methodAirCargoProblem.result
methodair_cargo_p2
functionair_cargo_p3
function
- Run uninformed planning searches for
air_cargo_p1
,air_cargo_p2
, andair_cargo_p3
; provide metrics on number of node expansions required, number of goal tests, time elapsed, and optimality of solution for each search algorithm. Include the result of at least three of these searches, including breadth-first and depth-first, in your write-up (breadth_first_search
anddepth_first_graph_search
). - If depth-first takes longer than 10 minutes for Problem 3 on your system, stop the search and provide this information in your report.
- Use the
run_search
script for your data collection: from the command line typepython run_search.py -h
to learn more.
Progression planning problems can be solved with graph searches such as breadth-first, depth-first, and A*, where the nodes of the graph are "states" and edges are "actions". A "state" is the logical conjunction of all boolean ground "fluents", or state variables, that are possible for the problem using Propositional Logic. For example, we might have a problem to plan the transport of one cargo, C1, on a single available plane, P1, from one airport to another, SFO to JFK. In this simple example, there are five fluents, or state variables, which means our state space could be as large as . Note the following:
- While the initial state defines every fluent explicitly, in this case mapped to TTFFF, the goal may be a set of states. Any state that is
True
for the fluentAt(C1,JFK)
meets the goal.- Even though PDDL uses variable to describe actions as "action schema", these problems are not solved with First Order Logic. They are solved with Propositional logic and must therefore be defined with concrete (non-variable) actions and literal (non-variable) fluents in state descriptions.
- The fluents here are mapped to a simple string representing the boolean value of each fluent in the system, e.g. TTFFTT...TTF. This will be the state representation in the
AirCargoProblem
class and is compatible with theNode
andProblem
classes, and the search methods in the AIMA library.
"Artificial Intelligence: A Modern Approach" 3rd edition chapter 10 or 2nd edition Chapter 11 on Planning, available on the AIMA book site section:
- Planning Graph
AirCargoProblem.h_ignore_preconditions
method
PlanningGraph.add_action_level
methodPlanningGraph.add_literal_level
methodPlanningGraph.inconsistent_effects_mutex
methodPlanningGraph.interference_mutex
methodPlanningGraph.competing_needs_mutex
methodPlanningGraph.negation_mutex
methodPlanningGraph.inconsistent_support_mutex
methodPlanningGraph.h_levelsum
method
- Run A* planning searches using the heuristics you have implemented on
air_cargo_p1
,air_cargo_p2
andair_cargo_p3
. Provide metrics on number of node expansions required, number of goal tests, time elapsed, and optimality of solution for each search algorithm and include the results in your report. - Use the
run_search
script for this purpose: from the command line typepython run_search.py -h
to learn more.
The planning graph is somewhat complex, but is useful in planning because it is a polynomial-size approximation of the exponential tree that represents all possible paths. The planning graph can be used to provide automated admissible heuristics for any domain. It can also be used as the first step in implementing GRAPHPLAN, a direct planning algorithm that you may wish to learn more about on your own (but we will not address it here).
- Provide an optimal plan for Problems 1, 2, and 3.
- Compare and contrast non-heuristic search result metrics (optimality, time elapsed, number of node expansions) for Problems 1,2, and 3. Include breadth-first, depth-first, and at least one other uninformed non-heuristic search in your comparison; Your third choice of non-heuristic search may be skipped for Problem 3 if it takes longer than 10 minutes to run, but a note in this case should be included.
- Compare and contrast heuristic search result metrics using A* with the "ignore preconditions" and "level-sum" heuristics for Problems 1, 2, and 3.
- What was the best heuristic used in these problems? Was it better than non-heuristic search planning methods for all problems? Why or why not?
- Provide tables or other visual aids as needed for clarity in your discussion.
- The planning problem for the "Have Cake and Eat it Too" problem in the book has been
implemented in the
example_have_cake
module as an example. - The
tests
directory includesunittest
test cases to evaluate your implementations. All tests should pass before you submit your project for review. From the AIND-Planning directory command line:python -m unittest tests.test_my_air_cargo_problems
python -m unittest tests.test_my_planning_graph
- You can run all the test cases with additional context by running
python -m unittest -v
- The
run_search
script is provided for gathering metrics for various search methods on any or all of the problems and should be used for this purpose.
Before submitting your solution to a reviewer, you are required to submit your project to Udacity's Project Assistant, which will provide some initial feedback.
The setup is simple. If you have not installed the client tool already, then you may do so with the command pip install udacity-pa
.
To submit your code to the project assistant, run udacity submit
from within the top-level directory of this project. You will be prompted for a username and password. If you login using google or facebook, visit this link for alternate login instructions.
This process will create a zipfile in your top-level directory named cargo_planning-.zip. This is the file that you should submit to the Udacity reviews system.
The exercises in this project can take a long time to run (from several seconds to a several hours) depending on the heuristics and search algorithms you choose, as well as the efficiency of your own code. (You may want to stop and profile your code if runtimes stretch past a few minutes.) One option to improve execution time is to try installing and using pypy3 -- a python JIT, which can accelerate execution time substantially. Using pypy is not required (and thus not officially supported) -- an efficient solution to this project runs in very reasonable time on modest hardware -- but working with pypy may allow students to explore more sophisticated problems than the examples included in the project.