Trait moonlander_gp::RandNode
[−]
[src]
pub trait RandNode: Sized { fn rand(weights: NodeWeights, rng: &mut Rng) -> Self; }
Implement trait to generate random subtrees of a given type.
This trait is like rand::Rand
, but it doesn't require that the Rng
instance is Sized
, so that we can combine it with the Mutatable
trait.
It also takes a parameter that controls the height of trees that will be
randomly generated. The NodeWeights
parameter will indicate the relative
weights to be used when deciding between generating internal vs. leaf nodes
in the tree.