Go to the documentation of this file.
10 #ifndef DIRECTIONAL2DENVIRONMENT
11 #define DIRECTIONAL2DENVIRONMENT
27 std::vector<std::vector<float> >
hTable;
154 float mySin(
int dir)
const;
155 float myCos(
int dir)
const;
181 if ((floorf(l1.
x) != floorf(l2.
x)) && (!
fequal(l1.
x, l2.
x)))
183 if ((floorf(l1.
y) != floorf(l2.
y)) && (!
fequal(l1.
y, l2.
y)))
199 out <<
"(" <<
loc.
x <<
", " <<
loc.
y <<
")";
200 out <<
"[" << (int)
loc.speed <<
":" << (
int)
loc.rotation <<
"]";
206 out <<
"{" << ((int)
loc.turn) <<
"|" << ((int)
loc.speed) <<
"}";
std::vector< float > cosTable
uint64_t GetStateHash(const xySpeedHeading &node) const
std::vector< std::vector< float > > hTable
UnitSimulation< xySpeedHeading, deltaSpeedHeading, Directional2DEnvironment > DirectionSimulation
virtual double HCost(const xySpeedHeading &) const
Heuristic value between node and the stored goal.
uint64_t GetActionHash(deltaSpeedHeading act) const
void GetActions(const xySpeedHeading &nodeID, std::vector< deltaSpeedHeading > &actions) const
virtual OccupancyInterface< xySpeedHeading, deltaSpeedHeading > * GetOccupancyInfo()
bool Legal(const xySpeedHeading &node1, const deltaSpeedHeading &act) const
bool GoalTest(const xySpeedHeading &node, const xySpeedHeading &goal) const
static std::ostream & operator<<(std::ostream &out, const xySpeedHeading &loc)
virtual bool InvertAction(deltaSpeedHeading &a) const
virtual void UndoAction(xySpeedHeading &s, deltaSpeedHeading dir) const
bool GoalTest(const xySpeedHeading &) const
Goal Test if the goal is stored.
void SetGoalTest(GoalTester *t)
@ kExtendedPerimeterHeuristic
virtual double HCost(const xySpeedHeading &node1, const xySpeedHeading &node2) const
Heuristic value between two arbitrary nodes.
virtual double GCost(const xySpeedHeading &node1, const xySpeedHeading &node2) const
std::vector< dirHeuristicTable > heuristics
virtual ~Directional2DEnvironment()
void GLDrawLine(const xySpeedHeading &a, const xySpeedHeading &b) const
virtual void OpenGLDraw() const
Directional2DEnvironment(Map *m, model envType=kVehicle, heuristicType heuristic=kExtendedPerimeterHeuristic)
virtual void GetNextState(const xySpeedHeading ¤ts, deltaSpeedHeading dir, xySpeedHeading &news) const
float myCos(int dir) const
void RotateCCW(xySpeedHeading &s, unsigned int rotation) const
bool LookupStateHashIndex(const xySpeedHeading &s, int &index1, int &index2) const
virtual void ApplyAction(xySpeedHeading &s, deltaSpeedHeading dir) const
virtual bool goalTest(const xySpeedHeading &i1) const =0
float mySin(int dir) const
The basic simulation class for the world.
void SetHeuristicType(heuristicType theType)
xySpeedHeading(float _x, float _y)
void BuildHTable(dirHeuristicTable &t)
float LookupStateHash(const xySpeedHeading &s, const dirHeuristicTable &t) const
bool fequal(double a, double b, double tolerance=TOLERANCE)
std::vector< float > sinTable
void GetSuccessors(const xySpeedHeading &nodeID, std::vector< xySpeedHeading > &neighbors) const
deltaSpeedHeading GetAction(const xySpeedHeading &s1, const xySpeedHeading &s2) const
Nodes to be stored within a Graph.
A tile-based representation of the world.
float LookupStateHeuristic(const xySpeedHeading &s1, const xySpeedHeading &s2) const
static bool operator==(const xySpeedHeading &l1, const xySpeedHeading &l2)