class Expression

Expression is the ancestor of all expression classes

Inheritance:


Public Methods

virtual bool isCompositeExpression()
Test whether this Expression is an instance of CompositeExpression
virtual bool isConstantExpression()
Test whether this Expression is an instance of ConstantExpression
virtual bool isNodeExpression()
Test whether this Expression is an instance of NodeExpression
static Expression* stringToExpression(const std::string& str, Domain dom) throw( ExceptionHugin )
Create an Expression from a given string
static Expression* stringToExpression(const std::string& str, NetworkModel* dom) throw( ExceptionHugin )
Equivalent to stringToExpression(string, Domain) except that it will accept both a Class and a Domain as parameter

Documentation

Expression is the ancestor of all expression classes. Expression classes are used to build expressions for discrete chance node tables and utility tables (see also class Model).
virtual bool isCompositeExpression()
Test whether this Expression is an instance of CompositeExpression

virtual bool isConstantExpression()
Test whether this Expression is an instance of ConstantExpression

virtual bool isNodeExpression()
Test whether this Expression is an instance of NodeExpression

static Expression* stringToExpression(const std::string& str, Domain dom) throw( ExceptionHugin )
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=NetworkModel::stringToExpression("if(true, 1, Distribution(1,2))", domain);

Parameters:
str - The string containing a textual representation of the expression
dom - The domain in which the Expression is generated

static Expression* stringToExpression(const std::string& str, NetworkModel* dom) throw( ExceptionHugin )
Equivalent to stringToExpression(string, Domain) except that it will accept both a Class and a Domain as parameter


Direct child classes:
NodeExpression
ConstantExpression
CompositeExpression

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de