Browse Source

print player structs

pull/1/head
sp 6 months ago
parent
commit
54af53e039
  1. 8
      util/PrismModulesPrinter.cpp
  2. 2
      util/PrismModulesPrinter.h

8
util/PrismModulesPrinter.cpp

@ -72,6 +72,12 @@ namespace prism {
}
}
if(agentNameAndPositionMap.size() > 1) {
for(const auto [agentName, index] : agentIndexMap) {
printPlayerStruct(agentName);
}
}
return os;
}
@ -485,7 +491,7 @@ namespace prism {
os << "\t[" << agentName << "_done]" << moveGuard(agentName) << agentName << "IsInGoal | " << agentName << "IsInLava -> (" << agentName << "Done'=true);\n";
}
void PrismModulesPrinter::printPlayerStruct(const AgentName &agentName, const std::vector<float> &probabilities, const std::set<std::string> &slipperyActions) {
void PrismModulesPrinter::printPlayerStruct(const AgentName &agentName) {
os << "player " << agentName << "\n\t";
bool first = true;
for(const auto [actionId, actionName] : agentNameActionMap.at(agentName)) {

2
util/PrismModulesPrinter.h

@ -63,7 +63,7 @@ namespace prism {
void printConstants(const std::vector<std::string> &constants);
void printDoneActions(const AgentName &agentName);
void printPlayerStruct(const AgentName &agentName, const std::vector<float> &probabilities = {}, const std::set<std::string> &slipperyActions = {});
void printPlayerStruct(const AgentName &agentName);
void printRewards(const AgentName &agentName, const std::map<coordinates, float> &stateRewards, const cells &lava, const cells &goals, const std::map<Color, cells> &backgroundTiles);
void printConfiguration(const std::vector<Configuration>& configurations);

Loading…
Cancel
Save