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

#include <MNAgentPuzzle.h>

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

Public Member Functions

 MNAgentEnvironment ()
 
virtual void GetSuccessors (const MNAgentPuzzleState &nodeID, std::vector< MNAgentPuzzleState > &neighbors) const
 
virtual void GetActions (const MNAgentPuzzleState &nodeID, std::vector< tAgentAction > &actions) const
 
virtual tAgentAction GetAction (const MNAgentPuzzleState &s1, const MNAgentPuzzleState &s2) const
 
virtual void ApplyAction (MNAgentPuzzleState &s, tAgentAction a) const
 
virtual void GetNextState (const MNAgentPuzzleState &, tAgentAction, MNAgentPuzzleState &) const
 
virtual bool InvertAction (tAgentAction &a) const
 
virtual double HCost (const MNAgentPuzzleState &node1, const MNAgentPuzzleState &node2) const
 Heuristic value between two arbitrary nodes. More...
 
virtual double HCost (const MNAgentPuzzleState &node) const
 Heuristic value between node and the stored goal. More...
 
virtual double GCost (const MNAgentPuzzleState &node1, const MNAgentPuzzleState &node2) const
 
virtual double GCost (const MNAgentPuzzleState &node, const tAgentAction &act) const
 
virtual bool GoalTest (const MNAgentPuzzleState &node, const MNAgentPuzzleState &goal) const
 
virtual bool GoalTest (const MNAgentPuzzleState &node) const
 Goal Test if the goal is stored. More...
 
void SetDomainAbstractionSize (int val)
 
virtual uint64_t GetStateHash (const MNAgentPuzzleState &node) const
 
virtual uint64_t GetActionHash (tAgentAction act) const
 
virtual void OpenGLDraw () const
 
virtual void OpenGLDraw (const MNAgentPuzzleState &) const
 
virtual void OpenGLDraw (const MNAgentPuzzleState &, const MNAgentPuzzleState &, float) const
 Draw the transition at some percentage 0...1 between two states. More...
 
virtual void OpenGLDraw (const MNAgentPuzzleState &, const tAgentAction &) const
 
- Public Member Functions inherited from SearchEnvironment< MNAgentPuzzleState, tAgentAction >
virtual ~SearchEnvironment ()
 
virtual int GetNumSuccessors (const MNAgentPuzzleState &stateID) const
 
virtual void UndoAction (MNAgentPuzzleState &s, tAgentAction a) const
 
virtual void StoreGoal (MNAgentPuzzleState &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 MNAgentPuzzleState &node1, const MNAgentPuzzleState &node2, double parentHCost) const
 
virtual uint64_t GetMaxHash () const
 
virtual void GetStateFromHash (uint64_t parent, MNAgentPuzzleState &s) const
 
virtual double GetPathLength (std::vector< MNAgentPuzzleState > &neighbors)
 
virtual double GetPathLength (const MNAgentPuzzleState &start, std::vector< tAgentAction > &neighbors)
 
virtual OccupancyInterface< MNAgentPuzzleState, tAgentAction > * GetOccupancyInfo ()
 
virtual void SetOccupancyInfo (OccupancyInterface< MNAgentPuzzleState, tAgentAction > *)
 
virtual void OpenGLDraw () const
 
virtual void GLLabelState (const MNAgentPuzzleState &, const char *) const
 
virtual void GLDrawLine (const MNAgentPuzzleState &x, const MNAgentPuzzleState &y) const
 
virtual void GLDrawPath (const std::vector< MNAgentPuzzleState > &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 MNAgentPuzzleState &) const
 
virtual void DrawLine (Graphics::Display &display, const MNAgentPuzzleState &x, const MNAgentPuzzleState &y, float width=1.0) const
 
- Public Member Functions inherited from Heuristic< MNAgentPuzzleState >
 Heuristic ()
 
virtual ~Heuristic ()
 

Private Member Functions

void FindLegalMoves (MNAgentPuzzleState &s, tAgentAction &curr, std::vector< tAgentAction > &actions, int realMoves, int depth, std::vector< bool > &moved) const
 

Private Attributes

int domainAbstractionSize
 

Additional Inherited Members

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

Detailed Description

Definition at line 90 of file MNAgentPuzzle.h.

Constructor & Destructor Documentation

◆ MNAgentEnvironment()

MNAgentEnvironment::MNAgentEnvironment ( )
inline

Definition at line 93 of file MNAgentPuzzle.h.

References domainAbstractionSize.

Member Function Documentation

◆ ApplyAction()

void MNAgentEnvironment::ApplyAction ( MNAgentPuzzleState s,
tAgentAction  a 
) const
virtual

◆ FindLegalMoves()

