Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/14/12 15:59:39 (12 years ago)
Author:
abeham
Message:

#1614, #1848

  • updated extension methods and operators that use them
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/Manipulators/RelocateEquipmentManipluator.cs

    r7523 r7807  
    7979      }
    8080
    81       var sourceLocation = overbookedLocations.ChooseUniformRandom(random);
    82       int equipmentToRelocate = groupedLocations[sourceLocation.Key].ChooseUniformRandom(random);
     81      var sourceLocation = overbookedLocations.SampleRandom(random);
     82      int equipmentToRelocate = groupedLocations[sourceLocation.Key].SampleRandom(random);
    8383      var bestFreeLocations = freeLocations.Where(x => capacities[x.Key] > x.Value + demands[equipmentToRelocate]);
    8484
    8585      if (bestFreeLocations.Any()) { // a feasible solution will still be feasible, an infeasible solution might become feasible
    86         var selected = bestFreeLocations.ChooseUniformRandom(random);
     86        var selected = bestFreeLocations.SampleRandom(random);
    8787        assignment[equipmentToRelocate] = sourceLocation.Key;
    8888      } else { // the solution will become infeasible
    89         sourceLocation = freeLocations.ChooseUniformRandom(random);
     89        sourceLocation = freeLocations.SampleRandom(random);
    9090        assignment[equipmentToRelocate] = sourceLocation.Key;
    9191      }
Note: See TracChangeset for help on using the changeset viewer.