Changeset 15069 for trunk/sources
- Timestamp:
- 06/27/17 13:45:50 (8 years ago)
- Location:
- trunk/sources
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/2D/IntegerVectorEncoding/IntegerVectorProblem.cs
r14162 r15069 24 24 using System.Collections.Generic; 25 25 using System.Linq; 26 using HeuristicLab.Analysis; 26 27 using HeuristicLab.Common; 27 28 using HeuristicLab.Core; 28 29 using HeuristicLab.Encodings.IntegerVectorEncoding; 29 30 using HeuristicLab.Optimization; 31 using HeuristicLab.Optimization.Operators; 30 32 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 33 … … 52 54 Encoding = new IntegerVectorEncoding(EncodedSolutionName, Items.Count, min: 0, max: LowerBound + 1); // NOTE: assumes that all items can be packed into LowerBound+1 bins 53 55 AddOperators(); 56 Parameterize(); 54 57 RegisterEventHandlers(); 55 58 } … … 63 66 } 64 67 68 protected override void OnEncodingChanged() { 69 base.OnEncodingChanged(); 70 Parameterize(); 71 } 65 72 66 73 private void AddOperators() { 67 68 74 // move operators are not yet supported (TODO) 69 75 Operators.RemoveAll(x => x is SingleObjectiveMoveGenerator); 70 76 Operators.RemoveAll(x => x is SingleObjectiveMoveMaker); 71 77 Operators.RemoveAll(x => x is SingleObjectiveMoveEvaluator); 78 Operators.Add(new HammingSimilarityCalculator()); 79 Operators.Add(new EuclideanSimilarityCalculator()); 80 Operators.Add(new QualitySimilarityCalculator()); 81 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 72 82 73 Encoding.ConfigureOperators(Operators.OfType<IOperator>()); // gkronber: not strictly necessary (only when customer ops are added)83 Encoding.ConfigureOperators(Operators.OfType<IOperator>()); 74 84 } 75 85 76 86 private void RegisterEventHandlers() { 77 87 // update encoding length when number of items is changed 78 ItemsParameter.ValueChanged += (sender, args) => Encoding.Length = Items.Count; 79 LowerBoundParameter.Value.ValueChanged += (sender, args) => { 80 for (int i = 0; i < Encoding.Bounds.Rows; i++) { 81 Encoding.Bounds[i, 1] = LowerBound + 1; 82 } 83 }; 88 ItemsParameter.ValueChanged += (sender, args) => Parameterize(); 89 LowerBoundParameter.Value.ValueChanged += (sender, args) => Parameterize(); 84 90 } 85 91 … … 96 102 return result; 97 103 } 104 105 private void Parameterize() { 106 Encoding.Length = Items.Count; 107 for (int i = 0; i < Encoding.Bounds.Rows; i++) { 108 Encoding.Bounds[i, 1] = LowerBound + 1; 109 } 110 foreach (var similarityCalculator in Operators.OfType<ISolutionSimilarityCalculator>()) { 111 similarityCalculator.SolutionVariableName = Encoding.SolutionCreator.IntegerVectorParameter.ActualName; 112 similarityCalculator.QualityVariableName = Evaluator.QualityParameter.ActualName; 113 } 114 } 98 115 #endregion 99 116 } -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/2D/PermutationEncoding/PermutationProblem.cs
r14162 r15069 23 23 24 24 using System.Linq; 25 using System.Windows.Forms;25 using HeuristicLab.Analysis; 26 26 using HeuristicLab.Common; 27 27 using HeuristicLab.Core; 28 28 using HeuristicLab.Encodings.PermutationEncoding; 29 29 using HeuristicLab.Optimization; 30 using HeuristicLab.Optimization.Operators; 30 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 32 … … 51 52 Encoding = new PermutationEncoding(EncodedSolutionName, Items.Count, PermutationTypes.Absolute); 52 53 AddOperators(); 54 Parameterize(); 53 55 RegisterEventHandlers(); 54 56 } … … 62 64 } 63 65 66 protected override void OnEncodingChanged() { 67 base.OnEncodingChanged(); 68 Parameterize(); 69 } 64 70 65 71 private void AddOperators() { … … 70 76 Operators.RemoveAll(x => x is SingleObjectiveMoveMaker); 71 77 Operators.RemoveAll(x => x is SingleObjectiveMoveEvaluator); 78 Operators.Add(new HammingSimilarityCalculator()); 79 Operators.Add(new QualitySimilarityCalculator()); 80 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 72 81 73 82 Encoding.ConfigureOperators(Operators.OfType<IOperator>()); … … 83 92 private void RegisterEventHandlers() { 84 93 // update encoding length when number of items is changed 85 ItemsParameter.ValueChanged += (sender, args) => Encoding.Length = Items.Count; 94 ItemsParameter.ValueChanged += (sender, args) => Parameterize(); 95 } 96 97 private void Parameterize() { 98 Encoding.Length = Items.Count; 99 foreach (var similarityCalculator in Operators.OfType<ISolutionSimilarityCalculator>()) { 100 similarityCalculator.SolutionVariableName = Encoding.SolutionCreator.PermutationParameter.ActualName; 101 similarityCalculator.QualityVariableName = Evaluator.QualityParameter.ActualName; 102 } 86 103 } 87 104 } -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/3D/IntegerVectorEncoding/IntegerVectorProblem.cs
r14167 r15069 24 24 using System.Collections.Generic; 25 25 using System.Linq; 26 using HeuristicLab.Analysis; 26 27 using HeuristicLab.Common; 27 28 using HeuristicLab.Core; 28 29 using HeuristicLab.Encodings.IntegerVectorEncoding; 29 30 using HeuristicLab.Optimization; 31 using HeuristicLab.Optimization.Operators; 30 32 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 33 … … 51 53 Encoding = new IntegerVectorEncoding(EncodedSolutionName, Items.Count, min: 0, max: LowerBound + 1); // NOTE: assumes that all items can be packed into LowerBound+1 bins 52 54 AddOperators(); 55 Parameterize(); 53 56 RegisterEventHandlers(); 54 57 } … … 62 65 } 63 66 67 protected override void OnEncodingChanged() { 68 base.OnEncodingChanged(); 69 Parameterize(); 70 } 64 71 65 72 private void AddOperators() { 66 67 73 // move operators are not yet supported (TODO) 68 74 Operators.RemoveAll(x => x is SingleObjectiveMoveGenerator); 69 75 Operators.RemoveAll(x => x is SingleObjectiveMoveMaker); 70 76 Operators.RemoveAll(x => x is SingleObjectiveMoveEvaluator); 77 Operators.Add(new HammingSimilarityCalculator()); 78 Operators.Add(new EuclideanSimilarityCalculator()); 79 Operators.Add(new QualitySimilarityCalculator()); 80 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 71 81 72 82 Encoding.ConfigureOperators(Operators.OfType<IOperator>()); // gkronber: not strictly necessary (only when customer ops are added) … … 75 85 private void RegisterEventHandlers() { 76 86 // update encoding length when number of items is changed 77 ItemsParameter.ValueChanged += (sender, args) => Encoding.Length = Items.Count; 78 LowerBoundParameter.Value.ValueChanged += (sender, args) => { 79 for (int i = 0; i < Encoding.Bounds.Rows; i++) { 80 Encoding.Bounds[i, 1] = LowerBound + 1; 81 } 82 }; 87 ItemsParameter.ValueChanged += (sender, args) => Parameterize(); 88 LowerBoundParameter.Value.ValueChanged += (sender, args) => Parameterize(); 83 89 } 84 90 85 91 #region helpers 86 87 92 public static List<List<int>> GenerateSequenceMatrix(IntegerVector intVec) { 88 93 List<List<int>> result = new List<List<int>>(); … … 95 100 return result; 96 101 } 102 103 private void Parameterize() { 104 Encoding.Length = Items.Count; 105 for (int i = 0; i < Encoding.Bounds.Rows; i++) { 106 Encoding.Bounds[i, 1] = LowerBound + 1; 107 } 108 foreach (var similarityCalculator in Operators.OfType<ISolutionSimilarityCalculator>()) { 109 similarityCalculator.SolutionVariableName = Encoding.SolutionCreator.IntegerVectorParameter.ActualName; 110 similarityCalculator.QualityVariableName = Evaluator.QualityParameter.ActualName; 111 } 112 } 97 113 #endregion 98 114 } -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/3D/PermutationEncoding/PermutationProblem.cs
r14167 r15069 23 23 24 24 using System.Linq; 25 using HeuristicLab.Analysis; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; 27 28 using HeuristicLab.Encodings.PermutationEncoding; 28 29 using HeuristicLab.Optimization; 30 using HeuristicLab.Optimization.Operators; 29 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 32 … … 49 51 Encoding = new PermutationEncoding(EncodedSolutionName, Items.Count, PermutationTypes.Absolute); 50 52 AddOperators(); 53 Parameterize(); 51 54 RegisterEventHandlers(); 52 55 } … … 60 63 } 61 64 65 protected override void OnEncodingChanged() { 66 base.OnEncodingChanged(); 67 Parameterize(); 68 } 62 69 63 70 private void AddOperators() { … … 68 75 Operators.RemoveAll(x => x is SingleObjectiveMoveMaker); 69 76 Operators.RemoveAll(x => x is SingleObjectiveMoveEvaluator); 77 Operators.Add(new HammingSimilarityCalculator()); 78 Operators.Add(new QualitySimilarityCalculator()); 79 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 70 80 71 81 Encoding.ConfigureOperators(Operators.OfType<IOperator>()); … … 82 92 private void RegisterEventHandlers() { 83 93 // update encoding length when number of items is changed 84 ItemsParameter.ValueChanged += (sender, args) => Encoding.Length = Items.Count; 94 ItemsParameter.ValueChanged += (sender, args) => Parameterize(); 95 } 96 97 private void Parameterize() { 98 Encoding.Length = Items.Count; 99 foreach (var similarityCalculator in Operators.OfType<ISolutionSimilarityCalculator>()) { 100 similarityCalculator.SolutionVariableName = Encoding.SolutionCreator.PermutationParameter.ActualName; 101 similarityCalculator.QualityVariableName = Evaluator.QualityParameter.ActualName; 102 } 85 103 } 86 104 } -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/HeuristicLab.Problems.BinPacking-3.3.csproj
r14273 r15069 150 150 <ItemGroup /> 151 151 <ItemGroup> 152 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj"> 153 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project> 154 <Name>HeuristicLab.Analysis-3.3</Name> 155 <Private>False</Private> 156 </ProjectReference> 152 157 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 153 158 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> … … 183 188 <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project> 184 189 <Name>HeuristicLab.Operators-3.3</Name> 190 <Private>False</Private> 191 </ProjectReference> 192 <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj"> 193 <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project> 194 <Name>HeuristicLab.Optimization.Operators-3.3</Name> 185 195 <Private>False</Private> 186 196 </ProjectReference> -
trunk/sources/HeuristicLab.Problems.BinPacking/3.3/Plugin.cs.frame
r14174 r15069 28 28 [Plugin("HeuristicLab.Problems.BinPacking", "3.3.14.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Problems.BinPacking-3.3.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.Analysis", "3.3")] 30 31 [PluginDependency("HeuristicLab.Collections", "3.3")] 31 32 [PluginDependency("HeuristicLab.Common", "3.3")] … … 36 37 [PluginDependency("HeuristicLab.Operators", "3.3")] 37 38 [PluginDependency("HeuristicLab.Optimization", "3.3")] 39 [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")] 38 40 [PluginDependency("HeuristicLab.Parameters", "3.3")] 39 41 [PluginDependency("HeuristicLab.Persistence", "3.3")] -
trunk/sources/HeuristicLab.Problems.LinearAssignment/3.3/HeuristicLab.Problems.LinearAssignment-3.3.csproj
r11623 r15069 175 175 <Private>False</Private> 176 176 </ProjectReference> 177 <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj"> 178 <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project> 179 <Name>HeuristicLab.Optimization.Operators-3.3</Name> 180 <Private>False</Private> 181 </ProjectReference> 177 182 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 178 183 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project> -
trunk/sources/HeuristicLab.Problems.LinearAssignment/3.3/LinearAssignmentProblem.cs
r14185 r15069 23 23 using System.Drawing; 24 24 using System.Linq; 25 using HeuristicLab.Analysis; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; … … 28 29 using HeuristicLab.Encodings.PermutationEncoding; 29 30 using HeuristicLab.Optimization; 31 using HeuristicLab.Optimization.Operators; 30 32 using HeuristicLab.Parameters; 31 33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 178 180 Operators.RemoveAll(x => x is IMoveOperator); 179 181 Operators.Add(bestLAPSolutionAnalyzer); 182 183 Operators.Add(new HammingSimilarityCalculator()); 184 Operators.Add(new QualitySimilarityCalculator()); 185 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 180 186 } 181 187 … … 207 213 } 208 214 215 foreach (var similarityCalculator in Operators.OfType<ISolutionSimilarityCalculator>()) { 216 similarityCalculator.SolutionVariableName = SolutionCreator.PermutationParameter.ActualName; 217 similarityCalculator.QualityVariableName = Evaluator.QualityParameter.ActualName; 218 } 219 209 220 bestLAPSolutionAnalyzer.AssignmentParameter.ActualName = SolutionCreator.PermutationParameter.ActualName; 210 221 bestLAPSolutionAnalyzer.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name; -
trunk/sources/HeuristicLab.Problems.LinearAssignment/3.3/Plugin.cs.frame
r14195 r15069 34 34 [PluginDependency("HeuristicLab.Operators", "3.3")] 35 35 [PluginDependency("HeuristicLab.Optimization", "3.3")] 36 [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")] 36 37 [PluginDependency("HeuristicLab.Parameters", "3.3")] 37 38 [PluginDependency("HeuristicLab.Persistence", "3.3")] -
trunk/sources/HeuristicLab.Problems.Orienteering/3.3/HeuristicLab.Problems.Orienteering-3.3.csproj
r13008 r15069 112 112 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project> 113 113 <Name>HeuristicLab.Analysis-3.3</Name> 114 <Private>False</Private> 114 115 </ProjectReference> 115 116 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 116 117 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> 117 118 <Name>HeuristicLab.Collections-3.3</Name> 119 <Private>False</Private> 118 120 </ProjectReference> 119 121 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj"> 120 122 <Project>{0e27a536-1c4a-4624-a65e-dc4f4f23e3e1}</Project> 121 123 <Name>HeuristicLab.Common.Resources-3.3</Name> 124 <Private>False</Private> 122 125 </ProjectReference> 123 126 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj"> … … 134 137 <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project> 135 138 <Name>HeuristicLab.Data-3.3</Name> 139 <Private>False</Private> 136 140 </ProjectReference> 137 141 <ProjectReference Include="..\..\HeuristicLab.Encodings.IntegerVectorEncoding\3.3\HeuristicLab.Encodings.IntegerVectorEncoding-3.3.csproj"> 138 142 <Project>{DDFB14DD-2A85-493C-A52D-E69729BBAEB0}</Project> 139 143 <Name>HeuristicLab.Encodings.IntegerVectorEncoding-3.3</Name> 144 <Private>False</Private> 140 145 </ProjectReference> 141 146 <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj"> 142 147 <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project> 143 148 <Name>HeuristicLab.Operators-3.3</Name> 149 <Private>False</Private> 150 </ProjectReference> 151 <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj"> 152 <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project> 153 <Name>HeuristicLab.Optimization.Operators-3.3</Name> 154 <Private>False</Private> 144 155 </ProjectReference> 145 156 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 146 157 <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project> 147 158 <Name>HeuristicLab.Optimization-3.3</Name> 159 <Private>False</Private> 148 160 </ProjectReference> 149 161 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj"> 150 162 <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project> 151 163 <Name>HeuristicLab.Parameters-3.3</Name> 164 <Private>False</Private> 152 165 </ProjectReference> 153 166 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj"> 154 167 <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project> 155 168 <Name>HeuristicLab.Persistence-3.3</Name> 169 <Private>False</Private> 156 170 </ProjectReference> 157 171 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj"> 158 172 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> 159 173 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 174 <Private>False</Private> 160 175 </ProjectReference> 161 176 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj"> 162 177 <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project> 163 178 <Name>HeuristicLab.Problems.Instances-3.3</Name> 179 <Private>False</Private> 164 180 </ProjectReference> 165 181 <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj"> … … 171 187 <Project>{21977CC3-1757-4B3B-87BD-FF817AAA900F}</Project> 172 188 <Name>HeuristicLab.Scripting-3.3</Name> 189 <Private>False</Private> 173 190 </ProjectReference> 174 191 </ItemGroup> -
trunk/sources/HeuristicLab.Problems.Orienteering/3.3/OrienteeringProblem.cs
r14185 r15069 23 23 using System.IO; 24 24 using System.Linq; 25 using HeuristicLab.Analysis; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; … … 28 29 using HeuristicLab.Encodings.IntegerVectorEncoding; 29 30 using HeuristicLab.Optimization; 31 using HeuristicLab.Optimization.Operators; 30 32 using HeuristicLab.Parameters; 31 33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 272 274 Operators.Add(new OrienteeringLocalImprovementOperator()); 273 275 Operators.Add(new OrienteeringShakingOperator()); 276 Operators.Add(new QualitySimilarityCalculator()); 277 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 278 274 279 ParameterizeOperators(); 275 280 } … … 292 297 op.TerminalPointParameter.ActualName = TerminalPointParameter.Name; 293 298 op.PointVisitingCostsParameter.ActualName = PointVisitingCostsParameter.Name; 299 } 300 foreach (var similarityCalculator in Operators.OfType<ISolutionSimilarityCalculator>()) { 301 similarityCalculator.SolutionVariableName = SolutionCreator.IntegerVectorParameter.ActualName; 302 similarityCalculator.QualityVariableName = Evaluator.QualityParameter.ActualName; 294 303 } 295 304 } -
trunk/sources/HeuristicLab.Problems.Orienteering/3.3/Plugin.cs.frame
r14195 r15069 28 28 [Plugin("HeuristicLab.Problems.Orienteering", "3.3.14.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Problems.Orienteering-3.3.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.Analysis", "3.3")] 30 31 [PluginDependency("HeuristicLab.Collections", "3.3")] 31 32 [PluginDependency("HeuristicLab.Common", "3.3")] … … 36 37 [PluginDependency("HeuristicLab.Operators", "3.3")] 37 38 [PluginDependency("HeuristicLab.Optimization", "3.3")] 39 [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")] 38 40 [PluginDependency("HeuristicLab.Parameters", "3.3")] 39 41 [PluginDependency("HeuristicLab.Persistence", "3.3")] -
trunk/sources/HeuristicLab.Problems.PTSP/3.3/HeuristicLab.Problems.PTSP-3.3.csproj
r13484 r15069 74 74 </PropertyGroup> 75 75 <ItemGroup> 76 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj"> 77 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project> 78 <Name>HeuristicLab.Analysis-3.3</Name> 79 <Private>False</Private> 80 </ProjectReference> 76 81 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 77 82 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> … … 107 112 <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project> 108 113 <Name>HeuristicLab.Operators-3.3</Name> 114 <Private>False</Private> 115 </ProjectReference> 116 <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj"> 117 <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project> 118 <Name>HeuristicLab.Optimization.Operators-3.3</Name> 109 119 <Private>False</Private> 110 120 </ProjectReference> -
trunk/sources/HeuristicLab.Problems.PTSP/3.3/PTSP.cs
r14185 r15069 22 22 using System; 23 23 using System.Linq; 24 using HeuristicLab.Analysis; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; … … 27 28 using HeuristicLab.Encodings.PermutationEncoding; 28 29 using HeuristicLab.Optimization; 30 using HeuristicLab.Optimization.Operators; 29 31 using HeuristicLab.Parameters; 30 32 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 119 121 Probabilities = new DoubleArray(Enumerable.Range(0, coordinates.Rows).Select(x => 0.5).ToArray()); 120 122 123 InitializeOperators(); 124 Parameterize(); 121 125 RegisterEventHandlers(); 126 } 127 128 private void InitializeOperators() { 129 Operators.Add(new HammingSimilarityCalculator()); 130 Operators.Add(new QualitySimilarityCalculator()); 131 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 122 132 } 123 133 … … 125 135 private void AfterDeserialization() { 126 136 RegisterEventHandlers(); 137 } 138 139 protected override void OnEncodingChanged() { 140 base.OnEncodingChanged(); 141 Encoding.Length = Coordinates.Rows; 142 Parameterize(); 127 143 } 128 144 … … 236 252 return Coordinates != null ? Coordinates.Rows : DistanceMatrix.Rows; 237 253 } 254 255 private void Parameterize() { 256 foreach (var similarityCalculator in Operators.OfType<ISolutionSimilarityCalculator>()) { 257 similarityCalculator.SolutionVariableName = Encoding.SolutionCreator.PermutationParameter.ActualName; 258 similarityCalculator.QualityVariableName = Evaluator.QualityParameter.ActualName; 259 } 260 } 238 261 } 239 262 } -
trunk/sources/HeuristicLab.Problems.PTSP/3.3/Plugin.cs.frame
r14195 r15069 25 25 [Plugin("HeuristicLab.Problems.PTSP", "Provides an implementation of the probabilistic traveling salesman problem (PTSP)", "3.3.14.$WCREV$")] 26 26 [PluginFile("HeuristicLab.Problems.PTSP-3.3.dll", PluginFileType.Assembly)] 27 [PluginDependency("HeuristicLab.Analysis", "3.3")] 27 28 [PluginDependency("HeuristicLab.Collections", "3.3")] 28 29 [PluginDependency("HeuristicLab.Common", "3.3")] … … 33 34 [PluginDependency("HeuristicLab.Operators", "3.3")] 34 35 [PluginDependency("HeuristicLab.Optimization", "3.3")] 36 [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")] 35 37 [PluginDependency("HeuristicLab.Parameters", "3.3")] 36 38 [PluginDependency("HeuristicLab.Persistence", "3.3")] -
trunk/sources/HeuristicLab.Problems.ParameterOptimization/3.3/HeuristicLab.Problems.ParameterOptimization-3.3.csproj
r11623 r15069 104 104 </ItemGroup> 105 105 <ItemGroup> 106 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj"> 107 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project> 108 <Name>HeuristicLab.Analysis-3.3</Name> 109 <Private>False</Private> 110 </ProjectReference> 106 111 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 107 112 <Project>{958b43bc-cc5c-4fa2-8628-2b3b01d890b6}</Project> 108 113 <Name>HeuristicLab.Collections-3.3</Name> 114 <Private>False</Private> 109 115 </ProjectReference> 110 116 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj"> … … 131 137 <Project>{23da7ff4-d5b8-41b6-aa96-f0561d24f3ee}</Project> 132 138 <Name>HeuristicLab.Operators-3.3</Name> 139 <Private>False</Private> 140 </ProjectReference> 141 <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj"> 142 <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project> 143 <Name>HeuristicLab.Optimization.Operators-3.3</Name> 133 144 <Private>False</Private> 134 145 </ProjectReference> -
trunk/sources/HeuristicLab.Problems.ParameterOptimization/3.3/ParameterOptimizationProblem.cs
r14185 r15069 22 22 using System; 23 23 using System.Linq; 24 using HeuristicLab.Analysis; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; … … 27 28 using HeuristicLab.Encodings.RealVectorEncoding; 28 29 using HeuristicLab.Optimization; 30 using HeuristicLab.Optimization.Operators; 29 31 using HeuristicLab.Parameters; 30 32 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 113 115 Operators.Add(new BestSolutionAnalyzer()); 114 116 Operators.Add(new BestSolutionsAnalyzer()); 117 118 Operators.Add(new HammingSimilarityCalculator()); 119 Operators.Add(new EuclideanSimilarityCalculator()); 120 Operators.Add(new QualitySimilarityCalculator()); 121 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 122 115 123 UpdateParameters(); 116 124 UpdateStrategyVectorBounds(); … … 147 155 foreach (var op in Operators.OfType<IRealVectorManipulator>()) 148 156 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 157 158 foreach (var similarityCalculator in Operators.OfType<ISolutionSimilarityCalculator>()) { 159 similarityCalculator.SolutionVariableName = SolutionCreator.RealVectorParameter.ActualName; 160 similarityCalculator.QualityVariableName = Evaluator.QualityParameter.ActualName; 161 } 149 162 } 150 163 -
trunk/sources/HeuristicLab.Problems.ParameterOptimization/3.3/Plugin.cs.frame
r14195 r15069 28 28 [Plugin("HeuristicLab.Problems.ParameterOptimization", "3.3.14.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Problems.ParameterOptimization-3.3.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.Analysis", "3.3")] 30 31 [PluginDependency("HeuristicLab.Collections", "3.3")] 31 32 [PluginDependency("HeuristicLab.Common", "3.3")] … … 35 36 [PluginDependency("HeuristicLab.Operators", "3.3")] 36 37 [PluginDependency("HeuristicLab.Optimization", "3.3")] 38 [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")] 37 39 [PluginDependency("HeuristicLab.Parameters", "3.3")] 38 40 [PluginDependency("HeuristicLab.Persistence", "3.3")] -
trunk/sources/HeuristicLab.Problems.QuadraticAssignment/3.3/Analyzers/QAPPopulationDiversityAnalyzer.cs
r14185 r15069 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Analysis; 23 24 using HeuristicLab.Common; … … 27 28 using HeuristicLab.Parameters; 28 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.PluginInfrastructure; 29 31 30 32 namespace HeuristicLab.Problems.QuadraticAssignment { … … 34 36 [Item("QAPPopulationDiversityAnalyzer", "An operator for analyzing the diversity of solutions of Quadratic Assignment Problems regarding their structural identity (number of equal facilty->location assignments).")] 35 37 [StorableClass] 38 [Obsolete("Use the PopulationSimilarityAnalyzer in the HeuristicLab.Analysis plugin instead.")] 39 [NonDiscoverableType] 36 40 #pragma warning disable 0612 37 publicsealed class QAPPopulationDiversityAnalyzer : PopulationDiversityAnalyzer<Permutation> {41 internal sealed class QAPPopulationDiversityAnalyzer : PopulationDiversityAnalyzer<Permutation> { 38 42 #pragma warning restore 0612 39 43 public IValueParameter<BoolValue> UsePhenotypeSimilarityParameter { … … 85 89 if (phenotypeSimilarity) 86 90 similarities[i, j] = QAPPermutationProximityCalculator.CalculatePhenotypeSimilarity(solutions[i], solutions[j], weights, distances); 87 else similarities[i, j] = QAPPermutationProximityCalculator.CalculateGenotypeSimilarity(solutions[i], solutions[j]);91 else similarities[i, j] = HammingSimilarityCalculator.CalculateSimilarity(solutions[i], solutions[j]); 88 92 similarities[j, i] = similarities[i, j]; 89 93 } -
trunk/sources/HeuristicLab.Problems.QuadraticAssignment/3.3/QAPPermutationProximityCalculator.cs
r14185 r15069 26 26 namespace HeuristicLab.Problems.QuadraticAssignment { 27 27 public static class QAPPermutationProximityCalculator { 28 29 public static double CalculateGenotypeSimilarity(Permutation a, Permutation b) {30 int similar = 0;31 for (int i = 0; i < a.Length; i++) {32 if (a[i] == b[i]) similar++;33 }34 return similar / (double)a.Length;35 }36 37 public static double CalculateGenotypeDistance(Permutation a, Permutation b) {38 return 1.0 - CalculateGenotypeSimilarity(a, b);39 }40 28 41 29 public static double CalculatePhenotypeSimilarity(Permutation a, Permutation b, DoubleMatrix weights, DoubleMatrix distances) { -
trunk/sources/HeuristicLab.Problems.QuadraticAssignment/3.3/QAPSimilarityCalculator.cs
r14185 r15069 23 23 using HeuristicLab.Common; 24 24 using HeuristicLab.Core; 25 using HeuristicLab.Data; 25 26 using HeuristicLab.Encodings.PermutationEncoding; 26 27 using HeuristicLab.Optimization.Operators; 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 29 28 30 namespace HeuristicLab.Problems.QuadraticAssignment { … … 34 36 /// </remarks> 35 37 [Item("QAPSimilarityCalculator", "An operator that performs similarity calculation between two quadratic assignment solutions. The operator calculates the similarity based on the number of edges the two solutions have in common.")] 38 [StorableClass] 36 39 public sealed class QAPSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator { 37 40 protected override bool IsCommutative { get { return true; } } 38 41 42 [Storable] 43 public DoubleMatrix Weights { get; set; } 44 [Storable] 45 public DoubleMatrix Distances { get; set; } 46 39 47 private QAPSimilarityCalculator(bool deserializing) : base(deserializing) { } 40 private QAPSimilarityCalculator(QAPSimilarityCalculator original, Cloner cloner) : base(original, cloner) { } 48 private QAPSimilarityCalculator(QAPSimilarityCalculator original, Cloner cloner) 49 : base(original, cloner) { 50 Weights = cloner.Clone(original.Weights); 51 Distances = cloner.Clone(original.Distances); 52 } 41 53 public QAPSimilarityCalculator() : base() { } 42 54 … … 45 57 } 46 58 47 public static double CalculateSimilarity(Permutation left, Permutation right ) {59 public static double CalculateSimilarity(Permutation left, Permutation right, DoubleMatrix weights, DoubleMatrix distances) { 48 60 if (left == null || right == null) 49 61 throw new ArgumentException("Cannot calculate similarity because one of the provided solutions or both are null."); … … 52 64 if (object.ReferenceEquals(left, right)) return 1.0; 53 65 54 return QAPPermutationProximityCalculator.Calculate GenotypeSimilarity(left, right);66 return QAPPermutationProximityCalculator.CalculatePhenotypeSimilarity(left, right, weights, distances); 55 67 } 56 68 … … 59 71 var sol2 = rightSolution.Variables[SolutionVariableName].Value as Permutation; 60 72 61 return CalculateSimilarity(sol1, sol2 );73 return CalculateSimilarity(sol1, sol2, Weights, Distances); 62 74 } 63 75 } -
trunk/sources/HeuristicLab.Problems.QuadraticAssignment/3.3/QuadraticAssignmentProblem.cs
r14185 r15069 24 24 using System.Drawing; 25 25 using System.Linq; 26 using HeuristicLab.Analysis; 26 27 using HeuristicLab.Common; 27 28 using HeuristicLab.Core; … … 29 30 using HeuristicLab.Encodings.PermutationEncoding; 30 31 using HeuristicLab.Optimization; 32 using HeuristicLab.Optimization.Operators; 31 33 using HeuristicLab.Parameters; 32 34 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 301 303 Operators.Add(new BestQAPSolutionAnalyzer()); 302 304 Operators.Add(new QAPAlleleFrequencyAnalyzer()); 303 Operators.Add(new QAPPopulationDiversityAnalyzer());304 305 305 306 Operators.Add(new QAPExhaustiveInsertionLocalImprovement()); … … 308 309 Operators.Add(new QAPExhaustiveSwap2LocalImprovement()); 309 310 311 Operators.Add(new HammingSimilarityCalculator()); 310 312 Operators.Add(new QAPSimilarityCalculator()); 313 Operators.Add(new QualitySimilarityCalculator()); 314 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 315 311 316 ParameterizeAnalyzers(); 312 317 ParameterizeOperators(); … … 393 398 } 394 399 395 QAPSimilarityCalculator similarityCalculator = Operators.OfType<QAPSimilarityCalculator>().SingleOrDefault(); 396 if (similarityCalculator != null) { 400 foreach (var similarityCalculator in Operators.OfType<ISolutionSimilarityCalculator>()) { 397 401 similarityCalculator.SolutionVariableName = SolutionCreator.PermutationParameter.ActualName; 398 402 similarityCalculator.QualityVariableName = Evaluator.QualityParameter.ActualName; 403 var qapsimcalc = similarityCalculator as QAPSimilarityCalculator; 404 if (qapsimcalc != null) { 405 qapsimcalc.Weights = Weights; 406 qapsimcalc.Distances = Distances; 407 } 399 408 } 400 409 } -
trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs
r14185 r15069 261 261 Operators.Add(new SingleObjectiveTestFunctionPathRelinker()); 262 262 Operators.Add(new SingleObjectiveTestFunctionSimilarityCalculator()); 263 Operators.Add(new HammingSimilarityCalculator()); 264 Operators.Add(new EuclideanSimilarityCalculator()); 263 265 Operators.Add(new QualitySimilarityCalculator()); 264 Operators.Add(new NoSimilarityCalculator());265 266 266 267 Operators.Add(new BestSingleObjectiveTestFunctionSolutionAnalyzer()); -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/SimilarityCalculators/TSPSimilarityCalculator.cs
r14185 r15069 25 25 using HeuristicLab.Encodings.PermutationEncoding; 26 26 using HeuristicLab.Optimization.Operators; 27 using HeuristicLab.PluginInfrastructure; 27 28 28 29 namespace HeuristicLab.Problems.TravelingSalesman { … … 34 35 /// </remarks> 35 36 [Item("TSPSimilarityCalculator", "An operator that performs similarity calculation between two traveling salesman solutions. The operator calculates the similarity based on the number of edges the two solutions have in common.")] 36 public sealed class TSPSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator { 37 [Obsolete("This operator is similar to the Hamming similarity calculator in the Encodings.PermutationEncoding namespace")] 38 [NonDiscoverableType] 39 internal sealed class TSPSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator { 37 40 protected override bool IsCommutative { get { return true; } } 38 41 -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs
r14185 r15069 233 233 Operators.Add(new TSPPathRelinker()); 234 234 Operators.Add(new TSPSimultaneousPathRelinker()); 235 Operators.Add(new TSPSimilarityCalculator()); 235 236 Operators.Add(new HammingSimilarityCalculator()); 236 237 Operators.Add(new QualitySimilarityCalculator()); 237 Operators.Add(new NoSimilarityCalculator());238 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 238 239 239 240 Operators.Add(new BestTSPSolutionAnalyzer()); 240 241 Operators.Add(new TSPAlleleFrequencyAnalyzer()); 241 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>()));242 242 ParameterizeAnalyzers(); 243 243 var operators = new HashSet<IPermutationOperator>(new IPermutationOperator[] { -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs
r14481 r15069 254 254 Operators.Add(new VRPSimilarityCalculator()); 255 255 Operators.Add(new QualitySimilarityCalculator()); 256 Operators.Add(new NoSimilarityCalculator());257 256 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 258 257
Note: See TracChangeset
for help on using the changeset viewer.