//True = keep iterating, False = stop iterating public bool Iterate() { LivingCells = new Population(LivingCells.Run(Rules)); LivingCells.CheckForDuplicates(); LivingCells.UpdateCellCount(); UpdateGridEvent(this, EventArgs.Empty); CurrentIteration++; if (CurrentIteration >= MaxIterations && MaxIterations != 0) { CurrentIteration = 0; return false; } else return true; }
public Population Run(Ruleset rules) { Population tempPop = new Population(this); for (int index = 0; index < CellList.Count; index++) { if (!Survive(CellList[index], rules)) tempPop.RemoveCell(CellList[index]); } tempPop.UpdateCellCount(); Reproduction(tempPop); return tempPop; }
//True = keep iterating, False = stop iterating public bool Iterate() { LivingCells = new Population(LivingCells.Run(Rules)); LivingCells.CheckForDuplicates(); LivingCells.UpdateCellCount(); UpdateGridEvent(this, EventArgs.Empty); CurrentIteration++; if (CurrentIteration >= MaxIterations && MaxIterations != 0) { CurrentIteration = 0; return(false); } else { return(true); } }
public Population Run(Ruleset rules) { Population tempPop = new Population(this); for (int index = 0; index < CellList.Count; index++) { if (!Survive(CellList[index], rules)) { tempPop.RemoveCell(CellList[index]); } } tempPop.UpdateCellCount(); Reproduction(tempPop); return(tempPop); }