Go to the documentation of this file.
9 #ifndef __hog2_glut__CanonicalGrid__
10 #define __hog2_glut__CanonicalGrid__
41 out <<
"(" <<
loc.
x <<
", " <<
loc.
y <<
" : " <<
loc.parent <<
")";
46 return (l1.
x == l2.
x) && (l1.
y == l2.
y);
50 return (l1.
x != l2.
x) || (l1.
y != l2.
y);
57 void GetSuccessors(
const xyLoc &nodeID, std::vector<xyLoc> &neighbors)
const;
58 void GetActions(
const xyLoc &nodeID, std::vector<tDirection> &actions)
const;
65 fprintf(stderr,
"ERROR: Single State HCost not implemented for CanonicalGrid\n");
66 exit(1);
return -1.0;}
67 double HCost(
const xyLoc &node1,
const xyLoc &node2)
const;
68 double GCost(
const xyLoc &node1,
const xyLoc &node2)
const;
73 fprintf(stderr,
"ERROR: Single State Goal Test not implemented for CanonicalGrid\n");
74 exit(1);
return false;}
76 uint64_t GetMaxHash()
const;
77 uint64_t GetStateHash(
const xyLoc &
node)
const;
79 void OpenGLDraw()
const;
80 void OpenGLDraw(
const xyLoc &l)
const;
81 void OpenGLDraw(
const xyLoc &l1,
const xyLoc &l2,
float v)
const;
83 void GLLabelState(
const xyLoc &,
const char *)
const;
84 void GLLabelState(
const xyLoc &s,
const char *str,
double scale)
const;
85 void GLDrawLine(
const xyLoc &x,
const xyLoc &y)
const;
88 std::string SVGHeader();
89 std::string SVGDraw();
90 std::string SVGDraw(
const xyLoc &);
91 std::string SVGLabelState(
const xyLoc &,
const char *,
double scale)
const;
93 std::string
SVGFrameRect(
int left,
int top,
int right,
int bottom,
int width = 1);
106 void GetFirstJumpPoints(
const xyLoc &nodeID, std::vector<xyLoc> &neighbors)
const;
120 void GetBasicSuccessors(
const xyLoc &nodeID, std::vector<xyLoc> &neighbors)
const;
bool GoalTest(const xyLoc &) const
void SetDiagonalCost(double val)
xyLoc(uint16_t _x, uint16_t _y, tDirection _parent=kAll)
static std::ostream & operator<<(std::ostream &out, const xyLoc &loc)
bool IsGoalStored() const
static bool operator!=(const xyLoc &l1, const xyLoc &l2)
static bool operator==(const xyLoc &l1, const xyLoc &l2)
UnitSimulation< xyLoc, tDirection, CanonicalGrid > UnitMapSimulation
std::string SVGDrawLine(float x1, float y1, float x2, float y2, float width, rgbColor c)
The basic simulation class for the world.
void ClearGoal()
Clears the goal from memory.
double HCost(const xyLoc &) const
Nodes to be stored within a Graph.
A tile-based representation of the world.
std::string SVGFrameRect(float x, float y, float width, float height, float border, rgbColor c)