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); }
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); }