4 #include <ext/hash_map>
16 * Creates a plan given the input actions, initial state and goal.
18 * @param actions A list of actions which will be used to reach the goal.
19 * @param init The initial state which the plan will start from.
20 * @param goal The goal state which the plan will try to reach.
22 Planner(std::vector<Action> actions, Literals init, Literals goal);
25 * Deletes all the remaining nodes and actions.
31 * Creates new threads for execution of each action.
33 * If any action fail in some way, this method will try to replan and
34 * recursively call itself.
42 * This method does the actual planning. Given the input node it will
43 * try to find all preconditions and create links from parent nodes
44 * to this node and, if the precondition did not have a node associated
45 * with it, create a new and recursively call this method for the newly
48 * @param node The node which this method will find parent nodes for.
50 void makePlan(Node* node);
53 * Adds this node to the internal map and vector.
55 void addNode(Node* node);
58 * This method goes through the executed nodes and then calls
59 * executeChildren for these nodes.
62 int executeChildren(Node* node);
64 int cleanupExecution();
68 std::queue<Node*> _executedNodes;
72 __gnu_cxx::hash_map<std::string,Node*> _addedEffects;
73 __gnu_cxx::hash_map<std::string,Action*> _actionEffects;
76 std::vector<Node*> _addedNodes;
77 std::vector<Action*> _actions;