Ejemplo n.º 1
0
 public void AssignTask(TaskNode task, int currentTime)
 {
     currentTask = task;
     if (task != null)
     {
         task.UpdateEST();
         TaskList.Add(task);
         if (currentTime + task.SimulatedExecutionTime < task.EarliestStartTime + task.SimulatedExecutionTime)
         {
             FinishTime = task.EarliestStartTime + task.SimulatedExecutionTime;
         }
         else
         {
             FinishTime = currentTime + task.SimulatedExecutionTime;
             foreach (var item in task.ChildNodes)
             {
                 if (item.EarliestStartTime < currentTime + task.SimulatedExecutionTime)
                 {
                     item.UpdateEST();
                 }
             }
         }
         task.FinishTime = FinishTime;
     }
 }