9 #ifndef IncrementalDFID_h
10 #define IncrementalDFID_h
12 template <
class state,
class action>
17 std::vector<state> &thePath);
19 std::vector<action> &thePath);
21 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::vector<std::pair<state, int>>
history;
49 template <
class state,
class action>
51 std::vector<state> &thePath)
53 while (!DoSingleSearchStep(env, from, to, thePath))
57 template <
class state,
class action>
59 std::vector<action> &thePath)
64 template <
class state,
class action>
66 std::vector<state> &thePath)
68 if (history.size() == 0)
70 history.push_back({from, 0});
75 int depth = history.back().second;
79 if (
path.size() > depth)
84 if (
path.size() <= depth && env->
GoalTest(history.back().first, to))
85 path.push_back(history.back().first);
88 path.push_back(history.back().first);
91 if (env->
GoalTest(history.back().first, to))
100 for (
int x = succ.size()-1; x >= 0; x--)
103 history.push_back({succ[x], depth+1});
109 template <
class state,
class action>
114 for (
int x = 1; x <
path.size(); x++)
115 env->GLDrawLine(
path[x-1],
path[x]);
118 template <
class state,
class action>
121 for (
int x = 1; x <
path.size(); x++)
122 env->DrawLine(display,
path[x-1],
path[x], 2.0);