Go to the documentation of this file.
9 #ifndef CanonicalGraphEnvironment_h
10 #define CanonicalGraphEnvironment_h
13 #include <unordered_map>
28 template<>
struct hash<
std::pair<graphState, graphState>>
30 inline size_t operator()(
const pair<graphState, graphState> & v)
const
32 return (v.first<<32)|v.second;
78 fprintf(stderr,
"ERROR: Single State HCost not implemented for CanonicalGraphEnvironment\n");
79 exit(1);
return -1.0;}
82 fprintf(stderr,
"ERROR: Single State Goal Test not implemented for CanonicalGraphEnvironment\n");
83 exit(1);
return false;
uint64_t GetActionHash(graphMove act) const
uint64_t GetStateHash(const canGraphState &state) const
bool InvertAction(graphMove &a) const
double GCost(const canGraphState &state1, const canGraphState &state2) const
size_t operator()(const pair< graphState, graphState > &v) const
bool operator==(const canGraphState &s1, const canGraphState &s2)
void GetActions(const canGraphState &stateID, std::vector< graphMove > &actions) const
void ApplyAction(canGraphState &s, graphMove a) const
double HCost(const canGraphState &) const
Heuristic value between node and the stored goal.
bool GoalTest(const canGraphState &) const
Goal Test if the goal is stored.
void SetDrawEdgeCosts(bool val)
graphMove GetAction(const canGraphState &s1, const canGraphState &s2) const
void GetSuccessors(const canGraphState &stateID, std::vector< canGraphState > &neighbors) const
bool GoalTest(const canGraphState &state, const canGraphState &goal) const
void GLDrawLine(const canGraphState &x, const canGraphState &y) const
void SetDrawNodeLabels(bool val)
void StoreGoal(canGraphState &)
Stores the goal for use by single-state HCost.
size_t operator()(const canGraphState &v) const
CanonicalGraphEnvironment(Graph *g)
std::ostream & operator<<(std::ostream &out, const canGraphState &s1)
void ClearGoal()
Clears the goal from memory.
double HCost(const canGraphState &state1, const canGraphState &state2) const
Heuristic value between two arbitrary nodes.
std::unordered_map< canGraphState, uint8_t > canonicalOrdering
void OpenGLDraw(const canGraphState &s, const canGraphState &, float) const
Draw the transition at some percentage 0...1 between two states.
~CanonicalGraphEnvironment()
uint64_t GetMaxHash() const
bool IsGoalStored() const
void SetNodeScale(double v)