Browse Source

added model type inference

pull/3/head
Thomas Knoll 1 year ago
parent
commit
4dd5e07d02
  1. 2
      main.cpp
  2. 9
      util/Grid.cpp
  3. 2
      util/Grid.h

2
main.cpp

@ -167,7 +167,7 @@ int main(int argc, char* argv[]) {
//grid.printToPrism(std::cout, prism::ModelType::MDP);
std::stringstream ss;
// grid.printToPrism(file, configurations ,prism::ModelType::MDP);
grid.printToPrism(ss, configurations ,prism::ModelType::MDP);
grid.printToPrism(ss, configurations , gridOptions.getModelType());
std::string str = ss.str();
grid.applyOverwrites(str, configurations);
file << str;

9
util/Grid.cpp

@ -2,6 +2,15 @@
#include <algorithm>
prism::ModelType GridOptions::getModelType() const
{
if (agentsWithView.size() > 1) {
return prism::ModelType::SMG;
}
return prism::ModelType::MDP;
}
Grid::Grid(cells gridCells, cells background, const GridOptions &gridOptions, const std::map<coordinates, float> &stateRewards)
: allGridCells(gridCells), background(background), gridOptions(gridOptions), stateRewards(stateRewards)
{

2
util/Grid.h

@ -15,6 +15,8 @@ struct GridOptions {
std::vector<AgentName> agentsWithProbabilisticBehaviour;
std::vector<float> probabilitiesForActions;
bool enforceOneWays;
prism::ModelType getModelType() const;
};
class Grid {

Loading…
Cancel
Save