コード例 #1
0
ファイル: Population.cs プロジェクト: tauerlund/Playtest-AI
 /// <summary>
 /// Replaces the current agents in the population with the selected agents.
 /// </summary>
 /// <param name="selector">The selection method that defines how the selection should be perfomed.</param>
 /// <param name="selectionSize">The desired size of the selected agents.</param>
 public void MakeSelection(ISelector selector, int selectionSize, IRandomNumberGenerator random)
 {
     if (!fitnessCalculated)
     {
         throw new Exception("Fitness must be calculated selection can be performed.");
     }
     Agents = selector.MakeSelection(Agents, selectionSize, random); // lav til void
 }