Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

unitRaceSimulation Class Reference

#include <unitRaceSimulation.h>

Inheritance diagram for unitRaceSimulation:

Inheritance graph
[legend]
Collaboration diagram for unitRaceSimulation:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 unitRaceSimulation (mapAbstraction *m, bool keepStats=false)
 ~unitRaceSimulation ()
void addUnit (unit *u)
 add a unit to the simulation.

void addUnit (unit *u, bool block)
 add a unit to the simulation.

virtual bool done ()
 done returns true when all units/groups say they are done.

void setStopOnConvergence (bool stop)
void setTargetTolerance (double x)
double getTargetTolerance ()
void setDisjunctiveTrialEnd (bool value)
void setUseSameStart (bool val)
int getCurrRound ()
void setTravelLimit (double lim)
void setTrialLimit (long maxTrials)
void disableTravelLimit ()

Private Member Functions

virtual void doPreTimestepCalc ()
virtual void doTimestepCalc ()
tUnitOnTargetStatus unitOnTargetStatus (unitInfo *)
 Checks and returns details of whether a racing unit is on target kNoTarget, kOutOfTravel, kReachedTarget, kNotOnTarget.

bool unitOnTarget (unitInfo *)
 A racing unit is on-target iff: - it has no target or - it uses a travel limit and it used it up or - it is within tolerance of its target.

bool isUnitRacing (unitInfo *u)
 Check if the unit is racing.


Private Attributes

bool allRacesDone
bool sameStart
int currRound
double travelLimit
bool useTravelLimit
bool stopOnConvergence
long maxRounds
bool useMaxRounds
double targetTolerance
bool disjunctiveTrialEnd

Constructor & Destructor Documentation

unitRaceSimulation::unitRaceSimulation mapAbstraction m,
bool  keepStats = false
 

unitRaceSimulation::~unitRaceSimulation  ) 
 


Member Function Documentation

void unitRaceSimulation::addUnit unit u,
bool  block
[inline, virtual]
 

add a unit to the simulation.

Adds a unit to the simulation. You can optionally set whether this unit blocks the places where it stands, which can differ from the simulation default. If the unit's current x/y location is valid, the unit will be placed there. Otherwise it will be added to a random location on the map. If a unit is part of a group, it should be added to that group before being added to the simulation.

Reimplemented from unitSimulation.

void unitRaceSimulation::addUnit unit u  )  [inline, virtual]
 

add a unit to the simulation.

Adds a unit to the simulation. If the unit's current x/y location is valid, the unit will be placed there. Otherwise it will be added to a random location on the map. If a unit is part of a group, it should be added to that group before being added to the simulation.

Reimplemented from unitSimulation.

void unitRaceSimulation::disableTravelLimit  )  [inline]
 

virtual bool unitRaceSimulation::done  )  [inline, virtual]
 

done returns true when all units/groups say they are done.

For episodic tasks we may want to run a set number of times, or until learning converges, etc. This is a way of detecting this so we can stop the simulation or start a new episode.

Reimplemented from unitSimulation.

void unitRaceSimulation::doPreTimestepCalc  )  [private, virtual]
 

Reimplemented from unitSimulation.

void unitRaceSimulation::doTimestepCalc  )  [private, virtual]
 

Reimplemented from unitSimulation.

int unitRaceSimulation::getCurrRound  )  [inline]
 

double unitRaceSimulation::getTargetTolerance  )  [inline]
 

bool unitRaceSimulation::isUnitRacing unitInfo u  )  [private]
 

Check if the unit is racing.

void unitRaceSimulation::setDisjunctiveTrialEnd bool  value  )  [inline]
 

void unitRaceSimulation::setStopOnConvergence bool  stop  )  [inline]
 

void unitRaceSimulation::setTargetTolerance double  x  )  [inline]
 

void unitRaceSimulation::setTravelLimit double  lim  )  [inline]
 

void unitRaceSimulation::setTrialLimit long  maxTrials  )  [inline]
 

void unitRaceSimulation::setUseSameStart bool  val  )  [inline]
 

bool unitRaceSimulation::unitOnTarget unitInfo u  )  [private]
 

A racing unit is on-target iff: - it has no target or - it uses a travel limit and it used it up or - it is within tolerance of its target.

tUnitOnTargetStatus unitRaceSimulation::unitOnTargetStatus unitInfo u  )  [private]
 

Checks and returns details of whether a racing unit is on target kNoTarget, kOutOfTravel, kReachedTarget, kNotOnTarget.


Member Data Documentation

bool unitRaceSimulation::allRacesDone [private]
 

int unitRaceSimulation::currRound [private]
 

bool unitRaceSimulation::disjunctiveTrialEnd [private]
 

long unitRaceSimulation::maxRounds [private]
 

bool unitRaceSimulation::sameStart [private]
 

bool unitRaceSimulation::stopOnConvergence [private]
 

double unitRaceSimulation::targetTolerance [private]
 

double unitRaceSimulation::travelLimit [private]
 

bool unitRaceSimulation::useMaxRounds [private]
 

bool unitRaceSimulation::useTravelLimit [private]
 


The documentation for this class was generated from the following files:
Generated on Tue Aug 18 03:46:05 2009 for HOG by doxygen 1.3.4