Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::expressions::SimpleValuation Class Reference

A simple implementation of the valuation interface. More...

#include <SimpleValuation.h>

Inheritance diagram for storm::expressions::SimpleValuation:
Collaboration diagram for storm::expressions::SimpleValuation:

Public Member Functions

 SimpleValuation ()
 Creates an empty simple valuation that is associated to no manager and has no variables.
 SimpleValuation (std::shared_ptr< storm::expressions::ExpressionManager const > const &manager)
 Creates a new valuation over the non-auxiliary variables of the given manager.
 SimpleValuation (SimpleValuation const &other)
SimpleValuation & operator= (SimpleValuation const &other)
 SimpleValuation (SimpleValuation &&other)
SimpleValuation & operator= (SimpleValuation &&other)
bool operator== (SimpleValuation const &other) const
 Checks whether the two valuations are semantically equivalent.
bool contains (Variable const &variable) const
 Checks whether this valuation stores a value for the given variable.
virtual bool getBooleanValue (Variable const &booleanVariable) const override
 Retrieves the value of the given boolean variable.
virtual void setBooleanValue (Variable const &booleanVariable, bool value) override
 Sets the value of the given boolean variable to the provided value.
virtual int_fast64_t getIntegerValue (Variable const &integerVariable) const override
 Retrieves the value of the given integer variable.
virtual int_fast64_t getBitVectorValue (Variable const &bitVectorVariable) const override
 Retrieves the value of the given bit vector variable.
virtual void setIntegerValue (Variable const &integerVariable, int_fast64_t value) override
 Sets the value of the given integer variable to the provided value.
virtual void setBitVectorValue (Variable const &bitVectorVariable, int_fast64_t value) override
 Sets the value of the given bit vector variable to the provided value.
virtual double getRationalValue (Variable const &rationalVariable) const override
 Retrieves the value of the given rational variable.
virtual void setRationalValue (Variable const &rationalVariable, double value) override
 Sets the value of the given boolean variable to the provided value.
virtual std::string toPrettyString (std::set< storm::expressions::Variable > const &selectedVariables) const
 Returns a string representation of the valuation of the selected variables.
virtual std::string toString (bool pretty=true) const
storm::json< storm::RationalNumber > toJson () const
Public Member Functions inherited from storm::expressions::Valuation
 Valuation (std::shared_ptr< ExpressionManager const > const &manager)
 Creates a valuation of all non-auxiliary variables managed by the given manager.
virtual ~Valuation ()
 Declare virtual destructor, so we can properly delete instances later.
ExpressionManager const & getManager () const
 Retrieves the manager responsible for the variables of this valuation.

Friends

class SimpleValuationPointerHash
class SimpleValuationPointerLess
std::ostream & operator<< (std::ostream &out, SimpleValuation const &valuation)

Additional Inherited Members

Protected Member Functions inherited from storm::expressions::Valuation
std::shared_ptr< ExpressionManager const > const & getManagerAsSharedPtr () const
 Retrieves the manager responsible for the variables of this valuation.
void setManager (std::shared_ptr< ExpressionManager const > const &manager)
 Sets the manager responsible for the variables in this valuation.

Detailed Description

A simple implementation of the valuation interface.

Definition at line 17 of file SimpleValuation.h.

Constructor & Destructor Documentation

◆ SimpleValuation() [1/4]

storm::expressions::SimpleValuation::SimpleValuation ( )

Creates an empty simple valuation that is associated to no manager and has no variables.

Definition at line 16 of file SimpleValuation.cpp.

◆ SimpleValuation() [2/4]

storm::expressions::SimpleValuation::SimpleValuation ( std::shared_ptr< storm::expressions::ExpressionManager const > const & manager)

Creates a new valuation over the non-auxiliary variables of the given manager.

Parameters
managerThe manager responsible for the variables of this valuation.

Definition at line 20 of file SimpleValuation.cpp.

◆ SimpleValuation() [3/4]

storm::expressions::SimpleValuation::SimpleValuation ( SimpleValuation const & other)

Definition at line 28 of file SimpleValuation.cpp.

◆ SimpleValuation() [4/4]

storm::expressions::SimpleValuation::SimpleValuation ( SimpleValuation && other)

Definition at line 46 of file SimpleValuation.cpp.

Member Function Documentation

◆ contains()

bool storm::expressions::SimpleValuation::contains ( Variable const & variable) const

Checks whether this valuation stores a value for the given variable.

The contained variables are those the manager knew at the time this valuation was created. Variables that are declared in the manager afterwards are not contained, as valuations are invalidated by such declarations. Note that array and string variables are never contained, as they are not stored by valuations of this type.

Parameters
variableThe variable to check.
Returns
True iff this valuation stores a value for the given variable.

Definition at line 69 of file SimpleValuation.cpp.

◆ getBitVectorValue()

