#pragma once #include #include #include #include #include "MinigridGrammar.h" #include "PrismModulesPrinter.h" struct GridOptions { std::vector agentsToBeConsidered; std::vector agentsWithView; std::vector agentsWithProbabilisticBehaviour; std::vector probabilitiesForActions; }; class Grid { public: Grid(cells gridCells, cells background, const GridOptions &gridOptions, const std::map &stateRewards = {}); cells getGridCells(); bool isBlocked(coordinates p); bool isWall(coordinates p); bool isLockedDoor(coordinates p); bool isKey(coordinates p); bool isBox(coordinates p); void printToPrism(std::ostream &os, const prism::ModelType& modelType); 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; cells walls; cells floor; cells slipperyNorth; cells slipperyEast; cells slipperySouth; cells slipperyWest; cells lockedDoors; cells boxes; cells lava; cells goals; cells keys; std::map backgroundTiles; std::map stateRewards; };