Go to the documentation of this file.
23 if (thePath.size() > 0 &&
verbose)
92 printf(
"Expanding node %ld , gcost=%lf, h=%lf, f=%lf.\n",
112 for (
unsigned int x = 0; x<
neighbors.size(); x++)
119 double gcost = topNode.
gCost + edgeWeight;
121 double f = gcost + h;
131 printf(
"Adding node %ld to OPEN, gcost=%lf, h=%lf, f=%lf.\n",
neighbor,gcost,f-gcost,f);
149 printf(
"Adjusting node %ld in OPEN, gcost=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,gcost,f-gcost,f, neighborNode.
gCost);
165 printf(
"Moving node %ld from CLOSED to OPEN, gcost=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,gcost,f-gcost,f, neighborNode.
gCost);
225 printf(
"F updated to %lf.\n",
F);
242 printf(
"Expanding node %ld , gcost=%lf, h=%lf, f=%lf.\n",topNodeID,topNode.
gCost,topNode.
fCost-topNode.
gCost,topNode.
fCost);
262 for (
unsigned int x = 0; x<
neighbors.size(); x++)
269 double gcost = topNode.
gCost + edgeWeight;
271 double f = gcost + h;
282 printf(
"Adding node %ld to OPEN, gcost=%lf, h=%lf, f=%lf.\n",
neighbor,gcost,f-gcost,f);
298 printf(
"Adjusting node %ld in OPEN, gcost=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,gcost,f-gcost,f, neighborNode.
gCost);
314 printf(
"Moving node %ld from CLOSED to OPEN, gcost=%lf, h=%lf, f=%lf; g_old=%lf.\n",
364 printf(
"Expanding a node below F.\n");
375 printf(
"F updated to %lf.\n",
F);
391 printf(
"Expanding node %ld , gcost=%lf, h=%lf, f=%lf.\n",topNodeID,topNode.
gCost,topNode.
fCost-topNode.
gCost,topNode.
fCost);
412 double minH2 = DBL_MAX;
414 for (
unsigned int x = 0; x<
neighbors.size(); x++)
421 double gcost = topNode.
gCost + edgeWeight;
450 printf(
"Improving h of node %ld by Mero rule (a), %lf->%lf\n",
neighbor,h_tmp,h);
453 double f = gcost + h;
456 minH2 =
min(minH2, h + edgeWeight);
466 printf(
"Adding node %ld to OPEN, gcost=%lf, h=%lf, f=%lf.\n",
neighbor,gcost,f-gcost,f);
483 f = h + neighborNode.
gCost;
484 neighborNode.
fCost = f;
492 printf(
"Adjusting node %ld in OPEN, gcost=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,gcost,f-gcost,f, neighborNode.
gCost);
516 f = h + neighborNode.
gCost;
517 neighborNode.
fCost = f;
525 printf(
"Moving node %ld from CLOSED to OPEN, gcost=%lf, h=%lf, f=%lf; g_old=%lf.\n",
neighbor,gcost,f-gcost,f, neighborNode.
gCost);
543 printf(
"Improving h of node %ld by Mero rule (b), %lf->%lf\n",topNodeID,hTop,minH2);
673 void MeroB::DrawText(
double x,
double y,
double z,
float r,
float gg,
float b,
char* str)
681 glScalef(1.0/(20*120.0), 1.0/(20*120.0), 1);
682 glRotatef(180, 0.0, 0.0, 1.0);
683 glRotatef(180, 0.0, 1.0, 0.0);
709 glVertex3f(x1,y1,z1);
710 glVertex3f(x2,y2,z2);
714 sprintf(buf,
"%ld",(
long)weight);
715 DrawText((x1+x2)/2, (y1+y2)/2, (z1+z2)/2 + 0.05, 1, 0, 0, buf);
void copy(double f, double g, graphState curr, graphState prev)
double min(double a, double b)
void DecreaseKey(OBJ val)
Indicate that the key for a particular object has decreased.
bool DoSingleStepA(std::vector< graphState > &thePath)
virtual void GetSuccessors(const graphState &stateID, std::vector< graphState > &neighbors) const
std::vector< graphState > neighbors
uint64_t GetNodesExpanded()
bool IsIn(const OBJ val) const
Returns true if the object is in the OpenClosedList.
node * GetNode(unsigned long num)
virtual bool GoalTest(const graphState &state, const graphState &goal) const
bool InitializeSearch(GraphEnvironment *env, Graph *g, graphState from, graphState to, std::vector< graphState > &thePath)
void DrawText(double x, double y, double z, float r, float g, float b, char *str)
bool DoSingleStepB(std::vector< graphState > &thePath)
void Add(OBJ val)
Add object into OpenClosedList.
bool fless(double a, double b)
bool DoSingleStepBP(std::vector< graphState > &thePath)
bool DoSingleSearchStep(std::vector< graphState > &thePath)
virtual double HCost(const state &a, const state &b) const
OBJ Remove()
Remove the item with the lowest key from the OpenClosedList & re-heapify.
virtual double GCost(const graphState &state1, const graphState &state2) const
void DrawEdge(unsigned int from, unsigned int to, double weight)
static void GetLoc(node *n, double &x, double &y, double &z)
bool fgreater(double a, double b)
void GetPath(GraphEnvironment *env, Graph *_g, graphState from, graphState to, std::vector< graphState > &thePath)
MeroBUtil::NodeLookupTable closedList
const static bool verbose
MeroBUtil::PQueue openQueue
void ExtractPathToStart(graphState goalNode, std::vector< graphState > &thePath)
OBJ find(OBJ val)
find this object in the Heap and return
uint64_t GetNodesTouched()
void IncreaseKey(OBJ val)
Indicate that the key for a particular object has increased.
Heuristic< graphState > * heuristic
void reset()
Remove all objects from queue.
Nodes to be stored within a Graph.