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

#include <tactics.h>

Public Member Functions

void createTacticsGroups (State *state, std::vector< uint8_t > &inBaseArea)
 
void collectMapNodesCoveredByGroups (State *state)
 
void assignUnits (State *state, std::unordered_set< Unit * > &wasInAGroup, std::vector< Unit * > leftoverWorkers, std::vector< std::shared_ptr< Task >> &tasks)
 
TacticsFightScores combatSimFightPrediction (State *state, TacticsGroup &g, std::unordered_map< Unit *, int > &nmyInStaticDefenceRange, std::unordered_map< Unit *, int > &nmyAlmostInStaticDefenceRange)
 
UnitgetBestEnemyTarget (State *state, TacticsGroup &g, Unit *u, std::unordered_map< Unit *, int > &meleeTargetCount, std::unordered_map< Unit *, int > &lastTargetInRange, bool &anySpiderMinesNearby)
 
bool shouldRunFromHiddenTarget (TacticsGroup &g, Unit *u, Unit *target)
 
Position idleGroupTargetPos (State *state, Unit *u, std::vector< uint8_t > &inBaseArea)
 
Position findRunPos (State *state, Unit *u, std::vector< uint16_t > &fleeScore)
 
Position scoutGroupTargetPos (State *state, TacticsGroup &g, Unit *u, std::unordered_map< Unit *, std::pair< int, Position >> &scoutTarget, std::ranlux24 &rngEngine)
 
Position searchAndDestroyGroupTargetPos (State *state, Unit *u, std::unordered_map< Unit *, std::pair< int, Position >> &searchAndDestroyTarget, std::ranlux24 &rngEngine)
 

Public Attributes

int srcUpcId_
 
float insideGroupDistance_ = 4 * 16
 
uint8_t visitNumber_ = 0
 
std::vector< uint8_t > tileVisitTracker_
 
std::vector< uint8_t > tileSpotTakenTracker_
 
std::vector< TacticsMapNodenodeInsideGroupTracker_
 
std::vector< TacticsGroup * > nodeGroupEdgeTracker_
 
std::unordered_map< Unit *, TacticsGroup * > hardAssignedUnits_
 
std::unordered_map< Unit *, TacticsGroup * > softAssignedUnits_
 
std::list< TacticsGroupgroups_
 

Member Function Documentation

void cherrypi::TacticsState::assignUnits ( State state,
std::unordered_set< Unit * > &  wasInAGroup,
std::vector< Unit * >  leftoverWorkers,
std::vector< std::shared_ptr< Task >> &  tasks 
)
void cherrypi::TacticsState::collectMapNodesCoveredByGroups ( State state)
TacticsFightScores cherrypi::TacticsState::combatSimFightPrediction ( State state,
TacticsGroup g,
std::unordered_map< Unit *, int > &  nmyInStaticDefenceRange,
std::unordered_map< Unit *, int > &  nmyAlmostInStaticDefenceRange 
)
void cherrypi::TacticsState::createTacticsGroups ( State state,
std::vector< uint8_t > &  inBaseArea 
)
Position cherrypi::TacticsState::findRunPos ( State state,
Unit u,
std::vector< uint16_t > &  fleeScore 
)
Unit * cherrypi::TacticsState::getBestEnemyTarget ( State state,
TacticsGroup g,
Unit u,
std::unordered_map< Unit *, int > &  meleeTargetCount,
std::unordered_map< Unit *, int > &  lastTargetInRange,
bool &  anySpiderMinesNearby 
)
Position cherrypi::TacticsState::idleGroupTargetPos ( State state,
Unit u,
std::vector< uint8_t > &  inBaseArea 
)
Position cherrypi::TacticsState::scoutGroupTargetPos ( State state,
TacticsGroup g,
Unit u,
std::unordered_map< Unit *, std::pair< int, Position >> &  scoutTarget,
std::ranlux24 &  rngEngine 
)
Position cherrypi::TacticsState::searchAndDestroyGroupTargetPos ( State state,
Unit u,
std::unordered_map< Unit *, std::pair< int, Position >> &  searchAndDestroyTarget,
std::ranlux24 &  rngEngine 
)
bool cherrypi::TacticsState::shouldRunFromHiddenTarget ( TacticsGroup g,
Unit u,
Unit target 
)

Member Data Documentation

std::list<TacticsGroup> cherrypi::TacticsState::groups_
std::unordered_map<Unit*, TacticsGroup*> cherrypi::TacticsState::hardAssignedUnits_
float cherrypi::TacticsState::insideGroupDistance_ = 4 * 16
std::vector<TacticsGroup*> cherrypi::TacticsState::nodeGroupEdgeTracker_
Initial value:
= std::vector<TacticsGroup*>(
std::vector<TacticsMapNode> cherrypi::TacticsState::nodeInsideGroupTracker_
Initial value:
=
std::vector<TacticsMapNode>(
std::unordered_map<Unit*, TacticsGroup*> cherrypi::TacticsState::softAssignedUnits_
int cherrypi::TacticsState::srcUpcId_
std::vector<uint8_t> cherrypi::TacticsState::tileSpotTakenTracker_
Initial value:
std::vector<uint8_t> cherrypi::TacticsState::tileVisitTracker_
Initial value:
uint8_t cherrypi::TacticsState::visitNumber_ = 0

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