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