TorchCraftAI
A bot for machine learning research on StarCraft: Brood War
|
Base class for providing scenarios. More...
#include <scenarioprovider.h>
Inherited by cherrypi::MicroScenarioProvider.
Public Member Functions | |
virtual | ~ScenarioProvider ()=default |
ScenarioProvider & | setMaxFrames (int value) |
The maximum number of steps to play before considering a scenario finished Defaults to -1, which indicates no maximum. More... | |
ScenarioProvider & | setGui (bool value) |
Specifies whether to run OpenBW headfully. More... | |
virtual std::pair< std::shared_ptr< BasePlayer >, std::shared_ptr< BasePlayer > > | startNewScenario (const std::function< void(BasePlayer *)> &setup1, const std::function< void(BasePlayer *)> &setup2)=0 |
Spawns a scenario. More... | |
virtual bool | isFinished (int currentStep) |
Check whether the scenario is finished. More... | |
Protected Member Functions | |
template<typename TPlayer > | |
void | loadMap (std::string const &map, tc::BW::Race race1, tc::BW::Race race2, GameType gameType, std::string const &replayPath=std::string()) |
Protected Attributes | |
int | maxFrame_ = 24 * 60 * 60 * 2 |
bool | gui_ = false |
std::shared_ptr< BasePlayer > | player1_ |
std::shared_ptr< BasePlayer > | player2_ |
std::shared_ptr< GameMultiPlayer > | game_ |
Base class for providing scenarios.
Returns a pair of players to be used by the training code.
Detects game end and cleans up after the scenario.
|
virtualdefault |
|
virtual |
Check whether the scenario is finished.
By default, return true whenever the number of frames is exceeded or one of the players don't have any units left
|
inlineprotected |
|
inline |
Specifies whether to run OpenBW headfully.
Takes effect only when spawning a new OpenBWProcess; so generally you want to invoke this before using the ScenarioProvider.
|
inline |
The maximum number of steps to play before considering a scenario finished Defaults to -1, which indicates no maximum.
|
pure virtual |
Spawns a scenario.
It takes as parameters the setup functions for both players (this should take care of adding modules), and returns the pointers to the created players
Implemented in cherrypi::MicroScenarioProvider.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |