From 8c6a2bf32731cc76f545e1f2fca44127ecbe66db Mon Sep 17 00:00:00 2001 From: sp Date: Mon, 8 Jan 2024 13:37:18 +0100 Subject: [PATCH] moved probIntended to Grid members --- util/Grid.cpp | 6 +++--- util/Grid.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/util/Grid.cpp b/util/Grid.cpp index d3e2d49..eb4ef38 100644 --- a/util/Grid.cpp +++ b/util/Grid.cpp @@ -11,8 +11,8 @@ prism::ModelType GridOptions::getModelType() const return prism::ModelType::MDP; } -Grid::Grid(cells gridCells, cells background, const GridOptions &gridOptions, const std::map &stateRewards, const float faultyProbability) - : allGridCells(gridCells), background(background), gridOptions(gridOptions), stateRewards(stateRewards), faultyProbability(faultyProbability) +Grid::Grid(cells gridCells, cells background, const GridOptions &gridOptions, const std::map &stateRewards, const float probIntended, const float faultyProbability) + : allGridCells(gridCells), background(background), gridOptions(gridOptions), stateRewards(stateRewards), probIntended(probIntended), faultyProbability(faultyProbability) { cell max = allGridCells.at(allGridCells.size() - 1); maxBoundaries = std::make_pair(max.row - 1, max.column - 1); @@ -159,7 +159,7 @@ void Grid::printToPrism(std::ostream& os, std::vector& configurat std::string agentName = agentNames.at(0); prism::PrismFormulaPrinter formulas(os, wallRestrictions, walls, boxes, balls, lockedDoors, unlockedDoors, keys, slipperyTiles, lava, goals); - prism::PrismModulesPrinter modules(os, modelType, maxBoundaries, boxes, balls, lockedDoors, unlockedDoors, keys, slipperyTiles, agentNameAndPositionMap, configuration, faultyProbability); + prism::PrismModulesPrinter modules(os, modelType, maxBoundaries, boxes, balls, lockedDoors, unlockedDoors, keys, slipperyTiles, agentNameAndPositionMap, configuration, probIntended, faultyProbability); modules.printModelType(modelType); for(const auto &agentName : agentNames) { diff --git a/util/Grid.h b/util/Grid.h index 1afd30c..eb95437 100644 --- a/util/Grid.h +++ b/util/Grid.h @@ -22,7 +22,7 @@ struct GridOptions { class Grid { public: - Grid(cells gridCells, cells background, const GridOptions &gridOptions, const std::map &stateRewards = {}, const float faultyProbability = 0); + Grid(cells gridCells, cells background, const GridOptions &gridOptions, const std::map &stateRewards = {}, const float probIntended = 1.0, const float faultyProbability = 0); cells getGridCells(); @@ -65,5 +65,6 @@ class Grid { std::map backgroundTiles; std::map stateRewards; + const float probIntended; const float faultyProbability; };