Example #1
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;
        }
Example #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;
        }
Example #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);
            }
        }
Example #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);
        }