HOG2
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
WeightedMap2DEnvironment Class Reference

#include <WeightedMap2DEnvironment.h>

Inheritance diagram for WeightedMap2DEnvironment:
Inheritance graph
[legend]
Collaboration diagram for WeightedMap2DEnvironment:
Collaboration graph
[legend]

Public Member Functions

 WeightedMap2DEnvironment (MapAbstraction *ma)
 Constructor for the WeightedMap2DEnvironment. More...
 
 WeightedMap2DEnvironment (AbsMapEnvironment *ame)
 
virtual ~WeightedMap2DEnvironment ()
 Destructor for the WeightedMap2DEnvironment. More...
 
void ApplyAction (xyLoc &s, tDirection dir) const
 ApplyAction is called when an action is applied. More...
 
virtual double GCost (const xyLoc &node1, const xyLoc &node2) const
 
virtual double GCost (const xyLoc &node1, const tDirection &act) const
 
virtual BaseMapOccupancyInterfaceGetOccupancyInfo ()
 
void OpenGLDraw () const
 
void OpenGLDraw (const xyLoc &l) const
 
void OpenGLDraw (const xyLoc &s, const tDirection &dir) const
 
void OpenGLDraw (const xyLoc &l1, const xyLoc &l2, float v) const
 
void DrawEdge (const edge *e) const
 
void UpdateAngle (const xyLoc &old, const xyLoc &s, double t)
 
void SetWeight (double wt)
 Set the cost of moving in the "wrong" direction. More...
 
void SetProportionOld (double prop)
 Set the weight (proportion) of the old angle. More...
 
void SetUpdateOnQuery (bool b)
 
void SetQueryProportionOld (double prop)
 Set the weight (proportion) of the old angle for queried edge updates. More...
 
void SetUpdateSurrounding (bool b)
 
void SetSurroundingProportion (double prop)
 
void UseWindow (bool b)
 
void SetWindowCenter (xyLoc l)
 
void SetWindowSize (double d)
 
void SetAngle (xyLoc &l, Vector2D angle)
 
Vector2D GetAngle (xyLoc &l)
 
void SetNoWeighting (bool b)
 
void UsePerceptron (double lr)
 
double ComputeArrowMetric (bool timed=false, double time=0, bool DoNormalize=false, double maxtime=0)
 
Vector2D GetAngleFromDirection (tDirection dir) const
 

Private Types

typedef std::unordered_map< AngleUtil::AngleSearchNode, Vector2D, AngleUtil::SearchNodeHash, AngleUtil::SearchNodeEqualAngleLookupTable
 

Private Member Functions

void UpdateAngle (const xyLoc &old, const xyLoc &s, double prop, double t)
 

Private Attributes

BaseMapOccupancyInterfaceoi
 
AngleLookupTable angleLookup
 
double diffWeight
 
double oldProportion
 
xyLoc windowCenter
 
bool useWindow
 
double windowSize
 
bool noWeighting
 
bool updateOnQuery
 
double queryOldProportion
 
bool updateSurrounding
 
double surroundingProportion
 
bool usePerceptron
 
double learningRate
 

Detailed Description

Definition at line 120 of file WeightedMap2DEnvironment.h.

Member Typedef Documentation

◆ AngleLookupTable

Definition at line 171 of file WeightedMap2DEnvironment.h.

Constructor & Destructor Documentation

◆ WeightedMap2DEnvironment() [1/2]

WeightedMap2DEnvironment::WeightedMap2DEnvironment ( MapAbstraction *  mapAbs)

Constructor for the WeightedMap2DEnvironment.

Parameters
maThe map abstraction the environment uses

Definition at line 10 of file WeightedMap2DEnvironment.cpp.

References diffWeight, learningRate, noWeighting, oi, oldProportion, queryOldProportion, surroundingProportion, updateOnQuery, updateSurrounding, usePerceptron, and useWindow.

◆ WeightedMap2DEnvironment() [2/2]

WeightedMap2DEnvironment::WeightedMap2DEnvironment ( AbsMapEnvironment *  ame)

◆ ~WeightedMap2DEnvironment()

WeightedMap2DEnvironment::~WeightedMap2DEnvironment ( )
virtual

Destructor for the WeightedMap2DEnvironment.

