Go to the documentation of this file.
48 neighbors.push_back(
goal);
49 for (
unsigned int x = 0; x <
obstacles.size(); x++)
54 for (
unsigned int x = 0; x < neighbors.size(); x++)
56 if (!
Legal(nodeID, neighbors[x]))
58 neighbors[x] = neighbors.back();
73 for (
unsigned int x = 0; x <
obstacles.size(); x++)
78 for (
unsigned int x = 0; x < actions.size(); x++)
80 if (!
Legal(actions[x].start, actions[x].end))
82 actions[x] = actions.back();
92 for (
unsigned int x = 0; x <
obstacles.size(); x++)
135 return sqrt((node1.
x-node2.
x)*(node1.
x-node2.
x) +
136 (node1.
y-node2.
y)*(node1.
y-node2.
y) +
137 (node1.
z-node2.
z)*(node1.
z-node2.
z));
142 return sqrt((node1.
x-node2.
x)*(node1.
x-node2.
x) +
143 (node1.
y-node2.
y)*(node1.
y-node2.
y) +
144 (node1.
z-node2.
z)*(node1.
z-node2.
z));
149 return sqrt((node1.
x-act.
end.
x)*(node1.
x-act.
end.
x) +
163 x = (int)((
double)fabs(
node.x)*10000.0);
164 y = (int)((
double)fabs(
node.y)*10000.0);
168 val = (val<<1)|(nx?1:0);
169 val = (val<<1)|(ny?1:0);
181 glColor3f(0, 0, 1.0);
182 for (
unsigned int x = 0; x <
obstacles.size(); x++)
189 glVertex3f(l.
x, l.
y, l.
z);
void DrawLine(line2d l) const
A generic vector (essentially the same as a point, but offers normalization)
virtual double HCost(const recVec &) const
Heuristic value between node and the stored goal.
uint64_t GetStateHash(const recVec &node) const
std::vector< line2d > obstacles
void GetSuccessors(const recVec &nodeID, std::vector< recVec > &neighbors) const
virtual double GCost(const recVec &node1, const recVec &node2) const
virtual ~ConfigEnvironment()
bool GoalTest(const recVec &node, const recVec &goal) const
virtual void ApplyAction(recVec &s, line2d dir) const
uint64_t GetActionHash(line2d act) const
virtual void OpenGLDraw() const
void GetActions(const recVec &nodeID, std::vector< line2d > &actions) const
bool Legal(const recVec &a, const recVec &b) const
virtual bool InvertAction(line2d &a) const
line2d GetAction(const recVec &s1, const recVec &s2) const
bool fequal(double a, double b, double tolerance=TOLERANCE)
Nodes to be stored within a Graph.
virtual void GetNextState(const recVec ¤ts, line2d dir, recVec &news) const