Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GaltonWatson ¶
type GaltonWatson struct {
// contains filtered or unexported fields
}
GaltonWatson implements a conditioned Galton-Watson tree generator. The conditioned Galton-Watson tree is specified by an offspring distribution and a node count.
func NewGaltonWatson ¶
func NewGaltonWatson(n uint32, offspringProb []float64, src rand.Source) *GaltonWatson
NewGaltonWatson returns a GaltonWatson which represents a conditioned Galton-Watson tree of a given size `n`, whose offspring distribution is a given probability mass function `offspringProb`.
func NewGaltonWatsonFromRander ¶
NewGaltonWatsonFromRander returns a GaltonWatson which represents a conditioned Galton-Watson tree of a given size `n`, whose offspring distribution can be generated by the given `rander`.
func (*GaltonWatson) Rand ¶
func (gw *GaltonWatson) Rand() *tree.Node
Rand returns a random sample drawn from the distribution. The generation algorithm is due to Devroye (2011), see: http://luc.devroye.org/gw-simulation.pdf.