Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
ValuationsTest.cpp
Go to the documentation of this file.
1#include "storm-config.h"
2#include "test/storm_gtest.h"
3
14
15TEST(ValuationTest, StateValuationConstruction) {
16#ifndef STORM_HAVE_Z3
17 GTEST_SKIP() << "Z3 not available.";
18#endif
19 storm::prism::Program program = storm::parser::PrismParser::parse(STORM_TEST_RESOURCES_DIR "/dtmc/die.pm");
21 generatorOptions.setBuildStateValuations();
22 generatorOptions.setBuildAllLabels();
23 auto builder = storm::builder::ExplicitModelBuilder<double>(program, generatorOptions);
24 std::shared_ptr<storm::models::sparse::Model<double>> model = builder.build();
25 ASSERT_TRUE(model->hasStateValuations());
26 auto const& sv = model->getStateValuations();
27 ASSERT_EQ(sv.getNumberOfEntities(), model->getNumberOfStates());
28 ASSERT_TRUE(sv.getManager().hasVariable("s"));
29 ASSERT_TRUE(sv.getManager().hasVariable("d"));
30 auto const s = sv.getManager().getVariable("s");
31 auto const d = sv.getManager().getVariable("d");
32 auto const vars = sv.getAllVariables();
33 ASSERT_EQ(2, vars.size());
34 ASSERT_TRUE(vars.contains(s));
35 ASSERT_TRUE(vars.contains(d));
36 // reading values at sinit
37 uint64_t const sinit = *model->getInitialStates().begin();
38 ASSERT_TRUE(sv.entityHasVariable(sinit, s));
39 ASSERT_TRUE(sv.entityHasVariable(sinit, d));
40 EXPECT_EQ(0, sv.getInt64Value(sinit, s));
41 EXPECT_EQ(0, sv.getOptionalInt64Value(sinit, s).value());
42 EXPECT_EQ(0, sv.getOptionalInt64Value(sinit, d).value());
43 // reading json at sinit
44 auto js = sv.toJson(sinit);
45 EXPECT_EQ(2, js.size());
46 EXPECT_TRUE(js.contains("s"));
47 EXPECT_TRUE(js.contains("d"));
48 EXPECT_EQ(0, js["s"].get<int64_t>());
49 EXPECT_EQ(0, js["d"].get<int64_t>());
50 // reading values at "three" state
51 ASSERT_TRUE(model->getStateLabeling().containsLabel("three"));
52 ASSERT_TRUE(model->getStates("three").hasUniqueSetBit());
53 uint64_t const three = *model->getStates("three").begin();
54 EXPECT_EQ(7, sv.getInt64Value(three, s));
55 EXPECT_EQ(3, sv.getInt64Value(three, d));
56 // reading all values for d
57 auto dValues = sv.getInt64Values(d);
58 ASSERT_EQ(sv.getNumberOfEntities(), dValues.size());
59 EXPECT_EQ(3, dValues[three]);
60 int64_t const sum = std::accumulate(dValues.begin(), dValues.end(), 0ll);
61 EXPECT_EQ(1 + 2 + 3 + 4 + 5 + 6, sum);
62}
63
64TEST(ValuationTest, StateValuationTransformation) {
65#ifndef STORM_HAVE_Z3
66 GTEST_SKIP() << "Z3 not available.";
67#endif
68 storm::prism::Program program = storm::parser::PrismParser::parse(STORM_TEST_RESOURCES_DIR "/dtmc/die.pm");
70 generatorOptions.setBuildStateValuations();
71 auto builder = storm::builder::ExplicitModelBuilder<double>(program, generatorOptions);
72 std::shared_ptr<storm::models::sparse::Model<double>> model = builder.build();
73 ASSERT_TRUE(model->hasStateValuations());
74 auto const& sv = model->getStateValuations();
76 auto newsv = notransformer.build(true);
77 ASSERT_EQ(newsv.getNumberOfEntities(), sv.getNumberOfEntities());
79 auto const svar = program.getManager().getVariable("s");
80 auto const dvar = program.getManager().getVariable("d");
81 auto const sgt3Var = program.getManager().declareBooleanVariable("sGT3");
82 auto const alwaysTrueVar = program.getManager().declareBooleanVariable("alwaysTrue");
83 auto const alwaysFalseVar = program.getManager().declareBooleanVariable("alwaysFalse");
84 transformer.addExpression(sgt3Var, svar.getExpression() > program.getManager().integer(3));
85 transformer.addExpression(alwaysTrueVar, svar.getExpression() == svar.getExpression());
86 transformer.addExpression(alwaysFalseVar, dvar.getExpression() < dvar.getExpression());
87 newsv = transformer.build(true);
88 auto const vars = newsv.getAllVariables();
89 ASSERT_EQ(5, vars.size());
90 ASSERT_TRUE(vars.contains(svar));
91 ASSERT_TRUE(vars.contains(dvar));
92 ASSERT_TRUE(vars.contains(sgt3Var));
93 ASSERT_TRUE(vars.contains(alwaysTrueVar));
94 ASSERT_TRUE(vars.contains(alwaysFalseVar));
95 uint64_t const sinit = *model->getInitialStates().begin();
96 EXPECT_EQ(0, newsv.getInt64Value(sinit, svar));
97 EXPECT_EQ(0, newsv.getInt64Value(sinit, dvar));
98 EXPECT_FALSE(newsv.getBooleanValue(sinit, sgt3Var));
99 EXPECT_TRUE(newsv.getBooleanValue(sinit, alwaysTrueVar));
100 EXPECT_FALSE(newsv.getBooleanValue(sinit, alwaysFalseVar));
101
102 for (uint64_t state = 0; state < newsv.getNumberOfEntities(); ++state) {
103 ASSERT_TRUE(newsv.getBooleanValue(state, alwaysTrueVar));
104 ASSERT_FALSE(newsv.getBooleanValue(state, alwaysFalseVar));
105 ASSERT_EQ(sv.getInt64Value(state, svar), newsv.getInt64Value(state, svar));
106 ASSERT_EQ(newsv.getBooleanValue(state, sgt3Var), newsv.getInt64Value(state, svar) > 3);
107 }
108}
109
110TEST(ValuationTest, Valuations2classes) {
111 auto manager = std::make_shared<storm::expressions::ExpressionManager>();
112 auto const b = manager->declareBooleanVariable("b");
113 auto const i = manager->declareIntegerVariable("i");
114 auto const s = manager->declareStringVariable("s");
115 auto const r = manager->declareRationalVariable("r");
116 std::vector<storm::storage::sparse::ValuationClassDescription> classes;
117 {
119 builder1.addBooleanVariable(b, true); // 1 + 1 bit (optional
120 builder1.addIntegerVariable(i, -4, 12); // 17 different values, therefore 5 bits
121 builder1.addStringVariable(s, true); // 64 + 1 bits (optional)
122 builder1.addRationalVariable(r, 166); // 166 bits
123 classes.push_back(builder1.buildClassDescription()); // adds 2 padding bits to fill a whole number of bytes
124 EXPECT_EQ(2 + 5 + 65 + 166 + 2, classes.back().sizeInBits());
125 EXPECT_TRUE(classes.back().hasStringVariable());
126
128 builder2.addDoubleVariable(r); // 64 bits
129 builder2.addBooleanVariable(b); // 1 bit
130 builder2.addIntegerVariable(i, -10, -7); // 4 different values, therefore 2 bits
131 classes.push_back(builder2.buildClassDescription()); // adds 5 padding bits to fill a whole number of bytes
132 EXPECT_EQ(64 + 1 + 2 + 5, classes.back().sizeInBits());
133 EXPECT_FALSE(classes.back().hasStringVariable());
134 }
135 storm::storage::sparse::ValuationsStorage valuations(classes, {manager, manager});
136 EXPECT_EQ(0, valuations.numStrings());
137 EXPECT_EQ(2, valuations.numClasses());
138 EXPECT_EQ(classes[0].sizeInBits(), valuations.getClassDescription(0).sizeInBits());
139 EXPECT_EQ(classes[1].sizeInBits(), valuations.getClassDescription(1).sizeInBits());
140 auto const vars = valuations.getAllVariables();
141 EXPECT_EQ(4, vars.size());
142 EXPECT_TRUE(vars.contains(b));
143 EXPECT_TRUE(vars.contains(i));
144 EXPECT_TRUE(vars.contains(s));
145 EXPECT_TRUE(vars.contains(r));
146 // Insert 200 entities with alternating classes and some non-trivial values
147 std::vector<std::optional<bool>> b_values;
148 std::vector<int64_t> i_values;
149 std::vector<std::optional<std::string>> s_values;
150 std::vector<storm::RationalNumber> r_values;
151 for (uint64_t e = 0; e < 200; ++e) {
152 if (e % 3 == 0) {
153 // insert class 0
154 valuations.emplaceBack<true>(0, [&](auto entity, auto const& var, auto& value) {
155 using ValueType = std::remove_cvref_t<decltype(value)>;
156 if constexpr (std::is_same_v<ValueType, std::optional<bool>>) {
157 EXPECT_EQ(b, var);
158 if (entity % 2 == 0) {
159 value = entity % 4 == 0;
160 }
161 b_values.push_back(value);
162 } else if constexpr (std::is_same_v<ValueType, int64_t>) {
163 EXPECT_EQ(i, var);
164 value = static_cast<int64_t>(entity) % 17 - 4;
165 i_values.push_back(value);
166 } else if constexpr (std::is_same_v<ValueType, std::optional<std::string>>) {
167 EXPECT_EQ(s, var);
168 if (entity % 2 == 1) {
169 value = "str" + std::to_string(entity);
170 }
171 s_values.push_back(value);
172 } else if constexpr (std::is_same_v<ValueType, storm::RationalNumber>) {
173 EXPECT_EQ(r, var);
174 auto const uint64max = storm::utility::convertNumber<storm::RationalNumber, uint64_t>(std::numeric_limits<uint64_t>::max());
175 value = (uint64max + uint64max + storm::utility::convertNumber<storm::RationalNumber>(entity)) / (uint64max);
176 if (entity % 8 == 0) {
177 value = -value;
178 }
179 r_values.push_back(value);
180 } else {
181 FAIL() << "Unexpected variable type " << typeid(ValueType).name() << " for variable " << var.getName();
182 }
183 });
184 } else {
185 // insert class 1
186 valuations.emplaceBack<false, double, bool, int64_t>(1, [&](auto entity, auto const& var, auto& value) {
187 using ValueType = std::remove_cvref_t<decltype(value)>;
188 if constexpr (std::is_same_v<ValueType, double>) {
189 EXPECT_EQ(r, var);
190 value = static_cast<double>(entity) / 3.0;
192 } else if constexpr (std::is_same_v<ValueType, bool>) {
193 EXPECT_EQ(b, var);
194 value = entity % 2 == 0;
195 b_values.push_back(value);
196 } else {
197 static_assert(std::is_same_v<ValueType, int64_t>);
198 EXPECT_EQ(i, var);
199 value = static_cast<int64_t>(entity) % 4 - 10;
200 i_values.push_back(value);
201 }
202 });
203 s_values.push_back(std::nullopt);
204 }
205 }
206 // Now check if reading back the values works correctly.
207 ASSERT_EQ(200, b_values.size());
208 ASSERT_EQ(200, i_values.size());
209 ASSERT_EQ(200, s_values.size());
210 ASSERT_EQ(200, r_values.size());
211 valuations.readCallback<std::nullopt_t, bool, int64_t, std::string, storm::RationalNumber, double>([&](auto entity, auto const& var, auto const& value) {
212 using ValueType = std::remove_cvref_t<decltype(value)>;
213 if constexpr (std::is_same_v<ValueType, std::nullopt_t>) {
214 EXPECT_EQ(0, valuations.getClassOfEntity(entity));
215 if (var == b) {
216 EXPECT_FALSE(b_values[entity].has_value());
217 } else {
218 EXPECT_TRUE(var == s);
219 EXPECT_FALSE(s_values[entity].has_value());
220 }
221 } else if constexpr (std::is_same_v<ValueType, bool>) {
222 EXPECT_EQ(b, var);
223 ASSERT_TRUE(b_values[entity].has_value());
224 EXPECT_EQ(b_values[entity].value(), value);
225 } else if constexpr (std::is_same_v<ValueType, int64_t>) {
226 EXPECT_EQ(i, var);
227 EXPECT_EQ(i_values[entity], value);
228 } else if constexpr (std::is_same_v<ValueType, std::string>) {
229 EXPECT_EQ(s, var);
230 ASSERT_TRUE(s_values[entity].has_value());
231 EXPECT_EQ(s_values[entity].value(), value);
232 } else if constexpr (std::is_same_v<ValueType, storm::RationalNumber>) {
233 EXPECT_EQ(0, valuations.getClassOfEntity(entity));
234 EXPECT_EQ(r, var);
235 EXPECT_EQ(r_values[entity], value);
236 } else {
237 static_assert(std::is_same_v<ValueType, double>);
238 EXPECT_EQ(1, valuations.getClassOfEntity(entity));
239 EXPECT_EQ(r, var);
241 }
242 });
243}
244
245TEST(ValuationTest, ValuationsSingleClass) {
246 // Tests point-access via readValue / writeValue, entityHasVariable, getAllVariables, and resize
247 // on a simple single-class layout with non-optional variables only.
248 auto manager = std::make_shared<storm::expressions::ExpressionManager>();
249 auto const b = manager->declareBooleanVariable("b");
250 auto const i = manager->declareIntegerVariable("i");
251 auto const d = manager->declareRationalVariable("d");
252
254 builder.addBooleanVariable(b); // 1 bit
255 builder.addIntegerVariable(i, -5, 5); // 11 values → 4 bits
256 builder.addDoubleVariable(d); // 64 bits
257 auto const desc = builder.buildClassDescription();
258 EXPECT_EQ(1 + 4 + 64 + 3, desc.sizeInBits());
259
260 storm::storage::sparse::ValuationsStorage valuations(desc, manager);
261 EXPECT_EQ(0u, valuations.size());
262 EXPECT_EQ(1u, valuations.numClasses());
263
264 // getAllVariables should list exactly the three declared variables
265 auto const vars = valuations.getAllVariables();
266 EXPECT_EQ(3u, vars.size());
267 EXPECT_TRUE(vars.contains(b));
268 EXPECT_TRUE(vars.contains(i));
269 EXPECT_TRUE(vars.contains(d));
270
271 // Insert 6 entities with distinct, easily checkable values
272 std::vector<bool> bVals = {true, false, true, false, true, false};
273 std::vector<int64_t> iVals = {-5, -3, 0, 2, 4, 5};
274 std::vector<double> dVals = {0.0, 1.5, -2.25, 1e10, -1e-5, 3.14};
275
276 for (uint64_t e = 0; e < 6; ++e) {
277 valuations.emplaceBack<false, bool, int64_t, double>([&](auto entity, auto const& var, auto& value) {
278 using ValueType = std::remove_cvref_t<decltype(value)>;
279 if constexpr (std::is_same_v<ValueType, bool>) {
280 value = bVals[entity];
281 } else if constexpr (std::is_same_v<ValueType, int64_t>) {
282 value = iVals[entity];
283 } else {
284 static_assert(std::is_same_v<ValueType, double>);
285 value = dVals[entity];
286 }
287 });
288 }
289 ASSERT_EQ(6u, valuations.size());
290
291 // entityHasVariable: all variables belong to the single class, so always true
292 for (uint64_t e = 0; e < 6; ++e) {
293 EXPECT_TRUE(valuations.entityHasVariable(e, b));
294 EXPECT_TRUE(valuations.entityHasVariable(e, i));
295 EXPECT_TRUE(valuations.entityHasVariable(e, d));
296 }
297
298 // readValue round-trips
299 for (uint64_t e = 0; e < 6; ++e) {
300 EXPECT_EQ(bVals[e], valuations.readValue<bool>(e, b)) << " at entity " << e;
301 EXPECT_EQ(iVals[e], valuations.readValue<int64_t>(e, i)) << " at entity " << e;
302 EXPECT_EQ(dVals[e], valuations.readValue<double>(e, d)) << " at entity " << e;
303 }
304
305 // writeValue then readValue: overwrite entity 3 and verify neighbours are unaffected
306 valuations.writeValue(3, b, true);
307 valuations.writeValue(3, i, int64_t(-1));
308 valuations.writeValue(3, d, 99.0);
309 EXPECT_EQ(true, valuations.readValue<bool>(3, b));
310 EXPECT_EQ(-1, valuations.readValue<int64_t>(3, i));
311 EXPECT_EQ(99.0, valuations.readValue<double>(3, d));
312 // neighbours untouched
313 EXPECT_EQ(bVals[2], valuations.readValue<bool>(2, b));
314 EXPECT_EQ(iVals[4], valuations.readValue<int64_t>(4, i));
315
316 // resize: grow to 9 — new entities get default values and the first 6 stay intact
317 valuations.resize(9);
318 ASSERT_EQ(9u, valuations.size());
319 for (uint64_t e = 0; e < 6; ++e) {
320 if (e == 3) {
321 continue; // entity 3 was overwritten above
322 }
323 EXPECT_EQ(bVals[e], valuations.readValue<bool>(e, b)) << " at entity " << e;
324 EXPECT_EQ(iVals[e], valuations.readValue<int64_t>(e, i)) << " at entity " << e;
325 EXPECT_EQ(dVals[e], valuations.readValue<double>(e, d)) << " at entity " << e;
326 }
327
328 // resize: shrink back to 4
329 valuations.resize(4);
330 EXPECT_EQ(4u, valuations.size());
331 EXPECT_EQ(bVals[0], valuations.readValue<bool>(0, b));
332 EXPECT_EQ(iVals[1], valuations.readValue<int64_t>(1, i));
333 EXPECT_EQ(dVals[2], valuations.readValue<double>(2, d));
334}
335
336TEST(ValuationTest, ValuationsSelectEntities) {
337 // Tests selectEntities (BitVector and vector<uint64_t> overloads) on a single-class
338 // layout. Verifies that the selection preserves values in the correct order and that the
339 // original Valuations object is left unchanged.
340 auto manager = std::make_shared<storm::expressions::ExpressionManager>();
341 auto const b = manager->declareBooleanVariable("b");
342 auto const i = manager->declareIntegerVariable("i");
343
345 builder.addBooleanVariable(b); // 1 bit
346 builder.addIntegerVariable(i, 0, 7); // 8 values → 3 bits
347 auto const desc = builder.buildClassDescription();
348
349 storm::storage::sparse::ValuationsStorage valuations(desc, manager);
350
351 // Insert 8 entities: b = (entity % 2 == 0), i = entity
352 for (uint64_t e = 0; e < 8; ++e) {
353 valuations.emplaceBack<false, bool, int64_t>([e](auto /*entity*/, auto const& var, auto& value) {
354 using ValueType = std::remove_cvref_t<decltype(value)>;
355 if constexpr (std::is_same_v<ValueType, bool>) {
356 value = (e % 2 == 0);
357 } else {
358 static_assert(std::is_same_v<ValueType, int64_t>);
359 value = static_cast<int64_t>(e);
360 }
361 });
362 }
363 ASSERT_EQ(8u, valuations.size());
364
365 // --- BitVector selection: pick entities 1, 3, 5, 7 (odd indices) ---
366 storm::storage::BitVector bvOdd(8, false);
367 for (uint64_t e = 1; e < 8; e += 2) {
368 bvOdd.set(e);
369 }
370 auto const selectedBv = valuations.selectEntities(bvOdd);
371 ASSERT_EQ(4u, selectedBv.size());
372 EXPECT_EQ(1u, selectedBv.numClasses());
373 for (uint64_t sel = 0; sel < 4; ++sel) {
374 uint64_t const origEntity = 2 * sel + 1; // 1, 3, 5, 7
375 EXPECT_EQ(false, selectedBv.readValue<bool>(sel, b)) << " selected entity " << sel;
376 EXPECT_EQ(static_cast<int64_t>(origEntity), selectedBv.readValue<int64_t>(sel, i)) << " selected entity " << sel;
377 }
378
379 // --- vector<uint64_t> selection: pick entities {6, 0, 4} in that order ---
380 std::vector<uint64_t> const indices = {6, 0, 4};
381 auto const selectedVec = valuations.selectEntities(indices);
382 ASSERT_EQ(3u, selectedVec.size());
383 EXPECT_EQ(true, selectedVec.readValue<bool>(0, b)); // entity 6: even → true
384 EXPECT_EQ(6, selectedVec.readValue<int64_t>(0, i));
385 EXPECT_EQ(true, selectedVec.readValue<bool>(1, b)); // entity 0: even → true
386 EXPECT_EQ(0, selectedVec.readValue<int64_t>(1, i));
387 EXPECT_EQ(true, selectedVec.readValue<bool>(2, b)); // entity 4: even → true
388 EXPECT_EQ(4, selectedVec.readValue<int64_t>(2, i));
389
390 // Original must be unchanged
391 ASSERT_EQ(8u, valuations.size());
392 for (uint64_t e = 0; e < 8; ++e) {
393 EXPECT_EQ(e % 2 == 0, valuations.readValue<bool>(e, b)) << " at original entity " << e;
394 EXPECT_EQ(static_cast<int64_t>(e), valuations.readValue<int64_t>(e, i)) << " at original entity " << e;
395 }
396}
397
398TEST(ValuationTest, RejectsNonCompliantDoubleOrStringSize) {
399 // Double and String fields must always be exactly their default size (64 bits) per the UMB spec
400 // (see storm::umb::validation::validateTypeDeclaration).
401 auto manager = std::make_shared<storm::expressions::ExpressionManager>();
402 auto const d = manager->declareRationalVariable("d");
405 .name = "d", .isOptional = std::nullopt, .type = {storm::umb::Type::Double, 128}, .lower = {}, .upper = {}, .offset = {}};
406 EXPECT_THROW(doubleBuilder.addVariable(badDouble), storm::exceptions::WrongFormatException);
407
408 auto const s = manager->declareStringVariable("s");
411 .name = "s", .isOptional = std::nullopt, .type = {storm::umb::Type::String, 128}, .lower = {}, .upper = {}, .offset = {}};
412 EXPECT_THROW(stringBuilder.addVariable(badString), storm::exceptions::WrongFormatException);
413
414 // A compliant (default-size) Double field must still be accepted.
417 .name = "d", .isOptional = std::nullopt, .type = {storm::umb::Type::Double, std::nullopt}, .lower = {}, .upper = {}, .offset = {}};
418 EXPECT_NO_THROW(okBuilder.addVariable(okDouble));
419}
TEST(ValuationTest, StateValuationConstruction)
BuilderOptions & setBuildAllLabels(bool newValue=true)
Should all reward models be built?
BuilderOptions & setBuildStateValuations(bool newValue=true)
Should the state valuation mapping be built?
Variable declareBooleanVariable(std::string const &name, bool auxiliary=false)
Declares a new boolean variable with a name that must not yet exist and its corresponding type.
Expression integer(int_fast64_t value) const
Creates an expression that characterizes the given integer literal.
Variable getVariable(std::string const &name) const
Retrieves the expression that represents the variable with the given name.
static storm::prism::Program parse(std::string const &filename, bool prismCompatability=false)
Parses the given file into the PRISM storage classes assuming it complies with the PRISM syntax.
storm::expressions::ExpressionManager & getManager() const
Retrieves the manager responsible for the expressions of this program.
Definition Program.cpp:2388
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:16
void set(uint64_t index, bool value=true)
Sets the given truth value at the given index.
Helper to incrementally build a ValuationClassDescription, i.e.
ValuationClassDescription buildClassDescription()
Creates the finalized state valuations object.
void addBooleanVariable(storm::expressions::Variable const &variable, bool optional=false)
Adds a new boolean variable to the builder.
void addRationalVariable(storm::expressions::Variable const &variable, uint64_t bitSize, bool optional=false)
Adds a new rational variable to the builder.
void addStringVariable(storm::expressions::Variable const &variable, bool optional=false)
Adds a new string variable to the builder.
void addIntegerVariable(storm::expressions::Variable const &variable, int64_t const lowerBound, int64_t const upperBound, bool optional=false)
Adds a new integer variable to the builder.
void addVariable(ValuationClassDescription::Variable const &variable)
Adds the given variable.
void addDoubleVariable(storm::expressions::Variable const &variable, bool optional=false)
Adds a new double variable to the builder.
Transforms the given state valuations to a new state valuations over a new variable set.
Valuations build(bool extend)
Build and export the state valuations.
void addExpression(storm::expressions::Variable const &var, storm::expressions::Expression const &expr)
Add a variable defined by the given expression.
std::set< storm::expressions::Variable > getAllVariables() const
Stores valuations of variables for a set of entities (e.g.
ValueType readValue(uint64_t entity, storm::expressions::Variable const &variable) const
Reads a single variable of the given entity and returns its value directly.
bool entityHasVariable(uint64_t entity, storm::expressions::Variable const &variable) const
Returns true iff the variable is relevant for the given entity's class, i.e.
ValuationsStorage selectEntities(T const &selectedEntities) const
Constructs a new ValuationsStorage containing only the selected entities, in the order they appear in...
void resize(uint64_t newEntityCount, uint64_t classIndex=0)
Resizes the entity count to newEntityCount.
std::set< storm::expressions::Variable > getAllVariables() const
Returns all expression variables that this valuation assigns values to for at least one class.
void writeValue(uint64_t entity, storm::expressions::Variable const &variable, ValueType const &value)
Directly writes value to the given variable of entity.
void emplaceBack(uint64_t classIndex, Callback const &callback)
Appends a new entity of the given class and populates its variables via callback.
storm::builder::BuilderOptions NextStateGeneratorOptions
TargetType convertNumber(SourceType const &number)