Changeset 6475 for branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/PWREncoding.cs
- Timestamp:
- 06/24/11 14:23:19 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/PWREncoding.cs
r6406 r6475 48 48 } 49 49 50 public PWREncoding(int problemDimension, IRandom random)50 public PWREncoding(int nrOfJobs, int nrOfResources, IRandom random) 51 51 : 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]; 54 54 55 55 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); 59 59 60 60 PermutationWithRepetition[i] = newValue;
Note: See TracChangeset
for help on using the changeset viewer.