Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14412


Ignore:
Timestamp:
11/25/16 09:31:59 (8 years ago)
Author:
abeham
Message:

#2706:

  • Encodings.BinaryVector:
    • Added HammingSimilarityCalculator
  • Problems.Knapsack:
    • Made KnapsackSimilarityCalculator NonDiscoverable and Obsolete
    • Added HammingSimilarityCalculator to KnapsackProblem and removed NoSimilarityCalculator
  • Problems.Binary:
    • Added HammingSimilarityCalculator and QualitySimilarityCalculator to BinaryProblem
    • Added PopulationSimilarityAnalyzer to BinaryProblem
Location:
trunk/sources
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/HeuristicLab.Encodings.BinaryVectorEncoding-3.3.csproj

    r11961 r14412  
    126126    <Compile Include="Crossovers\NPointCrossover.cs" />
    127127    <Compile Include="BinaryVector.cs" />
     128    <Compile Include="HammingSimilarityCalculator.cs" />
    128129    <Compile Include="Interfaces\IBinaryVectorMultiNeighborhoodShakingOperator.cs" />
    129130    <Compile Include="Interfaces\IOneBitflipMoveOperator.cs" />
  • trunk/sources/HeuristicLab.Problems.Binary/3.3/BinaryProblem.cs

    r14185 r14412  
    2424using System;
    2525using System.Linq;
     26using HeuristicLab.Analysis;
    2627using HeuristicLab.Common;
    2728using HeuristicLab.Core;
     
    2930using HeuristicLab.Encodings.BinaryVectorEncoding;
    3031using HeuristicLab.Optimization;
     32using HeuristicLab.Optimization.Operators;
    3133using HeuristicLab.Parameters;
    3234using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    6163      Parameters.Add(lengthParameter);
    6264      Encoding.LengthParameter = lengthParameter;
     65      Operators.Add(new HammingSimilarityCalculator());
     66      Operators.Add(new QualitySimilarityCalculator());
     67      Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>()));
     68      Parameterize();
    6369      RegisterEventHandlers();
    6470    }
     
    8793      base.OnEncodingChanged();
    8894      Encoding.LengthParameter = LengthParameter;
     95      Parameterize();
    8996    }
    9097
     98    private void Parameterize() {
     99      foreach (var similarityCalculator in Operators.OfType<ISolutionSimilarityCalculator>()) {
     100        similarityCalculator.SolutionVariableName = Encoding.SolutionCreator.BinaryVectorParameter.ActualName;
     101        similarityCalculator.QualityVariableName = Evaluator.QualityParameter.ActualName;
     102      }
     103    }
    91104
    92105    private void RegisterEventHandlers() {
  • trunk/sources/HeuristicLab.Problems.Binary/3.3/HeuristicLab.Problems.Binary-3.3.csproj

    r11993 r14412  
    9696  </ItemGroup>
    9797  <ItemGroup>
     98    <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
     99      <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>
     100      <Name>HeuristicLab.Analysis-3.3</Name>
     101      <Private>False</Private>
     102    </ProjectReference>
    98103    <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    99104      <Project>{958b43bc-cc5c-4fa2-8628-2b3b01d890b6}</Project>
     
    124129      <Project>{23da7ff4-d5b8-41b6-aa96-f0561d24f3ee}</Project>
    125130      <Name>HeuristicLab.Operators-3.3</Name>
     131      <Private>False</Private>
     132    </ProjectReference>
     133    <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj">
     134      <Project>{25087811-f74c-4128-bc86-8324271da13e}</Project>
     135      <Name>HeuristicLab.Optimization.Operators-3.3</Name>
    126136      <Private>False</Private>
    127137    </ProjectReference>
     
    163173      $SolutionDir/PreBuildEvent.sh
    164174    </PreBuildEvent>
    165   </PropertyGroup> 
     175  </PropertyGroup>
    166176  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
    167177       Other similar extension points exist, see Microsoft.Common.targets.
  • trunk/sources/HeuristicLab.Problems.Binary/3.3/Plugin.cs.frame

    r14195 r14412  
    2828  [Plugin("HeuristicLab.Problems.Binary","Provides binary benchmark problems.", "3.3.14.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Problems.Binary-3.3.dll", PluginFileType.Assembly)]
     30  [PluginDependency("HeuristicLab.Analysis", "3.3")]
    3031  [PluginDependency("HeuristicLab.Collections", "3.3")]
    3132  [PluginDependency("HeuristicLab.Common", "3.3")]
     
    3435  [PluginDependency("HeuristicLab.Encodings.BinaryVectorEncoding", "3.3")]
    3536  [PluginDependency("HeuristicLab.Optimization", "3.3")]
     37  [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")]
    3638  [PluginDependency("HeuristicLab.Parameters", "3.3")]
    3739  [PluginDependency("HeuristicLab.Persistence", "3.3")]
  • trunk/sources/HeuristicLab.Problems.Knapsack/3.3/KnapsackProblem.cs

    r14185 r14412  
    251251      Operators.Add(new KnapsackPathRelinker());
    252252      Operators.Add(new KnapsackSimultaneousPathRelinker());
    253       Operators.Add(new KnapsackSimilarityCalculator());
     253      Operators.Add(new HammingSimilarityCalculator());
    254254      Operators.Add(new QualitySimilarityCalculator());
    255       Operators.Add(new NoSimilarityCalculator());
    256255
    257256      Operators.Add(new BestKnapsackSolutionAnalyzer());
  • trunk/sources/HeuristicLab.Problems.Knapsack/3.3/SimilarityCalculators/KnapsackSimilarityCalculator.cs

    r14185 r14412  
    2525using HeuristicLab.Encodings.BinaryVectorEncoding;
    2626using HeuristicLab.Optimization.Operators;
     27using HeuristicLab.PluginInfrastructure;
    2728
    2829namespace HeuristicLab.Problems.Knapsack {
     
    3435  /// </remarks>
    3536  [Item("KnapsackSimilarityCalculator", "An operator that performs similarity calculation between two knapsack solutions. The operator calculates the similarity based on the number of elements the two solutions have in common.")]
    36   public sealed class KnapsackSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator {
     37  [NonDiscoverableType]
     38  [Obsolete("Please use the HammingSimilarityCalculator in the HeuristicLab.Encodings.BinaryVector plugin.")]
     39  internal sealed class KnapsackSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator {
    3740    protected override bool IsCommutative { get { return true; } }
    3841
Note: See TracChangeset for help on using the changeset viewer.