Changeset 16814
- Timestamp:
- 04/18/19 13:42:12 (6 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 8 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/BinaryVectorProblem.cs
r16805 r16814 24 24 using System; 25 25 using System.Linq; 26 using HEAL.Attic; 26 27 using HeuristicLab.Analysis; 27 28 using HeuristicLab.Common; 28 29 using HeuristicLab.Core; 29 30 using HeuristicLab.Data; 30 using HeuristicLab.Encodings.BinaryVectorEncoding;31 31 using HeuristicLab.Optimization; 32 32 using HeuristicLab.Optimization.Operators; 33 33 using HeuristicLab.Parameters; 34 using HEAL.Attic;35 34 36 namespace HeuristicLab. Problems.Binary{35 namespace HeuristicLab.Encodings.BinaryVectorEncoding { 37 36 [StorableType("2F6FEB34-BD19-47AF-9484-7F48565C0C43")] 38 public abstract class Binary Problem : SingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> {39 public virtualint Length {37 public abstract class BinaryVectorProblem : SingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> { 38 public int Length { 40 39 get { return Encoding.Length; } 41 40 set { Encoding.Length = value; } … … 47 46 48 47 [StorableConstructor] 49 protected Binary Problem(StorableConstructorFlag _) : base(_) { }48 protected BinaryVectorProblem(StorableConstructorFlag _) : base(_) { } 50 49 [StorableHook(HookType.AfterDeserialization)] 51 50 private void AfterDeserialization() { … … 53 52 } 54 53 55 protected Binary Problem(BinaryProblem original, Cloner cloner)54 protected BinaryVectorProblem(BinaryVectorProblem original, Cloner cloner) 56 55 : base(original, cloner) { 57 56 RegisterEventHandlers(); 58 57 } 59 58 60 protected BinaryProblem() 61 : base() { 59 protected BinaryVectorProblem() : base(new BinaryVectorEncoding()) { 62 60 var lengthParameter = new FixedValueParameter<IntValue>("Length", "The length of the BinaryVector.", new IntValue(10)); 63 61 Parameters.Add(lengthParameter); 64 62 Encoding.LengthParameter = lengthParameter; 63 65 64 Operators.Add(new HammingSimilarityCalculator()); 66 65 Operators.Add(new QualitySimilarityCalculator()); 67 66 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 67 68 68 Parameterize(); 69 69 RegisterEventHandlers(); … … 89 89 private void Parameterize() { 90 90 foreach (var similarityCalculator in Operators.OfType<ISolutionSimilarityCalculator>()) { 91 // TODO: BinaryVectorParameter is no more part of ISolutionCreator<BinaryVector> 92 similarityCalculator.SolutionVariableName = ((IBinaryVectorSolutionOperator)Encoding.SolutionCreator).BinaryVectorParameter.ActualName; 91 similarityCalculator.SolutionVariableName = Encoding.Name; 93 92 similarityCalculator.QualityVariableName = Evaluator.QualityParameter.ActualName; 94 93 } -
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/HeuristicLab.Encodings.BinaryVectorEncoding-3.3.csproj
r16723 r16814 119 119 </ItemGroup> 120 120 <ItemGroup> 121 <Compile Include="BinaryVectorProblem.cs" /> 121 122 <Compile Include="BinaryVectorEncoding.cs" /> 122 123 <Compile Include="BinaryVectorEqualityComparer.cs" /> … … 158 159 </ItemGroup> 159 160 <ItemGroup> 161 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj"> 162 <Project>{887425b4-4348-49ed-a457-b7d2c26ddbf9}</Project> 163 <Name>HeuristicLab.Analysis-3.3</Name> 164 <Private>False</Private> 165 </ProjectReference> 160 166 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 161 167 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Binary/3.3/DeceptiveStepTrapProblem.cs
r16723 r16814 22 22 #endregion 23 23 24 using HEAL.Attic; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; … … 27 28 using HeuristicLab.Encodings.BinaryVectorEncoding; 28 29 using HeuristicLab.Parameters; 29 using HEAL.Attic;30 30 31 31 namespace HeuristicLab.Problems.Binary { … … 55 55 } 56 56 57 public DeceptiveStepTrapProblem() 58 : base() { 57 public DeceptiveStepTrapProblem() : base() { 59 58 Parameters.Add(new FixedValueParameter<IntValue>(StepSizeParameterName, "", new IntValue(2))); 60 59 RegisterParameterEvents(); -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Binary/3.3/DeceptiveTrapProblem.cs
r16723 r16814 23 23 24 24 using System; 25 using HEAL.Attic; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; … … 28 29 using HeuristicLab.Encodings.BinaryVectorEncoding; 29 30 using HeuristicLab.Parameters; 30 using HEAL.Attic;31 31 32 32 namespace HeuristicLab.Problems.Binary { … … 34 34 [StorableType("399FFE01-2B76-4DBF-B363-8BB65FE95A5D")] 35 35 [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 230)] 36 public class DeceptiveTrapProblem : Binary Problem {36 public class DeceptiveTrapProblem : BinaryVectorProblem { 37 37 [StorableConstructor] 38 38 protected DeceptiveTrapProblem(StorableConstructorFlag _) : base(_) { } … … 63 63 } 64 64 65 public DeceptiveTrapProblem() 66 : base() { 65 public DeceptiveTrapProblem() : base() { 67 66 Parameters.Add(new FixedValueParameter<IntValue>(TrapSizeParameterName, "", new IntValue(7))); 68 67 Encoding.Length = 49; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Binary/3.3/HIFFProblem.cs
r16723 r16814 23 23 24 24 using System; 25 using HEAL.Attic; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; 27 28 using HeuristicLab.Encodings.BinaryVectorEncoding; 28 using HEAL.Attic;29 29 30 30 namespace HeuristicLab.Problems.Binary { … … 32 32 [StorableType("8AC6D94E-E7B4-4216-B2CA-8E142E7A1391")] 33 33 [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 220)] 34 public class HIFFProblem : Binary Problem {34 public class HIFFProblem : BinaryVectorProblem { 35 35 [StorableConstructor] 36 36 protected HIFFProblem(StorableConstructorFlag _) : base(_) { } … … 46 46 } 47 47 48 public HIFFProblem() 49 : base() { 48 public HIFFProblem() : base() { 50 49 Encoding.Length = 64; 51 50 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Binary/3.3/HeuristicLab.Problems.Binary-3.3.csproj
r16723 r16814 83 83 </ItemGroup> 84 84 <ItemGroup> 85 <Compile Include="BinaryProblem.cs" />86 85 <Compile Include="DeceptiveStepTrapProblem.cs" /> 87 86 <Compile Include="DeceptiveTrapProblem.cs" /> … … 97 96 </ItemGroup> 98 97 <ItemGroup> 99 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">100 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>101 <Name>HeuristicLab.Analysis-3.3</Name>102 <Private>False</Private>103 </ProjectReference>104 98 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 105 99 <Project>{958b43bc-cc5c-4fa2-8628-2b3b01d890b6}</Project> 106 100 <Name>HeuristicLab.Collections-3.3</Name> 107 <Private>False</Private>108 101 </ProjectReference> 109 102 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj"> … … 127 120 <Private>False</Private> 128 121 </ProjectReference> 129 <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">130 <Project>{23da7ff4-d5b8-41b6-aa96-f0561d24f3ee}</Project>131 <Name>HeuristicLab.Operators-3.3</Name>132 <Private>False</Private>133 </ProjectReference>134 <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj">135 <Project>{25087811-f74c-4128-bc86-8324271da13e}</Project>136 <Name>HeuristicLab.Optimization.Operators-3.3</Name>137 <Private>False</Private>138 </ProjectReference>139 122 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 140 123 <Project>{14ab8d24-25bc-400c-a846-4627aa945192}</Project> 141 124 <Name>HeuristicLab.Optimization-3.3</Name> 142 <Private>False</Private>143 125 </ProjectReference> 144 126 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj"> 145 127 <Project>{56f9106a-079f-4c61-92f6-86a84c2d84b7}</Project> 146 128 <Name>HeuristicLab.Parameters-3.3</Name> 147 <Private>False</Private>148 </ProjectReference>149 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">150 <Project>{102bc7d3-0ef9-439c-8f6d-96ff0fdb8e1b}</Project>151 <Name>HeuristicLab.Persistence-3.3</Name>152 129 <Private>False</Private> 153 130 </ProjectReference> -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Binary/3.3/OneMaxProblem.cs
r16723 r16814 22 22 using System; 23 23 using System.Linq; 24 using HEAL.Attic; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 26 27 using HeuristicLab.Encodings.BinaryVectorEncoding; 27 using HEAL.Attic;28 28 29 29 namespace HeuristicLab.Problems.Binary { … … 31 31 [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 210)] 32 32 [StorableType("A290ADDE-33F5-4607-ABC0-19349CD0FBF1")] 33 public class OneMaxProblem : Binary Problem {33 public class OneMaxProblem : BinaryVectorProblem { 34 34 public override bool Maximization { 35 35 get { return true; } 36 36 } 37 37 38 public OneMaxProblem() 39 : base() { 38 public OneMaxProblem() : base() { 40 39 Encoding.Length = 10; 41 40 BestKnownQuality = Encoding.Length; -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Binary/3.3/Plugin.cs.frame
r16723 r16814 28 28 [Plugin("HeuristicLab.Problems.Binary","Provides binary benchmark problems.", "3.3.15.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Problems.Binary-3.3.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.Analysis", "3.3")]31 30 [PluginDependency("HeuristicLab.Collections", "3.3")] 32 31 [PluginDependency("HeuristicLab.Common", "3.3")] … … 35 34 [PluginDependency("HeuristicLab.Encodings.BinaryVectorEncoding", "3.3")] 36 35 [PluginDependency("HeuristicLab.Optimization", "3.3")] 37 [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")]38 36 [PluginDependency("HeuristicLab.Parameters", "3.3")] 39 37 [PluginDependency("HeuristicLab.Attic", "1.0")] -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.NK/3.3/NKLandscape.cs
r16723 r16814 37 37 [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 215)] 38 38 [StorableType("04294537-87F2-4A9F-BC14-7D4CA700F326")] 39 public sealed class NKLandscape : Binary Problem {39 public sealed class NKLandscape : BinaryVectorProblem { 40 40 public override bool Maximization { 41 41 get { return false; }
Note: See TracChangeset
for help on using the changeset viewer.