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 | |
StageNode * | ptParent |
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. |
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.
StageNode::StageNode | ( | StageNode * | ptPred, | |
const int | nmbAssets, | |||
const int | nodeN, | |||
const double | condProb | |||
) | [inline] |
virtual StageNode::~StageNode | ( | ) | [inline, virtual] |
Definition at line 55 of file investment.cpp.
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().
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_().
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().
double StageNode::prob |
probability (unconditional) of the node
Definition at line 43 of file investment.cpp.
Referenced by LeafNode::make_obj_function_(), and StageNode().