]> ruin.nu Git - popboot.git/blob - planner.h
including iterator
[popboot.git] / planner.h
1 #ifndef __PLANNER_H__
2 #define __PLANNER_H__
3
4 #include <ext/hash_map>
5 #include <vector>
6 #include <queue>
7 #include <pthread.h>
8 #include <semaphore.h>
9 #include "action.h"
10
11 class Node;
12
13 class Planner {
14         public:
15                 Planner(std::vector<Action> actions, Literals init, Literals goal);
16                 ~Planner();
17
18                 void execute();
19
20
21         protected:
22
23                 void makePlan(Node* node);
24                 void addNode(Node* node);
25
26                 sem_t _nodes;
27                 sem_t _list;
28                 std::queue<Node*> _executedNodes;
29                 
30                 Node* _start;
31                 Node* _finish;
32                 __gnu_cxx::hash_map<std::string,Node*> _addedEffects;
33                 __gnu_cxx::hash_map<std::string,Action*> _actionEffects;
34                 Literals _init;
35                 Literals _goal;
36                 std::vector<Node*> _addedNodes;
37                 std::vector<Action*> _actions;
38 };
39 #endif