From 6bd0eee85ee5f2d9ec90a07482067c9a554e06fa Mon Sep 17 00:00:00 2001 From: sp Date: Sun, 14 Jan 2024 10:21:40 +0100 Subject: [PATCH] fixed column row issue in variable declaration --- util/PrismModulesPrinter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/PrismModulesPrinter.cpp b/util/PrismModulesPrinter.cpp index ad8617c..3d5adaa 100644 --- a/util/PrismModulesPrinter.cpp +++ b/util/PrismModulesPrinter.cpp @@ -104,8 +104,8 @@ namespace prism { void PrismModulesPrinter::printPortableObjectModule(const cell &object) { std::string identifier = capitalize(object.getColor()) + object.getType(); os << "\nmodule " << identifier << std::endl; - os << " x" << identifier << " : [-1.." << maxBoundaries.second << "] init " << object.column << ";\n"; - os << " y" << identifier << " : [-1.." << maxBoundaries.first << "] init " << object.row << ";\n"; + os << " x" << identifier << " : [-1.." << maxBoundaries.first << "] init " << object.column << ";\n"; + os << " y" << identifier << " : [-1.." << maxBoundaries.second << "] init " << object.row << ";\n"; os << " " << identifier << "PickedUp : bool;\n"; os << "\n"; @@ -171,8 +171,8 @@ namespace prism { void PrismModulesPrinter::printRobotModule(const AgentName &agentName, const coordinates &initialPosition) { os << "\nmodule " << agentName << std::endl; - os << " col" << agentName << " : [1.." << maxBoundaries.second << "] init " << initialPosition.second << ";\n"; - os << " row" << agentName << " : [1.." << maxBoundaries.first << "] init " << initialPosition.first << ";\n"; + os << " col" << agentName << " : [1.." << maxBoundaries.first << "] init " << initialPosition.first << ";\n"; + os << " row" << agentName << " : [1.." << maxBoundaries.second << "] init " << initialPosition.second << ";\n"; os << " view" << agentName << " : [0..3] init 1;\n"; printTurnActionsForRobot(agentName);