示例#1
0
 /// <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);
 }
示例#2
0
 public Gene(float value, IGeneType type)
 {
     Value = value;
     Type  = type;
 }