Go to the documentation of this file.
23 for (
unsigned int x = 0; x <
puzzle.size(); x++)
30 for (
unsigned int x = 0; x <
puzzle.size(); x++)
46 for (
unsigned int x = 0; x <
loc.puzzle.size(); x++)
48 if (x ==
loc.puzzle.size()/2)
50 out <<
loc.puzzle[x] <<
" ";
60 for (
unsigned int x = 0; x < l1.
puzzle.size(); x++)
79 fprintf(stderr,
"ERROR: Single State HCost not implemented for FlipSide\n");
80 exit(1);
return -1.0;}
87 fprintf(stderr,
"ERROR: Single State Goal Test not implemented for FlipSide\n");
88 exit(1);
return false;}
uint64_t GetStateHash(const FlipSideState &state) const
void GetSuccessors(const FlipSideState &stateID, std::vector< FlipSideState > &neighbors) const
double GCost(const FlipSideState &state1, const FlipSideState &state2) const
void StoreGoal(FlipSideState &)
Stores the goal for use by single-state HCost.
uint64_t GetActionHash(flipMove act) const
static bool operator==(const FlipSideState &l1, const FlipSideState &l2)
void OpenGLDraw(const FlipSideState &, const flipMove &) const
bool IsGoalStored() const
bool GoalTest(const FlipSideState &state, const FlipSideState &goal) const
std::vector< int > puzzle
flipMove GetAction(const FlipSideState &s1, const FlipSideState &s2) const
static std::ostream & operator<<(std::ostream &out, const FlipSideState &loc)
FlipSideState(int _width)
The basic simulation class for the world.
void GetActions(const FlipSideState &stateID, std::vector< flipMove > &actions) const
void ClearGoal()
Clears the goal from memory.
UnitSimulation< FlipSideState, flipMove, FlipSide > FlipPuzzleSimulation
bool GoalTest(const FlipSideState &) const
Goal Test if the goal is stored.
void ApplyAction(FlipSideState &s, flipMove a) const
double GCost(const FlipSideState &, const flipMove &) const
double HCost(const FlipSideState &) const
Heuristic value between node and the stored goal.
void OpenGLDraw(const FlipSideState &, const FlipSideState &, float) const
Draw the transition at some percentage 0...1 between two states.
bool InvertAction(flipMove &) const