00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _ABSTRACT_ASTAR_H_
00025 #define _ABSTRACT_ASTAR_H_
00026
00027 #include <utils/search/astar_state.h>
00028
00029 #include <vector>
00030 #include <map>
00031 #include <queue>
00032
00033 namespace fawkes {
00034
00035
00036 class AStar
00037 {
00038 public:
00039 AStar ();
00040 ~AStar();
00041
00042 std::vector< AStarState * > solve( AStarState * initialState );
00043
00044 private:
00045
00046 struct Cmp {
00047 bool operator() ( AStarState * a1, AStarState * a2 ) const
00048 { return (a1->totalEstimatedCost >= a2->totalEstimatedCost); }
00049 };
00050
00051 std::priority_queue< AStarState *, std::vector< AStarState * >, Cmp > openList;
00052 std::map< const long, AStarState*> closedList;
00053
00054 AStarState * search();
00055
00056 std::vector< AStarState * > getSolutionSequence( AStarState * node );
00057 std::vector< AStarState * > solution;
00058
00059 };
00060
00061
00062 }
00063
00064 #endif