예제 #1
0
 public static IEnumerable <Bee> Generate(int populationSize)
 {
     foreach (var _ in Enumerable.Range(0, populationSize))
     {
         yield return(BeeGenerator.Generate());
     }
 }
예제 #2
0
파일: Bee.cs 프로젝트: Roydoy7/PowerGrid
 public bool IsReSearchLimitExceed()
 {
     //If the research count exceed the limit
     //Generate a new bee
     //This is turning self into a scout bee
     if (ReSearchCount > ReSearchLimit)
     {
         this.Clear();
         foreach (var h in BeeGenerator.Generate())
         {
             this.Add(h);
         }
         //Reset count
         ReSearchCount = 0;
         return(true);
     }
     return(false);
 }