Anytime D* search planner: all states are uniquely defined by stateIDs. More...
#include <adplanner.h>
Public Member Functions | |
ADPlanner (DiscreteSpaceInformation *environment, bool bForwardSearch) | |
constructor | |
void | costs_changed (StateChangeQuery const &stateChange) |
inform the search about the new edge costs | |
int | force_planning_from_scratch () |
set a flag to get rid of the previous search efforts, release the memory and re-initialize the search, when the next replan is called | |
double | get_final_eps_planning_time () |
returns the time taken to get the final solution | |
double | get_final_epsilon () |
returns the final epsilon achieved during the search | |
double | get_initial_eps () |
returns the initial epsilon | |
double | get_initial_eps_planning_time () |
returns the time taken to find the first solution | |
virtual int | get_n_expands () const |
returns the number of states expanded so far | |
int | get_n_expands_init_solution () |
returns the number of expands to find the first solution | |
virtual double | get_solution_eps () const |
returns the suboptimality bound on the currently found solution | |
int | replan (double allocated_time_secs, vector< int > *solution_stateIDs_V) |
replan a path within the allocated time, return the solution in the vector | |
int | replan (double allocated_time_secs, vector< int > *solution_stateIDs_V, int *solcost) |
replan a path within the allocated time, return the solution in the vector, also returns solution cost | |
int | set_goal (int goal_stateID) |
set the goal state | |
virtual void | set_initialsolution_eps (double initialsolution_eps) |
returns the value of the initial epsilon (suboptimality bound) used | |
int | set_search_mode (bool bSearchUntilFirstSolution) |
you can either search forwards or backwards | |
int | set_start (int start_stateID) |
set the start state | |
void | update_preds_of_changededges (vector< int > *predsIDV) |
direct form of informing the search about the new edge costs | |
void | update_succs_of_changededges (vector< int > *succsIDV) |
direct form of informing the search about the new edge costs | |
~ADPlanner () | |
destructor | |
Private Member Functions | |
void | BuildNewOPENList (ADSearchStateSpace_t *pSearchStateSpace) |
int | ComputeHeuristic (CMDPSTATE *MDPstate, ADSearchStateSpace_t *pSearchStateSpace) |
CKey | ComputeKey (ADState *state) |
int | ComputePath (ADSearchStateSpace_t *pSearchStateSpace, double MaxNumofSecs) |
int | CreateSearchStateSpace (ADSearchStateSpace_t *pSearchStateSpace) |
CMDPSTATE * | CreateState (int stateID, ADSearchStateSpace_t *pSearchStateSpace) |
void | DeleteSearchStateData (ADState *state) |
void | DeleteSearchStateSpace (ADSearchStateSpace_t *pSearchStateSpace) |
int | GetGVal (int StateID, ADSearchStateSpace_t *pSearchStateSpace) |
int | getHeurValue (ADSearchStateSpace_t *pSearchStateSpace, int StateID) |
vector< int > | GetSearchPath (ADSearchStateSpace_t *pSearchStateSpace, int &solcost) |
CMDPSTATE * | GetState (int stateID, ADSearchStateSpace_t *pSearchStateSpace) |
void | Initialize_searchinfo (CMDPSTATE *state, ADSearchStateSpace_t *pSearchStateSpace) |
void | InitializeSearchStateInfo (ADState *state, ADSearchStateSpace_t *pSearchStateSpace) |
int | InitializeSearchStateSpace (ADSearchStateSpace_t *pSearchStateSpace) |
void | PrintSearchPath (ADSearchStateSpace_t *pSearchStateSpace, FILE *fOut) |
void | PrintSearchState (ADState *searchstateinfo, FILE *fOut) |
void | Recomputegval (ADState *state) |
int | ReconstructPath (ADSearchStateSpace_t *pSearchStateSpace) |
void | Reevaluatefvals (ADSearchStateSpace_t *pSearchStateSpace) |
void | ReInitializeSearchStateInfo (ADState *state, ADSearchStateSpace_t *pSearchStateSpace) |
void | ReInitializeSearchStateSpace (ADSearchStateSpace_t *pSearchStateSpace) |
int | ResetSearchStateSpace (ADSearchStateSpace_t *pSearchStateSpace) |
bool | Search (ADSearchStateSpace_t *pSearchStateSpace, vector< int > &pathIds, int &PathCost, bool bFirstSolution, bool bOptimalSolution, double MaxNumofSecs) |
int | SetSearchGoalState (int SearchGoalStateID, ADSearchStateSpace_t *pSearchStateSpace) |
int | SetSearchStartState (int SearchStartStateID, ADSearchStateSpace_t *pSearchStateSpace) |
void | Update_SearchSuccs_of_ChangedEdges (vector< int > const *statesIDV) |
void | UpdatePredsofOverconsState (ADState *state, ADSearchStateSpace_t *pSearchStateSpace) |
void | UpdatePredsofUnderconsState (ADState *state, ADSearchStateSpace_t *pSearchStateSpace) |
void | UpdateSetMembership (ADState *state) |
void | UpdateSuccsofOverconsState (ADState *state, ADSearchStateSpace_t *pSearchStateSpace) |
void | UpdateSuccsofUnderconsState (ADState *state, ADSearchStateSpace_t *pSearchStateSpace) |
Private Attributes | |
bool | bforwardsearch |
bool | bsearchuntilfirstsolution |
FILE * | fDeb |
double | final_eps |
double | final_eps_planning_time |
double | finitial_eps |
double | finitial_eps_planning_time |
int | MaxMemoryCounter |
MDPConfig * | MDPCfg_ |
int | num_of_expands_initial_solution |
ADSearchStateSpace_t * | pSearchStateSpace_ |
unsigned int | searchexpands |
clock_t | TimeStarted |
Anytime D* search planner: all states are uniquely defined by stateIDs.
Definition at line 124 of file adplanner.h.
ADPlanner::ADPlanner | ( | DiscreteSpaceInformation * | environment, |
bool | bForwardSearch | ||
) |
constructor
Definition at line 39 of file adplanner.cpp.
destructor
Definition at line 83 of file adplanner.cpp.
void ADPlanner::BuildNewOPENList | ( | ADSearchStateSpace_t * | pSearchStateSpace | ) | [private] |
Definition at line 698 of file adplanner.cpp.
int ADPlanner::ComputeHeuristic | ( | CMDPSTATE * | MDPstate, |
ADSearchStateSpace_t * | pSearchStateSpace | ||
) | [private] |
Definition at line 181 of file adplanner.cpp.
CKey ADPlanner::ComputeKey | ( | ADState * | state | ) | [private] |
Definition at line 162 of file adplanner.cpp.
int ADPlanner::ComputePath | ( | ADSearchStateSpace_t * | pSearchStateSpace, |
double | MaxNumofSecs | ||
) | [private] |
Definition at line 529 of file adplanner.cpp.
void ADPlanner::costs_changed | ( | StateChangeQuery const & | stateChange | ) | [virtual] |
inform the search about the new edge costs
Implements SBPLPlanner.
Definition at line 1563 of file adplanner.cpp.
int ADPlanner::CreateSearchStateSpace | ( | ADSearchStateSpace_t * | pSearchStateSpace | ) | [private] |
Definition at line 753 of file adplanner.cpp.
CMDPSTATE * ADPlanner::CreateState | ( | int | stateID, |
ADSearchStateSpace_t * | pSearchStateSpace | ||
) | [private] |
Definition at line 104 of file adplanner.cpp.
void ADPlanner::DeleteSearchStateData | ( | ADState * | state | ) | [private] |
Definition at line 274 of file adplanner.cpp.
void ADPlanner::DeleteSearchStateSpace | ( | ADSearchStateSpace_t * | pSearchStateSpace | ) | [private] |
Definition at line 774 of file adplanner.cpp.
int ADPlanner::force_planning_from_scratch | ( | ) | [virtual] |
set a flag to get rid of the previous search efforts, release the memory and re-initialize the search, when the next replan is called
Implements SBPLPlanner.
Definition at line 1543 of file adplanner.cpp.
double ADPlanner::get_final_eps_planning_time | ( | ) | [inline, virtual] |
returns the time taken to get the final solution
Reimplemented from SBPLPlanner.
Definition at line 185 of file adplanner.h.
double ADPlanner::get_final_epsilon | ( | ) | [inline, virtual] |
returns the final epsilon achieved during the search
Reimplemented from SBPLPlanner.
Definition at line 193 of file adplanner.h.
double ADPlanner::get_initial_eps | ( | ) | [inline, virtual] |
returns the initial epsilon
Reimplemented from SBPLPlanner.
Definition at line 177 of file adplanner.h.
double ADPlanner::get_initial_eps_planning_time | ( | ) | [inline, virtual] |
returns the time taken to find the first solution
Reimplemented from SBPLPlanner.
Definition at line 181 of file adplanner.h.
virtual int ADPlanner::get_n_expands | ( | ) | const [inline, virtual] |
returns the number of states expanded so far
Reimplemented from SBPLPlanner.
Definition at line 173 of file adplanner.h.
int ADPlanner::get_n_expands_init_solution | ( | ) | [inline, virtual] |
returns the number of expands to find the first solution
Reimplemented from SBPLPlanner.
Definition at line 189 of file adplanner.h.
virtual double ADPlanner::get_solution_eps | ( | ) | const [inline, virtual] |
returns the suboptimality bound on the currently found solution
Reimplemented from SBPLPlanner.
Definition at line 169 of file adplanner.h.
int ADPlanner::GetGVal | ( | int | StateID, |
ADSearchStateSpace_t * | pSearchStateSpace | ||
) | [private] |
Definition at line 521 of file adplanner.cpp.
int ADPlanner::getHeurValue | ( | ADSearchStateSpace_t * | pSearchStateSpace, |
int | StateID | ||
) | [private] |
Definition at line 1105 of file adplanner.cpp.
vector< int > ADPlanner::GetSearchPath | ( | ADSearchStateSpace_t * | pSearchStateSpace, |
int & | solcost | ||
) | [private] |
Definition at line 1113 of file adplanner.cpp.
CMDPSTATE * ADPlanner::GetState | ( | int | stateID, |
ADSearchStateSpace_t * | pSearchStateSpace | ||
) | [private] |
Definition at line 141 of file adplanner.cpp.
void ADPlanner::Initialize_searchinfo | ( | CMDPSTATE * | state, |
ADSearchStateSpace_t * | pSearchStateSpace | ||
) | [private] |
Definition at line 94 of file adplanner.cpp.
void ADPlanner::InitializeSearchStateInfo | ( | ADState * | state, |
ADSearchStateSpace_t * | pSearchStateSpace | ||
) | [private] |
Definition at line 211 of file adplanner.cpp.
int ADPlanner::InitializeSearchStateSpace | ( | ADSearchStateSpace_t * | pSearchStateSpace | ) | [private] |
Definition at line 858 of file adplanner.cpp.
void ADPlanner::PrintSearchPath | ( | ADSearchStateSpace_t * | pSearchStateSpace, |
FILE * | fOut | ||
) | [private] |
Definition at line 1013 of file adplanner.cpp.
void ADPlanner::PrintSearchState | ( | ADState * | searchstateinfo, |
FILE * | fOut | ||
) | [private] |
Definition at line 1002 of file adplanner.cpp.
void ADPlanner::Recomputegval | ( | ADState * | state | ) | [private] |
Definition at line 318 of file adplanner.cpp.
int ADPlanner::ReconstructPath | ( | ADSearchStateSpace_t * | pSearchStateSpace | ) | [private] |
Definition at line 942 of file adplanner.cpp.
void ADPlanner::Reevaluatefvals | ( | ADSearchStateSpace_t * | pSearchStateSpace | ) | [private] |
Definition at line 727 of file adplanner.cpp.
void ADPlanner::ReInitializeSearchStateInfo | ( | ADState * | state, |
ADSearchStateSpace_t * | pSearchStateSpace | ||
) | [private] |
Definition at line 240 of file adplanner.cpp.
void ADPlanner::ReInitializeSearchStateSpace | ( | ADSearchStateSpace_t * | pSearchStateSpace | ) | [private] |
Definition at line 816 of file adplanner.cpp.
int ADPlanner::replan | ( | double | allocated_time_secs, |
vector< int > * | solution_stateIDs_V | ||
) |
replan a path within the allocated time, return the solution in the vector
Definition at line 1429 of file adplanner.cpp.
int ADPlanner::replan | ( | double | allocated_time_secs, |
vector< int > * | solution_stateIDs_V, | ||
int * | solcost | ||
) |
replan a path within the allocated time, return the solution in the vector, also returns solution cost
Definition at line 1440 of file adplanner.cpp.
int ADPlanner::ResetSearchStateSpace | ( | ADSearchStateSpace_t * | pSearchStateSpace | ) | [private] |
Definition at line 807 of file adplanner.cpp.
bool ADPlanner::Search | ( | ADSearchStateSpace_t * | pSearchStateSpace, |
vector< int > & | pathIds, | ||
int & | PathCost, | ||
bool | bFirstSolution, | ||
bool | bOptimalSolution, | ||
double | MaxNumofSecs | ||
) | [private] |
Definition at line 1225 of file adplanner.cpp.
int ADPlanner::set_goal | ( | int | goal_stateID | ) | [virtual] |
virtual void ADPlanner::set_initialsolution_eps | ( | double | initialsolution_eps | ) | [inline, virtual] |
returns the value of the initial epsilon (suboptimality bound) used
Reimplemented from SBPLPlanner.
Definition at line 197 of file adplanner.h.
int ADPlanner::set_search_mode | ( | bool | bSearchUntilFirstSolution | ) | [virtual] |
you can either search forwards or backwards
Implements SBPLPlanner.
Definition at line 1553 of file adplanner.cpp.
int ADPlanner::set_start | ( | int | start_stateID | ) | [virtual] |
int ADPlanner::SetSearchGoalState | ( | int | SearchGoalStateID, |
ADSearchStateSpace_t * | pSearchStateSpace | ||
) | [private] |
Definition at line 889 of file adplanner.cpp.
int ADPlanner::SetSearchStartState | ( | int | SearchStartStateID, |
ADSearchStateSpace_t * | pSearchStateSpace | ||
) | [private] |
Definition at line 925 of file adplanner.cpp.
void ADPlanner::update_preds_of_changededges | ( | vector< int > * | predsIDV | ) |
direct form of informing the search about the new edge costs
predsIDV | array of predecessors of changed edges |
Definition at line 1535 of file adplanner.cpp.
void ADPlanner::Update_SearchSuccs_of_ChangedEdges | ( | vector< int > const * | statesIDV | ) | [private] |
Definition at line 1356 of file adplanner.cpp.
void ADPlanner::update_succs_of_changededges | ( | vector< int > * | succsIDV | ) |
direct form of informing the search about the new edge costs
succsIDV | array of successors of changed edges |
Definition at line 1528 of file adplanner.cpp.
void ADPlanner::UpdatePredsofOverconsState | ( | ADState * | state, |
ADSearchStateSpace_t * | pSearchStateSpace | ||
) | [private] |
Definition at line 362 of file adplanner.cpp.
void ADPlanner::UpdatePredsofUnderconsState | ( | ADState * | state, |
ADSearchStateSpace_t * | pSearchStateSpace | ||
) | [private] |
Definition at line 452 of file adplanner.cpp.
void ADPlanner::UpdateSetMembership | ( | ADState * | state | ) | [private] |
Definition at line 282 of file adplanner.cpp.
void ADPlanner::UpdateSuccsofOverconsState | ( | ADState * | state, |
ADSearchStateSpace_t * | pSearchStateSpace | ||
) | [private] |
Definition at line 415 of file adplanner.cpp.
void ADPlanner::UpdateSuccsofUnderconsState | ( | ADState * | state, |
ADSearchStateSpace_t * | pSearchStateSpace | ||
) | [private] |
Definition at line 492 of file adplanner.cpp.
bool ADPlanner::bforwardsearch [private] |
Definition at line 216 of file adplanner.h.
bool ADPlanner::bsearchuntilfirstsolution [private] |
Definition at line 217 of file adplanner.h.
FILE* ADPlanner::fDeb [private] |
Definition at line 224 of file adplanner.h.
double ADPlanner::final_eps [private] |
Definition at line 212 of file adplanner.h.
double ADPlanner::final_eps_planning_time [private] |
Definition at line 212 of file adplanner.h.
double ADPlanner::finitial_eps [private] |
Definition at line 212 of file adplanner.h.
double ADPlanner::finitial_eps_planning_time [private] |
Definition at line 212 of file adplanner.h.
int ADPlanner::MaxMemoryCounter [private] |
Definition at line 222 of file adplanner.h.
MDPConfig* ADPlanner::MDPCfg_ [private] |
Definition at line 214 of file adplanner.h.
int ADPlanner::num_of_expands_initial_solution [private] |
Definition at line 213 of file adplanner.h.
Definition at line 219 of file adplanner.h.
unsigned int ADPlanner::searchexpands [private] |
Definition at line 221 of file adplanner.h.
clock_t ADPlanner::TimeStarted [private] |
Definition at line 223 of file adplanner.h.