14 #ifndef SCENTREE_STRUCT_HPP
15 #define SCENTREE_STRUCT_HPP
75 int &branchStage,
double &prob) = 0;
113 int &branchStage,
double &prob);
168 int &branchStage,
double &prob);
int const * get_core_scen()
Get the vector of nodes of a core scenario - just a wrapper.
Class for a 2-stage tree (bush)
int get_parent_node(int n) const
Get the parent of a given node.
vector< int > leaves
list of leaf nodes - they define scenarios
int nextScen
next scenario to be processed by gen_next_scen
int get_nmb_scens() const
Get the number of scenarios = the number of leaves.
int nmbScens
number of scenarios
int const * get_scen_nodes(int const sc)
Get the vector of nodes of a given scenarios.
int nmbStages
number of stages, again counted from zero
double scenProb
probability of each scenario (equiprobable)
int nmbStages
number of stages, again counted from zero
ScenTreeStruct(int const nScens, int const nStages=0)
Constructor.
TwoStageTree(int const nScens)
Constructor.
virtual int const * get_next_scen(int &scen, int &parentScen, int &branchStage, double &prob)=0
Get vector of nodes of a next scenario in the list.
int const * get_next_scen(int &scen, int &parentScen, int &branchStage, double &prob)
Get vector of nodes of a next scenario in the list.
vector< double > probs
scenario probabilities
int nmbScens
number of scenarios
int * scenNodeNmb
vector of nodes of a scenario - for internal use
int const * get_scen_nodes(int const sc)
Get the vector of nodes of a given scenarios.
double get_scen_prob(int const sc) const
Get probability of a given scenarios.
virtual int get_parent_node(int n) const =0
Get the parent of a given node.
int nextScen
next scenario to be processed by gen_next_scen
BinTreeStruct(int const T)
Constructor.
vector< int > leaves
list of leaf nodes - they define scenarios
Class for balanced binary trees.
virtual ~ScenTreeStruct()
Destructor.
~TwoStageTree()
Destructor.
void set_scen_prob(double *const pr)
Set scenario probabilities (if non-equiprobable)
virtual double get_scen_prob(int const sc) const =0
Get probability of a given scenarios.
int const * get_next_scen(int &scen, int &parentScen, int &branchStage, double &prob)
Get vector of nodes of a next scenario in the list.
double get_scen_prob(int const sc) const
Get probability of a given scenarios.
virtual int const * get_scen_nodes(int const sc)=0
Get the vector of nodes of a given scenarios.
int set_scen_nodes(int const sc)
Fill scenNodeNmb with nodes of a given scenarios.
int get_parent_node(int n) const
Get the parent of a given node.
int set_scen_nodes(int const sc)
Fill scenNodeNmb with nodes of a given scenarios.
Base class for scenario-trees.
int scenNodeNmb[2]
vector of nodes of a scenario - for internal use
int get_nmb_stages() const
Get the number of stages.