X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=planner.h;h=ab8f4ee27774f4df9e13283a67b1c744619a18f5;hb=7b9821d42d980e5788bbc65563973eddd6e4c40d;hp=e2207757d0a1329619adbac00a9e16a66ac19a02;hpb=ac1a37b852607a750cf391e458ab53e8ff504d6a;p=popboot.git diff --git a/planner.h b/planner.h index e220775..ab8f4ee 100644 --- a/planner.h +++ b/planner.h @@ -1,10 +1,55 @@ #ifndef __PLANNER_H__ #define __PLANNER_H__ +#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(); + + void execute(); protected: - Node start; - hash_map addedNodes; + + void makePlan(Node* node); + void addNode(Node* node); + + Node* _start; + __gnu_cxx::hash_map _addedNodes; + __gnu_cxx::hash_map _actions; +}; #endif