X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=planner.h;h=79db5420a06cd52e751947013f8eb594af8d7791;hb=52feef3369ad80d5b7207620f37ae341ccd11b95;hp=7932eb9251814908502d07b197c198d5bed9f712;hpb=dc49c0c521090f0eb4b9692b25a129537c07e19e;p=popboot.git diff --git a/planner.h b/planner.h index 7932eb9..79db542 100644 --- a/planner.h +++ b/planner.h @@ -7,45 +7,24 @@ 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); Node* _start; - __gnu_cxx::hash_map _addedNodes; + Node* _finish; + __gnu_cxx::hash_map _addedEffects; __gnu_cxx::hash_map _actions; + Literals _init; + Literals _goal; + std::vector _addedNodes; }; #endif