From 12b08ab068d44c3c95b7b946d25bbe415e4ef588 Mon Sep 17 00:00:00 2001 From: sp Date: Sat, 13 Jan 2024 18:25:14 +0100 Subject: [PATCH] set modelType based on the amount of agents --- util/Grid.cpp | 8 +++++++- util/Grid.h | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/util/Grid.cpp b/util/Grid.cpp index d5e454e..8a02c5e 100644 --- a/util/Grid.cpp +++ b/util/Grid.cpp @@ -61,6 +61,12 @@ Grid::Grid(cells gridCells, cells background, const std::map backgroundTiles.emplace(color, cellsOfColor); } } + + if(adversaries.empty()) { + modelType = prism::ModelType::MDP; + } else { + modelType = prism::ModelType::SMG; + } } std::ostream& operator<<(std::ostream& os, const Grid& grid) { @@ -97,7 +103,7 @@ void Grid::applyOverwrites(std::string& str, std::vector& configu } for (auto& index : config.indexes_) { size_t start_pos; - std::string search; + std::string search; if (config.type_ == ConfigType::Formula) { search = "formula " + config.identifier_; diff --git a/util/Grid.h b/util/Grid.h index 7e890d3..da593ba 100644 --- a/util/Grid.h +++ b/util/Grid.h @@ -27,12 +27,12 @@ class Grid { friend std::ostream& operator<<(std::ostream& os, const Grid &grid); private: - GridOptions gridOptions; - cells allGridCells; cells background; coordinates maxBoundaries; + prism::ModelType modelType; + cell agent; cells adversaries; AgentNameAndPositionMap agentNameAndPositionMap;