private void frameTimer_Tick(object sender, EventArgs e)
        {
            FrameCount++;

            bool endcheck = false;

            int start, end;

            if (Setting.Instance().테스트단위 > Setting.Instance().모집단)
            {
                start = 0;
                end   = Setting.Instance().모집단;
            }
            else
            {
                if (rotate < Setting.Instance().모집단 / Setting.Instance().테스트단위)
                {
                    start = rotate * Setting.Instance().테스트단위;
                    end   = Setting.Instance().테스트단위 + Setting.Instance().테스트단위 *rotate;
                }
                else
                {
                    start = rotate * Setting.Instance().테스트단위;
                    end   = Setting.Instance().모집단 % Setting.Instance().테스트단위 + Setting.Instance().테스트단위 *rotate;
                }
            }
            for (int i = start; i < end; i++)
            {
                trainers[i].FrameUpdate();
            }
            for (int i = start, k = 0; i < end; i++)
            {
                if (warms._Genetic.score <= trainers[i]._Genetic.score)
                {
                    warms = trainers[i];
                }
                if (trainers[i].dead == 1) // 부딪히는 함수 추가필요
                {
                    k++;
                }
                if (k == Setting.Instance().테스트단위 || k == Setting.Instance().모집단)
                {
                    endcheck = true;
                }
            }
            if (endcheck) // boolean = true -> 끝값이 수신되면
            {
                rotate     = (rotate + 1);
                FrameCount = 0;
                warms      = new Trainer(window_width, window_height, blocksize);
                warms.train_setting();
            }

            if (rotate == (Setting.Instance().모집단 / Setting.Instance().테스트단위))
            {
                rotate = 0;                                                                            // rotate 초기화

                trainers.Sort((Trainer x, Trainer y) => y._Genetic.score.CompareTo(x._Genetic.score)); //내림차순 정렬


                try
                {
                    if (_Generation % Setting.Instance().저장간격 == 0)
                    {
                        IFormatter formatter = new BinaryFormatter();

                        Stream stream = new FileStream(Setting.Instance().저장위치 + @"\BestGeneration[" + _Generation + "].bin", FileMode.Create, FileAccess.Write, FileShare.None);

                        formatter.Serialize(stream, Setting.Instance());
                        for (int i = 0; i < Setting.Instance().저장개체수; i++)
                        {
                            formatter.Serialize(stream, trainers[i]._Genetic);
                        }
                        stream.Close();
                    }
                    using (StreamWriter w = File.AppendText(Setting.Instance().저장위치 + @"\BestGeneration.txt"))
                    {
                        //w.Write(log);
                    }
                }
                catch (Exception ee)
                {
                    using (StreamWriter w = File.AppendText("BestGeneration.txt"))
                    {
                        // w.Write(log);
                    }
                }
                trainers             = Generic.check(trainers, Setting.Instance().모집단);   // 확률분포리스트를 뽑음
                trainers             = Generic.repList(trainers, Setting.Instance().모집단); // 교배 및 돌연변이
                warms._Genetic.score = 1;                                                 // 점수 초기화
                _Generation++;                                                            // 세대 +1
            }
            FrameUpdate();
            FrameRender();
        }