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.

63 lines
1.5 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. 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 lockedDoors;
  38. cells unlockedDoors;
  39. cells boxes;
  40. cells balls;
  41. cells lava;
  42. cells goals;
  43. cells keys;
  44. std::map<Color, cells> backgroundTiles;
  45. std::map<coordinates, float> stateRewards;
  46. const float probIntended;
  47. const float faultyProbability;
  48. };