Example #1
0
 public void Add(Individual p)
 {
     population.Add(p);
     averagePopulationFitness = (averagePopulationFitness + p.fitness) / Count;
     if (((p.profit > Parameters.bestOne.profit && p.length <= Parameters.maxLength) || (p.profit == Parameters.bestOne.profit && p.length <= Parameters.maxLength)) && p.path.Contains(0))
     {
         Parameters.bestOne = p;
     }
 }
Example #2
0
 public void Add(Individual p)
 {
     population.Add(p);
     averagePopulationFitness = (averagePopulationFitness + p.fitness) / Count;
     if (p.profit >= Params.bestOne.profit && p.length <= Params.maxLength)
     {
         Params.bestOne = p;
     }
 }