Browse Source

set modelType based on the amount of agents

pull/16/head
sp 10 months ago
parent
commit
12b08ab068
  1. 6
      util/Grid.cpp
  2. 4
      util/Grid.h

6
util/Grid.cpp

@ -61,6 +61,12 @@ Grid::Grid(cells gridCells, cells background, const std::map<coordinates, float>
backgroundTiles.emplace(color, cellsOfColor); 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) { std::ostream& operator<<(std::ostream& os, const Grid& grid) {

4
util/Grid.h

@ -27,12 +27,12 @@ class Grid {
friend std::ostream& operator<<(std::ostream& os, const Grid &grid); friend std::ostream& operator<<(std::ostream& os, const Grid &grid);
private: private:
GridOptions gridOptions;
cells allGridCells; cells allGridCells;
cells background; cells background;
coordinates maxBoundaries; coordinates maxBoundaries;
prism::ModelType modelType;
cell agent; cell agent;
cells adversaries; cells adversaries;
AgentNameAndPositionMap agentNameAndPositionMap; AgentNameAndPositionMap agentNameAndPositionMap;

Loading…
Cancel
Save