HOG2
|
#include <GenericPatrolUnit.h>
Public Member Functions | |
GenericPatrolUnit (state &s, GenericSearchAlgorithm< state, action, environment > *alg) | |
GenericPatrolUnit (state &s, GenericSearchAlgorithm< state, action, environment > *alg, GLfloat _r, GLfloat _g, GLfloat _b) | |
virtual const char * | GetName () |
void | SetName (char *myname) |
virtual void | GetLocation (state &s) |
virtual bool | MakeMove (environment *env, OccupancyInterface< state, action > *, SimulationInfo< state, action, environment > *si, action &dir) |
virtual void | OpenGLDraw (const environment *, const SimulationInfo< state, action, environment > *) const |
void | AddPatrolLocation (state &s) |
state & | GetGoal () |
void | GetGoal (state &s) |
virtual bool | Done () |
void | UpdateLocation (environment *, state &l, bool success, SimulationInfo< state, action, environment > *si) |
void | LogStats (StatCollection *stats) |
log an stats that may have been computed during the last run More... | |
void | LogFinalStats (StatCollection *stats) |
log any final one-time stats before a simulation is ended More... | |
void | SetNumPatrols (int num) |
void | SetTrimPath (bool trim) |
Set whether we want to trim the planned path. More... | |
void | SetTrimWindow (double d) |
Set the window at which we want to trim the planned path. More... | |
void | SetDrawUnit (bool draw) |
Set whether we want to draw the unit. More... | |
Public Member Functions inherited from GenericSearchUnit< state, action, environment > | |
GenericSearchUnit (state &start, state &goal, GenericSearchAlgorithm< state, action, environment > *alg) | |
GenericSearchUnit (state &start, Unit< state, action, environment > *target, GenericSearchAlgorithm< state, action, environment > *alg) | |
virtual | ~GenericSearchUnit () |
virtual GenericSearchAlgorithm< state, action, environment > * | getAlgorithm () |
virtual void | SetTarget (Unit< state, action, environment > *u) |
virtual Unit< state, action, environment > * | GetTarget () |
void | LogStats (StatCollection *stats) |
log an stats that may have been computed during the last run More... | |
void | LogFinalStats (StatCollection *stats) |
log any final one-time stats before a simulation is ended More... | |
Public Member Functions inherited from Unit< state, action, environment > | |
Unit () | |
virtual | ~Unit () |
virtual double | GetSpeed () |
void | SetSpeed (double s) |
virtual void | SetColor (GLfloat _r, GLfloat _g, GLfloat _b) |
virtual void | GetColor (GLfloat &_r, GLfloat &_g, GLfloat &_b) const |
UnitGroup< state, action, environment > * | GetUnitGroup () |
void | SetUnitGroup (UnitGroup< state, action, environment > *_group) |
virtual unsigned int | GetNum () |
virtual void | SetNum (unsigned int num) |
virtual void | StartNewTrial (StatCollection *) |
virtual int | GetPriority () |
virtual void | SetPriority (int val) |
Private Member Functions | |
void | GoToLoc (environment *env, int which) |
void | AddPathToCache (environment *env, std::vector< state > &path) |
Store path as a vector of actions. More... | |
Private Attributes | |
state | loc |
int | numPatrols |
int | counter |
action | oldDir |
action | oldDirColl |
double | totalDistance |
double | lastFailedMove |
std::vector< action > | moves |
std::vector< state > | locs |
GenericSearchAlgorithm< state, action, environment > * | algorithm |
int | currTarget |
int | nodesExpanded |
int | nodesTouched |
int | numFailedMoves |
int | numDirectionChanges |
int | numDirectionChangesCollisions |
std::vector< int > | nodesExpandedPatrols |
std::vector< int > | nodesTouchedPatrols |
std::vector< int > | numFailedMovesPatrols |
std::vector< int > | numDirectionChangesPatrols |
std::vector< int > | numDirectionChangesCollisionsPatrols |
std::vector< double > | totalDistancePatrols |
char | name [128] |
bool | trimPath |
double | trimWindow |
bool | drawUnit |
Additional Inherited Members | |
Protected Member Functions inherited from GenericSearchUnit< state, action, environment > | |
bool | getCachedMove (action &a) |
Protected Attributes inherited from GenericSearchUnit< state, action, environment > | |
int | nodesExpanded |
int | nodesTouched |
std::vector< action > | moves |
GenericSearchAlgorithm< state, action, environment > * | algorithm |
Unit< state, action, environment > * | target |
state | loc |
state | goal |
state | lastloc |
double | targetTime |
double | lastTime |
bool | onTarget |
Definition at line 11 of file GenericPatrolUnit.h.
GenericPatrolUnit< state, action, environment >::GenericPatrolUnit | ( | state & | s, |
GenericSearchAlgorithm< state, action, environment > * | alg | ||
) |
Definition at line 100 of file GenericPatrolUnit.h.
References GenericPatrolUnit< state, action, environment >::algorithm, GenericPatrolUnit< state, action, environment >::counter, GenericPatrolUnit< state, action, environment >::currTarget, GenericPatrolUnit< state, action, environment >::drawUnit, GenericPatrolUnit< state, action, environment >::lastFailedMove, GenericPatrolUnit< state, action, environment >::locs, GenericPatrolUnit< state, action, environment >::name, GenericPatrolUnit< state, action, environment >::nodesExpanded, GenericPatrolUnit< state, action, environment >::nodesTouched, GenericPatrolUnit< state, action, environment >::numDirectionChanges, GenericPatrolUnit< state, action, environment >::numDirectionChangesCollisions, GenericPatrolUnit< state, action, environment >::numFailedMoves, GenericPatrolUnit< state, action, environment >::numPatrols, GenericPatrolUnit< state, action, environment >::oldDir, GenericPatrolUnit< state, action, environment >::oldDirColl, Unit< state, action, environment >::SetColor(), GenericPatrolUnit< state, action, environment >::totalDistance, GenericPatrolUnit< state, action, environment >::trimPath, and GenericPatrolUnit< state, action, environment >::trimWindow.
GenericPatrolUnit< state, action, environment >::GenericPatrolUnit | ( | state & | s, |
GenericSearchAlgorithm< state, action, environment > * | alg, | ||
GLfloat | _r, | ||
GLfloat | _g, | ||
GLfloat | _b | ||
) |
Definition at line 131 of file GenericPatrolUnit.h.
References GenericPatrolUnit< state, action, environment >::algorithm, Unit< state, action, environment >::b, GenericPatrolUnit< state, action, environment >::counter, GenericPatrolUnit< state, action, environment >::currTarget, GenericPatrolUnit< state, action, environment >::drawUnit, Unit< state, action, environment >::g, kStay, GenericPatrolUnit< state, action, environment >::lastFailedMove, GenericPatrolUnit< state, action, environment >::locs, GenericPatrolUnit< state, action, environment >::name, GenericPatrolUnit< state, action, environment >::nodesExpanded, GenericPatrolUnit< state, action, environment >::nodesTouched, GenericPatrolUnit< state, action, environment >::numDirectionChanges, GenericPatrolUnit< state, action, environment >::numDirectionChangesCollisions, GenericPatrolUnit< state, action, environment >::numFailedMoves, GenericPatrolUnit< state, action, environment >::numPatrols, GenericPatrolUnit< state, action, environment >::oldDir, GenericPatrolUnit< state, action, environment >::oldDirColl, Unit< state, action, environment >::r, GenericPatrolUnit< state, action, environment >::totalDistance, GenericPatrolUnit< state, action, environment >::trimPath, and GenericPatrolUnit< state, action, environment >::trimWindow.
|
privatevirtual |
Store path as a vector of actions.
??? Rename moves --> actions? Moves only for maps?
Reimplemented from GenericSearchUnit< state, action, environment >.
Definition at line 273 of file GenericPatrolUnit.h.
void GenericPatrolUnit< state, action, environment >::AddPatrolLocation | ( | state & | s | ) |
Definition at line 266 of file GenericPatrolUnit.h.
|
virtual |
Reimplemented from GenericSearchUnit< state, action, environment >.
Definition at line 370 of file GenericPatrolUnit.h.
state& GenericPatrolUnit< state, action, environment >::GetGoal | ( | ) |
|
inlinevirtual |
Reimplemented from GenericSearchUnit< state, action, environment >.
Definition at line 23 of file GenericPatrolUnit.h.
References GenericSearchUnit< state, action, environment >::GetGoal().
|
inlinevirtual |
Reimplemented from GenericSearchUnit< state, action, environment >.
Definition at line 17 of file GenericPatrolUnit.h.
References GenericPatrolUnit< state, action, environment >::loc.
|
inlinevirtual |
Reimplemented from GenericSearchUnit< state, action, environment >.
Definition at line 15 of file GenericPatrolUnit.h.
References GenericPatrolUnit< state, action, environment >::name.
|
private |
Definition at line 241 of file GenericPatrolUnit.h.
References path.
|
virtual |
log any final one-time stats before a simulation is ended
Reimplemented from Unit< state, action, environment >.
Definition at line 405 of file GenericPatrolUnit.h.
References StatCollection::AddStat().
|
virtual |
log an stats that may have been computed during the last run
Reimplemented from Unit< state, action, environment >.
Definition at line 385 of file GenericPatrolUnit.h.
References StatCollection::AddStat(), and StatCollection::SumStat().
|
virtual |
Reimplemented from GenericSearchUnit< state, action, environment >.
Definition at line 160 of file GenericPatrolUnit.h.
|
virtual |
Reimplemented from GenericSearchUnit< state, action, environment >.
Definition at line 285 of file GenericPatrolUnit.h.
References PublicUnitInfo< state, action, environment >::currentState, fgreater(), SimulationInfo< state, action, environment >::GetCurrentUnit(), SimulationInfo< state, action, environment >::GetPublicUnitInfo(), SimulationInfo< state, action, environment >::GetSimulationTime(), PublicUnitInfo< state, action, environment >::lastState, PublicUnitInfo< state, action, environment >::lastTime, and PublicUnitInfo< state, action, environment >::nextTime.
|
inline |
Set whether we want to draw the unit.
Default "true".
Definition at line 53 of file GenericPatrolUnit.h.
References GenericPatrolUnit< state, action, environment >::drawUnit.
|
inline |
Definition at line 16 of file GenericPatrolUnit.h.
References GenericPatrolUnit< state, action, environment >::name.
|
inline |
Definition at line 28 of file GenericPatrolUnit.h.
References GenericPatrolUnit< state, action, environment >::numPatrols.
|
inline |
Set whether we want to trim the planned path.
Definition at line 35 of file GenericPatrolUnit.h.
References GenericPatrolUnit< state, action, environment >::trimPath.
|
inline |
Set the window at which we want to trim the planned path.
If trimPath is set to true, this will determine where the path is trimmed
Definition at line 45 of file GenericPatrolUnit.h.
References d, and GenericPatrolUnit< state, action, environment >::trimWindow.
|
virtual |
Reimplemented from GenericSearchUnit< state, action, environment >.
Definition at line 332 of file GenericPatrolUnit.h.
References SimulationInfo< state, action, environment >::GetSimulationTime().
|
private |
Definition at line 74 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit().
|
private |
Definition at line 63 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit().
|
private |
Definition at line 76 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit().
|
private |
Definition at line 96 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit(), and GenericPatrolUnit< state, action, environment >::SetDrawUnit().
|
private |
Definition at line 66 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit().
|
private |
Definition at line 61 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GetLocation().
|
private |
Definition at line 72 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit().
|
private |
Definition at line 71 of file GenericPatrolUnit.h.
|
private |
Definition at line 91 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit(), GenericPatrolUnit< state, action, environment >::GetName(), and GenericPatrolUnit< state, action, environment >::SetName().
|
private |
Definition at line 77 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit().
|
private |
Definition at line 84 of file GenericPatrolUnit.h.
|
private |
Definition at line 78 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit().
|
private |
Definition at line 85 of file GenericPatrolUnit.h.
|
private |
Definition at line 80 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit().
|
private |
Definition at line 81 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit().
|
private |
Definition at line 88 of file GenericPatrolUnit.h.
|
private |
Definition at line 87 of file GenericPatrolUnit.h.
|
private |
Definition at line 79 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit().
|
private |
Definition at line 86 of file GenericPatrolUnit.h.
|
private |
Definition at line 62 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit(), and GenericPatrolUnit< state, action, environment >::SetNumPatrols().
|
private |
Definition at line 64 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit().
|
private |
Definition at line 64 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit().
|
private |
Definition at line 65 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit().
|
private |
Definition at line 89 of file GenericPatrolUnit.h.
|
private |
Definition at line 93 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit(), and GenericPatrolUnit< state, action, environment >::SetTrimPath().
|
private |
Definition at line 94 of file GenericPatrolUnit.h.
Referenced by GenericPatrolUnit< state, action, environment >::GenericPatrolUnit(), and GenericPatrolUnit< state, action, environment >::SetTrimWindow().