Changeset 6890 for branches/GeneralizedQAP/HeuristicLab.Tests/HeuristicLab.Problems.QuadraticAssignment-3.3/QAPMoveEvaluatorTest.cs
- Timestamp:
- 10/07/11 23:21:06 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/HeuristicLab.Tests/HeuristicLab.Problems.QuadraticAssignment-3.3/QAPMoveEvaluatorTest.cs
r6878 r6890 233 233 // SYMMETRIC MATRICES 234 234 double before = QAPEvaluator.Apply(assignment, symmetricWeights, symmetricDistances); 235 Permutation clone = new Cloner().Clone(assignment);235 double move = QAPScrambleMoveEvaluator.Apply(assignment, scramble, symmetricWeights, symmetricDistances); 236 236 ScrambleManipulator.Apply(assignment, scramble.StartIndex, scramble.ScrambledIndices); 237 237 double after = QAPEvaluator.Apply(assignment, symmetricWeights, symmetricDistances); 238 double move = QAPScrambleMoveEvaluator.Apply(clone, scramble, symmetricWeights, symmetricDistances);239 238 Assert.IsTrue(move.IsAlmost(after - before), "Failed on symmetric matrices"); 240 239 241 240 // ASYMMETRIC MATRICES 242 241 before = QAPEvaluator.Apply(assignment, asymmetricWeights, asymmetricDistances); 243 clone = new Cloner().Clone(assignment);242 move = QAPScrambleMoveEvaluator.Apply(assignment, scramble, asymmetricWeights, asymmetricDistances); 244 243 ScrambleManipulator.Apply(assignment, scramble.StartIndex, scramble.ScrambledIndices); 245 244 after = QAPEvaluator.Apply(assignment, asymmetricWeights, asymmetricDistances); 246 move = QAPScrambleMoveEvaluator.Apply(clone, scramble, asymmetricWeights, asymmetricDistances);247 245 Assert.IsTrue(move.IsAlmost(after - before), "Failed on asymmetric matrices"); 248 246 249 247 // NON-ZERO DIAGONAL ASYMMETRIC MATRICES 250 248 before = QAPEvaluator.Apply(assignment, nonZeroDiagonalWeights, nonZeroDiagonalDistances); 251 clone = new Cloner().Clone(assignment);249 move = QAPScrambleMoveEvaluator.Apply(assignment, scramble, nonZeroDiagonalWeights, nonZeroDiagonalDistances); 252 250 ScrambleManipulator.Apply(assignment, scramble.StartIndex, scramble.ScrambledIndices); 253 251 after = QAPEvaluator.Apply(assignment, nonZeroDiagonalWeights, nonZeroDiagonalDistances); 254 move = QAPScrambleMoveEvaluator.Apply(clone, scramble, nonZeroDiagonalWeights, nonZeroDiagonalDistances);255 252 Assert.IsTrue(move.IsAlmost(after - before), "Failed on non-zero diagonal matrices"); 256 253 }
Note: See TracChangeset
for help on using the changeset viewer.