int_fast64_t storm::expressions::SimpleValuation::getBitVectorValue ( Variable const & bitVectorVariable) const
overridevirtual

Retrieves the value of the given bit vector variable.

Parameters
bitVectorVariableThe bit vector variable whose value to retrieve.
Returns
The value of the bit vector variable.

Implements storm::expressions::Valuation.

Definition at line 100 of file SimpleValuation.cpp.

◆ getBooleanValue()

bool storm::expressions::SimpleValuation::getBooleanValue ( Variable const & booleanVariable) const
overridevirtual

Retrieves the value of the given boolean variable.

Parameters
booleanVariableThe boolean variable whose value to retrieve.
Returns
The value of the boolean variable.

Implements storm::expressions::Valuation.

Definition at line 90 of file SimpleValuation.cpp.

◆ getIntegerValue()

int_fast64_t storm::expressions::SimpleValuation::getIntegerValue ( Variable const & integerVariable) const
overridevirtual

Retrieves the value of the given integer variable.

Parameters
integerVariableThe integer variable whose value to retrieve.
Returns
The value of the integer variable.

Implements storm::expressions::Valuation.

Definition at line 95 of file SimpleValuation.cpp.

◆ getRationalValue()

double storm::expressions::SimpleValuation::getRationalValue ( Variable const & rationalVariable) const
overridevirtual

Retrieves the value of the given rational variable.

Parameters
rationalVariableThe rational variable whose value to retrieve.
Returns
The value of the rational variable.

Implements storm::expressions::Valuation.

Definition at line 105 of file SimpleValuation.cpp.

◆ operator=() [1/2]

SimpleValuation & storm::expressions::SimpleValuation::operator= ( SimpleValuation && other)

Definition at line 54 of file SimpleValuation.cpp.

◆ operator=() [2/2]

SimpleValuation & storm::expressions::SimpleValuation::operator= ( SimpleValuation const & other)

Definition at line 36 of file SimpleValuation.cpp.

◆ operator==()

bool storm::expressions::SimpleValuation::operator== ( SimpleValuation const & other) const

Checks whether the two valuations are semantically equivalent.

Parameters
otherThe valuation with which to compare.
Returns
True iff the two valuations are semantically equivalent.

Definition at line 64 of file SimpleValuation.cpp.

◆ setBitVectorValue()

void storm::expressions::SimpleValuation::setBitVectorValue ( Variable const & bitVectorVariable,
int_fast64_t value )
overridevirtual

Sets the value of the given bit vector variable to the provided value.

Parameters
bitVectorVariableThe variable whose value to set.
valueThe new value of the variable.

Implements storm::expressions::Valuation.

Definition at line 120 of file SimpleValuation.cpp.

◆ setBooleanValue()

void storm::expressions::SimpleValuation::setBooleanValue ( Variable const & booleanVariable,
bool value )
overridevirtual

Sets the value of the given boolean variable to the provided value.

Parameters
booleanVariableThe variable whose value to set.
valueThe new value of the variable.

Implements storm::expressions::Valuation.

Definition at line 110 of file SimpleValuation.cpp.

◆ setIntegerValue()

void storm::expressions::SimpleValuation::setIntegerValue ( Variable const & integerVariable,
int_fast64_t value )
overridevirtual

Sets the value of the given integer variable to the provided value.

Parameters
integerVariableThe variable whose value to set.
valueThe new value of the variable.

Implements storm::expressions::Valuation.

Definition at line 115 of file SimpleValuation.cpp.

◆ setRationalValue()

void storm::expressions::SimpleValuation::setRationalValue ( Variable const & rationalVariable,
double value )
overridevirtual

Sets the value of the given boolean variable to the provided value.

Parameters
integerVariableThe variable whose value to set.
valueThe new value of the variable.

Implements storm::expressions::Valuation.

Definition at line 125 of file SimpleValuation.cpp.

◆ toJson()

storm::json< storm::RationalNumber > storm::expressions::SimpleValuation::toJson ( ) const

Definition at line 186 of file SimpleValuation.cpp.

◆ toPrettyString()

std::string storm::expressions::SimpleValuation::toPrettyString ( std::set< storm::expressions::Variable > const & selectedVariables) const
virtual

Returns a string representation of the valuation of the selected variables.

Parameters
selectedVariablesThe variables to select.
Returns
The string representation.

Definition at line 130 of file SimpleValuation.cpp.

◆ toString()

std::string storm::expressions::SimpleValuation::toString ( bool pretty = true) const
virtual

Definition at line 149 of file SimpleValuation.cpp.

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
SimpleValuation const & valuation )
friend

Definition at line 206 of file SimpleValuation.cpp.

◆ SimpleValuationPointerHash

friend class SimpleValuationPointerHash
friend

Definition at line 19 of file SimpleValuation.h.

◆ SimpleValuationPointerLess

friend class SimpleValuationPointerLess
friend

Definition at line 20 of file SimpleValuation.h.


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