TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
|
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 |
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.
|
inline |
|
inlinevirtual |
|
pure virtual |
Implemented in cherrypi::SanityFilter, and cherrypi::AssignedUnitsFilter.