You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.5 KiB

6 months ago
  1. #pragma once
  2. #include <iostream>
  3. #include <fstream>
  4. #include <map>
  5. #include <utility>
  6. #include "MinigridGrammar.h"
  7. #include "PrismPrinter.h"
  8. #include "PrismModulesPrinter.h"
  9. #include "PrismFormulaPrinter.h"
  10. #include "ConfigYaml.h"
  11. class Grid {
  12. public:
  13. Grid(cells gridCells, cells background, const std::map<coordinates, float> &stateRewards = {}, const float probIntended = 1.0, const float faultyProbability = 0, prism::ModelType mType = prism::ModelType::MDP);
  14. cells getGridCells();
  15. bool isBlocked(coordinates p);
  16. bool isWall(coordinates p);
  17. void printToPrism(std::ostream &os, std::vector<Configuration>& configuration);
  18. void applyOverwrites(std::string& str, std::vector<Configuration>& configuration);
  19. std::array<bool, 8> getWalkableDirOf8Neighborhood(cell c);
  20. friend std::ostream& operator<<(std::ostream& os, const Grid &grid);
  21. private:
  22. cells allGridCells;
  23. cells background;
  24. coordinates maxBoundaries;
  25. prism::ModelType modelType;
  26. cell agent;
  27. cells adversaries;
  28. AgentNameAndPositionMap agentNameAndPositionMap;
  29. KeyNameAndPositionMap keyNameAndPositionMap;
  30. cells walls;
  31. cells floor;
  32. cells slipperyNorth;
  33. cells slipperyEast;
  34. cells slipperySouth;
  35. cells slipperyWest;
  36. cells lockedDoors;
  37. cells unlockedDoors;
  38. cells boxes;
  39. cells balls;
  40. cells lava;
  41. cells goals;
  42. cells keys;
  43. std::map<Color, cells> backgroundTiles;
  44. std::map<coordinates, float> stateRewards;
  45. const float probIntended;
  46. const float faultyProbability;
  47. };