Free cookie consent management tool by TermsFeed Policy Generator

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.