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

Determines positions for buildings. More...

#include <buildingplacer.h>

Inherits cherrypi::Module.

Public Member Functions

virtual ~BuildingPlacerModule ()=default
 
virtual void step (State *s) 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 ()
 
virtual void onGameEnd (State *s)
 

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< Modulemake (std::string const &typeName)
 
static std::string makeName (std::type_index const &type)
 
- Protected Member Functions inherited from cherrypi::Module
 Module ()
 
- Protected Attributes inherited from cherrypi::Module
BasePlayerplayer_
 
std::string name_
 

Detailed Description

Determines positions for buildings.

For buildings that require a worker to build them, BuilderModule requires the UPC to specify a Dirac position. This module's job is to determine suitable positions based on an existing distribution over positions and various heuristics (via builderhelpers).

Optionally, BuildingPlacerModel can be used for building placement. The model location is specified via the -bp_model command-line flag; if a valid model is found at the specified location, it will be loaded and used. If GPU support is available, the model will be run on the GPU.

ProxyTasks are used to track execution of the downstream production task. If the production task will fail (e.g. because the location became unbuildable), retries will be attempted until the ProxyTask is cancelled (e.g. from an upstream module).

This module will also reserve build tiles as unbuildable via TilesInfo.

Constructor & Destructor Documentation

virtual cherrypi::BuildingPlacerModule::~BuildingPlacerModule ( )
virtualdefault

Member Function Documentation

void cherrypi::BuildingPlacerModule::onGameStart ( State state)
overridevirtual

Reimplemented from cherrypi::Module.

void cherrypi::BuildingPlacerModule::step ( State s)
overridevirtual

Reimplemented from cherrypi::Module.


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