Struct mli_mep::Mep
[−]
[src]
pub struct Mep<Ins> { /* fields omitted */ }
A multi-expression program represented using a series of operations that can reuse results of previous operations.
Methods
impl<Ins> Mep<Ins>
[src]
fn new<R>(
inputs: usize,
outputs: usize,
internal_instruction_count: usize,
mutate_lambda: usize,
crossover_points: usize,
rng: &mut R
) -> Self where
R: Rng,
Ins: Rand,
[src]
inputs: usize,
outputs: usize,
internal_instruction_count: usize,
mutate_lambda: usize,
crossover_points: usize,
rng: &mut R
) -> Self where
R: Rng,
Ins: Rand,
Generates a new Mep with a particular size. Takes an RNG as well to generate random instructions using
the instruction's Rng
implementation.
inputs
determines exactly how many inputs will be passed each time processing is done. Anything else will
panic.
outputs
determines exactly how many outputs will be consumed each time processing is done. Anything else will
panic.
internal_instruction_count
determines how many instructions aren't used for outputs, but just do internal
processing (hidden instructions).
mutate_lambda
corresponds to the lambda of a poisson distribution. It is proportional
to the average unit mutate cycles between mutations. It is biased by 1
, so a mutate_lambda
of 0
means, on average, the instruction distance between mutations is about 1
.
crossover_points
corresponds to the maximum amount of crossover locations on the
chromosome when mating. When mating the crossover_points
is chosen randomly between the
two Meps.
Trait Implementations
impl<Ins: Debug> Debug for Mep<Ins>
[src]
impl<Ins: Clone> Clone for Mep<Ins>
[src]
fn clone(&self) -> Mep<Ins>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<Ins, R> MateRand<R> for Mep<Ins> where
R: Rng,
Ins: Clone,
[src]
R: Rng,
Ins: Clone,
fn mate(&self, rhs: &Self, rng: &mut R) -> Self
[src]
The mate function takes two parent references and an Rng (r
), then returns a new child. So long as r
is deterministic, the output is also deterministic as no other sources of randomness are involved. Read more
impl<Ins, R> Mutate<R> for Mep<Ins> where
Ins: Mutate<R>,
R: Rng,
[src]
Ins: Mutate<R>,
R: Rng,
impl<'a, Ins, Param> Stateless<'a, &'a [Param], ResultIterator<'a, Ins, Param>> for Mep<Ins> where
Param: Clone,
[src]
Param: Clone,
fn process(&'a self, inputs: &'a [Param]) -> ResultIterator<'a, Ins, Param>
[src]
Takes an input slice which must be exactly equal in length to self.inputs
, or it will panic.
Produces an iterator which must be entirely consumed or else it will panic on drop().