Changeset 5814 for branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/QuadraticAssignmentProblem.cs
- Timestamp:
- 03/23/11 12:03:24 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/QuadraticAssignmentProblem.cs
r5811 r5814 325 325 .GetManifestResourceStream(InstancePrefix + instance + ".sln")) { 326 326 QAPLIBSolutionParser solParser = new QAPLIBSolutionParser(); 327 solParser.Parse(solStream );327 solParser.Parse(solStream, false); // most sln's seem to be of the type index = location => value = facility 328 328 if (solParser.Error != null) throw solParser.Error; 329 BestKnownQuality = new DoubleValue(solParser.Qualiy); 330 BestKnownSolution = new Permutation(PermutationTypes.Absolute, solParser.Assignment); 329 if (!solParser.Quality.IsAlmost(QAPEvaluator.Apply(new Permutation(PermutationTypes.Absolute, solParser.Assignment), Weights, DistanceMatrix))) { 330 solStream.Seek(0, SeekOrigin.Begin); 331 solParser.Parse(solStream, true); // some sln's seem to be of the type index = facility => value = location 332 if (solParser.Error != null) throw solParser.Error; 333 if (solParser.Quality.IsAlmost(QAPEvaluator.Apply(new Permutation(PermutationTypes.Absolute, solParser.Assignment), Weights, DistanceMatrix))) { 334 BestKnownQuality = new DoubleValue(solParser.Quality); 335 BestKnownSolution = new Permutation(PermutationTypes.Absolute, solParser.Assignment); 336 } else { 337 BestKnownQuality = null; 338 BestKnownSolution = null; 339 } 340 } else { 341 BestKnownQuality = new DoubleValue(solParser.Quality); 342 BestKnownSolution = new Permutation(PermutationTypes.Absolute, solParser.Assignment); 343 } 331 344 } 332 345 } else {
Note: See TracChangeset
for help on using the changeset viewer.