Changeset 15492 for branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/Crossovers
- Timestamp:
- 12/04/17 23:19:44 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/Crossovers/GQAPPathRelinking.cs
r15490 r15492 137 137 var fix = new HashSet<int>(); 138 138 var nonFix = new HashSet<int>(Enumerable.Range(0, demands.Length)); 139 var phi = new HashSet<int>(( pi_prime.GetDifferingIndices(target)));139 var phi = new HashSet<int>((IntegerVectorEqualityComparer.GetDifferingIndices(pi_prime, target))); 140 140 141 141 while (phi.Any()) { … … 176 176 bool contains = false; 177 177 foreach (var b in B) { 178 if (! solution.Assignment.GetDifferingIndices(b.Assignment).Any()) {178 if (!IntegerVectorEqualityComparer.GetDifferingIndices(solution.Assignment, b.Assignment).Any()) { 179 179 contains = true; 180 180 break; … … 189 189 if (maximization.Value) pi = B.SampleProportional(random, 1, B.Select(x => x.Quality.Value), false).First(); 190 190 else pi = B.SampleProportional(random, 1, B.Select(x => 1.0 / x.Quality.Value), false).First(); 191 var diff = pi.Assignment.GetDifferingIndices(target);191 var diff = IntegerVectorEqualityComparer.GetDifferingIndices(pi.Assignment, target); 192 192 var I = phi.Except(diff); 193 193 var i = I.SampleRandom(random); … … 203 203 } 204 204 } else return result; 205 phi = new HashSet<int>( pi_prime.GetDifferingIndices(target));205 phi = new HashSet<int>(IntegerVectorEqualityComparer.GetDifferingIndices(pi_prime, target)); 206 206 } 207 207
Note: See TracChangeset
for help on using the changeset viewer.