probability-0.2.4: Probabilistic Functional Programming

Safe HaskellSafe-Inferred

Numeric.Probability.Example.TreeGrowth

Contents

Synopsis

Documentation

type Height = Int

data Tree

Constructors

Alive Height 
Hit Height 
Fallen 

Instances

seed :: Tree

tree growth simulation: start with seed and run for n generations

exact results

tree :: Int -> Tree -> Dist Tree

tree n : tree distribution after n generations

hist :: Int -> Expand Tree

hist n : history of tree distributions for n generations

simulation results

simTree :: Int -> Int -> RTrans Tree

Since '(*.)' is overloaded for Trans and RChange, we can run the simulation ~. directly to n *. live.

sh2 :: IO ()

st2 :: IO ()

p1 :: Vis

p6 :: Vis

p5 :: Vis

p4 :: Vis

p3 :: Vis

p2 :: Vis

done :: Tree -> Bool