Browse Source

WIP: changed probabilities in main for testing

pull/1/head
sp 11 months ago
parent
commit
8cf91e700c
  1. 12
      main.cpp

12
main.cpp

@ -144,12 +144,13 @@ int main(int argc, char* argv[]) {
pos_iterator_t backgroundIter = backgroundFirst; pos_iterator_t backgroundIter = backgroundFirst;
pos_iterator_t backgroundLast(background.end()); pos_iterator_t backgroundLast(background.end());
MinigridParser<pos_iterator_t> backgroundParser(backgroundFirst); MinigridParser<pos_iterator_t> backgroundParser(backgroundFirst);
cells contentCells; cells contentCells;
cells backgroundCells; cells backgroundCells;
std::vector<Configuration> configurations; std::vector<Configuration> configurations;
std::map<coordinates, float> stateRewards; std::map<coordinates, float> stateRewards;
double faultyProbability;
float faultyProbability = 0.0;
float probIntended = 0.9;
try { try {
bool ok = phrase_parse(contentIter, contentLast, contentParser, qi::space, contentCells); bool ok = phrase_parse(contentIter, contentLast, contentParser, qi::space, contentCells);
@ -157,7 +158,7 @@ int main(int argc, char* argv[]) {
ok &= phrase_parse(backgroundIter, backgroundLast, backgroundParser, qi::space, backgroundCells); ok &= phrase_parse(backgroundIter, backgroundLast, backgroundParser, qi::space, backgroundCells);
// TODO } // TODO }
if (configFilename->is_set()) { if (configFilename->is_set()) {
YamlConfigParser parser(configFilename->value(0));
YamlConfigParser parser(configFilename->value(0));
configurations = parser.parseConfiguration(); configurations = parser.parseConfiguration();
} }
@ -181,8 +182,9 @@ int main(int argc, char* argv[]) {
} }
} }
if(ok) { if(ok) {
Grid grid(contentCells, backgroundCells, gridOptions, stateRewards, faultyProbability);
//grid.printToPrism(std::cout, prism::ModelType::MDP);
Grid grid(contentCells, backgroundCells, gridOptions, stateRewards, probIntended, faultyProbability);
grid.printToPrism(std::cout, configurations , gridOptions.getModelType());
std::stringstream ss; std::stringstream ss;
// grid.printToPrism(file, configurations ,prism::ModelType::MDP); // grid.printToPrism(file, configurations ,prism::ModelType::MDP);
grid.printToPrism(ss, configurations , gridOptions.getModelType()); grid.printToPrism(ss, configurations , gridOptions.getModelType());

Loading…
Cancel
Save