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

Base class for UPC filters. More...

#include <upcfilter.h>

Inherited by cherrypi::AssignedUnitsFilter, and cherrypi::SanityFilter.

Public Member Functions

 UPCFilter ()
 
virtual ~UPCFilter ()
 
virtual bool filter (State *state, std::shared_ptr< UPCTuple > upc, Module *origin)=0
 

Detailed Description

Base class for UPC filters.

Note that the ownership of UPCs are yielded to the blackboard when posted. These filters are then applied to each UPC to ensure validity. If Upcs are slightly incorrect but fixable, then they will be modified to comply with the specification. Otherwise, if they are wrong and we cannot fix them, the "filter" method should return false, indicating a wrong UPC. In that case, the corresponding UPC should not be posted in the blackboard.

Possible use cases for UPC filters are consistency checks (which would log a warning if simple conditions are violated, for example) or enforcing unit allocations according to a set of rules based on which tasks are currently holding on to units. See below for a concrete application of the latter.

Constructor & Destructor Documentation

cherrypi::UPCFilter::UPCFilter ( )
inline
virtual cherrypi::UPCFilter::~UPCFilter ( )
inlinevirtual

Member Function Documentation

virtual bool cherrypi::UPCFilter::filter ( State state,
std::shared_ptr< UPCTuple upc,
Module origin 
)
pure virtual

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