Go to the documentation of this file.
30 #ifndef WEIGHTEDMAP2DENVIRONMENT_H
31 #define WEIGHTEDMAP2DENVIRONMENT_H
38 #include <unordered_map>
44 void Set(
float _x,
float _y) {
x=_x;
y=_y; }
55 out <<
"(" <<
x <<
", " <<
y <<
")";
85 float magnitude = sqrt(
x*
x +
y*
y);
108 {
return (
size_t)(x.
hashKey); } };
110 typedef std::unordered_map<AngleUtil::AngleSearchNode,Vector2D, AngleUtil::SearchNodeHash, AngleUtil::SearchNodeEqual>
AngleLookupTable;
128 virtual double GCost(
const xyLoc &node1,
const tDirection &act)
const {
return AbsMapEnvironment::GCost(node1, act); }
164 double ComputeArrowMetric(
bool timed=
false,
double time=0,
bool DoNormalize=
false,
double maxtime=0);
171 typedef std::unordered_map<AngleUtil::AngleSearchNode,Vector2D, AngleUtil::SearchNodeHash, AngleUtil::SearchNodeEqual>
AngleLookupTable;
UnitSimulation< xyLoc, tDirection, WeightedMap2DEnvironment > UnitWeightedMapSimulation
Vector2D GetAngleFromDirection(tDirection dir) const
virtual double GCost(const xyLoc &node1, const tDirection &act) const
bool operator()(const AngleSearchNode &i1, const AngleSearchNode &i2) const
virtual double GCost(const xyLoc &node1, const xyLoc &node2) const
void SetUpdateOnQuery(bool b)
void OpenGLDraw(const xyLoc &l1, const xyLoc &l2, float v) const
virtual ~WeightedMap2DEnvironment()
Destructor for the WeightedMap2DEnvironment.
size_t operator()(const AngleSearchNode &x) const
double ComputeArrowMetric(bool timed=false, double time=0, bool DoNormalize=false, double maxtime=0)
void SetAccessTime(double t)
Vector2D GetAngle(xyLoc &l)
virtual BaseMapOccupancyInterface * GetOccupancyInfo()
virtual void OpenGLDraw() const
void ApplyAction(xyLoc &s, tDirection dir) const
ApplyAction is called when an action is applied.
void SetAngle(xyLoc &l, Vector2D angle)
void UsePerceptron(double lr)
void SetWindowSize(double d)
void SetWeight(double wt)
Set the cost of moving in the "wrong" direction.
void DrawEdge(const edge *e) const
friend Vector2D operator*(const Vector2D &vec, const double num)
bool operator==(const Vector2D &rhs)
Vector2D(float _x, float _y)
void SetProportionOld(double prop)
Set the weight (proportion) of the old angle.
void SetWindowCenter(xyLoc l)
void SetNoWeighting(bool b)
double queryOldProportion
double surroundingProportion
void Set(float _x, float _y)
friend Vector2D operator+(const Vector2D &v1, const Vector2D &v2)
AngleLookupTable angleLookup
std::unordered_map< AngleUtil::AngleSearchNode, Vector2D, AngleUtil::SearchNodeHash, AngleUtil::SearchNodeEqual > AngleLookupTable
WeightedMap2DEnvironment(MapAbstraction *ma)
Constructor for the WeightedMap2DEnvironment.
void SetUpdateTime(double t)
The basic simulation class for the world.
std::ostream & operator<<(std::ostream &out)
void UpdateAngle(const xyLoc &old, const xyLoc &s, double t)
AngleSearchNode(const xyLoc &s, uint64_t key)
void SetQueryProportionOld(double prop)
Set the weight (proportion) of the old angle for queried edge updates.
BaseMapOccupancyInterface * oi
std::unordered_map< AngleUtil::AngleSearchNode, Vector2D, AngleUtil::SearchNodeHash, AngleUtil::SearchNodeEqual > AngleLookupTable
void SetSurroundingProportion(double prop)
Nodes to be stored within a Graph.
void SetUpdateSurrounding(bool b)
void OpenGLDraw(const xyLoc &l) const
Edge class for connections between node in a Graph.