pub 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,
    {
        assert_ne!(outputs, 0);
        Mep {
            program: (0..internal_instruction_count + outputs)
                .map(|i| if i < internal_instruction_count {
                    Opcode {
                        instruction: rng.gen(),
                        first: rng.gen_range(0, i + inputs),
                        second: rng.gen_range(0, i + inputs),
                    }
                } else {
                    Opcode {
                        instruction: rng.gen(),
                        first: rng.gen_range(0, internal_instruction_count + inputs),
                        second: rng.gen_range(0, internal_instruction_count + inputs),
                    }
                })
                .collect(),
            mutate_lambda: mutate_lambda,
            crossover_points: crossover_points,
            inputs: inputs,
            outputs: outputs,
        }
    }
/// 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.
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.

`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.
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 . ` 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 .
pub 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,
    {
        assert_ne!(outputs, 0);
        Mep {
            program: (0..internal_instruction_count + outputs)
                .map(|i| if i < internal_instruction_count {
                    Opcode {
                        instruction: rng.gen(),
                        first: rng.gen_range(0, i + inputs),
                        second: rng.gen_range(0, i + inputs),
                    }
                } else {
                    Opcode {
                        instruction: rng.gen(),
                        first: rng.gen_range(0, internal_instruction_count + inputs),
                        second: rng.gen_range(0, internal_instruction_count + inputs),
                    }
                })
                .collect(),
            mutate_lambda: mutate_lambda,
            crossover_points: crossover_points,
            inputs: inputs,
            outputs: outputs,
        }
    }
pub 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 , { assert_ne ! ( outputs 0 ) ; Mep { program : ( 0 .. internal_instruction_count + outputs ) . map ( | i | if i < internal_instruction_count { Opcode { instruction : rng . gen ( ) , first : rng . gen_range ( 0 , i + inputs ) , second : rng . gen_range ( 0 , i + inputs ) , } } else { Opcode { instruction : rng . gen ( ) , first : rng . gen_range ( 0 , internal_instruction_count + inputs ) , second : rng . gen_range ( 0 , internal_instruction_count + inputs ) , } } ) . collect ( ) , mutate_lambda : mutate_lambda , crossover_points : crossover_points , inputs : inputs , outputs : outputs , } }
Generates a new Mep with a particular size.
Generates a new Mep with a particular size .
inputs
usize
outputs
usize
internal_instruction_count
usize
mutate_lambda
usize
crossover_points
usize
rng
&mut R
inputs
usize
outputs
usize
internal_instruction_count
usize
mutate_lambda
usize
crossover_points
usize
rng
&mut R