X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=planner.h;h=55d572877e61641cbdce15d0186bee9b4da9c235;hb=92aca829cc32e9e4d5965259bd565e727469358d;hp=e2207757d0a1329619adbac00a9e16a66ac19a02;hpb=ac1a37b852607a750cf391e458ab53e8ff504d6a;p=popboot.git diff --git a/planner.h b/planner.h index e220775..55d5728 100644 --- a/planner.h +++ b/planner.h @@ -1,10 +1,43 @@ #ifndef __PLANNER_H__ #define __PLANNER_H__ +#include +#include +#include +#include +#include +#include "action.h" + +class Node; + class Planner { public: + Planner(std::vector actions, Literals init, Literals goal); + ~Planner(); + + void execute(); + protected: - Node start; - hash_map addedNodes; + + void makePlan(Node* node); + void addNode(Node* node); + void executePlan(); + void replan(); + int cleanupExecution(); + int executeChildren(Node* node); + + sem_t _nodes; + sem_t _list; + std::queue _executedNodes; + + Node* _start; + Node* _finish; + __gnu_cxx::hash_map _addedEffects; + __gnu_cxx::hash_map _actionEffects; + Literals _init; + Literals _goal; + std::vector _addedNodes; + std::vector _actions; +}; #endif