示例#1
0
 public void NewPopulation(int count)
 {
     // should be done
     double min = functions.GetLowerThreshold();
     double max = functions.GetUpperThreshold();
     int n = functions.GetDecisionVariablesCount();
     Random rand = new Random();
     for (int i = 0; i < count; i++)
     {
         Solution item = new Solution();
         for (int j = 0; j < n; j++)
         {
             item.AddDecisionVariable(min + (max - min) * rand.NextDouble());
         }
         this.Add(item);
     }
 }