Valuations¶
- class Valuations(
- self: stormpy.models.Valuations,
- class_description: stormpy.models.ValuationClassDescription,
- manager=None,
- num_entities: SupportsInt | SupportsIndex = 0,
Bases:
pybind11_objectValuations for explicit entities (states/observations)
Construct valuations from a class description, optional expression manager and entity count
- entity_has_variable(
- self: stormpy.models.Valuations,
- entity: SupportsInt | SupportsIndex,
- variable,
- get_all_variables(self: stormpy.models.Valuations)¶
Get all variables with valuations
- get_boolean_value(
- self: stormpy.models.Valuations,
- entity: SupportsInt | SupportsIndex,
- variable,
- get_boolean_values(
- self: stormpy.models.Valuations,
- variable,
Values of a Boolean variable as a BitVector
- get_double_value(
- self: stormpy.models.Valuations,
- entity: SupportsInt | SupportsIndex,
- variable,
Get the value of a rational variable that was declared with the double (64-bit IEEE754) storage encoding via add_double_variable, as a Python float. get_value/get_rational_value assume the exact encoding and cannot read a double-encoded variable.
- get_double_values(self: stormpy.models.Valuations, variable) list[float]¶
Get the value for all entities of a rational variable declared via add_double_variable.
- get_int64_value(
- self: stormpy.models.Valuations,
- entity: SupportsInt | SupportsIndex,
- variable,
- get_int64_values(self: stormpy.models.Valuations, variable) list[int]¶
Get the integer variable value for all entities. The i-th entry is the value of entity i.
- get_integer_bigint_value(
- self: stormpy.models.Valuations,
- entity: SupportsInt | SupportsIndex,
- variable,
Get the value of an integer variable as an arbitrary-precision integer. Only needed for integer variables declared with arbitrary-precision bounds whose value does not fit in an int64; get_value already handles the common case.
- get_number_of_entities(self: stormpy.models.Valuations) int¶
Get number of entities
- get_rational_value(
- self: stormpy.models.Valuations,
- entity: SupportsInt | SupportsIndex,
- variable,
- get_rational_values(
- self: stormpy.models.Valuations,
- variable,
Get the rational variable value for all entities. The i-th entry is the value of entity i.
- get_string_value(
- self: stormpy.models.Valuations,
- entity: SupportsInt | SupportsIndex,
- variable,
- get_string_values(self: stormpy.models.Valuations, variable) list[str]¶
- get_value(
- entity: int,
- variable: Variable,
Read a variable at an entity, dispatching by its expression type.
- Parameters:
entity – State or observation index.
variable – Expression variable to read.
- Returns:
Boolean, integer, rational or string value.
- get_values_states(
- variable: Variable,
Read a variable for every entity, returning a list in entity order.
- Parameters:
variable – Expression variable to read.
- Returns:
List with one value per state or observation.
- property manager¶
- select_entities(
- selected_entities: stormpy.datastructures.BitVector,
- select_entities(
- selected_entities: collections.abc.Sequence[SupportsInt | SupportsIndex],
- to_json(
- self: stormpy.models.Valuations,
- entity: SupportsInt | SupportsIndex,
- selected_variables=None,
- to_string(
- self: stormpy.models.Valuations,
- entity: SupportsInt | SupportsIndex,
- pretty: bool = True,
- selected_variables=None,
- write_bool_value(
- self: stormpy.models.Valuations,
- entity: SupportsInt | SupportsIndex,
- variable,
- value: bool,
Write a boolean value for the given entity and variable
- write_double_value(
- self: stormpy.models.Valuations,
- entity: SupportsInt | SupportsIndex,
- variable,
- value: SupportsFloat | SupportsIndex,
Write the value of a rational variable that was declared with the double (64-bit IEEE754) storage encoding via add_double_variable
- write_int64_value(
- self: stormpy.models.Valuations,
- entity: SupportsInt | SupportsIndex,
- variable,
- value: SupportsInt | SupportsIndex,
Write an integer (int64) value for the given entity and variable
- write_integer_bigint_value(
- self: stormpy.models.Valuations,
- entity: SupportsInt | SupportsIndex,
- variable,
- value: stormpy.numbers.Integer,
Write an arbitrary-precision integer value for the given entity and variable. Only needed for integer variables declared with arbitrary-precision bounds whose value does not fit in an int64.
- write_rational_value(
- self: stormpy.models.Valuations,
- entity: SupportsInt | SupportsIndex,
- variable,
- value: stormpy.numbers.Rational,
Write a rational value for the given entity and variable
- write_string_value(
- self: stormpy.models.Valuations,
- entity: SupportsInt | SupportsIndex,
- variable,
- value: str,
Write a string value for the given entity and variable
- write_value( ) None¶
Write a variable at an entity, dispatching by its expression type.
- Parameters:
entity – State or observation index.
variable – Expression variable to write.
value – Value compatible with the variable’s type and storage encoding.