26 return labelOrExpression.which() == 0;
30 return boost::get<std::string>(labelOrExpression);
34 return labelOrExpression.which() == 1;
38 return boost::get<storm::expressions::Expression>(labelOrExpression);
42 : buildAllRewardModels(buildAllRewardModels),
43 buildAllLabels(buildAllLabels),
44 applyMaximalProgressAssumption(false),
45 buildChoiceLabels(false),
46 buildStateValuations(false),
47 buildObservationValuations(false),
48 buildChoiceOrigins(false),
49 scaleAndLiftTransitionRewards(true),
50 explorationChecks(false),
51 inferObservationsFromActions(false),
52 addOverlappingGuardsLabel(false),
53 addOutOfBoundsState(false),
54 reservedBitsForUnboundedVariables(32),
56 showProgressDelay(0) {
68 if (!formulas.empty()) {
69 for (
auto const& formula : formulas) {
72 if (formulas.size() == 1) {
83 showProgress = generalSettings.isVerboseSet();
84 showProgressDelay = generalSettings.getShowProgressDelay();
95 for (
auto const& rewardModelName : referencedRewardModels) {
96 rewardModelNames.emplace(rewardModelName);
100 std::vector<std::shared_ptr<storm::logic::AtomicLabelFormula const>> atomicLabelFormulas = formula.
getAtomicLabelFormulas();
101 for (
auto const& formula : atomicLabelFormulas) {
106 std::vector<std::shared_ptr<storm::logic::AtomicExpressionFormula const>> atomicExpressionFormulas = formula.
getAtomicExpressionFormulas();
107 for (
auto const& formula : atomicExpressionFormulas) {
111 scaleAndLiftTransitionRewards =
118 [
this](std::string
const& label,
bool inverted) { this->
addTerminalLabel(label, inverted); });
122 return rewardModelNames;
130 return expressionLabels;
134 return terminalStates;
138 return !terminalStates.empty();
142 terminalStates.clear();
146 return applyMaximalProgressAssumption;
150 return buildChoiceLabels;
154 return buildStateValuations;
158 return buildObservationValuations;
162 return buildChoiceOrigins;
166 return buildAllRewardModels;
170 return buildAllLabels;
174 return inferObservationsFromActions;
178 return scaleAndLiftTransitionRewards;
182 return addOutOfBoundsState;
186 return reservedBitsForUnboundedVariables;
190 return addOverlappingGuardsLabel;
194 buildAllRewardModels = newValue;
199 return explorationChecks;
207 return showProgressDelay;
211 explorationChecks = newValue;
216 STORM_LOG_THROW(!buildAllRewardModels, storm::exceptions::InvalidSettingsException,
"Cannot add reward model, because all reward models are built anyway.");
217 rewardModelNames.emplace(rewardModelName);
222 buildAllLabels = newValue;
227 std::stringstream stream;
228 stream << expression;
229 expressionLabels.emplace_back(stream.str(), expression);
234 STORM_LOG_THROW(!buildAllLabels, storm::exceptions::InvalidSettingsException,
"Cannot add label, because all labels are built anyway.");
235 labelNames.insert(labelName);
250 applyMaximalProgressAssumption = newValue;
255 buildChoiceLabels = newValue;
260 buildStateValuations = newValue;
265 buildObservationValuations = newValue;
270 buildChoiceOrigins = newValue;
275 scaleAndLiftTransitionRewards = newValue;
280 addOutOfBoundsState = newValue;
285 reservedBitsForUnboundedVariables = newValue;
290 addOverlappingGuardsLabel = newValue;
296 for (
auto& e : expressionLabels) {
297 e.second = substitutionFunction(e.second);
300 for (
auto& t : terminalStates) {
301 if (t.first.isExpression()) {
uint64_t getReservedBitsForUnboundedVariables() const
bool isApplyMaximalProgressAssumptionSet() const
std::set< std::string > const & getRewardModelNames() const
Which reward models are built.
BuilderOptions & setBuildAllLabels(bool newValue=true)
Should all reward models be built? If not set, only required reward models are build.
BuilderOptions & setExplorationChecks(bool newValue=true)
Should extra checks be performed during exploration.
void clearTerminalStates()
BuilderOptions & addTerminalExpression(storm::expressions::Expression const &expression, bool value)
BuilderOptions & setAddOutOfBoundsState(bool newValue=true)
Should a state for out of bounds be constructed.
BuilderOptions & setReservedBitsForUnboundedVariables(uint64_t value)
Sets the number of bits that will be reserved for unbounded integer variables.
bool isScaleAndLiftTransitionRewardsSet() const
BuilderOptions & setBuildChoiceLabels(bool newValue=true)
Should the choice labels be built?
bool isBuildStateValuationsSet() const
BuilderOptions & addRewardModel(std::string const &rewardModelName)
Add an additional reward model to build.
bool isBuildAllRewardModelsSet() const
BuilderOptions & setBuildAllRewardModels(bool newValue=true)
Should all reward models be built? If not set, only required reward models are build.
bool isBuildChoiceLabelsSet() const
bool isBuildChoiceOriginsSet() const
BuilderOptions & setBuildChoiceOrigins(bool newValue=true)
Should the origins the different choices be built?
bool isShowProgressSet() const
BuilderOptions & setBuildStateValuations(bool newValue=true)
Should the state valuation mapping be built?
BuilderOptions(bool buildAllRewardModels=false, bool buildAllLabels=false)
Creates an object representing the default options.
std::vector< std::pair< std::string, storm::expressions::Expression > > const & getExpressionLabels() const
Which expression labels are built.
BuilderOptions & substituteExpressions(std::function< storm::expressions::Expression(storm::expressions::Expression const &)> const &substitutionFunction)
Substitutes all expressions occurring in these options.
std::vector< std::pair< LabelOrExpression, bool > > const & getTerminalStates() const
bool isExplorationChecksSet() const
bool isBuildAllLabelsSet() const
BuilderOptions & setApplyMaximalProgressAssumption(bool newValue=true)
Should the maximal progress assumption be applied when building a Markov Automaton?
uint64_t getShowProgressDelay() const
bool isInferObservationsFromActionsSet() const
void preserveFormula(storm::logic::Formula const &formula, storm::storage::SymbolicModelDescription const &modelDescription=storm::storage::SymbolicModelDescription())
Changes the options in a way that ensures that the given formula can be checked on the model once it ...
bool hasTerminalStates() const
BuilderOptions & addLabel(storm::expressions::Expression const &expression)
bool isAddOverlappingGuardLabelSet() const
bool isAddOutOfBoundsStateSet() const
BuilderOptions & setBuildObservationValuations(bool newValue=true)
Should a observation valuation mapping be built?
void setTerminalStatesFromFormula(storm::logic::Formula const &formula)
Analyzes the given formula and sets an expression for the states states of the model that can be trea...
BuilderOptions & setAddOverlappingGuardsLabel(bool newValue=true)
Should a state be labelled for overlapping guards.
BuilderOptions & addTerminalLabel(std::string const &label, bool value)
BuilderOptions & setScaleAndLiftTransitionRewards(bool newValue=true)
Should extra checks be performed during exploration.
bool isBuildObservationValuationsSet() const
std::set< std::string > const & getLabelNames() const
Which labels are built.
LabelOrExpression(storm::expressions::Expression const &expression)
bool isExpression() const
storm::expressions::Expression const & getExpression() const
std::string const & getLabel() const
bool areTransitionRewardsLiftable(Formula const &f) const
Returns true, when lifting transition rewards to action rewards (by scaling with the transition proba...
ModelType getModelType() const
#define STORM_LOG_THROW(cond, exception, message)
void getTerminalStatesFromFormula(storm::logic::Formula const &formula, std::function< void(storm::expressions::Expression const &, bool)> const &terminalExpressionCallback, std::function< void(std::string const &, bool)> const &terminalLabelCallback)
Traverses the formula.
SettingsType const & getModule()
Get module.