X-Git-Url: https://ruin.nu/git/intel?a=blobdiff_plain;f=planner.h;h=7932eb9251814908502d07b197c198d5bed9f712;hb=dc49c0c521090f0eb4b9692b25a129537c07e19e;hp=1b4938b36e7eb04560342e9403baeec3499d896f;hpb=066d3c3659f52a73a0344c3e08989cc73a15164b;p=popboot.git diff --git a/planner.h b/planner.h index 1b4938b..7932eb9 100644 --- a/planner.h +++ b/planner.h @@ -1,14 +1,51 @@ #ifndef __PLANNER_H__ #define __PLANNER_H__ -#include -#include "node.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; - std::hash_map addedNodes; + + void makePlan(Node* node); + + Node* _start; + __gnu_cxx::hash_map _addedNodes; + __gnu_cxx::hash_map _actions; }; #endif