Definition at line 64 of file WeightedMap2DEnvironment.cpp.

References angleLookup.

Member Function Documentation

◆ ApplyAction()

void WeightedMap2DEnvironment::ApplyAction ( xyLoc s,
tDirection  dir 
) const

ApplyAction is called when an action is applied.

The current state, occupancy interface, and edge weight are updated if the action can be applied.

Parameters
sThe current state
dirThe action taken from the current state

Definition at line 77 of file WeightedMap2DEnvironment.cpp.

References kE, kN, kNE, kNW, kS, kSE, kSW, kW, xyLoc::x, and xyLoc::y.

◆ ComputeArrowMetric()

double WeightedMap2DEnvironment::ComputeArrowMetric ( bool  timed = false,
double  time = 0,
bool  DoNormalize = false,
double  maxtime = 0 
)

◆ DrawEdge()

void WeightedMap2DEnvironment::DrawEdge ( const edge e) const

◆ GCost() [1/2]

virtual double WeightedMap2DEnvironment::GCost ( const xyLoc node1,
const tDirection act 
) const
inlinevirtual

Definition at line 128 of file WeightedMap2DEnvironment.h.

◆ GCost() [2/2]

double WeightedMap2DEnvironment::GCost ( const xyLoc l1,
const xyLoc l2 
) const
virtual
Parameters
l1The first location
l2The second location
Returns
The weighted G-cost between l1 and l2, if there exists an edge between the two locations, DBL_MAX otherwise.

Definition at line 379 of file WeightedMap2DEnvironment.cpp.

References angleLookup, diffWeight, fgreater(), GetAngleFromDirection(), noWeighting, ROOT_TWO, useWindow, windowCenter, windowSize, Vector2D::x, and Vector2D::y.

Referenced by AbsGraphEnvironment::GCost().

◆ GetAngle()

Vector2D WeightedMap2DEnvironment::GetAngle ( xyLoc l)

◆ GetAngleFromDirection()

Vector2D WeightedMap2DEnvironment::GetAngleFromDirection ( tDirection  dir) const

◆ GetOccupancyInfo()

virtual BaseMapOccupancyInterface* WeightedMap2DEnvironment::GetOccupancyInfo ( )
inlinevirtual

Definition at line 130 of file WeightedMap2DEnvironment.h.

References oi.

◆ OpenGLDraw() [1/4]

void WeightedMap2DEnvironment::OpenGLDraw ( ) const

◆ OpenGLDraw() [2/4]

void WeightedMap2DEnvironment::OpenGLDraw ( const xyLoc l) const
inline

Definition at line 132 of file WeightedMap2DEnvironment.h.

◆ OpenGLDraw() [3/4]

void WeightedMap2DEnvironment::OpenGLDraw ( const xyLoc l1,
const xyLoc l2,
float  v 
) const
inline

Definition at line 134 of file WeightedMap2DEnvironment.h.

References MapEnvironment::OpenGLDraw().

◆ OpenGLDraw() [4/4]

void WeightedMap2DEnvironment::OpenGLDraw ( const xyLoc s,
const tDirection dir 
) const

Definition at line 591 of file WeightedMap2DEnvironment.cpp.

References DrawEdge(), Graph::FindEdge(), node::GetNum(), kE, kN, kNE, kNW, kS, kSE, kSW, kW, xyLoc::x, and xyLoc::y.

◆ SetAngle()

void WeightedMap2DEnvironment::SetAngle ( xyLoc l,
Vector2D  angle 
)

◆ SetNoWeighting()

void WeightedMap2DEnvironment::SetNoWeighting ( bool  b)
inline

◆ SetProportionOld()

void WeightedMap2DEnvironment::SetProportionOld ( double  prop)
inline

Set the weight (proportion) of the old angle.

Definition at line 142 of file WeightedMap2DEnvironment.h.

References oldProportion.

Referenced by WeightedUnitGroup< state, action, environment >::MakeMove(), and WeightedUnitGroup< state, action, environment >::UpdateLocation().

◆ SetQueryProportionOld()

void WeightedMap2DEnvironment::SetQueryProportionOld ( double  prop)
inline

Set the weight (proportion) of the old angle for queried edge updates.

Definition at line 146 of file WeightedMap2DEnvironment.h.

