Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
FlopSmiEx::TwoStageTree Class Reference

Class for a 2-stage tree (bush) More...

#include <scen-tree_struct.hpp>

Inheritance diagram for FlopSmiEx::TwoStageTree:
Inheritance graph
[legend]
Collaboration diagram for FlopSmiEx::TwoStageTree:
Collaboration graph
[legend]

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...
 
- Public Member Functions inherited from FlopSmiEx::ScenTreeStruct
 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...
 
- Public Attributes inherited from FlopSmiEx::ScenTreeStruct
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...
 
- Protected Attributes inherited from FlopSmiEx::ScenTreeStruct
int nmbScens
 number of scenarios More...
 
vector< int > leaves
 list of leaf nodes - they define scenarios More...
 

Detailed Description

Class for a 2-stage tree (bush)

Definition at line 118 of file scen-tree_struct.hpp.

Constructor & Destructor Documentation

FlopSmiEx::TwoStageTree::TwoStageTree ( int const  nScens)

Constructor.

FlopSmiEx::TwoStageTree::~TwoStageTree ( )
inline

Destructor.

Definition at line 140 of file scen-tree_struct.hpp.

Member Function Documentation

int FlopSmiEx::TwoStageTree::set_scen_nodes ( int const  sc)
inlineprotected

Fill scenNodeNmb with nodes of a given scenarios.

Returns
first stage when the scen. differs from current scenNodeNmb

Definition at line 128 of file scen-tree_struct.hpp.

int FlopSmiEx::TwoStageTree::get_parent_node ( int  n) const
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)

double FlopSmiEx::TwoStageTree::get_scen_prob ( int const  sc) const
inlinevirtual

Get probability of a given scenarios.

Implements FlopSmiEx::ScenTreeStruct.

Definition at line 149 of file scen-tree_struct.hpp.

int const* FlopSmiEx::TwoStageTree::get_scen_nodes ( int const  sc)
inlinevirtual

Get the vector of nodes of a given scenarios.

Implements FlopSmiEx::ScenTreeStruct.

Definition at line 152 of file scen-tree_struct.hpp.

int const* FlopSmiEx::TwoStageTree::get_next_scen ( int &  scen,
int &  parentScen,
int &  branchStage,
double &  prob 
)
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.

Parameters
[out]scennumber of the new scenario
[out]parentScenparent scenario
[out]branchStagestage where scen diverges from parentScen
[out]probprobability of the new scenario
Returns
vector of node indices of the new scen, NULL at the end

Implements FlopSmiEx::ScenTreeStruct.

Member Data Documentation

int FlopSmiEx::TwoStageTree::nmbScens
protected

number of scenarios

Definition at line 120 of file scen-tree_struct.hpp.

vector<int> FlopSmiEx::TwoStageTree::leaves
protected

list of leaf nodes - they define scenarios

Definition at line 121 of file scen-tree_struct.hpp.

vector<double> FlopSmiEx::TwoStageTree::probs
protected

scenario probabilities

Definition at line 122 of file scen-tree_struct.hpp.

int FlopSmiEx::TwoStageTree::scenNodeNmb[2]
protected

vector of nodes of a scenario - for internal use

Definition at line 123 of file scen-tree_struct.hpp.

int FlopSmiEx::TwoStageTree::nextScen
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.


The documentation for this class was generated from the following file: