HOG2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AirplaneEnvironment Class Reference

#include <Airplane.h>

Inheritance diagram for AirplaneEnvironment:
Inheritance graph
[legend]
Collaboration diagram for AirplaneEnvironment:
Collaboration graph
[legend]

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 &currents, 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)
 
recVecGetNormal (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< recVecgroundNormals
 
std::vector< airplaneActioninternalActions
 

Additional Inherited Members

- Public Attributes inherited from Heuristic< airplaneState >
std::vector< HeuristicTreeNodelookups
 
std::vector< Heuristic * > heuristics
 
uint64_t histogram [256]
 
- Protected Attributes inherited from SearchEnvironment< airplaneState, airplaneAction >
bool bValidSearchGoal
 
airplaneState searchGoal
 
rgbColor color
 
GLfloat transparency
 

Detailed Description

Definition at line 55 of file Airplane.h.

Constructor & Destructor Documentation

◆ AirplaneEnvironment()

AirplaneEnvironment::AirplaneEnvironment ( )

Member Function Documentation

◆ ApplyAction()

void AirplaneEnvironment::ApplyAction ( airplaneState s,
airplaneAction  dir 
) const
virtual

◆ DoNormal()

void AirplaneEnvironment::DoNormal ( recVec  pa,
recVec  pb 
) const
private

◆ GCost() [1/2]

double AirplaneEnvironment::GCost ( const airplaneState node1,
const airplaneAction act 
) const
virtual

Implements SearchEnvironment< airplaneState, airplaneAction >.

Definition at line 303 of file Airplane.cpp.

◆ GCost() [2/2]

double AirplaneEnvironment::GCost ( const airplaneState node1,
const airplaneState node2 
) const
virtual

Implements SearchEnvironment< airplaneState, airplaneAction >.

Definition at line 298 of file Airplane.cpp.

◆ GetActionHash()

uint64_t AirplaneEnvironment::GetActionHash ( airplaneAction  act) const
virtual

Implements SearchEnvironment< airplaneState, airplaneAction >.

Definition at line 319 of file Airplane.cpp.

◆ GetActions()

void AirplaneEnvironment::GetActions ( const airplaneState nodeID,
std::vector< airplaneAction > &  actions 
) const
virtual

Implements SearchEnvironment< airplaneState, airplaneAction >.

Definition at line 214 of file Airplane.cpp.

References airplaneState::height, k45, k90, and kShift.

Referenced by GetSuccessors().

◆ GetCoordinate()

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().

◆ GetGround()

uint8_t AirplaneEnvironment::GetGround ( int  x,
int  y 
) const
private

Definition at line 164 of file Airplane.cpp.

References ground, and length.

Referenced by AirplaneEnvironment(), OpenGLDraw(), and RecurseGround().

◆ GetNextState()

void AirplaneEnvironment::GetNextState ( const airplaneState currents,
airplaneAction  dir,
airplaneState news 
) const
virtual

Reimplemented from SearchEnvironment< airplaneState, airplaneAction >.

Definition at line 285 of file Airplane.cpp.

References ApplyAction().

Referenced by GetSuccessors().

◆ GetNormal() [1/2]

recVec & AirplaneEnvironment::GetNormal ( int  x,
int  y 
)
private

Definition at line 175 of file Airplane.cpp.

References groundNormals, and length.

Referenced by AirplaneEnvironment(), and OpenGLDraw().

◆ GetNormal() [2/2]

recVec AirplaneEnvironment::GetNormal ( int  x,
int  y 
) const
private

Definition at line 180 of file Airplane.cpp.

References groundNormals, and length.

◆ GetOccupancyInfo()

virtual OccupancyInterface<airplaneState,airplaneAction>* AirplaneEnvironment::GetOccupancyInfo ( )
inlinevirtual

Reimplemented from SearchEnvironment< airplaneState, airplaneAction >.

Definition at line 65 of file Airplane.h.

◆ GetStateHash()

uint64_t AirplaneEnvironment::GetStateHash ( const airplaneState node) const
virtual

Implements SearchEnvironment< airplaneState, airplaneAction >.

Definition at line 314 of file Airplane.cpp.

◆ GetSuccessors()

void AirplaneEnvironment::GetSuccessors ( const airplaneState nodeID,
std::vector< airplaneState > &  neighbors 
) const
virtual

◆ GLDrawLine()

void AirplaneEnvironment::GLDrawLine ( const airplaneState a,
const airplaneState b 
) const
virtual

Reimplemented from SearchEnvironment< airplaneState, airplaneAction >.

Definition at line 431 of file Airplane.cpp.

◆ GoalTest() [1/2]

bool AirplaneEnvironment::GoalTest ( const airplaneState node) const
inlinevirtual

Goal Test if the goal is stored.

Reimplemented from SearchEnvironment< airplaneState, airplaneAction >.

Definition at line 75 of file Airplane.h.

◆ GoalTest() [2/2]

bool AirplaneEnvironment::GoalTest ( const airplaneState node,
const airplaneState goal 
) const
virtual

Implements SearchEnvironment< airplaneState, airplaneAction >.

Definition at line 309 of file Airplane.cpp.

◆ HCost() [1/2]

virtual double AirplaneEnvironment::HCost ( const airplaneState node) const
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.

◆ HCost() [2/2]

double AirplaneEnvironment::HCost ( const airplaneState node1,
const airplaneState node2 
) const
virtual

Heuristic value between two arbitrary nodes.

Implements SearchEnvironment< airplaneState, airplaneAction >.

Definition at line 293 of file Airplane.cpp.

◆ InvertAction()

virtual bool AirplaneEnvironment::InvertAction ( airplaneAction a) const
inlinevirtual

Implements SearchEnvironment< airplaneState, airplaneAction >.

Definition at line 66 of file Airplane.h.

◆ OpenGLDraw() [1/4]

void AirplaneEnvironment::OpenGLDraw ( ) const
virtual

◆ OpenGLDraw() [2/4]

void AirplaneEnvironment::OpenGLDraw ( const airplaneState ,
const airplaneAction  
) const
virtual

Reimplemented from SearchEnvironment< airplaneState, airplaneAction >.

Definition at line 426 of file Airplane.cpp.

◆ OpenGLDraw() [3/4]

void AirplaneEnvironment::OpenGLDraw ( const airplaneState l) const
virtual

◆ OpenGLDraw() [4/4]

void AirplaneEnvironment::OpenGLDraw ( const airplaneState ,
const airplaneState ,
float   
) const
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.

◆ RecurseGround()

void AirplaneEnvironment::RecurseGround ( int  x1,
int  y1,
int  x2,
int  y2 
)
private

Definition at line 185 of file Airplane.cpp.

References GetGround(), and SetGround().

◆ SetGround()

void AirplaneEnvironment::SetGround ( int  x,
int  y,
uint8_t  val 
)
private

Definition at line 159 of file Airplane.cpp.

References ground, and length.

Referenced by AirplaneEnvironment(), and RecurseGround().

◆ UndoAction()

void AirplaneEnvironment::UndoAction ( airplaneState s,
airplaneAction  dir 
) const
virtual

Reimplemented from SearchEnvironment< airplaneState, airplaneAction >.

Definition at line 279 of file Airplane.cpp.

◆ Valid()

bool AirplaneEnvironment::Valid ( int  x,
int  y 
)
private

Definition at line 169 of file Airplane.cpp.

References length.

Referenced by AirplaneEnvironment().

Member Data Documentation

◆ ground

std::vector<uint8_t> AirplaneEnvironment::ground
private

Definition at line 94 of file Airplane.h.

Referenced by AirplaneEnvironment(), GetGround(), and SetGround().

◆ groundNormals

std::vector<recVec> AirplaneEnvironment::groundNormals
private

Definition at line 95 of file Airplane.h.

Referenced by AirplaneEnvironment(), and GetNormal().

◆ height

const int AirplaneEnvironment::height = 20
private

Definition at line 93 of file Airplane.h.

◆ internalActions

std::vector<airplaneAction> AirplaneEnvironment::internalActions
mutableprivate

Definition at line 97 of file Airplane.h.

Referenced by GetSuccessors().

◆ length

const int AirplaneEnvironment::length = 80
private

Definition at line 92 of file Airplane.h.

Referenced by AirplaneEnvironment(), GetGround(), GetNormal(), OpenGLDraw(), SetGround(), and Valid().

◆ width

const int AirplaneEnvironment::width = 80
private

Definition at line 91 of file Airplane.h.

Referenced by AirplaneEnvironment(), GetCoordinate(), and OpenGLDraw().


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