Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SimpleValuation.h
Go to the documentation of this file.
1#ifndef STORM_STORAGE_EXPRESSIONS_SIMPLEVALUATION_H_
2#define STORM_STORAGE_EXPRESSIONS_SIMPLEVALUATION_H_
3
4#include <cstdint>
5#include <set>
6#include <vector>
7
11
12namespace storm {
13namespace expressions {
14
18class SimpleValuation : public Valuation {
19 public:
22
27
33 SimpleValuation(std::shared_ptr<storm::expressions::ExpressionManager const> const& manager);
34
35 // Define deep-copy and move operators.
36 SimpleValuation(SimpleValuation const& other);
40
47 bool operator==(SimpleValuation const& other) const;
48
49 // Override virtual functions of base class.
50 virtual bool getBooleanValue(Variable const& booleanVariable) const override;
51 virtual void setBooleanValue(Variable const& booleanVariable, bool value) override;
52 virtual int_fast64_t getIntegerValue(Variable const& integerVariable) const override;
53 virtual int_fast64_t getBitVectorValue(Variable const& bitVectorVariable) const override;
54 virtual void setIntegerValue(Variable const& integerVariable, int_fast64_t value) override;
55 virtual void setBitVectorValue(Variable const& bitVectorVariable, int_fast64_t value) override;
56 virtual double getRationalValue(Variable const& rationalVariable) const override;
57 virtual void setRationalValue(Variable const& rationalVariable, double value) override;
58
65 virtual std::string toPrettyString(std::set<storm::expressions::Variable> const& selectedVariables) const;
66
67 virtual std::string toString(bool pretty = true) const;
69
70 friend std::ostream& operator<<(std::ostream& out, SimpleValuation const& valuation);
71
72 private:
73 // Containers that store the values of the variables of the appropriate type.
74 std::vector<bool> booleanValues;
75 std::vector<int_fast64_t> integerValues;
76 std::vector<double> rationalValues;
77};
78
79std::ostream& operator<<(std::ostream& out, SimpleValuation const& valuation);
80
86 public:
87 std::size_t operator()(SimpleValuation* valuation) const;
88};
89
96 public:
97 bool operator()(SimpleValuation* valuation1, SimpleValuation* valuation2) const;
98};
99
106 public:
107 bool operator()(SimpleValuation* valuation1, SimpleValuation* valuation2) const;
108};
109} // namespace expressions
110} // namespace storm
111
112#endif /* STORM_STORAGE_EXPRESSIONS_SIMPLEVALUATION_H_ */
A simple implementation of the valuation interface.
friend std::ostream & operator<<(std::ostream &out, SimpleValuation const &valuation)
virtual std::string toPrettyString(std::set< storm::expressions::Variable > const &selectedVariables) const
Returns a string representation of the valuation of the selected variables.
virtual void setIntegerValue(Variable const &integerVariable, int_fast64_t value) override
Sets the value of the given integer variable to the provided value.
virtual int_fast64_t getIntegerValue(Variable const &integerVariable) const override
Retrieves the value of the given integer variable.
virtual double getRationalValue(Variable const &rationalVariable) const override
Retrieves the value of the given rational variable.
bool operator==(SimpleValuation const &other) const
Checks whether the two valuations are semantically equivalent.
virtual void setBooleanValue(Variable const &booleanVariable, bool value) override
Sets the value of the given boolean variable to the provided value.
SimpleValuation & operator=(SimpleValuation const &other)
storm::json< storm::RationalNumber > toJson() const
virtual std::string toString(bool pretty=true) const
virtual bool getBooleanValue(Variable const &booleanVariable) const override
Retrieves the value of the given boolean variable.
SimpleValuation()
Creates an empty simple valuation that is associated to no manager and has no variables.
virtual void setRationalValue(Variable const &rationalVariable, double value) override
Sets the value of the given boolean variable to the provided value.
virtual int_fast64_t getBitVectorValue(Variable const &bitVectorVariable) const override
Retrieves the value of the given bit vector variable.
virtual void setBitVectorValue(Variable const &bitVectorVariable, int_fast64_t value) override
Sets the value of the given bit vector variable to the provided value.
A helper class that can be used as the comparison functor wrt.
bool operator()(SimpleValuation *valuation1, SimpleValuation *valuation2) const
A helper class that can pe used as the hash functor for data structures that need to hash valuations ...
std::size_t operator()(SimpleValuation *valuation) const
A helper class that can be used as the comparison functor wrt.
bool operator()(SimpleValuation *valuation1, SimpleValuation *valuation2) const
The base class of all valuations of variables.
Definition Valuation.h:16
std::ostream & operator<<(std::ostream &stream, BaseExpression const &expression)
LabParser.cpp.
Definition cli.cpp:18
nlohmann::basic_json< std::map, std::vector, std::string, bool, int64_t, uint64_t, ValueType > json
Definition JsonForward.h:10