25 #include <utils/search/astar.h> 66 while ( ! open_list.empty() )
68 best = open_list.top();
83 while ( open_list.size() > 0 )
85 best = open_list.top();
91 open_list.push( initialState );
92 return solution_sequence(
search() );
101 std::vector< AStarState * > children;
104 while ( open_list.size() > 0 )
109 if ( open_list.size() > 0 )
111 best = open_list.top();
118 while ( closed_list.find( key ) != closed_list.end() );
121 closed_list[key] = best;
130 for (
unsigned int i = 0; i < children.size(); i++ )
131 open_list.push( children[i] );
142 std::vector<AStarState *>
150 closed_list.erase(state->
key());
151 solution.insert( solution.begin(), state );
156 while ( closed_list.size() > 0 )
158 state = closed_list.begin()->second;
159 closed_list.erase(state->
key());
This is the abstract(!) class for an A* State.
AStarState * parent
Predecessor.
virtual size_t key()=0
Generates a unique key for this state.
This class tries to translate the found plan to interpreteable data for the rest of the program...
Fawkes library namespace.
std::vector< AStarState * > solve(AStarState *initialState)
Solves a situation given by the initial state with AStar, and returns a vector of AStarStates that so...
virtual bool is_goal()=0
Check, wether we reached a goal or not.
virtual std::vector< AStarState * > children()=0
Generate all successors and put them to this vector.