#include <unitRaceSimulation.h>
Inheritance diagram for unitRaceSimulation:
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 |
|
|
|
|
|
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. |
|
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. |
|
|
|
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. |
|
Reimplemented from unitSimulation. |
|
Reimplemented from unitSimulation. |
|
|
|
|
|
Check if the unit is racing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
Checks and returns details of whether a racing unit is on target kNoTarget, kOutOfTravel, kReachedTarget, kNotOnTarget.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|