using System; using DNAModule.Sunweaver.Commands.Abstracts; using DNAModule.Sunweaver.DataPrototypes; namespace DNAModule.Sunweaver { abstract public class CoduleMutation { public static Random random = new Random(); public int MinLength { get; protected set; } public int MaxLength { get; protected set; } public double Probability { get; protected set; } abstract public void mutate(Codule c, int index, int length); public void mutate(Codule c) { mutate(c, random.Next(c.BasePairs.Count), random.Next(MaxLength - MinLength) + MinLength); } public CoduleMutation(int minLength, int maxLength, double probability) { MinLength = minLength; MaxLength = maxLength; Probability = probability; } public CoduleMutation() : this(1, 1, 1) { } } }