Changeset 8345


Ignore:
Timestamp:
07/27/12 15:16:18 (7 years ago)
Author:
jkarder
Message:

#1331: made similarity based operators storable and cloneable

Location:
trunk/sources/HeuristicLab.Algorithms.ScatterSearch/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.ScatterSearch/3.3/ReferenceSetUpdateMethod.cs

    r8319 r8345  
    2727using HeuristicLab.Operators;
    2828using HeuristicLab.Optimization;
    29 using HeuristicLab.Optimization.Operators;
    3029using HeuristicLab.Parameters;
    3130using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3938  public sealed class ReferenceSetUpdateMethod : SingleSuccessorOperator, ISimilarityBasedOperator {
    4039    #region ISimilarityBasedOperator Members
     40    [Storable]
    4141    public ISolutionSimilarityCalculator SimilarityCalculator { get; set; }
    4242    #endregion
     
    6262    [StorableConstructor]
    6363    private ReferenceSetUpdateMethod(bool deserializing) : base(deserializing) { }
    64     private ReferenceSetUpdateMethod(ReferenceSetUpdateMethod original, Cloner cloner) : base(original, cloner) { }
     64    private ReferenceSetUpdateMethod(ReferenceSetUpdateMethod original, Cloner cloner)
     65      : base(original, cloner) {
     66      this.SimilarityCalculator = cloner.Clone(original.SimilarityCalculator);
     67    }
    6568    public ReferenceSetUpdateMethod()
    6669      : base() {
  • trunk/sources/HeuristicLab.Algorithms.ScatterSearch/3.3/SolutionPoolUpdateMethod.cs

    r8322 r8345  
    3838  public sealed class SolutionPoolUpdateMethod : SingleSuccessorOperator, ISimilarityBasedOperator {
    3939    #region ISimilarityBasedOperator Members
     40    [Storable]
    4041    public ISolutionSimilarityCalculator SimilarityCalculator { get; set; }
    4142    #endregion
     
    8182    [StorableConstructor]
    8283    private SolutionPoolUpdateMethod(bool deserializing) : base(deserializing) { }
    83     private SolutionPoolUpdateMethod(SolutionPoolUpdateMethod original, Cloner cloner) : base(original, cloner) { }
     84    private SolutionPoolUpdateMethod(SolutionPoolUpdateMethod original, Cloner cloner)
     85      : base(original, cloner) {
     86      this.SimilarityCalculator = cloner.Clone(original.SimilarityCalculator);
     87    }
    8488    public SolutionPoolUpdateMethod() : base() { Initialize(); }
    8589
Note: See TracChangeset for help on using the changeset viewer.