Changeset 6087 for branches/histogram
- Timestamp:
- 05/01/11 14:57:08 (14 years ago)
- Location:
- branches/histogram/HeuristicLab.Problems.QuadraticAssignment/3.3
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/histogram/HeuristicLab.Problems.QuadraticAssignment/3.3/Analyzers/BestQAPSolutionAnalyzer.cs
r6086 r6087 84 84 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best QAP solution should be stored.")); 85 85 Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this QAP instance.")); 86 Parameters.Add(new LookupParameter<ItemList<Permutation>>("BestKnownSolutions", "The best known solutions of this QAP instance."));86 Parameters.Add(new LookupParameter<ItemList<Permutation>>("BestKnownSolutions", "The best known solutions (there may be multiple) of this QAP instance.")); 87 87 Parameters.Add(new LookupParameter<Permutation>("BestKnownSolution", "The best known solution of this QAP instance.")); 88 88 } … … 92 92 // BackwardsCompatibility3.3 93 93 #region Backwards compatible code, remove with 3.4 94 /*if (Parameters.ContainsKey("BestKnownSolution")) {95 Parameters.Remove("BestKnownSolution");96 Parameters.Add(new LookupParameter<ItemList<Permutation>>("BestKnownSolutions", "The best known solutions of this QAP instance."));97 }*/98 94 if (!Parameters.ContainsKey("BestKnownSolutions")) { 99 95 Parameters.Add(new LookupParameter<ItemList<Permutation>>("BestKnownSolutions", "The best known solutions of this QAP instance.")); … … 117 113 if (bestKnownQuality == null 118 114 || max && qualities[i].Value > bestKnownQuality.Value 119 || !max && qualities[i].Value < bestKnownQuality.Value 120 || bestKnownQuality.Value == qualities[i].Value 121 && (BestKnownSolutionsParameter.ActualValue == null || BestKnownSolutionsParameter.ActualValue.Count == 0)) { 115 || !max && qualities[i].Value < bestKnownQuality.Value) { 116 // if there isn't a best-known quality or we improved the best-known quality we'll add the current solution as best-known 122 117 BestKnownQualityParameter.ActualValue = new DoubleValue(qualities[i].Value); 123 118 BestKnownSolutionParameter.ActualValue = (Permutation)permutations[i].Clone(); 124 119 BestKnownSolutionsParameter.ActualValue = new ItemList<Permutation>(); 125 120 BestKnownSolutionsParameter.ActualValue.Add((Permutation)permutations[i].Clone()); 126 } else if (bestKnownQuality != null && qualities[i].Value == bestKnownQuality.Value) { 121 } else if (bestKnownQuality.Value == qualities[i].Value) { 122 // if we matched the best-known quality we'll try to set the best-known solution if it isn't null 123 // and try to add it to the pool of best solutions if it is different 124 if (BestKnownSolutionParameter.ActualValue == null) 125 BestKnownSolutionParameter.ActualValue = (Permutation)permutations[i].Clone(); 126 if (BestKnownSolutionsParameter.ActualValue == null) 127 BestKnownSolutionsParameter.ActualValue = new ItemList<Permutation>(); 127 128 PermutationEqualityComparer comparer = new PermutationEqualityComparer(); 128 foreach (var k in sorted) { 129 foreach (var k in sorted) { // for each solution that we found check if it is in the pool of best-knowns 129 130 if (!max && k.Value > qualities[i].Value 130 || max && k.Value < qualities[i].Value) break; 131 || max && k.Value < qualities[i].Value) break; // stop when we reached a solution worse than the best-known quality 131 132 Permutation p = permutations[k.index]; 132 133 bool alreadyPresent = false; -
branches/histogram/HeuristicLab.Problems.QuadraticAssignment/3.3/HeuristicLab.Problems.QuadraticAssignment-3.3.csproj
r6086 r6087 439 439 </ItemGroup> 440 440 <ItemGroup> 441 <Content Include="Data\tai100a.sln" /> 442 <Content Include="Data\tai25a.sln" /> 443 <Content Include="Data\tai50a.sln" /> 441 <EmbeddedResource Include="Data\tai100a.sln" /> 442 <EmbeddedResource Include="Data\tai25a.sln" /> 443 <EmbeddedResource Include="Data\tai50a.sln" /> 444 </ItemGroup> 445 <ItemGroup> 446 <EmbeddedResource Include="Data\esc32a.sln" /> 447 </ItemGroup> 448 <ItemGroup> 449 <EmbeddedResource Include="Data\sko49.sln" /> 444 450 </ItemGroup> 445 451 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Note: See TracChangeset
for help on using the changeset viewer.