TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
|
Module which controls ("micromanages") units into and out of combat. More...
#include <squadcombat.h>
Inherits cherrypi::Module.
Public Member Functions | |
virtual void | step (State *s) override |
void | enqueueModel (std::shared_ptr< MicroModel > model, std::string name) |
Adds a MicroModel to the end of the list of models which will be updated and solicited for UPCs. More... | |
std::shared_ptr< MicroModel > | getModel (std::string) |
virtual void | onGameEnd (State *state) override |
virtual void | onGameStart (State *state) override |
Public Member Functions inherited from cherrypi::Module | |
virtual | ~Module ()=default |
virtual void | setPlayer (BasePlayer *p) |
void | setName (std::string name) |
std::string | name () |
Protected Member Functions | |
bool | formNewSquad (std::shared_ptr< UPCTuple > sourceUpc, int sourceUpcId) |
Takes incoming UPCs (usually from the Tactics module) and forms clusters of units that fight collaboratively. More... | |
void | updateTask (std::shared_ptr< Task >) |
virtual BehaviorList | makeDeleteBehaviors () |
Produces new fight Behaviors for an Agent. More... | |
virtual BehaviorList | makeFleeBehaviors () |
Produces new flee Behaviors for an Agent. More... | |
Protected Member Functions inherited from cherrypi::Module | |
Module () | |
Protected Attributes | |
State * | state |
std::unordered_map< Unit const *, Agent > | agents_ |
Micromanagement state of our units. More... | |
std::unordered_map< Unit const *, EnemyState > | enemyStates_ |
Micromanagement state of enemy units. More... | |
std::unordered_map< std::string, std::shared_ptr< MicroModel > > | models_ |
Models for SquadCombat to solicit for unit UPCs. More... | |
Protected Attributes inherited from cherrypi::Module | |
BasePlayer * | player_ |
std::string | name_ |
Additional Inherited Members | |
Static Public Member Functions inherited from cherrypi::Module | |
template<typename T , typename... Args> | |
static std::shared_ptr< T > | make (Args &&...args) |
static std::shared_ptr< Module > | make (std::string const &typeName) |
static std::string | makeName (std::type_index const &type) |
Module which controls ("micromanages") units into and out of combat.
SquadCombat reads diffuse Delete ("Fight") or Flee UPCs from the Blackboard and reposts them as sharp UPCs for commands like Delete or Move.
SquadCombatModule is a thin orchestrator for micromanagement. Most of the micromanagement logic lives in the supporting classes of src/modules/squadcombat/
void cherrypi::SquadCombatModule::enqueueModel | ( | std::shared_ptr< MicroModel > | model, |
std::string | name | ||
) |
Adds a MicroModel to the end of the list of models which will be updated and solicited for UPCs.
|
protected |
Takes incoming UPCs (usually from the Tactics module) and forms clusters of units that fight collaboratively.
std::shared_ptr< MicroModel > cherrypi::SquadCombatModule::getModel | ( | std::string | name | ) |
|
protectedvirtual |
Produces new fight Behaviors for an Agent.
Intended for override by subclasses which insert baseline or ML-powered behaviors.
|
protectedvirtual |
Produces new flee Behaviors for an Agent.
Intended for override by subclasses which insert baseline or ML-powered behaviors.
|
overridevirtual |
Reimplemented from cherrypi::Module.
|
overridevirtual |
Reimplemented from cherrypi::Module.
|
overridevirtual |
Reimplemented from cherrypi::Module.
|
protected |
Micromanagement state of our units.
|
protected |
Micromanagement state of enemy units.
|
protected |
Models for SquadCombat to solicit for unit UPCs.
|
protected |