]> ruin.nu Git - popboot.git/blobdiff - planner.h
more documentation
[popboot.git] / planner.h
index fc49df9d5659e42646fa307e034c4c59b6ec58b4..c6f23b2334895bb91a09562ba465017be18a74ff 100644 (file)
--- a/planner.h
+++ b/planner.h
@@ -10,6 +10,9 @@
 
 class Node;
 
+/**
+ * This class creates, holds and executes a plan.
+ */
 class Planner {
        public:
                /**
@@ -59,21 +62,47 @@ class Planner {
                 * executeChildren for these nodes.
                 */
                void executePlan();
+
+               /**
+                * Iterates through the children of the input node and satisfies all
+                * preconditions possible with this node. The children will be executed
+                * if all preconditions have been satisfied.
+                */
                int executeChildren(Node* node);
+
+               /**
+                * Addes the remaining actions to the actions map, creates new start and
+                * finish nodes and runs makePlan.
+                */
                void replan();
+               
+               /**
+                * Deletes all nodes, updates _init and _goal, and clears the internal maps and vector.
+                */
                int cleanupExecution();
 
+               //! Semaphore which is used to signal if a new node has been executed and added to _executedNodes.
                sem_t _nodes;
+               //! Mutex for access to _executedNodes.
                sem_t _list;
+               //! Holds the nodes which have been executed, but the children haven't been taken care of yet.
                std::queue<Node*> _executedNodes;
 
+               //! The start node in the plan graph.
                Node* _start;
+               //! The end node in the plan graph.
                Node* _finish;
+               //! Map from all the effects which can be achieved with the already added nodes.
                __gnu_cxx::hash_map<std::string,Node*> _addedEffects;
+               //! Map with all effects available and their corresponding actions.
                __gnu_cxx::hash_map<std::string,Action*> _actionEffects;
+               //! The initial state.
                Literals _init;
+               //! The goal state
                Literals _goal;
+               //! All the nodes added to the current plan.
                std::vector<Node*> _addedNodes;
+               //! All the non-executed actions available in the current plan.
                std::vector<Action*> _actions;
 };
 #endif