spcreatetree


Purpose
It is used for creating the structure for scenario tree without setting the values of random elements, or the proabilities in the tree.
Synopsis
spcreatetree(sb: integer)
spcreatetree(br: array(range) of integer)
spcreatetree(nd: array(range,range) of integer)
Arguments
sb 
number of branches from each node in a symmetic scenario tree
br 
number of branches from nodes in each stage of a scenario tree
nd 
node number of node in each scenario at each stage
Example
Ex 1:
spcreatetree(2) !create binary tree
   
Ex 2:
branches:=[2,3]
spcreatetree(branches)  ! create a 3-stage tree with 2 branches from
                        ! first stage node, 
                        ! and 3 branches from second stage nodes.
   
Ex 3:
NodeNum:=[
1,1,1,
1,1,2, 
1,2,3, 
1,2,4];
spcreatetree(NodeNum)   ! create a 3-stage binary tree explictly	
   
Further information
1. All sprands must have been associated with stages before creating scenario tree.
2. Tree can be generated by setting values of sprands in the tree and probabilities of visting nodes or scenarios, followed by calling spgentree().
Related topics
spsetprobscen, spsetprobcond, spsetprobcondatnode, spsetrand, spsetrandatnode, spaddchildren, spgentree, spprinttree


If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.