]> ruin.nu Git - popboot.git/blobdiff - planner.h
delete remaining actions
[popboot.git] / planner.h
index 7932eb9251814908502d07b197c198d5bed9f712..f00c61473382884c6c42bf427614278c627c851f 100644 (file)
--- a/planner.h
+++ b/planner.h
@@ -7,45 +7,25 @@
 
 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);
+               Planner(std::vector<Action> actions, Literals init, Literals goal);
+               ~Planner();
+
+               void execute();
 
        protected:
 
                void makePlan(Node* node);
+               void addNode(Node* node);
                
                Node* _start;
-               __gnu_cxx::hash_map<std::string,Node*> _addedNodes;
-               __gnu_cxx::hash_map<std::string,Action> _actions;
+               Node* _finish;
+               __gnu_cxx::hash_map<std::string,Node*> _addedEffects;
+               __gnu_cxx::hash_map<std::string,Action*> _actionEffects;
+               Literals _init;
+               Literals _goal;
+               std::vector<Node*> _addedNodes;
+               std::vector<Action*> _actions;
 };
 #endif