示例#1
0
文件: Program.cs 项目: IIITanbI/Ant
        public Task RemoveCurrentTask()
        {
            MacnhineItem temp = q.Dequeue();
            Task         task = temp.Task;

            _lastTime = temp.EndTime;

            if (!IsEmpty)
            {
                MacnhineItem _temp = q.Peek();
                _temp.EndTime = temp.EndTime + _temp.Task[this];
            }

            return(task);
        }
示例#2
0
文件: Program.cs 项目: IIITanbI/Ant
        public void AddTask(Task task, int time)
        {
            var temp = new MacnhineItem();

            temp.Task        = task;
            temp.ArrivalTime = time;

            if (IsEmpty)
            {
                temp.EndTime = temp.ArrivalTime + task[this];

                if (_lastTime != time)
                {
                    DowntimeList.Add(new TimeInterval(_lastTime, time));
                }
            }

            q.Enqueue(temp);
        }