From 54af53e03943ecefc86bee96cb4b267bb7c97cb0 Mon Sep 17 00:00:00 2001 From: sp Date: Mon, 8 Jan 2024 16:50:21 +0100 Subject: [PATCH] print player structs --- util/PrismModulesPrinter.cpp | 8 +++++++- util/PrismModulesPrinter.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/util/PrismModulesPrinter.cpp b/util/PrismModulesPrinter.cpp index 4e73af2..430dd3c 100644 --- a/util/PrismModulesPrinter.cpp +++ b/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 &probabilities, const std::set &slipperyActions) { + void PrismModulesPrinter::printPlayerStruct(const AgentName &agentName) { os << "player " << agentName << "\n\t"; bool first = true; for(const auto [actionId, actionName] : agentNameActionMap.at(agentName)) { diff --git a/util/PrismModulesPrinter.h b/util/PrismModulesPrinter.h index eefaef8..a66d68f 100644 --- a/util/PrismModulesPrinter.h +++ b/util/PrismModulesPrinter.h @@ -63,7 +63,7 @@ namespace prism { void printConstants(const std::vector &constants); void printDoneActions(const AgentName &agentName); - void printPlayerStruct(const AgentName &agentName, const std::vector &probabilities = {}, const std::set &slipperyActions = {}); + void printPlayerStruct(const AgentName &agentName); void printRewards(const AgentName &agentName, const std::map &stateRewards, const cells &lava, const cells &goals, const std::map &backgroundTiles); void printConfiguration(const std::vector& configurations);