HOG2
|
#include <Witness.h>
Classes | |
struct | mustCrossEdgeConstraint |
struct | PathLocation |
struct | separationObject |
Public Types | |
enum | legality { kLegal, kNotAtEnd, kNotAtStart, kNotValidAction, kHitCannotCross, kHitStart, kHitLine } |
Public Member Functions | |
Witness () | |
Witness (const Witness< width, height > &w) | |
Witness< width, height > & | operator= (const Witness< width, height > &w) |
void | Reset () |
void | GetSuccessors (const WitnessState< width, height > &nodeID, std::vector< WitnessState< width, height >> &neighbors) const |
void | GetActions (const WitnessState< width, height > &nodeID, std::vector< WitnessAction > &actions) const |
void | ApplyAction (WitnessState< width, height > &s, WitnessAction a) const |
void | ApplyAction (std::pair< int, int > &s, WitnessAction a) const |
bool | InvertAction (WitnessAction &a) const |
void | UndoAction (WitnessState< width, height > &s, WitnessAction a) const |
bool | Legal (WitnessState< width, height > &s, WitnessAction a) const |
bool | Legal (WitnessState< width, height > &s, WitnessAction a, legality &l) const |
double | HCost (const WitnessState< width, height > &node1, const WitnessState< width, height > &node2) const |
Heuristic value between two arbitrary nodes. More... | |
double | GCost (const WitnessState< width, height > &node1, const WitnessState< width, height > &node2) const |
double | GCost (const WitnessState< width, height > &node, const WitnessAction &act) const |
bool | GoalTest (const WitnessState< width, height > &node, const WitnessState< width, height > &goal) const |
bool | GoalTest (const WitnessState< width, height > &node) const |
Goal Test if the goal is stored. More... | |
uint64_t | GetMaxHash () const |
uint64_t | GetStateHash (const WitnessState< width, height > &node) const |
void | GetStateFromHash (uint64_t parent, WitnessState< width, height > &s) const |
uint64_t | GetActionHash (WitnessAction act) const |
void | OpenGLDraw () const |
void | OpenGLDraw (const WitnessState< width, height > &) const |
void | OpenGLDraw (const WitnessState< width, height > &, const WitnessState< width, height > &, float) const |
Draw the transition at some percentage 0...1 between two states. More... | |
void | OpenGLDraw (const WitnessState< width, height > &, const WitnessAction &) const |
void | GLLabelState (const WitnessState< width, height > &, const char *) const |
void | GLDrawLine (const WitnessState< width, height > &x, const WitnessState< width, height > &y) const |
void | DrawRegionConstraint (Graphics::Display &display, const WitnessRegionConstraint &constraint, const Graphics::point &p3) const |
void | Draw (Graphics::Display &display) const |
void | Draw (Graphics::Display &display, const WitnessState< width, height > &) const |
void | Draw (Graphics::Display &display, const InteractiveWitnessState< width, height > &) const |
bool | Click (Graphics::point, InteractiveWitnessState< width, height > &ws) |
void | Move (Graphics::point, InteractiveWitnessState< width, height > &ws) |
const WitnessRegionConstraint & | GetRegionConstraint (int x, int y) const |
void | SetStart (int x, int y) |
void | AddStart (int x, int y) |
void | SetGoal (int x, int y) |
bool | AddGoal (int x, int y) |
void | ClearPathConstraints () |
void | SetMustCrossConstraint (int) |
bool | GetMustCrossConstraint (int) const |
bool | GetMustCrossConstraint (int, int) const |
bool | GetMustCrossConstraint (bool, int, int) const |
void | ClearMustCrossConstraint (int) |
void | AddMustCrossConstraint (bool horiz, int x, int y) |
void | AddMustCrossConstraint (int x, int y) |
void | AddMustCrossConstraint (int) |
void | RemoveMustCrossConstraint (bool horiz, int x, int y) |
void | RemoveMustCrossConstraint (int x, int y) |
constexpr int | GetNumCannotCrossConstraints () const |
void | SetCannotCrossConstraint (int) |
bool | GetCannotCrossConstraint (int) const |
bool | GetCannotCrossConstraint (int, int) const |
bool | GetCannotCrossConstraint (bool, int, int) const |
void | ClearCannotCrossConstraint (int) |
void | AddCannotCrossConstraint (bool horiz, int x, int y) |
void | AddCannotCrossConstraint (int x, int y) |
void | AddCannotCrossConstraint (int) |
void | RemoveCannotCrossConstraint (bool horiz, int x, int y) |
void | RemoveCannotCrossConstraint (int x, int y) |
void | ClearInnerConstraints () |
void | ClearConstraint (WitnessRegionConstraintType t) |
void | RemoveRegionConstraint (int x, int y) |
void | ClearTriangleConstraints () |
void | AddTriangleConstraint (int x, int y, int count) |
void | AddTriangleConstraint (int which, int count) |
void | ClearSeparationConstraints () |
void | AddSeparationConstraint (int x, int y, rgbColor c) |
void | AddSeparationConstraint (int which, rgbColor c) |
void | ClearEraserConstraints () |
constexpr int | GetNumEraserConstraints () const |
void | AddEraserConstraint (int x, int y) |
void | AddEraserConstraint (int which) |
void | ClearTetrisConstraints () |
void | AddNegativeTetrisConstraint (int x, int y, int which) |
void | AddTetrisConstraint (int x, int y, int which) |
void | AddNegativeTetrisConstraint (int loc, int which) |
void | AddTetrisConstraint (int loc, int which) |
void | ClearStarConstraints () |
void | AddStarConstraint (int x, int y, rgbColor c) |
void | AddStarConstraint (int which, rgbColor c) |
void | AddRegionConstraint (int x, int y, const WitnessRegionConstraint &constraint) |
void | AddRegionConstraint (int which, const WitnessRegionConstraint &constraint) |
operator std::string () const | |
std::ostream & | Serialize (std::ostream &os) const |
std::istream & | Deserialize (std::istream &is) |
std::string | SaveToHashString () const |
void | GetDimensionsFromHashString (const std::string &s, int &w, int &h) const |
void | LoadFromHashString (std::string s) |
int | GetPathIndex (int x, int y) const |
PathLocation | GetPathLocation (int index) const |
int | GetRegionIndex (int x, int y) const |
int | GetRegionFromX (int index) const |
int | GetRegionFromY (int index) const |
void | LabelRegions (const WitnessState< width, height > &s) const |
bool | RecursivelyPlacePieces (int curr, uint64_t board, uint64_t oob, uint64_t posFootprint, uint64_t negFootprint) const |
void | GetMouseActions (const WitnessState< width, height > &nodeID, std::vector< WitnessAction > &actions) const |
void | DoLine (Graphics::Display &display, const Graphics::point &p1, const Graphics::point &p2, const rgbColor &c) const |
Graphics::point | GetScreenCoord (int x, int y) const |
void | DebugPrint (uint64_t val, int offset=0) const |
Public Member Functions inherited from SearchEnvironment< WitnessState< width, height >, WitnessAction > | |
virtual | ~SearchEnvironment () |
virtual void | GetSuccessors (const WitnessState< width, height > &nodeID, std::vector< WitnessState< width, height > > &neighbors) const=0 |
virtual int | GetNumSuccessors (const WitnessState< width, height > &stateID) const |
virtual WitnessAction | GetAction (const WitnessState< width, height > &s1, const WitnessState< width, height > &s2) const |
virtual void | GetNextState (const WitnessState< width, height > &s1, WitnessAction a, WitnessState< width, height > &s2) const |
virtual void | StoreGoal (WitnessState< width, height > &s) |
Stores the goal for use by single-state HCost. More... | |
virtual void | ClearGoal () |
Clears the goal from memory. More... | |
virtual bool | IsGoalStored () const |
Returns true if the goal is stored and false otherwise. More... | |
virtual double | HCost (const WitnessState< width, height > &node1, const WitnessState< width, height > &node2, double parentHCost) const |
virtual double | HCost (const WitnessState< width, height > &node) const |
Heuristic value between node and the stored goal. More... | |
virtual uint64_t | GetMaxHash () const |
virtual double | GetPathLength (std::vector< WitnessState< width, height > > &neighbors) |
virtual double | GetPathLength (const WitnessState< width, height > &start, std::vector< WitnessAction > &neighbors) |
virtual OccupancyInterface< WitnessState< width, height >, WitnessAction > * | GetOccupancyInfo () |
virtual void | SetOccupancyInfo (OccupancyInterface< WitnessState< width, height >, WitnessAction > *) |
virtual void | OpenGLDraw () const |
virtual void | GLDrawPath (const std::vector< WitnessState< width, height > > &x) const |
virtual void | SetColor (const rgbColor &r) const |
virtual void | SetColor (GLfloat rr, GLfloat g, GLfloat b, GLfloat t=1.0) const |
virtual void | GetColor (GLfloat &rr, GLfloat &g, GLfloat &b, GLfloat &t) const |
virtual rgbColor | GetColor () const |
virtual void | DrawLine (Graphics::Display &display, const WitnessState< width, height > &x, const WitnessState< width, height > &y, float width=1.0) const |
Public Member Functions inherited from Heuristic< WitnessState< width, height > > | |
Heuristic () | |
virtual | ~Heuristic () |
Static Public Member Functions | |
static constexpr int | GetNumPathConstraints () |
static constexpr int | GetNumTriangleConstraints () |
static constexpr int | GetNumSeparationConstraints () |
static constexpr int | GetNumTetrisConstraints () |
static constexpr int | GetNumStarConstraints () |
Public Attributes | |
std::array< WitnessPathConstraintType, Witness< width, height >::GetNumPathConstraints()> | pathConstraints |
std::array< std::pair< Graphics::point, Graphics::rect >, Witness< width, height >::GetNumPathConstraints()> | pathConstraintLocations |
std::array< std::array< WitnessRegionConstraint, height >, width > | regionConstraints |
std::array< int,(int) kRegionConstraintCount > | constraintCount |
std::array< std::pair< Graphics::point, Graphics::rect >, width *height > | regionConstraintLocations |
const uint16_t | tetrisBits [25] |
const uint64_t | tetrisBits64 [25] |
const uint16_t | tetrisSize [25] = {0, 1, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4} |
const uint16_t | tetrisWH [25][2] |
std::vector< std::pair< int, int > > | start |
std::vector< std::pair< int, int > > | goal |
std::array< int,(width+1) *(height+1)> | goalMap |
const rgbColor | tetrisYellow = {0.862745098f, 0.6549019608f, 0.0f} |
const rgbColor | tetrisBlue = {0.2196078431f, 0.3607843137f, 0.8705882353f} |
const rgbColor | drawColor = Colors::darkbluegray |
const rgbColor | lineColor = Colors::lightgray |
const rgbColor | backColor = Colors::white |
const rgbColor | outerBackColor = Colors::white |
const rgbColor | triangleColor = Colors::orange |
float | scale = 0.75f |
float | gapOffset = scale * 2.0f / (width > height ? width : height) |
float | lineWidth = gapOffset * 0.1f |
float | xGap = (((width > height) ? (width) : (height)) - width) * gapOffset / 2.0f |
float | yGap = -(((width > height) ? (width) : (height)) - height) * gapOffset / 2.0f |
std::array< int, width *height > | regions |
std::vector< std::vector< int > * > | regionList |
vectorCache< int > | regionCache |
std::vector< int > | tetrisBlockCount |
std::vector< int > | tetrisBlocksInRegion |
Public Attributes inherited from Heuristic< WitnessState< width, height > > | |
std::vector< HeuristicTreeNode > | lookups |
std::vector< Heuristic * > | heuristics |
uint64_t | histogram [256] |
Additional Inherited Members | |
Protected Attributes inherited from SearchEnvironment< WitnessState< width, height >, WitnessAction > | |
bool | bValidSearchGoal |
WitnessState< width, height > | searchGoal |
rgbColor | color |
GLfloat | transparency |
enum Witness::legality |
Definition at line 279 of file Witness.h.
References height, Witness< width, height >::Reset(), and width.
void Witness< width, height >::AddCannotCrossConstraint | ( | int | which | ) |
Definition at line 2359 of file Witness.h.
References kCannotCross.
|
inline |
Definition at line 629 of file Witness.h.
References Witness< width, height >::AddEraserConstraint(), Witness< width, height >::GetRegionFromX(), and Witness< width, height >::GetRegionFromY().
|
inline |
Definition at line 620 of file Witness.h.
References Witness< width, height >::constraintCount, kEraser, kSeparation, Witness< width, height >::regionConstraints, and Colors::white.
Referenced by Witness< width, height >::AddEraserConstraint(), and Witness< width, height >::AddRegionConstraint().
Definition at line 464 of file Witness.h.
References Witness< width, height >::GetPathIndex(), Witness< width, height >::goal, Witness< width, height >::goalMap, height, and width.
Referenced by Witness< width, height >::Deserialize(), and Witness< width, height >::SetGoal().
Definition at line 2189 of file Witness.h.
References kMustCross.
|
inline |
Definition at line 719 of file Witness.h.
References Witness< width, height >::AddNegativeTetrisConstraint(), Witness< width, height >::GetRegionFromX(), and Witness< width, height >::GetRegionFromY().
|
inline |
Definition at line 699 of file Witness.h.
References Witness< width, height >::constraintCount, kNegativeTetris, Witness< width, height >::regionConstraints, and Witness< width, height >::tetrisBlue.
Referenced by Witness< width, height >::AddNegativeTetrisConstraint(), and Witness< width, height >::AddRegionConstraint().
|
inline |
Definition at line 823 of file Witness.h.
References Witness< width, height >::AddRegionConstraint(), Witness< width, height >::GetRegionFromX(), and Witness< width, height >::GetRegionFromY().
|
inline |
Definition at line 796 of file Witness.h.
References Witness< width, height >::AddEraserConstraint(), Witness< width, height >::AddNegativeTetrisConstraint(), Witness< width, height >::AddSeparationConstraint(), Witness< width, height >::AddStarConstraint(), Witness< width, height >::AddTetrisConstraint(), Witness< width, height >::AddTriangleConstraint(), kEraser, kNegativeTetris, kSeparation, kStar, kTetris, and kTriangle.
Referenced by Witness< width, height >::AddRegionConstraint(), and Witness< width, height >::Deserialize().
|
inline |
Definition at line 606 of file Witness.h.
References Witness< width, height >::AddSeparationConstraint(), Witness< width, height >::GetRegionFromX(), and Witness< width, height >::GetRegionFromY().
|
inline |
Definition at line 597 of file Witness.h.
References Witness< width, height >::constraintCount, kSeparation, and Witness< width, height >::regionConstraints.
Referenced by Witness< width, height >::AddRegionConstraint(), and Witness< width, height >::AddSeparationConstraint().
|
inline |
Definition at line 791 of file Witness.h.
References Witness< width, height >::AddStarConstraint(), Witness< width, height >::GetRegionFromX(), and Witness< width, height >::GetRegionFromY().
|
inline |
Definition at line 778 of file Witness.h.
References Witness< width, height >::constraintCount, height, kStar, Witness< width, height >::regionConstraints, and width.
Referenced by Witness< width, height >::AddRegionConstraint(), and Witness< width, height >::AddStarConstraint().
Definition at line 455 of file Witness.h.
References Witness< width, height >::start.
Referenced by Witness< width, height >::Deserialize().
|
inline |
Definition at line 724 of file Witness.h.
References Witness< width, height >::AddTetrisConstraint(), Witness< width, height >::GetRegionFromX(), and Witness< width, height >::GetRegionFromY().
|
inline |
Definition at line 709 of file Witness.h.
References Witness< width, height >::constraintCount, kTetris, Witness< width, height >::regionConstraints, and Witness< width, height >::tetrisYellow.
Referenced by Witness< width, height >::AddRegionConstraint(), and Witness< width, height >::AddTetrisConstraint().
|
inline |
Definition at line 584 of file Witness.h.
References Witness< width, height >::AddTriangleConstraint(), and width.
|
inline |
Definition at line 568 of file Witness.h.
References Witness< width, height >::constraintCount, height, kTriangle, Witness< width, height >::regionConstraints, Witness< width, height >::triangleColor, and width.
Referenced by Witness< width, height >::AddRegionConstraint(), and Witness< width, height >::AddTriangleConstraint().
void Witness< width, height >::ApplyAction | ( | std::pair< int, int > & | s, |
WitnessAction | a | ||
) | const |
|
virtual |
Implements SearchEnvironment< WitnessState< width, height >, WitnessAction >.
Definition at line 1461 of file Witness.h.
References kDown, kEnd, kLeft, kRight, kStart, kUp, WitnessState< width, height >::Occupy(), WitnessState< width, height >::OccupyEdge(), WitnessState< width, height >::path, and WitnessState< width, height >::Reset().
void Witness< width, height >::ClearCannotCrossConstraint | ( | int | which | ) |
Definition at line 2300 of file Witness.h.
References kNoPathConstraint.
|
inline |
Definition at line 536 of file Witness.h.
References Witness< width, height >::constraintCount, height, kNoRegionConstraint, Witness< width, height >::regionConstraints, and width.
Referenced by Witness< width, height >::ClearEraserConstraints(), Witness< width, height >::ClearSeparationConstraints(), Witness< width, height >::ClearStarConstraints(), Witness< width, height >::ClearTetrisConstraints(), and Witness< width, height >::ClearTriangleConstraints().
Definition at line 615 of file Witness.h.
References Witness< width, height >::ClearConstraint(), and kEraser.
Definition at line 522 of file Witness.h.
References Witness< width, height >::constraintCount, height, kNoRegionConstraint, kRegionConstraintCount, Witness< width, height >::regionConstraints, and width.
void Witness< width, height >::ClearMustCrossConstraint | ( | int | which | ) |
Definition at line 2130 of file Witness.h.
References kNoPathConstraint.
Definition at line 484 of file Witness.h.
References kNoPathConstraint, and Witness< width, height >::pathConstraints.
|
inline |
Definition at line 591 of file Witness.h.
References Witness< width, height >::ClearConstraint(), and kSeparation.
Definition at line 774 of file Witness.h.
References Witness< width, height >::ClearConstraint(), and kStar.
Definition at line 692 of file Witness.h.
References Witness< width, height >::ClearConstraint(), kNegativeTetris, and kTetris.
Definition at line 562 of file Witness.h.
References Witness< width, height >::ClearConstraint(), and kTriangle.
bool Witness< width, height >::Click | ( | Graphics::point | mouseLoc, |
InteractiveWitnessState< width, height > & | ws | ||
) |
Definition at line 2493 of file Witness.h.
References InteractiveWitnessState< width, height >::currState, height, kEnd, kStart, InteractiveWitnessState< width, height >::Reset(), InteractiveWitnessState< width, height >::target, width, and InteractiveWitnessState< width, height >::ws.
|
inline |
Definition at line 902 of file Witness.h.
References Witness< width, height >::AddGoal(), Witness< width, height >::AddRegionConstraint(), Witness< width, height >::AddStart(), WitnessRegionConstraint::c, SearchEnvironment< WitnessState< width, height >, WitnessAction >::color, Witness< width, height >::goal, height, rgbColor::hex(), kPathConstraintCount, kRegionConstraintCount, WitnessRegionConstraint::parameter, Witness< width, height >::SetCannotCrossConstraint(), Witness< width, height >::SetMustCrossConstraint(), Witness< width, height >::start, WitnessRegionConstraint::t, and width.
Referenced by operator>>().
|
inline |
Definition at line 1239 of file Witness.h.
References Graphics::Display::DrawLine(), Graphics::Display::FillRect(), Witness< width, height >::lineWidth, max, min(), Graphics::point::x, and Graphics::point::y.
|
virtual |
Reimplemented from SearchEnvironment< WitnessState< width, height >, WitnessAction >.
Definition at line 2847 of file Witness.h.
References Colors::black, Graphics::Display::FillCircle(), Graphics::Display::FillNGon(), Graphics::Display::FillRect(), Graphics::Display::FillSquare(), height, width, Graphics::point::x, and Graphics::point::y.
void Witness< width, height >::Draw | ( | Graphics::Display & | display, |
const InteractiveWitnessState< width, height > & | iws | ||
) | const |
Definition at line 3105 of file Witness.h.
References InteractiveWitnessState< width, height >::currState, Graphics::Display::FillCircle(), InteractiveWitnessState< width, height >::frac, Graphics::Display::FrameCircle(), InteractiveWitnessState< width, height >::target, and InteractiveWitnessState< width, height >::ws.
|
virtual |
Reimplemented from SearchEnvironment< WitnessState< width, height >, WitnessAction >.
Definition at line 3080 of file Witness.h.
References Graphics::Display::FillCircle(), and WitnessState< width, height >::path.
void Witness< width, height >::DrawRegionConstraint | ( | Graphics::Display & | display, |
const WitnessRegionConstraint & | constraint, | ||
const Graphics::point & | p3 | ||
) | const |
Definition at line 2681 of file Witness.h.
References Graphics::Display::FillCircle(), Graphics::Display::FillNGon(), Graphics::Display::FillRect(), kEraser, kNegativeTetris, kNoRegionConstraint, kRegionConstraintCount, kSeparation, kStar, kTetris, kTriangle, Colors::orange, Graphics::point::x, and Graphics::point::y.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Implements SearchEnvironment< WitnessState< width, height >, WitnessAction >.
Definition at line 1322 of file Witness.h.
References height, kDown, kEnd, kLeft, kRight, kStart, kUp, WitnessState< width, height >::Occupied(), WitnessState< width, height >::path, and width.
bool Witness< width, height >::GetCannotCrossConstraint | ( | int | which | ) | const |
Definition at line 2264 of file Witness.h.
References kCannotCross.
Referenced by Witness< width, height >::SaveToHashString().
|
inline |
Definition at line 1071 of file Witness.h.
Referenced by Witness< width, height >::LoadFromHashString().
void Witness< width, height >::GetMouseActions | ( | const WitnessState< width, height > & | nodeID, |
std::vector< WitnessAction > & | actions | ||
) | const |
bool Witness< width, height >::GetMustCrossConstraint | ( | int | which | ) | const |
Definition at line 2094 of file Witness.h.
References kMustCross.
Referenced by Witness< width, height >::SaveToHashString().
|
staticconstexpr |
Definition at line 2078 of file Witness.h.
Referenced by Witness< width, height >::LoadFromHashString(), Witness< width, height >::Reset(), and Witness< width, height >::SaveToHashString().
|
inline |
Definition at line 1188 of file Witness.h.
References width.
Referenced by Witness< width, height >::AddGoal().
|
inline |
Definition at line 1197 of file Witness.h.
Referenced by Witness< width, height >::operator std::string().
|
inline |
Definition at line 444 of file Witness.h.
References Witness< width, height >::regionConstraints.
|
inline |
Definition at line 1216 of file Witness.h.
References width.
Referenced by Witness< width, height >::AddEraserConstraint(), Witness< width, height >::AddNegativeTetrisConstraint(), Witness< width, height >::AddRegionConstraint(), Witness< width, height >::AddSeparationConstraint(), Witness< width, height >::AddStarConstraint(), and Witness< width, height >::AddTetrisConstraint().
|
inline |
Definition at line 1218 of file Witness.h.
References width.
Referenced by Witness< width, height >::AddEraserConstraint(), Witness< width, height >::AddNegativeTetrisConstraint(), Witness< width, height >::AddRegionConstraint(), Witness< width, height >::AddSeparationConstraint(), Witness< width, height >::AddStarConstraint(), and Witness< width, height >::AddTetrisConstraint().
|
inline |
Definition at line 1256 of file Witness.h.
References Witness< width, height >::gapOffset, height, Witness< width, height >::lineWidth, Witness< width, height >::scale, width, Witness< width, height >::xGap, and Witness< width, height >::yGap.
Referenced by Witness< width, height >::Reset().
|
virtual |
Reimplemented from SearchEnvironment< WitnessState< width, height >, WitnessAction >.
|
virtual |
void Witness< width, height >::GetSuccessors | ( | const WitnessState< width, height > & | nodeID, |
std::vector< WitnessState< width, height >> & | neighbors | ||
) | const |
|
inlinevirtual |
Reimplemented from SearchEnvironment< WitnessState< width, height >, WitnessAction >.
|
inlinevirtual |
Reimplemented from SearchEnvironment< WitnessState< width, height >, WitnessAction >.
|
virtual |
Goal Test if the goal is stored.
printf("Checking (%d, %d) to (%d, %d) - ", c.location.first, c.location.second, c.location.first+(c.horiz?1:0), c.location.second+(c.horiz?0:1));
Reimplemented from SearchEnvironment< WitnessState< width, height >, WitnessAction >.
Definition at line 1743 of file Witness.h.
References height, kEraser, kNegativeTetris, kNoRegionConstraint, kSeparation, kStar, kTetris, kTriangle, numPieces, and width.
|
virtual |
|
virtual |
Heuristic value between two arbitrary nodes.
Implements SearchEnvironment< WitnessState< width, height >, WitnessAction >.
|
virtual |
void Witness< width, height >::LabelRegions | ( | const WitnessState< width, height > & | s | ) | const |
Definition at line 2385 of file Witness.h.
References height, WitnessState< width, height >::OccupiedEdge(), and width.
bool Witness< width, height >::Legal | ( | WitnessState< width, height > & | s, |
WitnessAction | a | ||
) | const |
bool Witness< width, height >::Legal | ( | WitnessState< width, height > & | s, |
WitnessAction | a, | ||
legality & | l | ||
) | const |
|
inline |
Definition at line 1088 of file Witness.h.
References Witness< width, height >::constraintCount, Witness< width, height >::GetDimensionsFromHashString(), Witness< width, height >::GetNumPathConstraints(), height, rgbColor::hex(), Witness< width, height >::regionConstraints, Witness< width, height >::Reset(), Witness< width, height >::SetCannotCrossConstraint(), Witness< width, height >::SetMustCrossConstraint(), and width.
void Witness< width, height >::Move | ( | Graphics::point | mouseLoc, |
InteractiveWitnessState< width, height > & | ws | ||
) |
Definition at line 2533 of file Witness.h.
References InteractiveWitnessState< width, height >::currState, InteractiveWitnessState< width, height >::frac, Graphics::PointInRect(), InteractiveWitnessState< width, height >::target, InteractiveWitnessState< width, height >::targetAct, InteractiveWitnessState< width, height >::ws, Graphics::point::x, and Graphics::point::y.
|
inlinevirtual |
Reimplemented from SearchEnvironment< WitnessState< width, height >, WitnessAction >.
|
inlinevirtual |
Reimplemented from SearchEnvironment< WitnessState< width, height >, WitnessAction >.
|
inlinevirtual |
Draw the transition at some percentage 0...1 between two states.
Reimplemented from SearchEnvironment< WitnessState< width, height >, WitnessAction >.
Definition at line 835 of file Witness.h.
References Witness< width, height >::constraintCount, Witness< width, height >::GetPathLocation(), Witness< width, height >::goal, height, kNoRegionConstraint, Witness< width, height >::pathConstraints, Witness< width, height >::regionConstraints, Witness< width, height >::start, Witness< width, height >::PathLocation::t, width, Witness< width, height >::PathLocation::x, and Witness< width, height >::PathLocation::y.
|
inline |
Definition at line 552 of file Witness.h.
References Witness< width, height >::constraintCount, kNoRegionConstraint, and Witness< width, height >::regionConstraints.
Definition at line 318 of file Witness.h.
References Witness< width, height >::constraintCount, Witness< width, height >::GetNumPathConstraints(), Witness< width, height >::GetScreenCoord(), height, kNoPathConstraint, kNoRegionConstraint, kRegionConstraintCount, Witness< width, height >::pathConstraintLocations, Witness< width, height >::pathConstraints, Witness< width, height >::regionConstraintLocations, Witness< width, height >::regionConstraints, Witness< width, height >::SetGoal(), Witness< width, height >::start, and width.
Referenced by Witness< width, height >::LoadFromHashString(), and Witness< width, height >::Witness().
|
inline |
Definition at line 897 of file Witness.h.
Referenced by operator<<().
void Witness< width, height >::SetCannotCrossConstraint | ( | int | which | ) |
Definition at line 2238 of file Witness.h.
References kCannotCross.
Referenced by Witness< width, height >::Deserialize(), and Witness< width, height >::LoadFromHashString().
Definition at line 457 of file Witness.h.
References Witness< width, height >::AddGoal(), Witness< width, height >::goal, and Witness< width, height >::goalMap.
Referenced by Witness< width, height >::Reset().
Definition at line 2088 of file Witness.h.
References kMustCross.
Referenced by Witness< width, height >::Deserialize(), and Witness< width, height >::LoadFromHashString().
Definition at line 449 of file Witness.h.
References Witness< width, height >::start.
|
virtual |
Reimplemented from SearchEnvironment< WitnessState< width, height >, WitnessAction >.
Definition at line 1524 of file Witness.h.
References height, WitnessState< width, height >::path, WitnessState< width, height >::Unoccupy(), WitnessState< width, height >::UnoccupyEdge(), and width.
const rgbColor Witness< width, height >::backColor = Colors::white |
std::array<int, (int)kRegionConstraintCount> Witness< width, height >::constraintCount |
Definition at line 266 of file Witness.h.
Referenced by Witness< width, height >::AddEraserConstraint(), Witness< width, height >::AddNegativeTetrisConstraint(), Witness< width, height >::AddSeparationConstraint(), Witness< width, height >::AddStarConstraint(), Witness< width, height >::AddTetrisConstraint(), Witness< width, height >::AddTriangleConstraint(), Witness< width, height >::ClearConstraint(), Witness< width, height >::ClearInnerConstraints(), Witness< width, height >::LoadFromHashString(), Witness< width, height >::operator std::string(), Witness< width, height >::operator=(), Witness< width, height >::RemoveRegionConstraint(), and Witness< width, height >::Reset().
const rgbColor Witness< width, height >::drawColor = Colors::darkbluegray |
float Witness< width, height >::gapOffset = scale * 2.0f / (width > height ? width : height) |
Definition at line 1183 of file Witness.h.
Referenced by Witness< width, height >::GetScreenCoord().
Definition at line 829 of file Witness.h.
Referenced by Witness< width, height >::AddGoal(), Witness< width, height >::Deserialize(), Witness< width, height >::operator std::string(), Witness< width, height >::operator=(), and Witness< width, height >::SetGoal().
std::array<int, (width + 1) * (height + 1)> Witness< width, height >::goalMap |
Definition at line 832 of file Witness.h.
Referenced by Witness< width, height >::AddGoal(), Witness< width, height >::operator=(), and Witness< width, height >::SetGoal().
const rgbColor Witness< width, height >::lineColor = Colors::lightgray |
Definition at line 1184 of file Witness.h.
Referenced by Witness< width, height >::DoLine(), and Witness< width, height >::GetScreenCoord().
const rgbColor Witness< width, height >::outerBackColor = Colors::white |
std::array<std::pair<Graphics::point, Graphics::rect>, Witness<width, height>::GetNumPathConstraints()> Witness< width, height >::pathConstraintLocations |
Definition at line 249 of file Witness.h.
Referenced by Witness< width, height >::Reset().
std::array<WitnessPathConstraintType, Witness<width, height>::GetNumPathConstraints()> Witness< width, height >::pathConstraints |
Definition at line 247 of file Witness.h.
Referenced by Witness< width, height >::ClearPathConstraints(), Witness< width, height >::operator std::string(), Witness< width, height >::operator=(), and Witness< width, height >::Reset().
|
mutable |
std::array<std::pair<Graphics::point, Graphics::rect>, width*height> Witness< width, height >::regionConstraintLocations |
Definition at line 277 of file Witness.h.
Referenced by Witness< width, height >::Reset().
std::array<std::array<WitnessRegionConstraint, height>, width> Witness< width, height >::regionConstraints |
Definition at line 264 of file Witness.h.
Referenced by Witness< width, height >::AddEraserConstraint(), Witness< width, height >::AddNegativeTetrisConstraint(), Witness< width, height >::AddSeparationConstraint(), Witness< width, height >::AddStarConstraint(), Witness< width, height >::AddTetrisConstraint(), Witness< width, height >::AddTriangleConstraint(), Witness< width, height >::ClearConstraint(), Witness< width, height >::ClearInnerConstraints(), Witness< width, height >::GetRegionConstraint(), Witness< width, height >::LoadFromHashString(), Witness< width, height >::operator std::string(), Witness< width, height >::operator=(), Witness< width, height >::RemoveRegionConstraint(), Witness< width, height >::Reset(), and Witness< width, height >::SaveToHashString().
Definition at line 1182 of file Witness.h.
Referenced by Witness< width, height >::GetScreenCoord().
Definition at line 828 of file Witness.h.
Referenced by Witness< width, height >::AddStart(), Witness< width, height >::Deserialize(), Witness< width, height >::operator std::string(), Witness< width, height >::operator=(), Witness< width, height >::Reset(), and Witness< width, height >::SetStart().
const rgbColor Witness< width, height >::tetrisBlue = {0.2196078431f, 0.3607843137f, 0.8705882353f} |
Definition at line 1175 of file Witness.h.
Referenced by Witness< width, height >::AddNegativeTetrisConstraint().
const rgbColor Witness< width, height >::tetrisYellow = {0.862745098f, 0.6549019608f, 0.0f} |
Definition at line 1174 of file Witness.h.
Referenced by Witness< width, height >::AddTetrisConstraint().
const rgbColor Witness< width, height >::triangleColor = Colors::orange |
Definition at line 1180 of file Witness.h.
Referenced by Witness< width, height >::AddTriangleConstraint().
float Witness< width, height >::xGap = (((width > height) ? (width) : (height)) - width) * gapOffset / 2.0f |
Definition at line 1185 of file Witness.h.
Referenced by Witness< width, height >::GetScreenCoord().
float Witness< width, height >::yGap = -(((width > height) ? (width) : (height)) - height) * gapOffset / 2.0f |
Definition at line 1186 of file Witness.h.
Referenced by Witness< width, height >::GetScreenCoord().