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