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.

67 lines
1.6 KiB

2 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);
  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. void setModelType(prism::ModelType type);
  20. std::array<bool, 8> getWalkableDirOf8Neighborhood(cell c);
  21. friend std::ostream& operator<<(std::ostream& os, const Grid &grid);
  22. private:
  23. cells allGridCells;
  24. cells background;
  25. coordinates maxBoundaries;
  26. prism::ModelType modelType;
  27. cell agent;
  28. cells adversaries;
  29. AgentNameAndPositionMap agentNameAndPositionMap;
  30. KeyNameAndPositionMap keyNameAndPositionMap;
  31. cells walls;
  32. cells floor;
  33. cells slipperyNorth;
  34. cells slipperyEast;
  35. cells slipperySouth;
  36. cells slipperyWest;
  37. cells slipperyNorthWest;
  38. cells slipperyNorthEast;
  39. cells slipperySouthWest;
  40. cells slipperySouthEast;
  41. cells lockedDoors;
  42. cells unlockedDoors;
  43. cells boxes;
  44. cells balls;
  45. cells lava;
  46. cells goals;
  47. cells keys;
  48. std::map<Color, cells> backgroundTiles;
  49. std::map<coordinates, float> stateRewards;
  50. const float probIntended;
  51. const float faultyProbability;
  52. };