9 #ifndef hog2_glut_Heuristic_h
10 #define hog2_glut_Heuristic_h
29 template <
class state>
34 virtual double HCost(
const state &a,
const state &b)
const;
39 double HCost(
const state &s1,
const state &s2,
int treeNode)
const;
42 template <
class state>
45 double HCost(
const state &a,
const state &b)
const {
return 0; }
48 template <
class state>
52 double HCost(
const state &a,
const state &b)
const {
return weight*
h->HCost(a, b); }
59 template <
class state>
72 template <
class state>
75 return HCost(s1, s2, 0);
78 template <
class state>
82 switch (lookups[treeNode].nodeType)
86 for (
size_t x = 0; x < lookups[treeNode].numChildren; x++)
88 hval =
std::max(hval, HCost(s1, s2, lookups[treeNode].whichNode+x));
93 for (
size_t x = 0; x < lookups[treeNode].numChildren; x++)
95 hval += HCost(s1, s2, lookups[treeNode].whichNode+x);
100 hval = heuristics[lookups[treeNode].whichNode]->HCost(s1, s2);