- Timestamp:
- 04/18/19 13:42:12 (6 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3
- Files:
-
- 1 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>
Note: See TracChangeset
for help on using the changeset viewer.