void MNAgentEnvironment::FindLegalMoves ( MNAgentPuzzleState s,
tAgentAction curr,
std::vector< tAgentAction > &  actions,
int  realMoves,
int  depth,
std::vector< bool > &  moved 
) const
private

◆ GCost() [1/2]

double MNAgentEnvironment::GCost ( const MNAgentPuzzleState node,
const tAgentAction act 
) const
virtual

◆ GCost() [2/2]

double MNAgentEnvironment::GCost ( const MNAgentPuzzleState node1,
const MNAgentPuzzleState node2 
) const
virtual

◆ GetAction()

tAgentAction MNAgentEnvironment::GetAction ( const MNAgentPuzzleState s1,
const MNAgentPuzzleState s2 
) const
virtual

Reimplemented from SearchEnvironment< MNAgentPuzzleState, tAgentAction >.

Definition at line 60 of file MNAgentPuzzle.cpp.

◆ GetActionHash()

uint64_t MNAgentEnvironment::GetActionHash ( tAgentAction  act) const
virtual

◆ GetActions()

void MNAgentEnvironment::GetActions ( const MNAgentPuzzleState nodeID,
std::vector< tAgentAction > &  actions 
) const
virtual

◆ GetNextState()

void MNAgentEnvironment::GetNextState ( const MNAgentPuzzleState s1,
tAgentAction  a,
MNAgentPuzzleState s2 
) const
virtual

Reimplemented from SearchEnvironment< MNAgentPuzzleState, tAgentAction >.

Definition at line 92 of file MNAgentPuzzle.cpp.

References ApplyAction().

◆ GetStateHash()

uint64_t MNAgentEnvironment::GetStateHash ( const MNAgentPuzzleState node) const
virtual

Implements SearchEnvironment< MNAgentPuzzleState, tAgentAction >.

Definition at line 120 of file MNAgentPuzzle.cpp.

References filled.

◆ GetSuccessors()

void MNAgentEnvironment::GetSuccessors ( const MNAgentPuzzleState nodeID,
std::vector< MNAgentPuzzleState > &  neighbors 
) const
virtual

◆ GoalTest() [1/2]

virtual bool MNAgentEnvironment::GoalTest ( const MNAgentPuzzleState node) const
inlinevirtual

◆ GoalTest() [2/2]

bool MNAgentEnvironment::GoalTest ( const MNAgentPuzzleState node,
const MNAgentPuzzleState goal 
) const
virtual

◆ HCost() [1/2]

virtual double MNAgentEnvironment::HCost ( const MNAgentPuzzleState node) const
inlinevirtual

◆ HCost() [2/2]

double MNAgentEnvironment::HCost ( const MNAgentPuzzleState node1,
const MNAgentPuzzleState node2 
) const
virtual

Heuristic value between two arbitrary nodes.

Implements SearchEnvironment< MNAgentPuzzleState, tAgentAction >.

Definition at line 104 of file MNAgentPuzzle.cpp.

Referenced by HCost().

◆ InvertAction()

bool MNAgentEnvironment::InvertAction ( tAgentAction a) const
virtual

◆ OpenGLDraw() [1/4]

void MNAgentEnvironment::OpenGLDraw ( ) const
virtual

Definition at line 149 of file MNAgentPuzzle.cpp.

◆ OpenGLDraw() [2/4]

void MNAgentEnvironment::OpenGLDraw ( const MNAgentPuzzleState s) const
virtual

◆ OpenGLDraw() [3/4]

void MNAgentEnvironment::OpenGLDraw ( const MNAgentPuzzleState ,
const MNAgentPuzzleState ,
float   
) const
virtual

Draw the transition at some percentage 0...1 between two states.

Draw the transition at some percentage 0...1 between two MNAgentPuzzleStates.

Reimplemented from SearchEnvironment< MNAgentPuzzleState, tAgentAction >.

Definition at line 203 of file MNAgentPuzzle.cpp.

◆ OpenGLDraw() [4/4]

void MNAgentEnvironment::OpenGLDraw ( const MNAgentPuzzleState ,
const tAgentAction  
) const
virtual

Reimplemented from SearchEnvironment< MNAgentPuzzleState, tAgentAction >.

Definition at line 207 of file MNAgentPuzzle.cpp.

◆ SetDomainAbstractionSize()

void MNAgentEnvironment::SetDomainAbstractionSize ( int  val)
inline

Definition at line 120 of file MNAgentPuzzle.h.

References domainAbstractionSize.

Member Data Documentation

◆ domainAbstractionSize

int MNAgentEnvironment::domainAbstractionSize
private

Definition at line 138 of file MNAgentPuzzle.h.

Referenced by MNAgentEnvironment(), and SetDomainAbstractionSize().


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