HOG2
IncrementalBGS.h
Go to the documentation of this file.
1 //
2 // IncrementalBGS.h
3 // hog2
4 //
5 // This is an incremental version of Budgeted Graph Search - IBEX on trees with Bounded Dijkstra at the low level.
6 // This code isn't meant for production - just to animate how the algorithm works as a comparison to IDA*.
7 // See (Helmert et al, IJCAI 2019) for details of the algorithm
8 //
9 
10 #ifndef IncrementalBGS_h
11 #define IncrementalBGS_h
12 
13 #include "Heuristic.h"
14 #include "AStarOpenClosed.h"
15 
16 template <class state, class action>
18 public:
20  { ResetNodeCount(); previousBound = 0; }
22  std::vector<state> &thePath);
23  void GetPath(SearchEnvironment<state, action> *env, state from, state to, Heuristic<state> *h,
24  std::vector<state> &thePath);
25  void GetPath(SearchEnvironment<state, action> *env, state from, state to,
26  std::vector<action> &thePath);
27  bool DoSingleSearchStep(std::vector<state> &thePath);
28  uint64_t GetNodesExpanded() { return nodesExpanded; }
30  uint64_t GetNodesTouched() { return nodesTouched; }
32  {
35  }
37  history.clear(); ResetNodeCount(); previousBound = 0; }
38  void OpenGLDraw();
39  void Draw(Graphics::Display &display) const;
40  state GetCurrentState() const
41  {
42  if (q.size() > 0)
43  return q.Lookup(q.Peek()).data;
44 // return search.back().currState;
45 // if (flesseq(solutionCost, data.solutionInterval.lowerBound))
46 // return goal;
47 // return start;
48 
49  }
50  void GetCurrentPath(std::vector<state> &p) const
51  { p = solutionPath; }
53  double GetNextFLimit() { return nextBound; }
55  const uint64_t c1 = 2;
56  const uint64_t c2 = 8;
57  const uint64_t gamma = 2;
58  const int infiniteWorkBound = -1;
59  void GetGlobalCostInterval(double &lower, double &upper)
61  void GetNodeInterval(uint64_t &lower, uint64_t &upper)
62  { lower = data.nodeLB*c1; upper = data.workBound; }
63  std::string stage;
64  std::string fEquation;
65 private:
66  struct costInterval {
67  double lowerBound;
68  double upperBound;
70  {
73  return *this;
74  }
75  };
76  struct IBEXData {
77  uint64_t nodesExpanded;
78  uint64_t workBound;
79  uint64_t nodeLB;
81  double delta;
82  };
84  struct searchData {
85  double f_below;
86  double f_above;
87  };
89 // enum kSearchStatus {
90 // kGoingDown,
91 // kGoingAcross
92 // };
93 // struct currSearchState {
94 // state currState;
95 // kSearchStatus status;
96 // double pathCost;
97 // std::vector<state> succ;
98 // };
99 // std::vector<currSearchState> search;
100  double solutionCost;
101  bool IterationComplete() { return q.OpenSize() == 0; }
102  unsigned long nodesExpanded, nodesTouched;
103 
104  void SetupIteration(double cost);
105  bool StepIteration();
106  void ExtractPathToStartFromID(uint64_t node, std::vector<state> &thePath);
107 
108  std::vector<std::pair<state, double>> history;
109  std::vector<state> solutionPath;
110  state start, goal;
112  double bound;
113  double initialBound;
114  double nextBound;
117  std::vector<state> succ;
119 
120  struct BFHSCompare {
122  {
123  return (fgreater(i1.g, i2.g));
124  }
125  };
126 
127  // Data for BFHS
129  std::vector<state> neighbors;
130  std::vector<uint64_t> neighborID;
131  std::vector<double> edgeCosts;
132  std::vector<dataLocation> neighborLoc;
133  std::vector<state> solutionStates;
134 };
135 
136 template <class state, class action>
138  Heuristic<state> *h, std::vector<state> &thePath)
139 {
140  if (InitializeSearch(e, from, to, h, thePath))
141  return;
142  while (!DoSingleSearchStep(thePath))
143  {}
144 }
145 
146 template <class state, class action>
148  std::vector<action> &thePath)
149 {
150 
151 }
152 
153 template <class state, class action>
155  std::vector<state> &thePath)
156 {
157  Reset();
158  if (from==to)
159  {
160  thePath.clear();
161  thePath.push_back(from);
162  return true;
163  }
164  start = from;
165  goal = to;
166  this->env = e;
167  start = from;
168  this->h = h;
169 
170  solutionPath.clear();
171 
172  // Setup BTS control data
173  data.nodesExpanded = 0;
174  data.workBound = infiniteWorkBound;
175  data.nodeLB = 0;
176  data.solutionInterval.lowerBound = h->HCost(start, goal);
177  data.solutionInterval.upperBound = DBL_MAX;
178  data.delta = 0;
179  fEquation = to_string_with_precision(h->HCost(start, goal), 0);
180  solutionCost = DBL_MAX;
181  SetupIteration(h->HCost(start, goal));
182  stage = "NEW ITERATION";
183  return false;
184 }
185 
186 template <class state, class action>
188 {
189  q.Reset(env->GetMaxHash());
190  // put start in open
191  q.AddOpenNode(start, env->GetStateHash(start), 0.0, 0.0);
192 
193 // search.resize(1);
194 // search.back().currState = start;
195 // search.back().status = kGoingDown;
196 // search.back().pathCost = 0;
197  previousBound = bound;
198  bound = cost;//nextBound;
199  nextBound = -1;
200  printf("Starting iteration bound %1.1f\n", bound);
201  newNodesLastIteration = newNodeCount;
202  newNodeCount = 0;
203  data.nodesExpanded = 0;
204  sd.f_below = 0;
205  sd.f_above = DBL_MAX;
206 }
207 
208 template <class state, class action>
209 void IncrementalBGS<state, action>::ExtractPathToStartFromID(uint64_t node, std::vector<state> &thePath)
210 {
211  thePath.clear();
212  do {
213  thePath.push_back(q.Lookup(node).data);
214  node = q.Lookup(node).parentID;
215  } while (q.Lookup(node).parentID != node);
216  thePath.push_back(q.Lookup(node).data);
217 }
218 
219 template <class state, class action>
221 {
222  uint64_t nodeid = q.Close();
223 
224  // Check if we are done
225  if (env->GoalTest(q.Lookup(nodeid).data, goal))
226  {
227  ExtractPathToStartFromID(nodeid, solutionPath);
228  std::reverse(solutionPath.begin(), solutionPath.end());
229  solutionCost = env->GetPathLength(solutionPath);
230  return false;
231  }
232 
233 
234  neighbors.resize(0);
235  edgeCosts.resize(0);
236  neighborID.resize(0);
237  neighborLoc.resize(0);
238 
239  // std::cout << "Expanding: " << q.Lookup(nodeid).data << " with f:";
240  // std::cout << q.Lookup(nodeid).g << std::endl;
241 
242  env->GetSuccessors(q.Lookup(nodeid).data, neighbors);
243  nodesExpanded++;
244 
245  // 1. load all the children
246  for (unsigned int x = 0; x < neighbors.size(); x++)
247  {
248  uint64_t theID;
249  neighborLoc.push_back(q.Lookup(env->GetStateHash(neighbors[x]), theID));
250  neighborID.push_back(theID);
251  edgeCosts.push_back(env->GCost(q.Lookup(nodeid).data, neighbors[x]));
252  }
253 
254  // iterate again updating costs and writing out to memory
255  for (int x = 0; x < neighbors.size(); x++)
256  {
257  double childGCost = q.Lookup(nodeid).g+edgeCosts[x];
258  double childFCost = childGCost+h->HCost(neighbors[x], goal);
259  if (fgreater(childFCost, bound))
260  {
261  if (nextBound == -1)
262  nextBound = childFCost;
263  else if (fless(childFCost, nextBound))
264  nextBound = childFCost;
265 
266  sd.f_above = std::min(sd.f_above, childFCost);
267  continue;
268  }
269 
270  switch (neighborLoc[x])
271  {
272  case kClosedList:
273  break;
274  case kOpenList:
275  if (fless(childGCost, q.Lookup(neighborID[x]).g))
276  {
277  q.Lookup(neighborID[x]).parentID = nodeid;
278  q.Lookup(neighborID[x]).g = childGCost;
279  q.KeyChanged(neighborID[x]);
280  }
281  break;
282  case kNotFound:
283  {
284  q.AddOpenNode(neighbors[x],
285  env->GetStateHash(neighbors[x]),
286  childGCost,
287  0,
288  nodeid);
289  }
290  }
291  }
292  return false;
293 
294 // if (search.back().status == kGoingDown)
295 // {
296 // double f = search.back().pathCost+h->HCost(search.back().currState, goal);
297 // // exceeded path cost bound
298 // if (fgreater(f, bound))
299 // {
300 // //printf("Above bound: %f/%f\n", bound, f);
301 // sd.f_above = std::min(sd.f_above, f);
302 // if (nextBound == -1)
303 // nextBound = f;
304 // else if (fless(f, nextBound))
305 // nextBound = f;
306 //
307 // search.pop_back();
308 // return false;
309 // }
310 // if (fgreater(f, solutionCost))
311 // {
312 // search.pop_back();
313 // return false;
314 // }
315 // if (flesseq(f, bound))
316 // sd.f_below = std::max(sd.f_below, f);
317 // // data.solutionInterval.upperBound = std::max(data.solutionInterval.upperBound, f);
318 //
319 // if (fgreater(f, previousBound) && flesseq(f, bound))
320 // newNodeCount++;
321 //
322 // // continue search
323 // //printf("Generating next set of successors\n");
324 // search.back().status = kGoingAcross;
325 // env->GetSuccessors(search.back().currState, search.back().succ);
326 // nodesExpanded++;
327 // for (int x = 0; x < search.back().succ.size(); x++)
328 // {
329 // if (search.size() > 1 && search.back().succ[x] == search[search.size()-2].currState)
330 // {
331 // search.back().succ.erase(search.back().succ.begin()+x);
332 // x--;
333 // }
334 // }
335 //
336 // // reverse and then handle them from back to front
337 // std::reverse(search.back().succ.begin(), search.back().succ.end());
338 // //return false;
339 // }
340 //
341 // if (search.back().status == kGoingAcross)
342 // {
343 // // no more succ to go down - go up
344 // if (search.back().succ.size() == 0)
345 // {
346 // //printf("Out of successors\n");
347 // search.pop_back();
348 // return false;
349 // }
350 //
351 // //printf("Taking next successors\n");
352 // // going down - generate next successor
353 // search.resize(search.size()+1);
354 // auto &s = search[search.size()-2];
355 // search.back().currState = s.succ.back();
356 // search.back().status = kGoingDown;
357 // search.back().pathCost = s.pathCost+env->GCost(s.currState, s.succ.back());
358 // s.succ.pop_back();
359 // return false;
360 // }
361 // assert(false);
362 // return false;
363 
364 }
365 
366 
367 template <class state, class action>
368 bool IncrementalBGS<state, action>::DoSingleSearchStep(std::vector<state> &thePath)
369 {
370  if (flesseq(solutionCost, data.solutionInterval.lowerBound))
371  {
372  thePath = solutionPath;
373  printf("Found solution cost %1.5f\n", solutionCost);
374  return true;
375  }
376 
377  if (!IterationComplete() && data.nodesExpanded < data.workBound)
378  {
379  uint64_t tmp = nodesExpanded;
380  StepIteration();
381  data.nodesExpanded += nodesExpanded-tmp;
382  return false;
383  }
384 
385  // Invariant - iteration complete *or* exceeded work limit
386  // last search completed - set the interval from this search
387  costInterval v;
388  if (data.nodesExpanded >= data.workBound)
389  {
390  v.lowerBound = 0;
391  v.upperBound = sd.f_below;
392  }
393  else if (solutionCost != DBL_MAX && fgreatereq(sd.f_below, solutionCost))
394  {
395  v.lowerBound = solutionCost;
396  v.upperBound = solutionCost;
397  }
398  else {
399  v.lowerBound = sd.f_above;
400  v.upperBound = DBL_MAX;
401  }
402  data.solutionInterval &= v;
403 
404  printf("--> Iteration complete - %" PRId64 " expanded; target [%" PRId64 ", %" PRId64 ")\n", data.nodesExpanded, c1*data.nodeLB, c2*data.nodeLB);
405  // Move to next iteration
406  if (data.nodesExpanded >= c1*data.nodeLB && data.workBound == infiniteWorkBound)
407  {
408  printf("Expanded %" PRId64 " - needed at least %" PRId64 "\n", data.nodesExpanded, c1*data.nodeLB);
409  if (data.solutionInterval.lowerBound == DBL_MAX) // No new nodes in iteration
410  printf("[HIT]--Critical f in [%1.5f, %1.5f]\n", solutionCost, solutionCost);
411  else
412  printf("[HIT]--Critical f in [%1.5f, ∞]\n", data.solutionInterval.lowerBound);
413  data.nodeLB = data.nodesExpanded;
414  data.solutionInterval.upperBound = DBL_MAX;
415  data.nodesExpanded = 0;
416  fEquation = to_string_with_precision(nextBound, 0);
417  SetupIteration(nextBound);
418  return false;
419  }
420 
421  // Check if bounds are equal or whether we fell within the node bounds
422  if (!
423  (fequal(data.solutionInterval.upperBound, data.solutionInterval.lowerBound) ||
424  (data.nodesExpanded >= c1*data.nodeLB && data.nodesExpanded < c2*data.nodeLB)
425  ))
426  {
427  if (data.solutionInterval.upperBound == DBL_MAX)
428  printf(" ]--Critical f in [%1.5f, ∞]\n", data.solutionInterval.lowerBound);
429  else
430  printf(" ]--Critical f in [%1.5f, %1.5f]\n", data.solutionInterval.lowerBound, data.solutionInterval.upperBound);
431 
432  double nextCost;
433  if (data.solutionInterval.upperBound == DBL_MAX)
434  {
435  nextCost = data.solutionInterval.lowerBound+pow(gamma, data.delta);
436  fEquation = to_string_with_precision(data.solutionInterval.lowerBound, 0)+"+"+to_string_with_precision(gamma, 0)+"^"+to_string_with_precision(data.delta, 0)+"="+to_string_with_precision(nextCost, 0);
437  stage = "EXP";
438  }
439  else {
440  nextCost = (data.solutionInterval.lowerBound+data.solutionInterval.upperBound)/2.0;
441  fEquation = "("+to_string_with_precision(data.solutionInterval.lowerBound, 0)+"+"+ to_string_with_precision(data.solutionInterval.upperBound, 0)+")/2"+"="+to_string_with_precision(nextCost, 0);
442  stage = "BIN";
443  }
444  data.delta += 1;
445  data.workBound = c2*data.nodeLB;
446  SetupIteration(nextCost);
447  printf("-> Starting new iteration with f: %f; node limit: %" PRId64 "\n", nextCost, data.workBound);
448 
449  return false;
450  }
451 
452  if (data.solutionInterval.lowerBound == DBL_MAX)
453  printf("[HIT]--Critical f in [∞, ∞]\n");
454  else
455  printf("[HIT]--Critical f in [%1.5f, ∞]\n", data.solutionInterval.lowerBound);
456  // finished iteration with current bound - ready to start next IBEX/BTS iteration
457  data.nodeLB = std::max(data.nodesExpanded, c1*data.nodeLB);
458  data.solutionInterval.upperBound = DBL_MAX;
459  data.workBound = infiniteWorkBound;
460  data.nodesExpanded = 0;
461  data.delta = 0;
462  fEquation = to_string_with_precision(nextBound, 0);
463  SetupIteration(nextBound);
464  stage = "NEW ITERATION";
465  return false;
466 }
467 
468 template <class state, class action>
470 {
471  double transparency = 1.0;
472  if (q.size() == 0)
473  return;
474  uint64_t top = -1;
475  // double minf = 1e9, maxf = 0;
476  if (q.OpenSize() > 0)
477  {
478  top = q.Peek();
479  }
480  for (unsigned int x = 0; x < q.size(); x++)
481  {
482  const auto &data = q.Lookat(x);
483  if (x == top)
484  {
485  env->SetColor(1.0, 1.0, 0.0, transparency);
486  env->Draw(disp, data.data);
487  }
488  else if ((data.where == kOpenList) && (data.reopened))
489  {
490  env->SetColor(0.0, 0.5, 0.5, transparency);
491  env->Draw(disp, data.data);
492  }
493  else if (data.where == kOpenList)
494  {
495  env->SetColor(0.0, 1.0, 0.0, transparency);
496  env->Draw(disp, data.data);
497  }
498  else if ((data.where == kClosedList) && (data.reopened))
499  {
500  env->SetColor(0.5, 0.0, 0.5, transparency);
501  env->Draw(disp, data.data);
502  }
503  else if (data.where == kClosedList)
504  {
505  // if (top != -1)
506  // {
507  // env->SetColor((data.g+data.h-minf)/(maxf-minf), 0.0, 0.0, transparency);
508  // }
509  // else {
510  if (data.parentID == x)
511  env->SetColor(1.0, 0.5, 0.5, transparency);
512  else
513  env->SetColor(1.0, 0.0, 0.0, transparency);
514  // }
515  env->Draw(disp, data.data);
516  }
517  }
518  env->SetColor(1.0, 0.5, 1.0, 0.5);
519  env->Draw(disp, goal);}
520 
521 template <class state, class action>
523 {
524 }
525 
526 
527 #endif /* IncrementalBGS_h */
IncrementalBGS::StepIteration
bool StepIteration()
Definition: IncrementalBGS.h:220
IncrementalBGS::costInterval::upperBound
double upperBound
Definition: IncrementalBGS.h:68
IncrementalBGS::GetNodeInterval
void GetNodeInterval(uint64_t &lower, uint64_t &upper)
Definition: IncrementalBGS.h:61
IncrementalBGS::ResetNodeCount
void ResetNodeCount()
Definition: IncrementalBGS.h:31
IncrementalBGS::GetCurrentState
state GetCurrentState() const
Definition: IncrementalBGS.h:40
IncrementalBGS::GetIterationNodesExpanded
uint64_t GetIterationNodesExpanded()
Definition: IncrementalBGS.h:29
IncrementalBGS::DoSingleSearchStep
bool DoSingleSearchStep(std::vector< state > &thePath)
Definition: IncrementalBGS.h:368
min
double min(double a, double b)
Definition: FPUtil.h:35
IncrementalBGS::neighborLoc
std::vector< dataLocation > neighborLoc
Definition: IncrementalBGS.h:132
fgreatereq
bool fgreatereq(double a, double b)
Definition: FPUtil.h:31
IncrementalBGS::bound
double bound
Definition: IncrementalBGS.h:112
IncrementalBGS::GetGlobalCostInterval
void GetGlobalCostInterval(double &lower, double &upper)
Definition: IncrementalBGS.h:59
IncrementalBGS::goal
state goal
Definition: IncrementalBGS.h:110
Heuristic
Definition: Heuristic.h:30
IncrementalBGS::IBEXData
Definition: IncrementalBGS.h:76
AStarOpenClosed.h
Heuristic.h
IncrementalBGS::initialBound
double initialBound
Definition: IncrementalBGS.h:113
IncrementalBGS::env
SearchEnvironment< state, action > * env
Definition: IncrementalBGS.h:115
IncrementalBGS::IBEXData::nodesExpanded
uint64_t nodesExpanded
Definition: IncrementalBGS.h:77
IBEX::infiniteWorkBound
const int infiniteWorkBound
Definition: IBEX.h:35
IncrementalBGS::h
Heuristic< state > * h
Definition: IncrementalBGS.h:116
IncrementalBGS::solutionStates
std::vector< state > solutionStates
Definition: IncrementalBGS.h:133
IncrementalBGS::nodesTouched
unsigned long nodesTouched
Definition: IncrementalBGS.h:102
IncrementalBGS::BFHSCompare::operator()
bool operator()(const AStarOpenClosedData< state > &i1, const AStarOpenClosedData< state > &i2) const
Definition: IncrementalBGS.h:121
IncrementalBGS::sd
searchData sd
Definition: IncrementalBGS.h:88
IncrementalBGS::stage
std::string stage
Definition: IncrementalBGS.h:63
IncrementalBGS::IBEXData::workBound
uint64_t workBound
Definition: IncrementalBGS.h:78
IncrementalBGS::InitializeSearch
bool InitializeSearch(SearchEnvironment< state, action > *env, state from, state to, Heuristic< state > *h, std::vector< state > &thePath)
Definition: IncrementalBGS.h:154
AStarOpenClosedData::g
double g
Definition: AStarOpenClosed.h:64
IncrementalBGS::start
state start
Definition: IncrementalBGS.h:110
IncrementalBGS::OpenGLDraw
void OpenGLDraw()
Definition: IncrementalBGS.h:522
IncrementalBGS::Reset
void Reset()
Definition: IncrementalBGS.h:36
to_string_with_precision
std::string to_string_with_precision(const T a_value, const int n=6)
Definition: GLUtil.h:185
IncrementalBGS::costInterval::lowerBound
double lowerBound
Definition: IncrementalBGS.h:67
IncrementalBGS::nodesExpanded
unsigned long nodesExpanded
Definition: IncrementalBGS.h:102
IncrementalBGS::costInterval::operator&=
costInterval & operator&=(const costInterval &i)
Definition: IncrementalBGS.h:69
IncrementalBGS::newNodesLastIteration
uint64_t newNodesLastIteration
Definition: IncrementalBGS.h:118
IncrementalBGS::IBEXData::nodeLB
uint64_t nodeLB
Definition: IncrementalBGS.h:79
IncrementalBGS::IBEXData::solutionInterval
costInterval solutionInterval
Definition: IncrementalBGS.h:80
AStarOpenClosed
Definition: AStarOpenClosed.h:74
IncrementalBGS::ExtractPathToStartFromID
void ExtractPathToStartFromID(uint64_t node, std::vector< state > &thePath)
Definition: IncrementalBGS.h:209
Graphics::Display
Definition: Graphics.h:146
IncrementalBGS::GetNextFLimit
double GetNextFLimit()
Definition: IncrementalBGS.h:53
fless
bool fless(double a, double b)
Definition: FPUtil.h:28
IncrementalBGS::IterationComplete
bool IterationComplete()
Definition: IncrementalBGS.h:101
IncrementalBGS::succ
std::vector< state > succ
Definition: IncrementalBGS.h:117
AStarOpenClosedData
Definition: AStarOpenClosed.h:52
IncrementalBGS::BFHSCompare
Definition: IncrementalBGS.h:120
IncrementalBGS::GetCurrentPath
void GetCurrentPath(std::vector< state > &p) const
Definition: IncrementalBGS.h:50
Heuristic::HCost
virtual double HCost(const state &a, const state &b) const
Definition: Heuristic.h:73
IncrementalBGS::infiniteWorkBound
const int infiniteWorkBound
Definition: IncrementalBGS.h:58
IncrementalBGS::GetCurrentFLimit
double GetCurrentFLimit()
Definition: IncrementalBGS.h:52
IncrementalBGS::c2
const uint64_t c2
Definition: IncrementalBGS.h:56
IncrementalBGS::gamma
const uint64_t gamma
Definition: IncrementalBGS.h:57
fgreater
bool fgreater(double a, double b)
Definition: FPUtil.h:29
IncrementalBGS::GetNodesExpanded
uint64_t GetNodesExpanded()
Definition: IncrementalBGS.h:28
max
#define max(a, b)
Definition: MinimalSectorAbstraction.cpp:40
IncrementalBGS::q
AStarOpenClosed< state, BFHSCompare > q
Definition: IncrementalBGS.h:128
IncrementalBGS::SetupIteration
void SetupIteration(double cost)
Definition: IncrementalBGS.h:187
IncrementalBGS::edgeCosts
std::vector< double > edgeCosts
Definition: IncrementalBGS.h:131
kOpenList
@ kOpenList
Definition: AStarOpenClosed.h:28
IncrementalBGS::solutionPath
std::vector< state > solutionPath
Definition: IncrementalBGS.h:109
IncrementalBGS::c1
const uint64_t c1
Definition: IncrementalBGS.h:55
IncrementalBGS::searchData
Definition: IncrementalBGS.h:84
IncrementalBGS::GetNewNodesLastIteration
uint64_t GetNewNodesLastIteration()
Definition: IncrementalBGS.h:54
IncrementalBGS::newNodeCount
uint64_t newNodeCount
Definition: IncrementalBGS.h:118
IncrementalBGS::data
IBEXData data
Definition: IncrementalBGS.h:83
IncrementalBGS::neighborID
std::vector< uint64_t > neighborID
Definition: IncrementalBGS.h:130
IncrementalBGS::costInterval
Definition: IncrementalBGS.h:66
IncrementalBGS::neighbors
std::vector< state > neighbors
Definition: IncrementalBGS.h:129
kNotFound
@ kNotFound
Definition: AStarOpenClosed.h:30
IncrementalBGS::GetNodesTouched
uint64_t GetNodesTouched()
Definition: IncrementalBGS.h:30
IncrementalBGS::searchData::f_above
double f_above
Definition: IncrementalBGS.h:86
IncrementalBGS::nextBound
double nextBound
Definition: IncrementalBGS.h:114
IncrementalBGS::history
std::vector< std::pair< state, double > > history
Definition: IncrementalBGS.h:108
IncrementalBGS::solutionCost
double solutionCost
Definition: IncrementalBGS.h:100
fequal
bool fequal(double a, double b, double tolerance=TOLERANCE)
Definition: FPUtil.h:32
IncrementalBGS
Definition: IncrementalBGS.h:17
IncrementalBGS::IncrementalBGS
IncrementalBGS(double initialBound=0)
Definition: IncrementalBGS.h:19
SearchEnvironment
Definition: SearchEnvironment.h:30
IncrementalBGS::previousBound
double previousBound
Definition: IncrementalBGS.h:111
IncrementalBGS::Draw
void Draw(Graphics::Display &display) const
Definition: IncrementalBGS.h:469
IncrementalBGS::searchData::f_below
double f_below
Definition: IncrementalBGS.h:85
IncrementalBGS::IBEXData::delta
double delta
Definition: IncrementalBGS.h:81
flesseq
bool flesseq(double a, double b)
Definition: FPUtil.h:30
kClosedList
@ kClosedList
Definition: AStarOpenClosed.h:29
node
Nodes to be stored within a Graph.
Definition: Graph.h:170
IncrementalBGS::fEquation
std::string fEquation
Definition: IncrementalBGS.h:64
IncrementalBGS::GetPath
void GetPath(SearchEnvironment< state, action > *env, state from, state to, Heuristic< state > *h, std::vector< state > &thePath)
Definition: IncrementalBGS.h:137
Graphics::Display::data
Definition: Graphics.h:226