Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/24/11 14:23:19 (14 years ago)
Author:
jhelm
Message:

#1329: Added DirectSchedule-Classes for optimization with the direct-schedule encoding.

Location:
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition
Files:
1 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Crossovers/PWRPPXCrossover.cs

    r6406 r6475  
    2828
    2929namespace HeuristicLab.Encodings.ScheduleEncoding.PermutationWithRepetition {
    30   [Item("PWROrderCrossover", "Represents a crossover operation swapping sequences of the parents to generate offspring.")]
     30  [Item("PWRPPXCrossover", "Represents a crossover operation swapping sequences of the parents to generate offspring.")]
    3131  [StorableClass]
    3232  public class PWRPPXCrossover : PWRCrossover {
  • branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/PWREncoding.cs

    r6406 r6475  
    4848    }
    4949
    50     public PWREncoding(int problemDimension, IRandom random)
     50    public PWREncoding(int nrOfJobs, int nrOfResources, IRandom random)
    5151      : base() {
    52       PermutationWithRepetition = new IntegerVector(problemDimension * problemDimension);
    53       int[] lookUpTable = new int[problemDimension];
     52      PermutationWithRepetition = new IntegerVector(nrOfJobs * nrOfResources);
     53      int[] lookUpTable = new int[nrOfJobs];
    5454
    5555      for (int i = 0; i < PermutationWithRepetition.Length; i++) {
    56         int newValue = random.Next(problemDimension);
    57         while (lookUpTable[newValue] >= problemDimension)
    58           newValue = random.Next(problemDimension);
     56        int newValue = random.Next(nrOfJobs);
     57        while (lookUpTable[newValue] >= nrOfResources)
     58          newValue = random.Next(nrOfJobs);
    5959
    6060        PermutationWithRepetition[i] = newValue;
  • branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/PWRRandomCreator.cs

    r6406 r6475  
    6363    }
    6464
     65    public static PWREncoding Apply(int jobs, int resources, IRandom random) {
     66      return new PWREncoding(jobs, resources, random);
     67    }
     68
    6569
    6670    protected override PWREncoding CreateSolution() {
    67       PWREncoding result = new PWREncoding(JobsParameter.ActualValue.Value, Random);
    68       return result;
     71      return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, Random);
    6972    }
    7073  }
Note: See TracChangeset for help on using the changeset viewer.