Class for a 2-stage tree (bush) More...
#include <scen-tree_struct.hpp>
Public Member Functions | |
TwoStageTree (int const nScens) | |
Constructor. More... | |
~TwoStageTree () | |
Destructor. More... | |
int | get_parent_node (int n) const |
Get the parent of a given node. More... | |
void | set_scen_prob (double *const pr) |
Set scenario probabilities (if non-equiprobable) More... | |
double | get_scen_prob (int const sc) const |
Get probability of a given scenarios. More... | |
int const * | get_scen_nodes (int const sc) |
Get the vector of nodes of a given scenarios. More... | |
int const * | get_next_scen (int &scen, int &parentScen, int &branchStage, double &prob) |
Get vector of nodes of a next scenario in the list. More... | |
![]() | |
ScenTreeStruct (int const nScens, int const nStages=0) | |
Constructor. More... | |
virtual | ~ScenTreeStruct () |
Destructor. More... | |
int | get_nmb_stages () const |
Get the number of stages. More... | |
int | get_nmb_scens () const |
Get the number of scenarios = the number of leaves. More... | |
int const * | get_core_scen () |
Get the vector of nodes of a core scenario - just a wrapper. More... | |
Public Attributes | |
int | nmbStages |
number of stages, again counted from zero More... | |
![]() | |
int | nmbStages |
number of stages, again counted from zero More... | |
Protected Member Functions | |
int | set_scen_nodes (int const sc) |
Fill scenNodeNmb with nodes of a given scenarios. More... | |
Protected Attributes | |
int | nmbScens |
number of scenarios More... | |
vector< int > | leaves |
list of leaf nodes - they define scenarios More... | |
vector< double > | probs |
scenario probabilities More... | |
int | scenNodeNmb [2] |
vector of nodes of a scenario - for internal use More... | |
int | nextScen |
next scenario to be processed by gen_next_scen More... | |
![]() | |
int | nmbScens |
number of scenarios More... | |
vector< int > | leaves |
list of leaf nodes - they define scenarios More... | |
Class for a 2-stage tree (bush)
Definition at line 118 of file scen-tree_struct.hpp.
FlopSmiEx::TwoStageTree::TwoStageTree | ( | int const | nScens | ) |
Constructor.
|
inline |
Destructor.
Definition at line 140 of file scen-tree_struct.hpp.
|
inlineprotected |
Fill scenNodeNmb
with nodes of a given scenarios.
scenNodeNmb
Definition at line 128 of file scen-tree_struct.hpp.
|
inlinevirtual |
Get the parent of a given node.
Implements FlopSmiEx::ScenTreeStruct.
Definition at line 143 of file scen-tree_struct.hpp.
void FlopSmiEx::TwoStageTree::set_scen_prob | ( | double *const | pr | ) |
Set scenario probabilities (if non-equiprobable)
|
inlinevirtual |
Get probability of a given scenarios.
Implements FlopSmiEx::ScenTreeStruct.
Definition at line 149 of file scen-tree_struct.hpp.
|
inlinevirtual |
Get the vector of nodes of a given scenarios.
Implements FlopSmiEx::ScenTreeStruct.
Definition at line 152 of file scen-tree_struct.hpp.
|
virtual |
Get vector of nodes of a next scenario in the list.
This assumes that the class itself will keep track of the calls and hence knows what is the next scenario. This is used for Smi, when each scenario is described as a difference from a given parent scenario.
[out] | scen | number of the new scenario |
[out] | parentScen | parent scenario |
[out] | branchStage | stage where scen diverges from parentScen |
[out] | prob | probability of the new scenario |
Implements FlopSmiEx::ScenTreeStruct.
|
protected |
number of scenarios
Definition at line 120 of file scen-tree_struct.hpp.
|
protected |
list of leaf nodes - they define scenarios
Definition at line 121 of file scen-tree_struct.hpp.
|
protected |
scenario probabilities
Definition at line 122 of file scen-tree_struct.hpp.
|
protected |
vector of nodes of a scenario - for internal use
Definition at line 123 of file scen-tree_struct.hpp.
|
protected |
next scenario to be processed by gen_next_scen
Definition at line 124 of file scen-tree_struct.hpp.
int FlopSmiEx::TwoStageTree::nmbStages |
number of stages, again counted from zero
Definition at line 134 of file scen-tree_struct.hpp.