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); }
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); }