#pragma once #include #include #include #include #include "MinigridGrammar.h" #include "PrismModulesPrinter.h" #include "PrismFormulaPrinter.h" #include "ConfigYaml.h" struct GridOptions { std::vector agentsToBeConsidered; std::vector agentsWithView; std::vector agentsWithProbabilisticBehaviour; std::vector probabilitiesForActions; bool enforceOneWays; prism::ModelType getModelType() const; }; class Grid { public: Grid(cells gridCells, cells background, const GridOptions &gridOptions, const std::map &stateRewards = {}, const float faultyProbability = 0); cells getGridCells(); bool isBlocked(coordinates p); bool isWall(coordinates p); void printToPrism(std::ostream &os, std::vector& configuration, const prism::ModelType& modelType); void applyOverwrites(std::string& str, std::vector& configuration); std::array getWalkableDirOf8Neighborhood(cell c); friend std::ostream& operator<<(std::ostream& os, const Grid &grid); private: GridOptions gridOptions; cells allGridCells; cells background; coordinates maxBoundaries; cell agent; cells adversaries; AgentNameAndPositionMap agentNameAndPositionMap; KeyNameAndPositionMap keyNameAndPositionMap; cells walls; cells floor; cells slipperyNorth; cells slipperyEast; cells slipperySouth; cells slipperyWest; cells lockedDoors; cells unlockedDoors; cells boxes; cells balls; cells lava; cells goals; cells keys; std::map backgroundTiles; std::map stateRewards; float faultyProbability; };