Пример #1
0
    public static double ComputeEarliestStartTime(Task t, Schedule schedule) {
      ScheduledTask previousTask = schedule.GetLastScheduledTaskForJobNr(t.JobNr);
      Resource affectedResource = schedule.Resources[t.ResourceNr];
      double lastMachineEndTime = affectedResource.TotalDuration;
      double previousJobTaskEndTime = 0;
      if (previousTask != null)
        previousJobTaskEndTime = previousTask.EndTime;

      return Math.Max(previousJobTaskEndTime, lastMachineEndTime);
    }
Пример #2
0
 public static ItemList<Task> GetConflictSetForTask(Task conflictedTask, ItemList<Task> earliestTasksList, ItemList<Job> jobData, Schedule schedule) {
   ItemList<Task> result = new ItemList<Task>();
   double conflictedCompletionTime = ComputeEarliestCompletionTime(conflictedTask, schedule);
   result.Add(conflictedTask);
   foreach (Task t in earliestTasksList) {
     if (t.ResourceNr == conflictedTask.ResourceNr) {
       if (ComputeEarliestStartTime(t, schedule) < conflictedCompletionTime)
         result.Add(t);
     }
   }
   return result;
 }
Пример #3
0
 public static double ComputeEarliestCompletionTime(Task t, Schedule schedule) {
   return ComputeEarliestStartTime(t, schedule) + t.Duration;
 }
Пример #4
0
 internal Task GetPreviousTask(Task t) {
   if (t.TaskNr == 0) return null;
   return Tasks[t.TaskNr - 1];
 }
Пример #5
0
 protected Task(Task original, Cloner cloner)
   : base(original, cloner) {
   this.resourceNr = original.ResourceNr;
   this.jobNr = original.JobNr;
   this.duration = original.Duration;
   this.taskNr = original.TaskNr;
   this.isScheduled = original.IsScheduled;
 }