public static string FCFS(queue q,queuefinish p)
        {
            string msg=null;
            if (q.length > 0)
            {
                if (q.now_process == null)
                {
                    q.now_process = q.del_first();
                }
                if (q.now_process.period_need_left <= 0)
                {
                    msg = "完成job" + q.now_process.num.ToString()+"\r\n";
                    q.now_process.time_out = q.now_process.wait_already + q.now_process._need_period_num + q.now_process._time_in;
                    p.wait[p.length++] = q.now_process;
                    q.now_process = q.del_first();
                    return msg;

                }
                else return null;
            }
            else if (q.now_process != null && q.now_process.period_need_left <= 0)
            {
                msg = "完成job" + q.now_process.num+"\r\n";
                q.now_process.time_out = q.now_process.wait_already + q.now_process._need_period_num + q.now_process._time_in;
                p.wait[p.length++] = q.now_process;
                q.now_process = null;
                return msg;
            }
            else return null;
        }
        public static string RR(queue q,queuefinish p)
        {
            string msg;
            process p1;

            if (q.length > 0)
            {
                if (q.now_process == null)
                {
                    q.now_process = q.del_first();

                }
                if (q.now_process.period_need_left <= 0)
                {
                    msg = "完成job" + q.now_process.num.ToString() + "\r\n";
                    q.now_process.time_out = q.now_process.wait_already + q.now_process._need_period_num + q.now_process._time_in;
                    p.wait[p.length++] = q.now_process;
                    q.now_process = q.del_first();

                    return msg;

                }
                else if (Form1.time_interval==0&&Form1 .change_enable==true)
                {
                    q.add(q.now_process);
                    p1=q.del_first();
                    q.now_process = p1;
                    Form1.change_enable =false ;
                    return null;
                }

                else
                {
                    return null;
                }
            }
            else if (q.now_process != null && q.now_process.period_need_left <= 0)
            {
                msg = "完成job" + q.now_process.num + "\r\n";
                q.now_process.time_out = q.now_process.wait_already + q.now_process._need_period_num + q.now_process._time_in;
                p.wait[p.length++] = q.now_process;
                q.now_process = null;
                return msg;
            }
            else return null;
        }