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 |
Definition at line 174 of file investment.cpp.
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.
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.
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().