예제 #1
0
        public bool Run()
        {
            Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High;
            Thread.CurrentThread.Priority = ThreadPriority.Highest;
            Process.GetCurrentProcess().ProcessorAffinity = (IntPtr)1;
            Generation generation = new Generation(0);

            generation.BeginProcess();
            FirstGeneration(generation);
            generation.EndProcess();
            AddGeneration(generation);

            OnGenerationCreated();

            while (!StopCondition())
            {
                generation = new Generation(LastGeneration.GenerationIndex + 1);
                generation.BeginProcess();
                NextGeneration(generation);
                generation.EndProcess();
                AddGeneration(generation);

                OnGenerationCreated();
            }
            return(true);
        }