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.

69 lines
1.8 KiB

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