/// <summary> /// Returns the next gene value. Adds a new gene with the default value if past the current /// total genes count. /// </summary> public float NextGene(float defaultValue, IGeneType geneType) { if (++lastGeneIndex < genes.Count) { return(genes[lastGeneIndex].Value); } genes.Add(new Gene(defaultValue, geneType)); return(defaultValue); }
public Gene(float value, IGeneType type) { Value = value; Type = type; }