9 #ifndef IncrementalBFS_h
10 #define IncrementalBFS_h
14 template <
class state,
class action>
18 std::vector<state> &thePath);
20 std::vector<action> &thePath);
22 std::vector<state> &thePath);
33 state parent, state currState,
34 std::vector<state> &thePath,
double bound,
double g);
36 action forbiddenAction, state &currState,
37 std::vector<action> &thePath,
double bound,
double g);
39 std::deque<std::pair<state, int>>
history;
45 template <
class state,
class action>
47 std::vector<state> &thePath)
49 while (!DoSingleSearchStep(env, from, to, thePath))
53 template <
class state,
class action>
55 std::vector<action> &thePath)
60 template <
class state,
class action>
62 std::vector<state> &thePath)
64 if (history.size() == 0)
66 history.push_back({from, 0});
70 int depth = history.front().second;
74 if (env->
GoalTest(history.front().first, to))
78 for (
int x = 0; x < succ.size(); x++)
80 history.push_back({succ[x], depth+1});
85 template <
class state,
class action>
88 for (
auto x : history)
89 env->OpenGLDraw(x.first);
92 template <
class state,
class action>
95 for (
auto x : history)
96 env->Draw(display, x.first);