Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::storage::sparse::Valuations Class Reference

Provides access to valuations of variables for a set of entities (e.g. More...

#include <Valuations.h>

Public Member Functions

 Valuations (ValuationClassDescription const valuationClassDescription, std::shared_ptr< storm::expressions::ExpressionManager const > const &manager={}, uint64_t const numEntities=0)
 Valuations (ValuationsStorage &&umbValuations)
 Valuations (Valuations const &other)
 Valuations (Valuations &&other)
 ~Valuations ()
Valuationsoperator= (Valuations &&other)
Valuationsoperator= (Valuations const &other)
storm::expressions::ExpressionManager const & getManager () const
ValuationsStorage const & getStorage () const
ValuationsStoragegetStorage ()
uint64_t getNumberOfEntities () const
std::set< storm::expressions::VariablegetAllVariables () const
bool entityHasVariable (uint64_t entity, storm::expressions::Variable const &variable) const
 Returns true iff the variable is relevant for the given entity.
bool getBooleanValue (uint64_t const entity, storm::expressions::Variable const &booleanVariable) const
std::optional< bool > getOptionalBooleanValue (uint64_t const entity, storm::expressions::Variable const &booleanVariable) const
int64_t getInt64Value (uint64_t const entity, storm::expressions::Variable const &integerVariable) const
std::optional< int64_t > getOptionalInt64Value (uint64_t const entity, storm::expressions::Variable const &integerVariable) const
double getDoubleValue (uint64_t const entity, storm::expressions::Variable const &doubleVariable) const
std::optional< double > getOptionalDoubleValue (uint64_t const entity, storm::expressions::Variable const &doubleVariable) const
storm::RationalNumber getRationalValue (uint64_t const entity, storm::expressions::Variable const &rationalVariable) const
std::optional< storm::RationalNumber > getOptionalRationalValue (uint64_t const entity, storm::expressions::Variable const &rationalVariable) const
std::string getStringValue (uint64_t const entity, storm::expressions::Variable const &stringVariable) const
std::optional< std::string > getOptionalStringValue (uint64_t const entity, storm::expressions::Variable const &stringVariable) const
template<typename RationalValueType>
void setValuesInEvaluator (uint64_t entity, storm::expressions::ExpressionEvaluator< RationalValueType > &evaluator) const
 Reads the variable values for the given entity and sets them into the given expression evaluator.
storm::storage::BitVector getBooleanValues (storm::expressions::Variable const &booleanVariable) const
 Returns a vector of size getNumberOfEntities() such that the i'th entry is the value of the given variable of entity i.
std::vector< int64_t > getInt64Values (storm::expressions::Variable const &integerVariable) const
 Returns a vector of size getNumberOfEntities() such that the i'th entry is the value of the given variable of entity i.
std::vector< double > getDoubleValues (storm::expressions::Variable const &doubleVariable) const
 Returns a vector of size getNumberOfEntities() such that the i'th entry is the value of the given variable of entity i.
std::vector< storm::RationalNumber > getRationalValues (storm::expressions::Variable const &rationalVariable) const
 Returns a vector of size getNumberOfEntities() such that the i'th entry is the value of the given variable of entity i.
std::vector< std::string > getStringValues (storm::expressions::Variable const &stringVariable) const
 Returns a vector of size getNumberOfEntities() such that the i'th entry is the value of the given variable of entity i.
std::string toString (uint64_t const entity, bool const pretty=true, std::optional< std::set< storm::expressions::Variable > > const &selectedVariables={}) const
 Returns a string representation of the valuation.
template<typename JsonRationalType = storm::RationalNumber>
storm::json< JsonRationalType > toJson (uint64_t const entity, std::optional< std::set< storm::expressions::Variable > > const &selectedVariables={}) const
 Returns a JSON representation of this valuation.
Valuations selectEntities (storm::storage::BitVector const &selectedEntities) const
 Derive new valuations from this by selecting the given entities.
Valuations selectEntities (std::vector< uint64_t > const &selectedEntities) const
 Derive new valuations from this by selecting the given entities.
std::size_t hash () const

Detailed Description

Provides access to valuations of variables for a set of entities (e.g.

states / observations). This class serves as a wrapper around the more low-level storm::storage::sparse::ValuationsStorage class

Definition at line 28 of file Valuations.h.

Constructor & Destructor Documentation

◆ Valuations() [1/4]

storm::storage::sparse::Valuations::Valuations ( ValuationClassDescription const valuationClassDescription,
std::shared_ptr< storm::expressions::ExpressionManager const > const & manager = {},
uint64_t const numEntities = 0 )

Definition at line 12 of file Valuations.cpp.

◆ Valuations() [2/4]

storm::storage::sparse::Valuations::Valuations ( ValuationsStorage && umbValuations)

Definition at line 18 of file Valuations.cpp.

◆ Valuations() [3/4]

storm::storage::sparse::Valuations::Valuations ( Valuations const & other)

Definition at line 30 of file Valuations.cpp.

◆ Valuations() [4/4]

storm::storage::sparse::Valuations::Valuations ( Valuations && other)
default

◆ ~Valuations()

storm::storage::sparse::Valuations::~Valuations ( )
default

Member Function Documentation

◆ entityHasVariable()

bool storm::storage::sparse::Valuations::entityHasVariable ( uint64_t entity,
storm::expressions::Variable const & variable ) const

Returns true iff the variable is relevant for the given entity.

Definition at line 68 of file Valuations.cpp.

◆ getAllVariables()

std::set< storm::expressions::Variable > storm::storage::sparse::Valuations::getAllVariables ( ) const
Returns
the variables that this stores valuations for

Definition at line 64 of file Valuations.cpp.

◆ getBooleanValue()

bool storm::storage::sparse::Valuations::getBooleanValue ( uint64_t const entity,
storm::expressions::Variable const & booleanVariable ) const

Definition at line 72 of file Valuations.cpp.

◆ getBooleanValues()

storm::storage::BitVector storm::storage::sparse::Valuations::getBooleanValues ( storm::expressions::Variable const & booleanVariable) const

Returns a vector of size getNumberOfEntities() such that the i'th entry is the value of the given variable of entity i.

Definition at line 170 of file Valuations.cpp.

◆ getDoubleValue()

double storm::storage::sparse::Valuations::getDoubleValue ( uint64_t const entity,
storm::expressions::Variable const & doubleVariable ) const

Definition at line 109 of file Valuations.cpp.

◆ getDoubleValues()

std::vector< double > storm::storage::sparse::Valuations::getDoubleValues ( storm::expressions::Variable const & doubleVariable) const

Returns a vector of size getNumberOfEntities() such that the i'th entry is the value of the given variable of entity i.

Definition at line 192 of file Valuations.cpp.

◆ getInt64Value()

int64_t storm::storage::sparse::Valuations::getInt64Value ( uint64_t const entity,
storm::expressions::Variable const & integerVariable ) const

Definition at line 91 of file Valuations.cpp.

◆ getInt64Values()

std::vector< int64_t > storm::storage::sparse::Valuations::getInt64Values ( storm::expressions::Variable const & integerVariable) const

Returns a vector of size getNumberOfEntities() such that the i'th entry is the value of the given variable of entity i.

Definition at line 181 of file Valuations.cpp.

◆ getManager()

storm::expressions::ExpressionManager const & storm::storage::sparse::Valuations::getManager ( ) const

Definition at line 49 of file Valuations.cpp.

◆ getNumberOfEntities()

uint64_t storm::storage::sparse::Valuations::getNumberOfEntities ( ) const
Returns
the numer of entities that this object describes

Definition at line 60 of file Valuations.cpp.

◆ getOptionalBooleanValue()

std::optional< bool > storm::storage::sparse::Valuations::getOptionalBooleanValue ( uint64_t const entity,
storm::expressions::Variable const & booleanVariable ) const

Definition at line 76 of file Valuations.cpp.

◆ getOptionalDoubleValue()

std::optional< double > storm::storage::sparse::Valuations::getOptionalDoubleValue ( uint64_t const entity,
storm::expressions::Variable const & doubleVariable ) const

Definition at line 113 of file Valuations.cpp.

◆ getOptionalInt64Value()

std::optional< int64_t > storm::storage::sparse::Valuations::getOptionalInt64Value ( uint64_t const entity,
storm::expressions::Variable const & integerVariable ) const

Definition at line 95 of file Valuations.cpp.

◆ getOptionalRationalValue()

std::optional< storm::RationalNumber > storm::storage::sparse::Valuations::getOptionalRationalValue ( uint64_t const entity,
storm::expressions::Variable const & rationalVariable ) const

Definition at line 131 of file Valuations.cpp.

◆ getOptionalStringValue()

std::optional< std::string > storm::storage::sparse::Valuations::getOptionalStringValue ( uint64_t const entity,
storm::expressions::Variable const & stringVariable ) const

Definition at line 149 of file Valuations.cpp.

◆ getRationalValue()

storm::RationalNumber storm::storage::sparse::Valuations::getRationalValue ( uint64_t const entity,
storm::expressions::Variable const & rationalVariable ) const

Definition at line 127 of file Valuations.cpp.

◆ getRationalValues()

std::vector< storm::RationalNumber > storm::storage::sparse::Valuations::getRationalValues ( storm::expressions::Variable const & rationalVariable) const

Returns a vector of size getNumberOfEntities() such that the i'th entry is the value of the given variable of entity i.

Definition at line 203 of file Valuations.cpp.

◆ getStorage() [1/2]

ValuationsStorage & storm::storage::sparse::Valuations::getStorage ( )

Definition at line 56 of file Valuations.cpp.

◆ getStorage() [2/2]

ValuationsStorage const & storm::storage::sparse::Valuations::getStorage ( ) const

Definition at line 53 of file Valuations.cpp.

◆ getStringValue()

std::string storm::storage::sparse::Valuations::getStringValue ( uint64_t const entity,
storm::expressions::Variable const & stringVariable ) const

Definition at line 145 of file Valuations.cpp.

◆ getStringValues()

std::vector< std::string > storm::storage::sparse::Valuations::getStringValues ( storm::expressions::Variable const & stringVariable) const

Returns a vector of size getNumberOfEntities() such that the i'th entry is the value of the given variable of entity i.

Definition at line 214 of file Valuations.cpp.

◆ hash()

std::size_t storm::storage::sparse::Valuations::hash ( ) const

Definition at line 273 of file Valuations.cpp.

◆ operator=() [1/2]

Valuations & storm::storage::sparse::Valuations::operator= ( Valuations && other)
default

◆ operator=() [2/2]

Valuations & storm::storage::sparse::Valuations::operator= ( Valuations const & other)

Definition at line 37 of file Valuations.cpp.

◆ selectEntities() [1/2]

Valuations storm::storage::sparse::Valuations::selectEntities ( std::vector< uint64_t > const & selectedEntities) const

Derive new valuations from this by selecting the given entities.

Requires that the selectedEntities are valid indices, i.e., < getNumberOfEntities()

Definition at line 269 of file Valuations.cpp.

◆ selectEntities() [2/2]

Valuations storm::storage::sparse::Valuations::selectEntities ( storm::storage::BitVector const & selectedEntities) const

Derive new valuations from this by selecting the given entities.

Definition at line 265 of file Valuations.cpp.

◆ setValuesInEvaluator()

template<typename RationalValueType>
template void storm::storage::sparse::Valuations::setValuesInEvaluator ( uint64_t entity,
storm::expressions::ExpressionEvaluator< RationalValueType > & evaluator ) const

Reads the variable values for the given entity and sets them into the given expression evaluator.

Template Parameters
RationalValueTypeThe value type of rationals as stored by the evaluator (e.g. double or storm::RationalNumber).
Parameters
entityEntity index; must be less than size().
evaluatorThe expression evaluator to set the variable values into.

Definition at line 164 of file Valuations.cpp.

◆ toJson()

template<typename JsonRationalType>
template storm::json< double > storm::storage::sparse::Valuations::toJson< double > ( uint64_t const entity,
std::optional< std::set< storm::expressions::Variable > > const & selectedVariables = {} ) const

Returns a JSON representation of this valuation.

Parameters
selectedVariablesIf given, only the informations for the variables in this set are processed.
Returns
the json representation

Definition at line 254 of file Valuations.cpp.

◆ toString()

std::string storm::storage::sparse::Valuations::toString ( uint64_t const entity,
bool const pretty = true,
std::optional< std::set< storm::expressions::Variable > > const & selectedVariables = {} ) const

Returns a string representation of the valuation.

Parameters
selectedVariablesIf given, only the informations for the variables in this set are processed.
Returns
The string representation.

Definition at line 225 of file Valuations.cpp.


The documentation for this class was generated from the following files: