Browse Source

changed behaviour when moving against wall

overwrites
sp 2 weeks ago
parent
commit
a3413fe990
  1. 5
      util/Grid.cpp
  2. 10
      util/PrismModulesPrinter.cpp

5
util/Grid.cpp

@ -181,12 +181,11 @@ void Grid::printToPrism(std::ostream& os, std::vector<Configuration>& configurat
}
if(agentNameAndPositionMap.size() > 1) formulas.printCollisionFormula(agentName);
formulas.printInitStruct();
os << "const int WIDTH = " << maxBoundaries.first << ";\n";
os << "const int HEIGHT = " << maxBoundaries.second << ";\n";
modules.print();
//if(!stateRewards.empty()) {
// modules.printRewards(os, agentName, stateRewards, lava, goals, backgroundTiles);
//}

10
util/PrismModulesPrinter.cpp

@ -5,10 +5,10 @@
#include <stdexcept>
std::string northUpdate(const AgentName &a) { return "(row"+a+"'=row"+a+"-1)"; }
std::string southUpdate(const AgentName &a) { return "(row"+a+"'=row"+a+"+1)"; }
std::string eastUpdate(const AgentName &a) { return "(col"+a+"'=col"+a+"+1)"; }
std::string westUpdate(const AgentName &a) { return "(col"+a+"'=col"+a+"-1)"; }
std::string northUpdate(const AgentName &a) { return "min(WIDTH, max(1, row"+a+"'=row"+a+"-1))"; }
std::string southUpdate(const AgentName &a) { return "min(WIDTH, max(1, row"+a+"'=row"+a+"+1))"; }
std::string eastUpdate(const AgentName &a) { return "min(HEIGHT, max(1, col"+a+"'=col"+a+"+1))"; }
std::string westUpdate(const AgentName &a) { return "min(HEIGHT, max(1, col"+a+"'=col"+a+"-1))"; }
namespace prism {
@ -250,7 +250,7 @@ namespace prism {
if(slipperyBehaviour()) guard += " & !" + a + "IsOnSlippery";
if(anyLava) guard += " & !" + a + "IsOnLava";
if(anyGoals && a == "Agent") guard += " & !" + a + "IsOnGoal";
guard += " & !" + a + "CannotMove" + direction + "Wall";
//guard += " & !" + a + "CannotMove" + direction + "Wall";
if(anyPortableObject() || !lockedDoors.empty() || !unlockedDoors.empty()) guard += " & !" + a + "CannotMoveConditionally";
guard += " -> ";
return guard;

|||||||
100:0
Loading…
Cancel
Save