Records bot internal state and dumps it to a file readable by CherryVis.
More...
#include <cherryvisdumper.h>
Inherits cherrypi::Module.
|
virtual | ~CherryVisDumperModule ()=default |
|
void | setReplayFile (std::string const &replayFile) |
|
virtual void | step (State *s) override |
|
virtual void | onGameStart (State *s) override |
|
virtual void | onGameEnd (State *s) override |
|
Logger & | getGlobalLogger () |
|
Logger & | getUnitLogger (Unit *u) |
|
void | onDrawCommand (State *s, tc::Client::Command const &command) |
|
template<typename T , typename V , typename W > |
void | addTree (State *s, std::string const &name, T dump_node, V get_children, W root) |
|
void | dumpTensorsSummary (State *s, std::unordered_map< std::string, ag::Variant > const &tensors) |
|
void | dumpTerrainHeatmaps (State *s, std::unordered_map< std::string, ag::Variant > const &tensors, std::array< int, 2 > const &topLeftPixel, std::array< float, 2 > const &scalingToPixels) |
| Dumps a heatmap that can be displayed as overlay of the terrain. More...
|
|
void | dumpGameValue (State *s, std::string const &key, float value) |
|
virtual | ~Module ()=default |
|
virtual void | setPlayer (BasePlayer *p) |
|
void | setName (std::string name) |
|
std::string | name () |
|
|
static void | writeGameSummary (State *final_state, std::string const &file) |
|
static std::string | parseReplayFileName (std::string name) |
|
template<typename T , typename... Args> |
static std::shared_ptr< T > | make (Args &&...args) |
|
static std::shared_ptr< Module > | make (std::string const &typeName) |
|
static std::string | makeName (std::type_index const &type) |
|
Records bot internal state and dumps it to a file readable by CherryVis.
virtual cherrypi::CherryVisDumperModule::~CherryVisDumperModule |
( |
| ) |
|
|
virtualdefault |
template<typename T , typename V , typename W >
void cherrypi::CherryVisDumperModule::addTree |
( |
State * |
s, |
|
|
std::string const & |
name, |
|
|
T |
dump_node, |
|
|
V |
get_children, |
|
|
W |
root |
|
) |
| |
void cherrypi::CherryVisDumperModule::dumpGameUpcs |
( |
State * |
s | ) |
|
|
protected |
void cherrypi::CherryVisDumperModule::dumpGameValue |
( |
State * |
s, |
|
|
std::string const & |
key, |
|
|
float |
value |
|
) |
| |
|
inline |
void cherrypi::CherryVisDumperModule::dumpTensorsSummary |
( |
State * |
s, |
|
|
std::unordered_map< std::string, ag::Variant > const & |
tensors |
|
) |
| |
void cherrypi::CherryVisDumperModule::dumpTerrainHeatmaps |
( |
State * |
s, |
|
|
std::unordered_map< std::string, ag::Variant > const & |
tensors, |
|
|
std::array< int, 2 > const & |
topLeftPixel, |
|
|
std::array< float, 2 > const & |
scalingToPixels |
|
) |
| |
Dumps a heatmap that can be displayed as overlay of the terrain.
- Parameters
-
std::string cherrypi::CherryVisDumperModule::getBoardValueAsString |
( |
Blackboard::Data const & |
value | ) |
|
|
protected |
Logger& cherrypi::CherryVisDumperModule::getGlobalLogger |
( |
| ) |
|
|
inline |
nlohmann::json cherrypi::CherryVisDumperModule::getTensor1d |
( |
at::Tensor const & |
t | ) |
|
|
protected |
nlohmann::json cherrypi::CherryVisDumperModule::getTensorSummary |
( |
std::string const & |
name, |
|
|
at::Tensor const & |
t |
|
) |
| |
|
protected |
Logger& cherrypi::CherryVisDumperModule::getUnitLogger |
( |
Unit * |
u | ) |
|
|
inline |
int32_t cherrypi::CherryVisDumperModule::getUnitTaskId |
( |
State * |
s, |
|
|
Unit * |
unit |
|
) |
| |
|
protected |
void cherrypi::CherryVisDumperModule::onDrawCommand |
( |
State * |
s, |
|
|
tc::Client::Command const & |
command |
|
) |
| |
void cherrypi::CherryVisDumperModule::onGameEnd |
( |
State * |
s | ) |
|
|
overridevirtual |
void cherrypi::CherryVisDumperModule::onGameStart |
( |
State * |
s | ) |
|
|
overridevirtual |
std::string cherrypi::CherryVisDumperModule::parseReplayFileName |
( |
std::string |
name | ) |
|
|
static |
void cherrypi::CherryVisDumperModule::setReplayFile |
( |
std::string const & |
replayFile | ) |
|
|
inline |
void cherrypi::CherryVisDumperModule::step |
( |
State * |
s | ) |
|
|
overridevirtual |
void cherrypi::CherryVisDumperModule::writeGameSummary |
( |
State * |
final_state, |
|
|
std::string const & |
file |
|
) |
| |
|
static |
void cherrypi::CherryVisDumperModule::writeTensors |
( |
std::string const & |
dumpDirectory | ) |
|
|
protected |
void cherrypi::CherryVisDumperModule::writeTrees |
( |
std::string const & |
dumpDirectory | ) |
|
|
protected |
std::string cherrypi::CherryVisDumperModule::replayFileName_ |
|
protected |
TraceData cherrypi::CherryVisDumperModule::trace_ |
|
protected |
The documentation for this class was generated from the following files: