Trait moonlander_gp::Mutatable
[−]
[src]
pub trait Mutatable { fn mutate(&self, max_height: i32, rng: &mut Rng) -> Box<AstNode>; }
Mutation trait for nodes
Implement this if you want to do controlled mutation of nodes. For example, changing the node type without changing the children, or changing the number value in a controlled way.
When not explicitly specified, a default implementation is provided for
nodes that also implement RandNode
, which completely replaces the node
with a random subtree.