Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
RationalLiteralExpression.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace storm {
7namespace expressions {
9 public:
16 RationalLiteralExpression(ExpressionManager const& manager, double value);
17
24 RationalLiteralExpression(ExpressionManager const& manager, std::string const& valueAsString);
25
32 RationalLiteralExpression(ExpressionManager const& manager, storm::RationalNumber const& value);
33
34 // Instantiate constructors and assignments with their default implementations.
39
40 virtual ~RationalLiteralExpression() = default;
41
42 // Override base class methods.
43 virtual double evaluateAsDouble(Valuation const* valuation = nullptr) const override;
44 virtual bool isLiteral() const override;
45 virtual void gatherVariables(std::set<storm::expressions::Variable>& variables) const override;
46 virtual std::shared_ptr<BaseExpression const> simplify() const override;
47 virtual boost::any accept(ExpressionVisitor& visitor, boost::any const& data) const override;
48 virtual bool isRationalLiteralExpression() const override;
49
55 double getValueAsDouble() const;
56
62 storm::RationalNumber getValue() const;
63
64 protected:
65 // Override base class method.
66 virtual void printToStream(std::ostream& stream) const override;
67
68 private:
69 // The value of the literal.
70 storm::RationalNumber value;
71};
72} // namespace expressions
73} // namespace storm
The base class of all expression classes.
This class is responsible for managing a set of typed variables and all expressions using these varia...
double getValueAsDouble() const
Retrieves the value of the double literal.
RationalLiteralExpression & operator=(RationalLiteralExpression &&)=delete
storm::RationalNumber getValue() const
Retrieves the value of the double literal.
RationalLiteralExpression & operator=(RationalLiteralExpression const &other)=delete
virtual double evaluateAsDouble(Valuation const *valuation=nullptr) const override
Evaluates the expression under the valuation of unknowns (variables and constants) given by the valua...
RationalLiteralExpression(RationalLiteralExpression &&)=default
virtual void printToStream(std::ostream &stream) const override
Prints the expression to the given stream.
RationalLiteralExpression(RationalLiteralExpression const &other)=default
virtual void gatherVariables(std::set< storm::expressions::Variable > &variables) const override
Retrieves the set of all variables that appear in the expression.
virtual boost::any accept(ExpressionVisitor &visitor, boost::any const &data) const override
Accepts the given visitor by calling its visit method.
virtual bool isLiteral() const override
Retrieves whether the expression is a literal.
virtual std::shared_ptr< BaseExpression const > simplify() const override
Simplifies the expression according to some simple rules.
The base class of all valuations of variables.
Definition Valuation.h:16