示例#1
0
文件: Main.cs 项目: FryDay/CellSharp
        //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;
        }
示例#2
0
        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;
        }
示例#3
0
        //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);
            }
        }
示例#4
0
        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);
        }