X-Git-Url: https://ruin.nu/git/?p=popboot.git;a=blobdiff_plain;f=planner.h;h=8d116933f14a6d0122aaa0182ca22f21686ca277;hp=ab8f4ee27774f4df9e13283a67b1c744619a18f5;hb=a1941ebc8535c578f0989f847794917096274f8e;hpb=7b9821d42d980e5788bbc65563973eddd6e4c40d diff --git a/planner.h b/planner.h index ab8f4ee..8d11693 100644 --- a/planner.h +++ b/planner.h @@ -3,53 +3,37 @@ #include #include +#include +#include +#include #include "action.h" class Node; - - -namespace __gnu_cxx { - - template< typename CharT, typename Traits, typename Alloc > - struct hash< std::basic_string > { - size_t operator()(const std::basic_string& s) const { - - const std::collate& c = std::use_facet< std::collate >(std::locale()); - - return c.hash(s.c_str(), s.c_str() + s.size()); - -} - - }; - - template< typename CharT, typename Traits, typename Alloc > - struct hash< const std::basic_string > { //yes you need this version aswell! - -size_t operator()(const std::basic_string& s) const { - - const std::collate& c = std::use_facet< std::collate >(std::locale()); - - return c.hash(s.c_str(), s.c_str() + s.size()); - } - - }; -}; - class Planner { public: - Planner(std::vector actions, literals init, literals goal); + Planner(std::vector actions, Literals init, Literals goal); ~Planner(); void execute(); + protected: void makePlan(Node* node); void addNode(Node* node); + + sem_t _nodes; + sem_t _list; + std::queue _executedNodes; Node* _start; - __gnu_cxx::hash_map _addedNodes; - __gnu_cxx::hash_map _actions; + Node* _finish; + __gnu_cxx::hash_map _addedEffects; + __gnu_cxx::hash_map _actionEffects; + Literals _init; + Literals _goal; + std::vector _addedNodes; + std::vector _actions; }; #endif