Exemplo n.º 1
0
        public override void MutateGene(Gene <Synapse> targetGene)
        {
            var randomDeltaWeight = RandomInst.NextDouble()
                                    * 2 * weightMutRange - weightMutRange;

            targetGene.Val = new Synapse(
                targetGene.Val.transmitter,
                targetGene.Val.receiver,
                targetGene.Val.weight + randomDeltaWeight);
        }
Exemplo n.º 2
0
 public void Mutate(IGenome <T> target)
 {
     foreach (var gene in target.Genes)
     {
         if (RandomInst.NextDouble() <= GeneMutationChance)
         {
             MutateGene(gene);
         }
     }
 }
 protected double RandomWeight()
 {
     return(RandomInst.NextDouble() * 2 * WeightRange -
            WeightRange);
 }