Inheritance diagram for HAPI::Expression:
Expression classes are used to build expressions for discrete chance node tables and utility tables (see also class Model).
Public Member Functions | |
Expression (const Expression &exprSrc) | |
Create a new expression from an existing expression. | |
virtual Expression * | clone () const=0 |
Clone this Expression. | |
virtual bool | isCompositeExpression () const=0 |
Test whether this Expression is an instance of CompositeExpression. | |
virtual bool | isConstantExpression () const=0 |
Test whether this Expression is an instance of ConstantExpression. | |
virtual bool | isNodeExpression () const=0 |
Test whether this Expression is an instance of NodeExpression. | |
Expression & | operator= (const Expression &rightExpr) |
Assignment operator. | |
std::string | toString () |
Return a string representation of this expression. | |
Static Public Member Functions | |
Expression * | stringToExpression (const std::string &str, const Domain &dom) |
Create an Expression from a given string. | |
Expression * | stringToExpression (const std::string &str, const Class &cls) |
Equivalent to stringToExpression (string, Domain) except that it takes a Class as second argument. |
|
Create a new expression from an existing expression.
|
|
|
Create an Expression from a given string. To ease the creation of complex expressions, it is possible to specify these as strings, instead of building them with objects. Example: The following code Expression *result=new IfExpression (new BooleanExpression (true), new NumberExpression (1), new DistributionDistribution (new NumberExpression (1), new NumberExpression (2))); can be written like this: Expression *result = Expression::stringToExpression ("if (true, 1, Distribution (1,2)) ", domain);
|
|
Return a string representation of this expression.
|