Describes a sample that can be used to learn the BuildingPlacerModel.
More...
#include <buildingplacer.h>
Describes a sample that can be used to learn the BuildingPlacerModel.
cherrypi::BuildingPlacerSample::BuildingPlacerSample |
( |
| ) |
|
|
default |
virtual cherrypi::BuildingPlacerSample::~BuildingPlacerSample |
( |
| ) |
|
|
virtualdefault |
cherrypi::BuildingPlacerSample::BuildingPlacerSample |
( |
State * |
state, |
|
|
std::shared_ptr< UPCTuple > |
upc, |
|
|
StaticData * |
staticData = nullptr |
|
) |
| |
Constructs a new sample with features extracted from the given state.
cherrypi::BuildingPlacerSample::BuildingPlacerSample |
( |
State * |
state, |
|
|
Position |
action, |
|
|
std::shared_ptr< UPCTuple > |
upc |
|
) |
| |
Constructs a new sample with features extracted from the given state, along with a target action.
int64_t cherrypi::BuildingPlacerSample::actionToOffset |
( |
Position |
pos, |
|
|
int |
scale = 1 |
|
) |
| const |
Maps an action (position) in walktiles to offset in flattened output or target tensor.
"scale" will be accounted for in addtion to the scale of the extracted features.
std::vector< torch::Tensor > cherrypi::BuildingPlacerSample::networkInput |
( |
| ) |
const |
Position cherrypi::BuildingPlacerSample::offsetToAction |
( |
int64_t |
offset, |
|
|
int |
scale = 1 |
|
) |
| const |
Maps offset in flattened output or target tensor to a walktile position.
"scale" will be accounted for in addtion to the scale of the extracted features.
template<class Archive >
void cherrypi::BuildingPlacerSample::serialize |
( |
Archive & |
ar, |
|
|
uint32_t const |
version |
|
) |
| |
|
inline |
Position cherrypi::BuildingPlacerSample::action |
Model target output: a single position (in walk tiles)
int cherrypi::BuildingPlacerSample::areaId = -1 |
Area ID; optional, for easier baseline computations.
struct { ... } cherrypi::BuildingPlacerSample::features |
State-dependent input features.
FrameNum cherrypi::BuildingPlacerSample::frame |
Frame number of this sample.
int constexpr cherrypi::BuildingPlacerSample::kMapSize = 512 |
|
static |
int cherrypi::BuildingPlacerSample::kNumMapChannels = 8 |
|
static |
Various map features (plus UPC probabilities), build tile resolution.
std::string cherrypi::BuildingPlacerSample::mapName |
Map name (file name for replays); optional.
std::string cherrypi::BuildingPlacerSample::playerName |
UnitType cherrypi::BuildingPlacerSample::type = (+tc::BW::UnitType::MAX)._to_integral() |
Unit type IDs that are present.
torch::Tensor cherrypi::BuildingPlacerSample::validLocations |
Float tensor that contains all valid build locations wrt the input UPC (1 = valid, 0 = invalid).
This is intended to be used as a mask for the model output.
The documentation for this struct was generated from the following files: