Fawkes API  Fawkes Development Version
fawkes::AStarState Class Referenceabstract

This is the abstract(!) class for an A* State. More...

#include <>>

Inheritance diagram for fawkes::AStarState:

Public Member Functions

 AStarState (float cost_sofar, AStarState *parent)
 Constructor. More...
 
virtual ~AStarState ()
 Destructor. More...
 
virtual size_t key ()=0
 Generates a unique key for this state. More...
 
virtual float estimate ()=0
 Estimate the heuristic cost to the goal. More...
 
virtual bool is_goal ()=0
 Check, wether we reached a goal or not. More...
 
virtual std::vector< AStarState * > children ()=0
 Generate all successors and put them to this vector. More...
 
 AStarState ()
 This is the standard constructor. More...
 
 AStarState (int x, int y, int past_cost, AStarState *father)
 This is another standard constuctor, this time parametrized. More...
 

Public Attributes

AStarStateparent
 Predecessor. More...
 
float path_cost
 Cost of path leading to this search state. More...
 
float total_estimated_cost
 Total estimated cost. More...
 
int x_
 x coordinate of the state More...
 
int y_
 y coordinate of the state More...
 
AStarStatefather_
 The predecessor state. More...
 
int past_cost_
 The past cost. More...
 
int total_cost_
 The total cost. More...
 

Detailed Description

This is the abstract(!) class for an A* State.

This is the class for an A* State.

Author
Stefan Jacobs

Definition at line 38 of file astar_state.h.

Constructor & Destructor Documentation

◆ AStarState() [1/3]

fawkes::AStarState::AStarState ( float  cost_sofar,
AStarState parent 
)
inline

Constructor.

Parameters
cost_sofarcosts for the path so far
parentparent search state (maybe NULL for first state)

Definition at line 46 of file astar_state.h.

◆ ~AStarState()

fawkes::AStarState::~AStarState ( )
inlinevirtual

Destructor.

Standard Destructor.

Definition at line 51 of file astar_state.h.

References children(), estimate(), is_goal(), and key().

Referenced by AStarState().

◆ AStarState() [2/3]

fawkes::AStarState::AStarState ( )
inline

This is the standard constructor.

Definition at line 58 of file astar_state.h.

References father_, past_cost_, total_cost_, x_, and y_.

◆ AStarState() [3/3]

fawkes::AStarState::AStarState ( int  x,
int  y,
int  past_cost,
AStarState father 
)
inline

This is another standard constuctor, this time parametrized.

Parameters
xis the x coordinate.
yis the y coordinate.
past_costis the total left cost.
fatheris a pointer to the predecessor of this AStarState.

Definition at line 73 of file astar_state.h.

References father_, past_cost_, x_, y_, and ~AStarState().

Member Function Documentation

◆ children()

virtual std::vector<AStarState *> fawkes::AStarState::children ( )
pure virtual

Generate all successors and put them to this vector.

Returns
a vector of pointers of AStarState to a successor

Referenced by fawkes::AStar::solve(), and ~AStarState().

◆ estimate()

virtual float fawkes::AStarState::estimate ( )
pure virtual

Estimate the heuristic cost to the goal.

Returns
estimated cost

Implemented in fawkes::NavGraphSearchState.

Referenced by ~AStarState().

◆ is_goal()

virtual bool fawkes::AStarState::is_goal ( )
pure virtual

Check, wether we reached a goal or not.

Returns
true, if this state is a goal, else false

Implemented in fawkes::NavGraphSearchState.

Referenced by fawkes::AStar::solve(), and ~AStarState().

◆ key()

virtual size_t fawkes::AStarState::key ( )
pure virtual

Generates a unique key for this state.

There has to be a unique key for each state (fast closed list -> bottleneck!)

Returns
unique key

Implemented in fawkes::NavGraphSearchState.

Referenced by fawkes::AStar::solve(), and ~AStarState().

Member Data Documentation

◆ father_

AStarState* fawkes::AStarState::father_

The predecessor state.

Definition at line 45 of file astar_state.h.

Referenced by AStarState(), and fawkes::AStar::solve().

◆ parent

AStarState* fawkes::AStarState::parent

Predecessor.

Definition at line 79 of file astar_state.h.

Referenced by fawkes::AStar::solve().

◆ past_cost_

int fawkes::AStarState::past_cost_

The past cost.

Definition at line 47 of file astar_state.h.

Referenced by AStarState(), and fawkes::AStar::solve().

◆ path_cost

float fawkes::AStarState::path_cost

Cost of path leading to this search state.

Definition at line 82 of file astar_state.h.

Referenced by fawkes::NavGraphSearchState::is_goal(), and fawkes::NavGraphSearchState::NavGraphSearchState().

◆ total_cost_

int fawkes::AStarState::total_cost_

The total cost.

Definition at line 48 of file astar_state.h.

Referenced by AStarState(), fawkes::AStar::remove_target_from_obstacle(), and fawkes::AStar::solve().

◆ total_estimated_cost

float fawkes::AStarState::total_estimated_cost

Total estimated cost.

Definition at line 85 of file astar_state.h.

Referenced by fawkes::NavGraphSearchState::NavGraphSearchState().

◆ x_

int fawkes::AStarState::x_

x coordinate of the state

Definition at line 42 of file astar_state.h.

Referenced by AStarState(), fawkes::AStar::remove_target_from_obstacle(), and fawkes::AStar::solve().

◆ y_

int fawkes::AStarState::y_

y coordinate of the state

Definition at line 43 of file astar_state.h.

Referenced by AStarState(), fawkes::AStar::remove_target_from_obstacle(), and fawkes::AStar::solve().


The documentation for this class was generated from the following file: