TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cherrypi::Behavior Class Referenceabstract

A Behavior is a self-contained situational micro rule. More...

#include <behavior.h>

Inherited by cherrypi::BehaviorSeries.

Public Member Functions

void perform (Agent &agent)
 Checks if a unit still needs a micro decision. If so, invokes onPerform() More...
 
virtual ~Behavior ()=default
 

Protected Member Functions

MicroAction doAction (std::shared_ptr< UPCTuple > upc) const
 Convenience method: Form a MicroAction reflecting a decision to issue a UPC for this unit. More...
 
virtual MicroAction onPerform (Agent &)=0
 Decide what to do with a unit that has not yet been controlled by a Behavior. More...
 

Protected Attributes

const MicroAction pass = MicroAction()
 Convenience: A MicroAction reflecting a decision to ignore this unit and let another Behavior control it. More...
 
const MicroAction doNothing = doAction(nullptr)
 Convenience: A MicroAction reflecting a decision to do nothing with this unit and let no other Behavior control it. More...
 

Detailed Description

A Behavior is a self-contained situational micro rule.

Constructor & Destructor Documentation

virtual cherrypi::Behavior::~Behavior ( )
virtualdefault

Member Function Documentation

MicroAction cherrypi::Behavior::doAction ( std::shared_ptr< UPCTuple upc) const
inlineprotected

Convenience method: Form a MicroAction reflecting a decision to issue a UPC for this unit.

virtual MicroAction cherrypi::Behavior::onPerform ( Agent )
protectedpure virtual

Decide what to do with a unit that has not yet been controlled by a Behavior.

Implemented in cherrypi::BehaviorSeries.

void cherrypi::Behavior::perform ( Agent agent)

Checks if a unit still needs a micro decision. If so, invokes onPerform()

Member Data Documentation

const MicroAction cherrypi::Behavior::doNothing = doAction(nullptr)
protected

Convenience: A MicroAction reflecting a decision to do nothing with this unit and let no other Behavior control it.

const MicroAction cherrypi::Behavior::pass = MicroAction()
protected

Convenience: A MicroAction reflecting a decision to ignore this unit and let another Behavior control it.


The documentation for this class was generated from the following files: