TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
|
Tracks movement of a set of units to a target location. More...
#include <commandtrackers.h>
Inherits cherrypi::Tracker.
Public Member Functions | |
MovementTracker (std::unordered_set< Unit * > units, int targetX, int targetY, float mind=4.0f *2, int timeout=15) | |
Public Member Functions inherited from cherrypi::Tracker | |
Tracker (int timeout) | |
virtual | ~Tracker () |
TrackerStatus | status () const |
void | cancel () |
bool | failed () const |
bool | succeeded () const |
virtual bool | update (State *s) |
Updates the tracker. More... | |
Protected Member Functions | |
virtual bool | updateNotTracking (State *s) override |
Updates the tracker if its status is NotTracking. More... | |
virtual bool | updatePending (State *s) override |
Updates the tracker if its status is Pending. More... | |
virtual bool | updateOngoing (State *s) override |
Updates the tracker if its status is Ongoing. More... | |
Additional Inherited Members | |
Protected Attributes inherited from cherrypi::Tracker | |
TrackerStatus | status_ = TrackerStatus::NotTracking |
int | time_ = 0 |
int | timeout_ |
Tracks movement of a set of units to a target location.
Ongoing is defined as at least one unit being in movement. The tracker might switch back to Pending if no unit is moving. Success is defined in terms of units reaching the target location with the center of units being within mind
distance.
cherrypi::MovementTracker::MovementTracker | ( | std::unordered_set< Unit * > | units, |
int | targetX, | ||
int | targetY, | ||
float | mind = 4.0f * 2 , |
||
int | timeout = 15 |
||
) |
|
inlineoverrideprotectedvirtual |
Updates the tracker if its status is NotTracking.
Returns true if status has changed
Implements cherrypi::Tracker.
|
overrideprotectedvirtual |
Updates the tracker if its status is Ongoing.
Returns true if status has changed
Implements cherrypi::Tracker.
|
overrideprotectedvirtual |
Updates the tracker if its status is Pending.
Returns true if status has changed
Implements cherrypi::Tracker.