Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/06/15 15:33:25 (9 years ago)
Author:
mkommend
Message:

#2521: Added encodings for schedules.

Location:
branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Crossovers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Crossovers/DirectScheduleCrossover.cs

    r12012 r13437  
    2929  [StorableClass]
    3030  public abstract class DirectScheduleCrossover : ScheduleCrossover, IDirectScheduleOperator {
     31    public ILookupParameter<ItemList<Job>> JobDataParameter {
     32      get { return (LookupParameter<ItemList<Job>>)Parameters["JobData"]; }
     33    }
     34
    3135    [StorableConstructor]
    3236    protected DirectScheduleCrossover(bool deserializing) : base(deserializing) { }
     
    3438    public DirectScheduleCrossover()
    3539      : base() {
    36       ParentsParameter.ActualName = "Schedule";
    37       ChildParameter.ActualName = "Schedule";
    3840      Parameters.Add(new LookupParameter<ItemList<Job>>("JobData", "Job data taken from the JSSP - Instance."));
    39     }
    40 
    41     public ILookupParameter<ItemList<Job>> JobDataParameter {
    42       get { return (LookupParameter<ItemList<Job>>)Parameters["JobData"]; }
    4341    }
    4442
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Crossovers/DirectScheduleGTCrossover.cs

    r12012 r13437  
    6464        Task minimal = GTAlgorithmUtils.GetTaskWithMinimalEC(earliestTasksList, child);
    6565        int conflictedResourceNr = minimal.ResourceNr;
    66         Resource conflictedResource = child.Resources[conflictedResourceNr];
    6766
    6867        //STEP 2 - Compute a conflict set of all operations that can be scheduled on the conflicted resource
    69         ItemList<Task> conflictSet = GTAlgorithmUtils.GetConflictSetForTask(minimal, earliestTasksList, jobData, child);
     68        ItemList<Task> conflictSet = GTAlgorithmUtils.GetConflictSetForTask(minimal, earliestTasksList, child);
    7069
    7170        //STEP 3 - Select a task from the conflict set
    72         int progressOnResource = conflictedResource.Tasks.Count;
    7371        Task selectedTask = null;
    7472        if (random.NextDouble() < mutProp) {
     
    7775        } else {
    7876          //Crossover
    79           selectedTask = SelectTaskFromConflictSet(conflictSet, ((random.Next(2) == 0) ? parent1 : parent2), conflictedResourceNr, progressOnResource);
     77          selectedTask = SelectTaskFromConflictSet(conflictSet, ((random.Next(2) == 0) ? parent1 : parent2), conflictedResourceNr);
    8078        }
    8179
     
    9290    }
    9391
    94     private static Task SelectTaskFromConflictSet(ItemList<Task> conflictSet, Schedule usedParent, int conflictedResourceNr, int progressOnResource) {
     92    private static Task SelectTaskFromConflictSet(ItemList<Task> conflictSet, Schedule usedParent, int conflictedResourceNr) {
    9593      //Apply Crossover
    9694      foreach (ScheduledTask st in usedParent.Resources[conflictedResourceNr].Tasks) {
Note: See TracChangeset for help on using the changeset viewer.