Go to the documentation of this file.
10 template <
class state,
class action,
class environment>
32 for (
unsigned int i=0; i<
unitWme.size(); i++)
36 virtual const char *
GetName() {
return "WeightedUnitGroup"; }
46 for (
unsigned int x = 0; x < this->
GetMembers().size(); x++)
130 return (u->
MakeMove(thisUnitsEnv, thisUnitsEnv->GetOccupancyInfo(), si,a));
148 if ((x<0)||(x>=uwme->GetMap()->GetMapWidth()))
152 if ((y<0)||(y>=uwme->GetMap()->GetMapHeight()))
173 for (
unsigned int x = 0; x < this->
GetMembers().size(); x++)
187 for (
unsigned int x = 0; x < this->
GetMembers().size(); x++)
286 std::vector<WeightedMap2DEnvironment*>
unitWme;
double ComputeArrowMetric(bool b, double t, bool b2, double mt)
void SetUseWindow(bool b)
A 2D map environment with edge costs weighted according to the number of times a unit has passed over...
void DrawNextEnvironment()
virtual void UpdateLocation(Unit< state, action, environment > *u, environment *e, state &loc, bool success, SimulationInfo< state, action, environment > *si)
int GetUnitIndex(Unit< state, action, environment > *u)
virtual void OpenGLDraw(const environment *, const SimulationInfo< state, action, environment > *) const
std::vector< environment * > unitEnv
virtual void UpdateLocation(environment *, state &, bool success, SimulationInfo< state, action, environment > *)=0
virtual bool MakeMove(Unit< state, action, environment > *u, environment *e, SimulationInfo< state, action, environment > *si, action &a)
void SetUpdateOnQuery(bool b)
virtual double GetSimulationTime() const =0
void SetLocalWeightRadius(double r)
double ComputeArrowMetric(bool timed=false, double time=0, bool DoNormalize=false, double maxtime=0)
virtual std::vector< Unit< state, action, environment > * > GetMembers()
Vector2D GetAngle(xyLoc &l)
void SetAngle(xyLoc &l, Vector2D angle)
void SetUpdateSurrounding(double d)
void UsePerceptron(double lr)
void SetWeight(double wght)
void SetWindowSize(double d)
void SetWeight(double wt)
Set the cost of moving in the "wrong" direction.
void SetWindowSize(double d)
virtual ~WeightedUnitGroup()
virtual void GetLocation(state &)=0
void UsePerceptron(double lr)
void SetProportionOld(double prop)
Set the weight (proportion) of the old angle.
void UpdateLocalWeights(Unit< state, action, environment > *u)
void SetWindowCenter(xyLoc l)
void UseLocalWeights(bool b)
void SetNoWeighting(bool b)
void SetNoWeighting(bool b)
WeightedUnitGroup(environment *e)
std::vector< WeightedMap2DEnvironment * > unitWme
WeightedMap2DEnvironment * wme
void UpdateAngle(const xyLoc &old, const xyLoc &s, double t)
void SetQueryProportionOld(double prop)
Set the weight (proportion) of the old angle for queried edge updates.
virtual bool MakeMove(environment *, OccupancyInterface< state, action > *, SimulationInfo< state, action, environment > *, action &a)=0
void SetUpdateOnQuery(double d)
WeightedMap2DEnvironment * GetWeightedEnvironment()
virtual const char * GetName()
void SetSurroundingProportion(double prop)
void SetProportion(double proport)
void SetUpdateSurrounding(bool b)