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.

65 lines
1.6 KiB

  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);
  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 slipperyNorthWest;
  37. cells slipperyNorthEast;
  38. cells slipperySouthWest;
  39. cells slipperySouthEast;
  40. cells lockedDoors;
  41. cells unlockedDoors;
  42. cells boxes;
  43. cells balls;
  44. cells lava;
  45. cells goals;
  46. cells keys;
  47. std::map<Color, cells> backgroundTiles;
  48. std::map<coordinates, float> stateRewards;
  49. const float probIntended;
  50. const float faultyProbability;
  51. };