18 std::vector<uint32_t> &thePath)
21 nodesExpanded = nodesTouched = 0;
24 UpdateNextBound(0, floor(env->
heuristic(from, to)));
25 while (thePath.size() == 0)
28 printf(
"Starting iteration with bound %f\n", nextBound);
29 DoIteration(env, from, from, to, thePath, nextBound, 0, 0);
34 uint32_t parent, uint32_t currState, uint32_t goal,
35 std::vector<uint32_t> &thePath,
double bound,
double g,
39 double h = floor(env->
heuristic(currState, goal));
43 if (usePathMax &&
fless(h, maxH))
47 UpdateNextBound(bound, g+h);
51 if (nodeTable.find(currState) != nodeTable.end())
53 if (
fless(g, nodeTable[currState]))
60 nodeTable[currState] = g;
62 std::vector<uint32_t> neighbors;
64 nodesTouched += neighbors.size();
66 for (
unsigned int x = 0; x < neighbors.size(); x++)
68 if (neighbors[x] == parent)
70 thePath.push_back(neighbors[x]);
71 double edgeCost = env->
gcost(currState, neighbors[x]);
72 double childH = DoIteration(env, currState, neighbors[x], goal, thePath, bound,
73 g+edgeCost, maxH - edgeCost);
74 if (thePath.back() == goal)
78 if (usePathMax &&
fgreater(childH-edgeCost, h))
80 nodeTable[currState] = g;
84 UpdateNextBound(bound, g+h);
97 else if (
fgreater(fCost, currBound) &&
fless(fCost, nextBound))