Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/19/19 09:09:45 (6 years ago)
Author:
gkronber
Message:

#2994: merged changesets r16740:16822 from trunk to branch

Location:
branches/2994-AutoDiffForIntervals
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2994-AutoDiffForIntervals

  • branches/2994-AutoDiffForIntervals/HeuristicLab.Optimization

  • branches/2994-AutoDiffForIntervals/HeuristicLab.Optimization/3.3/BasicProblems/Operators/MultiEncodingCrossover.cs

    r16565 r16829  
    2020#endregion
    2121
     22using HEAL.Attic;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    24 using HEAL.Attic;
     25using HeuristicLab.Parameters;
    2526
    2627namespace HeuristicLab.Optimization {
    2728  [Item("MultiEncoding Crossover", "Applies different crossovers to cross a multi-encoding.")]
    2829  [StorableType("BB0A04E2-899D-460C-82A2-5E4CEEDE8996")]
    29   public sealed class MultiEncodingCrossover : MultiEncodingOperator<ICrossover>, ICrossover {
     30  public sealed class MultiEncodingCrossover : MultiEncodingOperator<ICrossover>, ICrossover, IStochasticOperator {
     31    public ILookupParameter<IRandom> RandomParameter {
     32      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
     33    }
     34
     35    public override string OperatorPrefix => "Crossover";
     36
    3037    [StorableConstructor]
    3138    private MultiEncodingCrossover(StorableConstructorFlag _) : base(_) { }
    3239    private MultiEncodingCrossover(MultiEncodingCrossover original, Cloner cloner) : base(original, cloner) { }
    33     public MultiEncodingCrossover() { }
     40    public MultiEncodingCrossover() {
     41      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator used by the individual operators."));
     42    }
    3443
    3544    public override IDeepCloneable Clone(Cloner cloner) { return new MultiEncodingCrossover(this, cloner); }
     45
     46    [StorableHook(HookType.AfterDeserialization)]
     47    private void AfterDeserialization() {
     48      if (!Parameters.ContainsKey("Random")) {
     49        Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator used by the individual operators."));
     50      }
     51    }
    3652  }
    3753}
Note: See TracChangeset for help on using the changeset viewer.