Browse Source

removed unused options from cli option parsing

Note: Some of these functionalities might return in the future
yaml_config_changes
sp 10 months ago
parent
commit
edcab9c0a3
  1. 40
      main.cpp

40
main.cpp

@ -48,15 +48,6 @@ int main(int argc, char* argv[]) {
auto helpOption = optionParser.add<popl::Switch>("h", "help", "Print this help message.");
auto inputFilename = optionParser.add<popl::Value<std::string>>("i", "input-file", "Filename of the input file.");
auto outputFilename = optionParser.add<popl::Value<std::string>>("o", "output-file", "Filename for the output file.");
auto agentsToBeConsidered = optionParser.add<popl::Value<std::string>, popl::Attribute::optional>("a", "agents", "Which parsed agents should be considered in the output. WIP.");
auto viewForAgents = optionParser.add<popl::Value<std::string>, popl::Attribute::optional>("v", "view", "Agents for which the 'view'('direction') variable should be included. WIP.");
auto probabilisticBehaviourAgents = optionParser.add<popl::Value<std::string>, popl::Attribute::optional>("p", "prob-beh", "Agents for which we want to include probabilistic actions");
auto probabilities = optionParser.add<popl::Value<std::string>, popl::Attribute::optional>("q", "probs", "The probabilities for which probabilistic actions should be added. WIP");
auto enforceOneWays = optionParser.add<popl::Switch>("f", "force-oneways", "Enforce encoding of oneways. This entails that slippery tiles do not allow turning and have prob 1 to shift the agent by one and makes turning impossible if in a one tile wide section of the grid.");
auto configFilename = optionParser.add<popl::Value<std::string>, popl::Attribute::optional>("c", "config-file", "Filename of the predicate configuration file.");
@ -75,35 +66,6 @@ int main(int argc, char* argv[]) {
}
GridOptions gridOptions = { {}, {} };
if(agentsToBeConsidered->is_set()) {
gridOptions.agentsToBeConsidered = parseCommaSeparatedString(agentsToBeConsidered->value(0));
}
if(viewForAgents->is_set()) {
gridOptions.agentsWithView = parseCommaSeparatedString(viewForAgents->value(0));
}
if(enforceOneWays->is_set()) {
gridOptions.enforceOneWays = true;
}
if(probabilisticBehaviourAgents->is_set()) {
gridOptions.agentsWithProbabilisticBehaviour = parseCommaSeparatedString(probabilisticBehaviourAgents->value(0));
for(auto const& a : gridOptions.agentsWithProbabilisticBehaviour) {
std::cout << a << std::endl;
}
if(probabilities->is_set()) {
std::vector<std::string> parsedStrings = parseCommaSeparatedString(probabilities->value(0));
std::transform(parsedStrings.begin(), parsedStrings.end(), std::back_inserter(gridOptions.probabilitiesForActions), [](const std::string& string) {
return std::stof(string);
});
for(auto const& a : gridOptions.probabilitiesForActions) {
std::cout << a << std::endl;
}
} else {
throw std::logic_error{ "When adding agents with probabilistic behaviour, you also need to specify a list of probabilities via --probs." };
}
}
std::fstream file {outputFilename->value(0), file.trunc | file.out};
std::fstream infile {inputFilename->value(0), infile.in};
std::string line, content, background, rewards, properties;
@ -149,7 +111,7 @@ int main(int argc, char* argv[]) {
cells backgroundCells;
std::vector<Configuration> configurations;
std::map<coordinates, float> stateRewards;
float faultyProbability = 0.0;
float faultyProbability = 0.1;
float probIntended = 0.9;
try {

Loading…
Cancel
Save