LeafNode Class Reference

This is the class for the leaves, i.e. the last-stage nodes. More...

Inheritance diagram for LeafNode:

Inheritance graph
[legend]
Collaboration diagram for LeafNode:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 LeafNode (StageNode *ptPred, const int nodeN, const double condProb, const double *ptRetVect, const double capTg)
 Constructs a LeafNode object.
double get_wealth (const double *variableValues, const int nmbVars)
 In the leaves, the wealth is computed as: -w + y + capTarget.

Public Attributes

MP_variable w
 shortage variable
MP_variable y
 surplus variable
MP_constraint finalBalance
 constraint for the final balance
MP_data Return
 returns of the assets at this node
double capTarget
 the capital target parameter

Protected Member Functions

void make_obj_function_ ()
 version of make_obj_function_() for the leaves - no recursion


Detailed Description

This is the class for the leaves, i.e. the last-stage nodes.

Definition at line 174 of file investment.cpp.


Constructor & Destructor Documentation

LeafNode::LeafNode ( StageNode ptPred,
const int  nodeN,
const double  condProb,
const double *  ptRetVect,
const double  capTg 
) [inline]

Constructs a LeafNode object.

In this case, we use a deep copy for the MP_data Return, i.e. the return values in the constraints are copied from the retVect array to the constraints. This means that the retVect array can be safely changed or deleted afterwards.

Definition at line 187 of file investment.cpp.

References StageNode::all_constraints, StageNode::all_variables, StageNode::ASSETS, capTarget, finalBalance, StageNode::pt_balance_constraint, StageNode::ptParent, Return, w, StageNode::x, and y.


Member Function Documentation

double LeafNode::get_wealth ( const double *  variableValues,
const int  nmbVars 
) [inline, virtual]

In the leaves, the wealth is computed as: -w + y + capTarget.

Reimplemented from StageNode.

Definition at line 204 of file investment.cpp.

References StageNode::all_variables, and capTarget.

void LeafNode::make_obj_function_ (  )  [inline, protected, virtual]

version of make_obj_function_() for the leaves - no recursion

Reimplemented from StageNode.

Definition at line 212 of file investment.cpp.

References StageNode::objFunction, StageNode::prob, w, and y.


Member Data Documentation

MP_variable LeafNode::w

shortage variable

Definition at line 176 of file investment.cpp.

Referenced by LeafNode(), and make_obj_function_().

MP_variable LeafNode::y

surplus variable

Definition at line 177 of file investment.cpp.

Referenced by LeafNode(), and make_obj_function_().

MP_constraint LeafNode::finalBalance

constraint for the final balance

Definition at line 178 of file investment.cpp.

Referenced by LeafNode().

MP_data LeafNode::Return

returns of the assets at this node

Definition at line 179 of file investment.cpp.

Referenced by LeafNode().

double LeafNode::capTarget

the capital target parameter

Definition at line 180 of file investment.cpp.

Referenced by get_wealth(), and LeafNode().


The documentation for this class was generated from the following file:
Generated on Mon Jan 26 10:55:13 2009 for investment by  doxygen 1.5.4