Go to the documentation of this file.
9 #ifndef __hog2_glut__Map2DHeading__
10 #define __hog2_glut__Map2DHeading__
17 #include <unordered_map>
24 xyhLoc(uint16_t _x, uint16_t _y, uint8_t heading) :
x(_x),
y(_y),
h(heading) {}
32 out <<
"(" <<
loc.
x <<
", " <<
loc.
y <<
", " <<
static_cast<int>(
loc.h) <<
")";
38 return (l1.
x == l2.
x) && (l1.
y == l2.
y) && (l1.
h == l2.
h);
62 fprintf(stderr,
"ERROR: Single State HCost not implemented\n");
63 exit(1);
return -1.0;}
70 fprintf(stderr,
"ERROR: Single State Goal Test not implemented \n");
71 exit(1);
return false;}
113 typedef std::unordered_map<uint64_t, hdData, Hash64>
CostTable;
117 float mySin(
int dir)
const;
118 float myCos(
int dir)
const;
uint64_t GetActionHash(xyhAct act) const
bool IsGoalStored() const
virtual double HCost(const xyhLoc &) const
Heuristic value between node and the stored goal.
void GetActions(const xyhLoc &nodeID, std::vector< xyhAct > &actions) const
uint64_t GetStateHash(const xyhLoc &node) const
std::vector< float > cosTable
void SetCost(const xyhLoc &, double seen, double dist)
virtual bool InvertAction(xyhAct &a) const
virtual void OpenGLDraw() const
virtual void ApplyAction(xyhLoc &s, xyhAct dir) const
void ClearGoal()
Clears the goal from memory.
xyhLoc(uint16_t _x, uint16_t _y, uint8_t heading)
bool GoalTest(const xyhLoc &) const
Goal Test if the goal is stored.
virtual void GetSuccessors(const xyhLoc &nodeID, std::vector< xyhLoc > &neighbors) const
float mySin(int dir) const
bool LegalState(const xyhLoc &s)
virtual double GCost(const xyhLoc &node1, const xyhLoc &node2) const
virtual void GLLabelState(const xyhLoc &, const char *) const
void SetDiagonalCost(double val)
std::vector< float > sinTable
double GetCost(const xyhLoc &a, const xyhLoc &b, double P, double d) const
static std::ostream & operator<<(std::ostream &out, const xyhLoc &loc)
void GetStateFromHash(uint64_t hash, xyhLoc &node) const
void StoreGoal(xyhLoc &)
Stores the goal for use by single-state HCost.
virtual void GetNextState(const xyhLoc ¤ts, xyhAct dir, xyhLoc &news) const
void ClearCost(const xyhLoc &)
std::unordered_map< uint64_t, hdData, Hash64 > CostTable
static bool operator==(const xyhLoc &l1, const xyhLoc &l2)
virtual void GLDrawLine(const xyhLoc &x, const xyhLoc &y) const
float myCos(int dir) const
bool GoalTest(const xyhLoc &node, const xyhLoc &goal) const
Nodes to be stored within a Graph.
A tile-based representation of the world.
xyhAct GetAction(const xyhLoc &s1, const xyhLoc &s2) const