HOG2
|
#include <Airplane.h>
Public Member Functions | |
AirplaneEnvironment () | |
void | GetSuccessors (const airplaneState &nodeID, std::vector< airplaneState > &neighbors) const |
void | GetActions (const airplaneState &nodeID, std::vector< airplaneAction > &actions) const |
virtual void | ApplyAction (airplaneState &s, airplaneAction dir) const |
virtual void | UndoAction (airplaneState &s, airplaneAction dir) const |
virtual void | GetNextState (const airplaneState ¤ts, airplaneAction dir, airplaneState &news) const |
virtual OccupancyInterface< airplaneState, airplaneAction > * | GetOccupancyInfo () |
virtual bool | InvertAction (airplaneAction &a) const |
virtual double | HCost (const airplaneState &node1, const airplaneState &node2) const |
Heuristic value between two arbitrary nodes. More... | |
virtual double | HCost (const airplaneState &) const |
Heuristic value between node and the stored goal. More... | |
virtual double | GCost (const airplaneState &node1, const airplaneState &node2) const |
virtual double | GCost (const airplaneState &node1, const airplaneAction &act) const |
bool | GoalTest (const airplaneState &node, const airplaneState &goal) const |
bool | GoalTest (const airplaneState &) const |
Goal Test if the goal is stored. More... | |
uint64_t | GetStateHash (const airplaneState &node) const |
uint64_t | GetActionHash (airplaneAction act) const |
virtual void | OpenGLDraw () const |
virtual void | OpenGLDraw (const airplaneState &l) const |
virtual void | OpenGLDraw (const airplaneState &oldState, const airplaneState &newState, float perc) const |
Draw the transition at some percentage 0...1 between two states. More... | |
virtual void | OpenGLDraw (const airplaneState &, const airplaneAction &) const |
void | GLDrawLine (const airplaneState &a, const airplaneState &b) const |
recVec | GetCoordinate (int x, int y, int z) const |
Public Member Functions inherited from SearchEnvironment< airplaneState, airplaneAction > | |
virtual | ~SearchEnvironment () |
virtual int | GetNumSuccessors (const airplaneState &stateID) const |
virtual airplaneAction | GetAction (const airplaneState &s1, const airplaneState &s2) const |
virtual void | StoreGoal (airplaneState &s) |
Stores the goal for use by single-state HCost. More... | |
virtual void | ClearGoal () |
Clears the goal from memory. More... | |
virtual bool | IsGoalStored () const |
Returns true if the goal is stored and false otherwise. More... | |
virtual double | HCost (const airplaneState &node1, const airplaneState &node2, double parentHCost) const |
virtual uint64_t | GetMaxHash () const |
virtual void | GetStateFromHash (uint64_t parent, airplaneState &s) const |
virtual double | GetPathLength (std::vector< airplaneState > &neighbors) |
virtual double | GetPathLength (const airplaneState &start, std::vector< airplaneAction > &neighbors) |
virtual void | SetOccupancyInfo (OccupancyInterface< airplaneState, airplaneAction > *) |
virtual void | OpenGLDraw () const |
virtual void | GLLabelState (const airplaneState &, const char *) const |
virtual void | GLDrawPath (const std::vector< airplaneState > &x) const |
virtual void | SetColor (const rgbColor &r) const |
virtual void | SetColor (GLfloat rr, GLfloat g, GLfloat b, GLfloat t=1.0) const |
virtual void | GetColor (GLfloat &rr, GLfloat &g, GLfloat &b, GLfloat &t) const |
virtual rgbColor | GetColor () const |
virtual void | Draw (Graphics::Display &display) const |
virtual void | Draw (Graphics::Display &display, const airplaneState &) const |
virtual void | DrawLine (Graphics::Display &display, const airplaneState &x, const airplaneState &y, float width=1.0) const |
Public Member Functions inherited from Heuristic< airplaneState > | |
Heuristic () | |
virtual | ~Heuristic () |
Private Member Functions | |
void | SetGround (int x, int y, uint8_t val) |
uint8_t | GetGround (int x, int y) const |
bool | Valid (int x, int y) |
recVec & | GetNormal (int x, int y) |
recVec | GetNormal (int x, int y) const |
void | RecurseGround (int x1, int y1, int x2, int y2) |
void | DoNormal (recVec pa, recVec pb) const |
Private Attributes | |
const int | width = 80 |
const int | length = 80 |
const int | height = 20 |
std::vector< uint8_t > | ground |
std::vector< recVec > | groundNormals |
std::vector< airplaneAction > | internalActions |
Additional Inherited Members | |
Public Attributes inherited from Heuristic< airplaneState > | |
std::vector< HeuristicTreeNode > | lookups |
std::vector< Heuristic * > | heuristics |
uint64_t | histogram [256] |
Protected Attributes inherited from SearchEnvironment< airplaneState, airplaneAction > | |
bool | bValidSearchGoal |
airplaneState | searchGoal |
rgbColor | color |
GLfloat | transparency |
Definition at line 55 of file Airplane.h.
AirplaneEnvironment::AirplaneEnvironment | ( | ) |
Definition at line 18 of file Airplane.cpp.
References d, GetCoordinate(), GetGround(), GetNormal(), ground, groundNormals, length, max, min(), recVec::normalise(), SetGround(), Valid(), and width.
|
virtual |
Implements SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 239 of file Airplane.cpp.
References airplaneState::heading, airplaneAction::height, airplaneState::height, k45, k90, airplaneAction::turn, airplaneState::x, and airplaneState::y.
Referenced by GetNextState().
|
virtual |
Implements SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 303 of file Airplane.cpp.
|
virtual |
Implements SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 298 of file Airplane.cpp.
|
virtual |
Implements SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 319 of file Airplane.cpp.
|
virtual |
Implements SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 214 of file Airplane.cpp.
References airplaneState::height, k45, k90, and kShift.
Referenced by GetSuccessors().
recVec AirplaneEnvironment::GetCoordinate | ( | int | x, |
int | y, | ||
int | z | ||
) | const |
Definition at line 324 of file Airplane.cpp.
References width.
Referenced by AirplaneEnvironment(), and OpenGLDraw().
|
private |
Definition at line 164 of file Airplane.cpp.
References ground, and length.
Referenced by AirplaneEnvironment(), OpenGLDraw(), and RecurseGround().
|
virtual |
Reimplemented from SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 285 of file Airplane.cpp.
References ApplyAction().
Referenced by GetSuccessors().
|
private |
Definition at line 175 of file Airplane.cpp.
References groundNormals, and length.
Referenced by AirplaneEnvironment(), and OpenGLDraw().
|
private |
Definition at line 180 of file Airplane.cpp.
References groundNormals, and length.
|
inlinevirtual |
Reimplemented from SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 65 of file Airplane.h.
|
virtual |
Implements SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 314 of file Airplane.cpp.
|
virtual |
Implements SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 203 of file Airplane.cpp.
References GetActions(), GetNextState(), and internalActions.
|
virtual |
Reimplemented from SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 431 of file Airplane.cpp.
|
inlinevirtual |
Goal Test if the goal is stored.
Reimplemented from SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 75 of file Airplane.h.
|
virtual |
Implements SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 309 of file Airplane.cpp.
|
inlinevirtual |
Heuristic value between node and the stored goal.
Asserts that the goal is stored
Reimplemented from SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 69 of file Airplane.h.
|
virtual |
Heuristic value between two arbitrary nodes.
Implements SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 293 of file Airplane.cpp.
|
inlinevirtual |
Implements SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 66 of file Airplane.h.
|
virtual |
Definition at line 329 of file Airplane.cpp.
References rgbColor::b, DrawBoxFrame(), rgbColor::g, Colors::GetColor(), GetCoordinate(), GetGround(), GetNormal(), length, max, rgbColor::r, width, recVec::x, recVec::y, and recVec::z.
|
virtual |
Reimplemented from SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 426 of file Airplane.cpp.
|
virtual |
Reimplemented from SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 375 of file Airplane.cpp.
References DrawCylinder(), SearchEnvironment< airplaneState, airplaneAction >::GetColor(), airplaneState::heading, airplaneState::height, airplaneState::x, and airplaneState::y.
|
virtual |
Draw the transition at some percentage 0...1 between two states.
Reimplemented from SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 397 of file Airplane.cpp.
References DrawCylinder(), SearchEnvironment< airplaneState, airplaneAction >::GetColor(), airplaneState::heading, airplaneState::height, airplaneState::x, and airplaneState::y.
|
private |
Definition at line 185 of file Airplane.cpp.
References GetGround(), and SetGround().
|
private |
Definition at line 159 of file Airplane.cpp.
References ground, and length.
Referenced by AirplaneEnvironment(), and RecurseGround().
|
virtual |
Reimplemented from SearchEnvironment< airplaneState, airplaneAction >.
Definition at line 279 of file Airplane.cpp.
|
private |
Definition at line 169 of file Airplane.cpp.
References length.
Referenced by AirplaneEnvironment().
|
private |
Definition at line 94 of file Airplane.h.
Referenced by AirplaneEnvironment(), GetGround(), and SetGround().
|
private |
Definition at line 95 of file Airplane.h.
Referenced by AirplaneEnvironment(), and GetNormal().
|
private |
Definition at line 93 of file Airplane.h.
|
mutableprivate |
Definition at line 97 of file Airplane.h.
Referenced by GetSuccessors().
|
private |
Definition at line 92 of file Airplane.h.
Referenced by AirplaneEnvironment(), GetGround(), GetNormal(), OpenGLDraw(), SetGround(), and Valid().
|
private |
Definition at line 91 of file Airplane.h.
Referenced by AirplaneEnvironment(), GetCoordinate(), and OpenGLDraw().