]> ruin.nu Git - popboot.git/blobdiff - planner.h
it compiles
[popboot.git] / planner.h
index 1b4938b36e7eb04560342e9403baeec3499d896f..7932eb9251814908502d07b197c198d5bed9f712 100644 (file)
--- a/planner.h
+++ b/planner.h
@@ -1,14 +1,51 @@
 #ifndef __PLANNER_H__
 #define __PLANNER_H__
 
-#include <hash_map>
-#include "node.h"
+#include <ext/hash_map>
+#include <vector>
+#include "action.h"
+
+class Node;
+
+
+
+namespace __gnu_cxx {
+
+    template< typename CharT, typename Traits, typename Alloc >
+    struct hash< std::basic_string<CharT, Traits, Alloc> > {
+        size_t operator()(const std::basic_string<CharT, Traits, Alloc>& s) const {
+            
+           const std::collate<CharT>& c = std::use_facet< std::collate<CharT> >(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<CharT, Traits, Alloc> > { //yes you need this version aswell!
+
+size_t operator()(const std::basic_string<CharT, Traits, Alloc>& s) const {
+       
+          const std::collate<CharT>& c = std::use_facet< std::collate<CharT> >(std::locale());
+      
+          return c.hash(s.c_str(), s.c_str() + s.size());
+        }
+
+    };
+};
 
 class Planner {
        public:
+               Planner(std::vector<Action> actions, literals init, literals goal);
 
        protected:
-               Node start;
-               std::hash_map<string,Node*> addedNodes;
+
+               void makePlan(Node* node);
+               
+               Node* _start;
+               __gnu_cxx::hash_map<std::string,Node*> _addedNodes;
+               __gnu_cxx::hash_map<std::string,Action> _actions;
 };
 #endif