//模拟手工调课
    private void ChangeSchedule()
    {
        Random_Permutation RP = new Random_Permutation(N);

        int[] seq = RP.NextRandom();
        for (int t = 1; t <= N; t++)
        {
            //随机顺序调整班级课表
            ChangeSchedule(seq[t - 1] + 1);
        }
    }
    private void CreateIndividual(ref ch cc)
    {
        //对空染色体cc进行初始化为一个可行解
        //对每个空位塞课程,同时消除冲突
        for (int i = 1; i <= N; i++)                    //班级
        {
            for (int j = 0; j < courseList.Length; j++) //库里的课程数据
            {
                //语数外
                if (courseList[j].Hour1 >= 5)
                {
                    //先5,10,15课时分别安排不同5天
                    for (int count = courseList[j].Hour1 / 5; count >= 1; count--)
                    {
                        for (int t = 1; t <= 5; t++)
                        {
                            int pos = (t - 1) * 8 + GetRandnum.Next(1, 9);//pos刚好在星期t
                            while (!cc.teacher[i, pos].id.Equals("nullstring"))
                            {
                                pos = (t - 1) * 8 + GetRandnum.Next(1, 9);//pos刚好在星期t
                            }
                            //塞到这一天的空位然后消除冲突
                            cc.teacher[i, pos].id  = teacherArrange[i - 1, j].No;
                            cc.teacher[i, pos].cno = teacherArrange[i - 1, j].Courseno;
                            //然后消除矛盾
                            RemoveConflict(ref cc, i, pos);
                        }
                    }

                    //剩下课时不同天
                    Random_Permutation RP = new Random_Permutation(5);
                    int[] randpermutation = RP.NextRandom();

                    for (int t = 0; t < courseList[j].Hour1 % 5; t++)
                    {
                        int pos = 8 * (randpermutation[t]) + GetRandnum.Next(1, 9);
                        while (!cc.teacher[i, pos].id.Equals("nullstring"))
                        {
                            pos = 8 * (randpermutation[t]) + GetRandnum.Next(1, 9);
                        }
                        //塞到这一天的空位然后消除冲突
                        cc.teacher[i, pos].id  = teacherArrange[i - 1, j].No;
                        cc.teacher[i, pos].cno = teacherArrange[i - 1, j].Courseno;
                        //然后消除矛盾
                        RemoveConflict(ref cc, i, pos);
                    }
                }
                else//政史地
                {
                    for (int t = 1; t <= courseList[j].Hour1; t++)//按课时数量塞
                    {
                        int k = GetRandnum.Next(1, M + 1);                //随机塞的位置为i,k
                        while (!cc.teacher[i, k].id.Equals("nullstring")) //不为空就继续随机,直到随机到一个空位
                        {
                            k = GetRandnum.Next(1, M + 1);
                        }
                        cc.teacher[i, k].id  = teacherArrange[i - 1, j].No; //塞进表
                        cc.teacher[i, k].cno = teacherArrange[i - 1, j].Courseno;
                        RemoveConflict(ref cc, i, k);                       //同时消除冲突
                    }
                }
            }
        }

        for (int t = 1; t <= N; t++)
        {
            fresh_fitstu(ref cc, t);//init()更新fit值,每次班级课表变动也要更新
        }
    }