StageNode Class Reference

This is the base class for describing a model in one node of the tree. More...

Inheritance diagram for StageNode:

Inheritance graph
[legend]
Collaboration diagram for StageNode:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 StageNode (StageNode *ptPred, const int nmbAssets, const int nodeN, const double condProb)
virtual ~StageNode ()

Public Attributes

MP_set ASSETS
 set of assets
MP_index a
 index used in formulas
MP_variable x
 the "buy" variable, defined on ASSETS
MP_expression objFunction
 objective function at this node
StageNodeptParent
 pointer to parent node
vector< StageNode * > children
 pointers to children of this node
int nodeNmb
 node number - used only for reporting
double prob
 probability (unconditional) of the node

Protected Member Functions

virtual void make_obj_function_ ()
 Create the objective function expression, recursively for all children.


Detailed Description

This is the base class for describing a model in one node of the tree.

Note that variable x, as well as the vector of children, should not really be in this class, as they are not needed in all the nodes (they do not exist in leaves). It would thus be better to have an additional derived class for non-leaf nodes and then derive RootNode and MidStageNode from this one. This solution, however, brings some other problems...

Definition at line 33 of file investment.cpp.


Constructor & Destructor Documentation

StageNode::StageNode ( StageNode ptPred,
const int  nmbAssets,
const int  nodeN,
const double  condProb 
) [inline]

Definition at line 45 of file investment.cpp.

References children, prob, and ptParent.

virtual StageNode::~StageNode (  )  [inline, virtual]

Definition at line 55 of file investment.cpp.


Member Function Documentation

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

Create the objective function expression, recursively for all children.

This function is protected, as it only makes sense to call it in the root, to create the complete objective function.

Reimplemented in LeafNode.

Definition at line 61 of file investment.cpp.

References children, and objFunction.

Referenced by RootNode::make_objective_function().


Member Data Documentation

MP_set StageNode::ASSETS

set of assets

Definition at line 35 of file investment.cpp.

Referenced by LeafNode::LeafNode(), MidStageNode::MidStageNode(), and RootNode::RootNode().

MP_index StageNode::a

index used in formulas

Definition at line 36 of file investment.cpp.

Referenced by MidStageNode::MidStageNode().

MP_variable StageNode::x

the "buy" variable, defined on ASSETS

Definition at line 37 of file investment.cpp.

Referenced by LeafNode::LeafNode(), main(), MidStageNode::MidStageNode(), and RootNode::RootNode().

MP_expression StageNode::objFunction

objective function at this node

Definition at line 38 of file investment.cpp.

Referenced by main(), LeafNode::make_obj_function_(), and make_obj_function_().

StageNode* StageNode::ptParent

pointer to parent node

Definition at line 40 of file investment.cpp.

Referenced by LeafNode::LeafNode(), MidStageNode::MidStageNode(), and StageNode().

vector<StageNode *> StageNode::children

pointers to children of this node

Definition at line 41 of file investment.cpp.

Referenced by make_obj_function_(), and StageNode().

int StageNode::nodeNmb

node number - used only for reporting

Definition at line 42 of file investment.cpp.

double StageNode::prob

probability (unconditional) of the node

Definition at line 43 of file investment.cpp.

Referenced by LeafNode::make_obj_function_(), and StageNode().


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