public override Schedule CreateScheduleFromEncoding(IScheduleEncoding encoding) { var solution = encoding as PWREncoding; if (solution == null) { throw new InvalidOperationException("Encoding is not of type PWREncoding"); } var jobs = (ItemList <Job>)JobDataParameter.ActualValue.Clone(); var resultingSchedule = new Schedule(jobs[0].Tasks.Count); foreach (int jobNr in solution.PermutationWithRepetition) { int i = 0; while (jobs[jobNr].Tasks[i].IsScheduled) { i++; } Task currentTask = jobs[jobNr].Tasks[i]; double startTime = GTAlgorithmUtils.ComputeEarliestStartTime(currentTask, resultingSchedule); currentTask.IsScheduled = true; resultingSchedule.ScheduleTask(currentTask.ResourceNr, startTime, currentTask.Duration, currentTask.JobNr); } return(resultingSchedule); }
protected override void Manipulate(IRandom random, IScheduleEncoding encoding) { var solution = encoding as JSMEncoding; if (solution == null) { throw new InvalidOperationException("Encoding is not of type JSMEncoding"); } Apply(random, solution); }
public override Schedule CreateScheduleFromEncoding(IScheduleEncoding encoding) { var solution = encoding as JSMEncoding; if (solution == null) { throw new InvalidOperationException("Encoding is not of type JSMEncoding"); } return(CreateScheduleFromEncoding(solution, JobDataParameter.ActualValue)); }
public override Schedule CreateScheduleFromEncoding(IScheduleEncoding encoding) { var solution = encoding as PRVEncoding; if (solution == null) { throw new InvalidOperationException("Encoding is not of type PWREncoding"); } var jobs = (ItemList <Job>)JobDataParameter.ActualValue.Clone(); var resultingSchedule = new Schedule(jobs[0].Tasks.Count); //Reset scheduled tasks in result foreach (Job j in jobs) { foreach (Task t in j.Tasks) { t.IsScheduled = false; } } //GT-Algorithm //STEP 0 - Compute a list of "earliest operations" ItemList <Task> earliestTasksList = GTAlgorithmUtils.GetEarliestNotScheduledTasks(jobs); //int currentDecisionIndex = 0; while (earliestTasksList.Count > 0) { //STEP 1 - Get earliest not scheduled operation with minimal earliest completing time Task minimal = GTAlgorithmUtils.GetTaskWithMinimalEC(earliestTasksList, resultingSchedule); //STEP 2 - Compute a conflict set of all operations that can be scheduled on the machine the previously selected operation runs on ItemList <Task> conflictSet = GTAlgorithmUtils.GetConflictSetForTask(minimal, earliestTasksList, jobs, resultingSchedule); //STEP 3 - Select an operation from the conflict set (various methods depending on how the algorithm should work..) //Task selectedTask = SelectTaskFromConflictSet(conflictSet, solution.PriorityRulesVector [currentDecisionIndex++], solution.NrOfRules.Value); Task selectedTask = SelectTaskFromConflictSet(conflictSet, solution.PriorityRulesVector[minimal.JobNr], solution.NrOfRules.Value, resultingSchedule, jobs); //STEP 4 - Adding the selected operation to the current schedule selectedTask.IsScheduled = true; double startTime = GTAlgorithmUtils.ComputeEarliestStartTime(selectedTask, resultingSchedule); resultingSchedule.ScheduleTask(selectedTask.ResourceNr, startTime, selectedTask.Duration, selectedTask.JobNr); //STEP 5 - Back to STEP 1 earliestTasksList = GTAlgorithmUtils.GetEarliestNotScheduledTasks(jobs); } return(resultingSchedule); }
public override Schedule CreateScheduleFromEncoding(IScheduleEncoding encoding) { var solution = encoding as PWREncoding; if (solution == null) throw new InvalidOperationException("Encoding is not of type PWREncoding"); var jobs = (ItemList<Job>)JobDataParameter.ActualValue.Clone(); var resultingSchedule = new Schedule(jobs[0].Tasks.Count); foreach (int jobNr in solution.PermutationWithRepetition) { int i = 0; while (jobs[jobNr].Tasks[i].IsScheduled) i++; Task currentTask = jobs[jobNr].Tasks[i]; double startTime = GTAlgorithmUtils.ComputeEarliestStartTime(currentTask, resultingSchedule); currentTask.IsScheduled = true; resultingSchedule.ScheduleTask(currentTask.ResourceNr, startTime, currentTask.Duration, currentTask.JobNr); } return resultingSchedule; }
protected abstract void Manipulate(IRandom random, IScheduleEncoding individual);
protected override void Manipulate(IRandom random, IScheduleEncoding encoding) { var solution = encoding as JSMEncoding; if (solution == null) throw new InvalidOperationException("Encoding is not of type JSMEncoding"); Apply(random, solution); }
public abstract Schedule CreateScheduleFromEncoding(IScheduleEncoding solution);
public override Schedule CreateScheduleFromEncoding(IScheduleEncoding encoding) { var solution = encoding as PRVEncoding; if (solution == null) throw new InvalidOperationException("Encoding is not of type PWREncoding"); var jobs = (ItemList<Job>)JobDataParameter.ActualValue.Clone(); var resultingSchedule = new Schedule(jobs[0].Tasks.Count); //Reset scheduled tasks in result foreach (Job j in jobs) { foreach (Task t in j.Tasks) { t.IsScheduled = false; } } //GT-Algorithm //STEP 0 - Compute a list of "earliest operations" ItemList<Task> earliestTasksList = GTAlgorithmUtils.GetEarliestNotScheduledTasks(jobs); //int currentDecisionIndex = 0; while (earliestTasksList.Count > 0) { //STEP 1 - Get earliest not scheduled operation with minimal earliest completing time Task minimal = GTAlgorithmUtils.GetTaskWithMinimalEC(earliestTasksList, resultingSchedule); //STEP 2 - Compute a conflict set of all operations that can be scheduled on the machine the previously selected operation runs on ItemList<Task> conflictSet = GTAlgorithmUtils.GetConflictSetForTask(minimal, earliestTasksList, jobs, resultingSchedule); //STEP 3 - Select an operation from the conflict set (various methods depending on how the algorithm should work..) //Task selectedTask = SelectTaskFromConflictSet(conflictSet, solution.PriorityRulesVector [currentDecisionIndex++], solution.NrOfRules.Value); Task selectedTask = SelectTaskFromConflictSet(conflictSet, solution.PriorityRulesVector[minimal.JobNr], solution.NrOfRules.Value, resultingSchedule, jobs); //STEP 4 - Adding the selected operation to the current schedule selectedTask.IsScheduled = true; double startTime = GTAlgorithmUtils.ComputeEarliestStartTime(selectedTask, resultingSchedule); resultingSchedule.ScheduleTask(selectedTask.ResourceNr, startTime, selectedTask.Duration, selectedTask.JobNr); //STEP 5 - Back to STEP 1 earliestTasksList = GTAlgorithmUtils.GetEarliestNotScheduledTasks(jobs); } return resultingSchedule; }
public override Schedule CreateScheduleFromEncoding(IScheduleEncoding encoding) { var solution = encoding as JSMEncoding; if (solution == null) throw new InvalidOperationException("Encoding is not of type JSMEncoding"); return CreateScheduleFromEncoding(solution, JobDataParameter.ActualValue); }