References queryOldProportion.

Referenced by WeightedUnitGroup< state, action, environment >::MakeMove(), and WeightedUnitGroup< state, action, environment >::UpdateLocation().

◆ SetSurroundingProportion()

void WeightedMap2DEnvironment::SetSurroundingProportion ( double  prop)
inline

◆ SetUpdateOnQuery()

void WeightedMap2DEnvironment::SetUpdateOnQuery ( bool  b)
inline

◆ SetUpdateSurrounding()

void WeightedMap2DEnvironment::SetUpdateSurrounding ( bool  b)
inline

◆ SetWeight()

void WeightedMap2DEnvironment::SetWeight ( double  wt)
inline

Set the cost of moving in the "wrong" direction.

Definition at line 140 of file WeightedMap2DEnvironment.h.

References diffWeight.

Referenced by WeightedUnitGroup< state, action, environment >::MakeMove(), and WeightedUnitGroup< state, action, environment >::UpdateLocation().

◆ SetWindowCenter()

void WeightedMap2DEnvironment::SetWindowCenter ( xyLoc  l)
inline

◆ SetWindowSize()

void WeightedMap2DEnvironment::SetWindowSize ( double  d)
inline

◆ UpdateAngle() [1/2]

void WeightedMap2DEnvironment::UpdateAngle ( const xyLoc old,
const xyLoc s,
double  prop,
double  t 
)
private

◆ UpdateAngle() [2/2]

void WeightedMap2DEnvironment::UpdateAngle ( const xyLoc old,
const xyLoc s,
double  t 
)

◆ UsePerceptron()

void WeightedMap2DEnvironment::UsePerceptron ( double  lr)
inline

◆ UseWindow()

void WeightedMap2DEnvironment::UseWindow ( bool  b)
inline

Member Data Documentation

◆ angleLookup

AngleLookupTable WeightedMap2DEnvironment::angleLookup
private

◆ diffWeight

double WeightedMap2DEnvironment::diffWeight
private

Definition at line 176 of file WeightedMap2DEnvironment.h.

Referenced by GCost(), SetWeight(), and WeightedMap2DEnvironment().

◆ learningRate

double WeightedMap2DEnvironment::learningRate
private

◆ noWeighting

bool WeightedMap2DEnvironment::noWeighting
private

Definition at line 184 of file WeightedMap2DEnvironment.h.

Referenced by GCost(), SetNoWeighting(), and WeightedMap2DEnvironment().

◆ oi

BaseMapOccupancyInterface* WeightedMap2DEnvironment::oi
private

Definition at line 168 of file WeightedMap2DEnvironment.h.

Referenced by GetOccupancyInfo(), and WeightedMap2DEnvironment().

◆ oldProportion

double WeightedMap2DEnvironment::oldProportion
private

◆ queryOldProportion

double WeightedMap2DEnvironment::queryOldProportion
private

Definition at line 187 of file WeightedMap2DEnvironment.h.

Referenced by SetQueryProportionOld(), and WeightedMap2DEnvironment().

◆ surroundingProportion

double WeightedMap2DEnvironment::surroundingProportion
private

◆ updateOnQuery

bool WeightedMap2DEnvironment::updateOnQuery
private

Definition at line 186 of file WeightedMap2DEnvironment.h.

Referenced by SetUpdateOnQuery(), and WeightedMap2DEnvironment().

◆ updateSurrounding

bool WeightedMap2DEnvironment::updateSurrounding
private

◆ usePerceptron

bool WeightedMap2DEnvironment::usePerceptron
private

◆ useWindow

bool WeightedMap2DEnvironment::useWindow
private

Definition at line 181 of file WeightedMap2DEnvironment.h.

Referenced by GCost(), UseWindow(), and WeightedMap2DEnvironment().

◆ windowCenter

xyLoc WeightedMap2DEnvironment::windowCenter
private

Definition at line 180 of file WeightedMap2DEnvironment.h.

Referenced by GCost(), and SetWindowCenter().

◆ windowSize

double WeightedMap2DEnvironment::windowSize
private

Definition at line 182 of file WeightedMap2DEnvironment.h.

Referenced by GCost(), and SetWindowSize().


The documentation for this class was generated from the following files: