DSL_mau

<< Click to Display Table of Contents >>

Navigation:  Reference Manual > Node definitions >

DSL_mau

Header file: defmau.h

DSL_mau : public DSL_nodeDef

DSL_mau provides implementation for multi-attribute utility (MAU) nodes. By default, the representation uses a numeric weight for each utility parent (the additive linear utility, or ALU, model). It is also possible to specify the multi-attribute utility function as deterministic expressions. See the Equations section for list of functions which can be combined into MAU expressions.


virtual int GetType() const;

Overridden method from DSL_nodeDef. Returns DSL_MAU.


virtual const char* GetTypeName() const;

Overridden method from DSL_nodeDef. Returns "MAU".


const DSL_Dmatrix& GetWeights() const;

Returns a reference to the weights matrix. Note that you do not need to cast DSL_nodeDef pointer obtained from DSL_node::Def to DSL_mau in order to get the utilities. The methods GetMatrix and GetDefinition (declared in DSL_nodeDef) will return a pointer to the same DSL_Dmatrix object. GetWeights is defined to provide a method with a name closely reflecting the influence diagram terminology.


int ConvertToExpressions();

Converts the ALU representation to general MAU, with each expression derived from the existing ALU weight. Returns DSL_OKAY, or a negative error code when the node is already a general MAU.


int GetExpressions(std::vector<std::string> &expr) const;

Fills the expr with MAU expressions and returns DSL_OKAY. If node is ALU, the expr output vector is not modified, and function returns DSL_WRONG_NODE_TYPE.


int SetExpressions(const std::vector<std::string> &expr, std::string *errMsg=NULL);

Sets the MAU expressions. If errMsg is not NULL, it receives human-readable message on error. To remove expressions and change node representation to ALU, pass empty expr vector. Returns DSL_OKAY on success, or a negative error code on failure.


bool ValidateExpression(const std::string &str, std::string &errMsg, int *errPos=NULL);

Validates single expression for use with MAU node. Returns true on success. If validation fails, returns false and errMsg is set to human-readable error message. If errPos is not NULL, the index of the first invalid expression is returned in this output parameter.