public void TestMutationCollection() { var genotypes = Enumerable.Range(0, 100).Select(_ => Genotype.FromPrototype(protoGenotype)).ToArray(); var mutations = new NEAT.MutationCollection(); mutations.Add(0.75f, new NEAT.AddNeuronMutator(innovations)); mutations.Add(0.25f, new NEAT.AddSynapseMutator(innovations)); var results = mutations.Mutate(genotypes); Assert.AreEqual(75, results.addedNeurons, 75 * 0.15f); Assert.AreEqual(175, results.addedSynapses, 175 * 0.25f); }
public void TestMutationCollection() { var genotypes = Enumerable.Range(0, 100).Select(_ => Genotype.FromPrototype(protoGenotype)).ToArray(); var mutations = new NEAT.MutationCollection(); mutations.Add(0.75f, new NEAT.AddNeuronMutator(innovations)); mutations.Add(0.25f, new NEAT.AddSynapseMutator(innovations)); var results = mutations.Mutate(genotypes); Assert.AreEqual(75, results.addedNeurons, 75 * 0.15f); Assert.AreEqual(175, results.addedSynapses, 175 * 0.25f); }