Changeset 15555 for branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/SolutionCreators/RandomButFeasibleSolutionCreator.cs
- Timestamp:
- 12/20/17 23:35:23 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/SolutionCreators/RandomButFeasibleSolutionCreator.cs
r15504 r15555 65 65 int counter = 0; 66 66 double minViolation = double.MaxValue; 67 var slack = new DoubleArray(capacities.Length);68 var assignment = new IntegerVector(demands.Length);67 var slack = new double[capacities.Length]; 68 var assignment = new int[demands.Length]; 69 69 70 70 while (!isFeasible) { … … 86 86 isFeasible = violation == 0; 87 87 if (isFeasible || violation < minViolation) { 88 result = (IntegerVector)assignment.Clone();88 result = new IntegerVector(assignment); 89 89 minViolation = violation; 90 90 } … … 100 100 } 101 101 102 private static IEnumerable<int> GetFreeLocations(int equipment, DoubleArray demands, DoubleArrayfreeCapacities) {102 private static IEnumerable<int> GetFreeLocations(int equipment, DoubleArray demands, double[] freeCapacities) { 103 103 var freeLocations = freeCapacities 104 104 .Select((v, idx) => new KeyValuePair<int, double>(idx, v))
Note: See TracChangeset
for help on using the changeset viewer.