STORM_LOG_THROW(!buildAllRewardModels,storm::exceptions::InvalidSettingsException,"Cannot add reward model, because all reward models are built anyway.");
STORM_LOG_THROW(!buildAllRewardModels,storm::exceptions::InvalidSettingsException,"Cannot add reward model, because all reward models are built anyway.");
STORM_LOG_THROW(assignedValue<=integerIt->upperBound,storm::exceptions::WrongFormatException,"The update "<<assignmentIt->getExpressionVariable().getName()<<" := "<<assignmentIt->getAssignedExpression()<<" leads to an out-of-bounds value ("<<assignedValue<<") for the variable '"<<assignmentIt->getExpressionVariable().getName()<<"'.");
if(this->options.isExplorationChecksSet()){
STORM_LOG_THROW(assignedValue>=integerIt->lowerBound,storm::exceptions::WrongFormatException,"The update "<<assignmentIt->getExpressionVariable().getName()<<" := "<<assignmentIt->getAssignedExpression()<<" leads to an out-of-bounds value ("<<assignedValue<<") for the variable '"<<assignmentIt->getExpressionVariable().getName()<<"'.");
STORM_LOG_THROW(assignedValue<=integerIt->upperBound,storm::exceptions::WrongFormatException,"The update "<<assignmentIt->getExpressionVariable().getName()<<" := "<<assignmentIt->getAssignedExpression()<<" leads to an out-of-bounds value ("<<assignedValue<<") for the variable '"<<assignmentIt->getExpressionVariable().getName()<<"'.");
STORM_LOG_ASSERT(static_cast<int_fast64_t>(newState.getAsInt(integerIt->bitOffset,integerIt->bitWidth))+integerIt->lowerBound==assignedValue,"Writing to the bit vector bucket failed (read "<<newState.getAsInt(integerIt->bitOffset,integerIt->bitWidth)<<" but wrote "<<assignedValue<<").");
STORM_LOG_ASSERT(static_cast<int_fast64_t>(newState.getAsInt(integerIt->bitOffset,integerIt->bitWidth))+integerIt->lowerBound==assignedValue,"Writing to the bit vector bucket failed (read "<<newState.getAsInt(integerIt->bitOffset,integerIt->bitWidth)<<" but wrote "<<assignedValue<<").");
}
}
@ -424,15 +427,20 @@ namespace storm {
// Update the choice by adding the probability/target state to it.
// Update the choice by adding the probability/target state to it.
// Check that the resulting distribution is in fact a distribution.
STORM_LOG_THROW(!this->isDiscreteTimeModel()||this->comparator.isOne(probabilitySum),storm::exceptions::WrongFormatException,"Probabilities do not sum to one for edge (actually sum to "<<probabilitySum<<").");
if(this->options.isExplorationChecksSet()){
// Check that the resulting distribution is in fact a distribution.
STORM_LOG_THROW(!this->isDiscreteTimeModel()||this->comparator.isOne(probabilitySum),storm::exceptions::WrongFormatException,"Probabilities do not sum to one for edge (actually sum to "<<probabilitySum<<").");
}
}
}
++automatonIndex;
++automatonIndex;
@ -450,8 +458,10 @@ namespace storm {
// Only process this action, if there is at least one feasible solution.
// Only process this action, if there is at least one feasible solution.
if(!enabledEdges.empty()){
if(!enabledEdges.empty()){
// Check whether a global variable is written multiple times in any combination.
checkGlobalVariableWritesValid(enabledEdges);
if(this->options.isExplorationChecksSet()){
// Check whether a global variable is written multiple times in any combination.
// Check that the resulting distribution is in fact a distribution.
STORM_LOG_THROW(!this->isDiscreteTimeModel()||!this->comparator.isConstant(probabilitySum)||this->comparator.isOne(probabilitySum),storm::exceptions::WrongFormatException,"Sum of update probabilities do not sum to one for some command (actually sum to "<<probabilitySum<<").");
if(this->options.isExplorationChecksSet()){
// Check that the resulting distribution is in fact a distribution.
STORM_LOG_THROW(!this->isDiscreteTimeModel()||!this->comparator.isConstant(probabilitySum)||this->comparator.isOne(probabilitySum),storm::exceptions::WrongFormatException,"Sum of update probabilities do not sum to one for some command (actually sum to "<<probabilitySum<<").");
STORM_LOG_THROW(assignedValue<=integerIt->upperBound,storm::exceptions::WrongFormatException,"The update "<<update<<" leads to an out-of-bounds value ("<<assignedValue<<") for the variable '"<<assignmentIt->getVariableName()<<"'.");
STORM_LOG_THROW(assignedValue>=integerIt->lowerBound,storm::exceptions::WrongFormatException,"The update "<<update<<" leads to an out-of-bounds value ("<<assignedValue<<") for the variable '"<<assignmentIt->getVariableName()<<"'.");
if(this->options.isExplorationChecksSet()){
STORM_LOG_THROW(assignedValue>=integerIt->lowerBound,storm::exceptions::WrongFormatException,"The update "<<update<<" leads to an out-of-bounds value ("<<assignedValue<<") for the variable '"<<assignmentIt->getVariableName()<<"'.");
STORM_LOG_THROW(assignedValue<=integerIt->upperBound,storm::exceptions::WrongFormatException,"The update "<<update<<" leads to an out-of-bounds value ("<<assignedValue<<") for the variable '"<<assignmentIt->getVariableName()<<"'.");
STORM_LOG_ASSERT(static_cast<int_fast64_t>(newState.getAsInt(integerIt->bitOffset,integerIt->bitWidth))+integerIt->lowerBound==assignedValue,"Writing to the bit vector bucket failed (read "<<newState.getAsInt(integerIt->bitOffset,integerIt->bitWidth)<<" but wrote "<<assignedValue<<").");
STORM_LOG_ASSERT(static_cast<int_fast64_t>(newState.getAsInt(integerIt->bitOffset,integerIt->bitWidth))+integerIt->lowerBound==assignedValue,"Writing to the bit vector bucket failed (read "<<newState.getAsInt(integerIt->bitOffset,integerIt->bitWidth)<<" but wrote "<<assignedValue<<").");
}
}
@ -422,8 +424,10 @@ namespace storm {
choice.addReward(stateActionRewardValue);
choice.addReward(stateActionRewardValue);
}
}
// Check that the resulting distribution is in fact a distribution.
STORM_LOG_THROW(!program.isDiscreteTimeModel()||this->comparator.isOne(probabilitySum),storm::exceptions::WrongFormatException,"Probabilities do not sum to one for command '"<<command<<"' (actually sum to "<<probabilitySum<<").");
if(this->options.isExplorationChecksSet()){
// Check that the resulting distribution is in fact a distribution.
STORM_LOG_THROW(!program.isDiscreteTimeModel()||this->comparator.isOne(probabilitySum),storm::exceptions::WrongFormatException,"Probabilities do not sum to one for command '"<<command<<"' (actually sum to "<<probabilitySum<<").");
// Check that the resulting distribution is in fact a distribution.
STORM_LOG_THROW(!program.isDiscreteTimeModel()||!this->comparator.isConstant(probabilitySum)||this->comparator.isOne(probabilitySum),storm::exceptions::WrongFormatException,"Sum of update probabilities do not some to one for some command (actually sum to "<<probabilitySum<<").");
if(this->options.isExplorationChecksSet()){
// Check that the resulting distribution is in fact a distribution.
STORM_LOG_THROW(!program.isDiscreteTimeModel()||!this->comparator.isConstant(probabilitySum)||this->comparator.isOne(probabilitySum),storm::exceptions::WrongFormatException,"Sum of update probabilities do not some to one for some command (actually sum to "<<probabilitySum<<").");
}
// Create the state-action reward for the newly created choice.
// Create the state-action reward for the newly created choice.
this->addOption(storm::settings::OptionBuilder(moduleName,janiInputOptionName,false,"Parses the model given in the JANI format.")
this->addOption(storm::settings::OptionBuilder(moduleName,janiInputOptionName,false,"Parses the model given in the JANI format.")
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename","The name of the file from which to read the JANI input.").addValidationFunctionString(storm::settings::ArgumentValidators::existingReadableFileValidator()).build()).build());
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename","The name of the file from which to read the JANI input.").addValidationFunctionString(storm::settings::ArgumentValidators::existingReadableFileValidator()).build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,prismToJaniOptionName,false,"If set, the input PRISM model is transformed to JANI.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,prismToJaniOptionName,false,"If set, the input PRISM model is transformed to JANI.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,jitOptionName,false,"If set, the model is built using the JIT model builder if available.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,jitOptionName,false,"If set, the model is built using the JIT model builder.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,fullModelBuildOptionName,false,"If set, include all rewards and labels.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,fullModelBuildOptionName,false,"If set, include all rewards and labels.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,noBuildOptionName,false,"If set, do not build the model.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,noBuildOptionName,false,"If set, do not build the model.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,explorationOrderOptionName,false,"Sets which exploration order to use.").setShortName(explorationOrderOptionShortName)
this->addOption(storm::settings::OptionBuilder(moduleName,explorationOrderOptionName,false,"Sets which exploration order to use.").setShortName(explorationOrderOptionShortName)
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("name","The name of the exploration order to choose. Available are: dfs and bfs.").addValidationFunctionString(storm::settings::ArgumentValidators::stringInListValidator(explorationOrders)).setDefaultValueString("bfs").build()).build());
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("name","The name of the exploration order to choose. Available are: dfs and bfs.").addValidationFunctionString(storm::settings::ArgumentValidators::stringInListValidator(explorationOrders)).setDefaultValueString("bfs").build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,explorationChecksOptionName,false,"If set, additional checks (if available) are performed during model exploration to debug the model.").setShortName(explorationChecksOptionShortName).build());
this->addOption(storm::settings::OptionBuilder(moduleName,transitionRewardsOptionName,false,"If given, the transition rewards are read from this file and added to the explicit model. Note that this requires the model to be given as an explicit model (i.e., via --"+explicitOptionName+").")
this->addOption(storm::settings::OptionBuilder(moduleName,transitionRewardsOptionName,false,"If given, the transition rewards are read from this file and added to the explicit model. Note that this requires the model to be given as an explicit model (i.e., via --"+explicitOptionName+").")
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename","The file from which to read the transition rewards.").addValidationFunctionString(storm::settings::ArgumentValidators::existingReadableFileValidator()).build()).build());
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename","The file from which to read the transition rewards.").addValidationFunctionString(storm::settings::ArgumentValidators::existingReadableFileValidator()).build()).build());
@ -141,6 +144,10 @@ namespace storm {
STORM_LOG_THROW(false,storm::exceptions::IllegalArgumentValueException,"Unknown exploration order '"<<explorationOrderAsString<<"'.");
STORM_LOG_THROW(false,storm::exceptions::IllegalArgumentValueException,"Unknown exploration order '"<<explorationOrderAsString<<"'.");
// this->addOption(storm::settings::OptionBuilder(moduleName, noJitOptionName, false, "Don't use the jit-based explicit model builder.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,doctorOptionName,false,"Show information on why the jit-based explicit model builder is not usable on the current system.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,doctorOptionName,false,"Show debugging information on why the jit-based model builder is not working on your system.").build());
this->addOption(storm::settings::OptionBuilder(moduleName,compilerOptionName,false,"The compiler in the jit-based model builder.")
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("name","The name of the executable. Defaults to c++.").setDefaultValueString("c++").build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,stormRootOptionName,false,"The root directory of Storm.")
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("dir","The directory that contains the src/ subtree of Storm.").build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,boostIncludeDirectoryOptionName,false,"The include directory of boost.")
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("dir","The directory containing the boost headers version >= 1.61.").build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName,compilerFlagsOptionName,false,"The flags passed to the compiler.")