Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2780_SAPBA/HeuristicLab.Algorithms.SAPBA/Operators/FixedSolutionCreator.cs @ 17790

Last change on this file since 17790 was 16108, checked in by bwerth, 6 years ago

#2780 renamed branch to include ticket number

File size: 1.2 KB
Line 
1using HeuristicLab.Common;
2using HeuristicLab.Core;
3using HeuristicLab.Data;
4using HeuristicLab.Encodings.RealVectorEncoding;
5using HeuristicLab.Optimization;
6using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
7
8namespace HeuristicLab.Algorithms.SAPBA.Operators {
9  [Item("FixedRealVectorCreator", "An operator which creates a new real vector cloned from a single Point")]
10  [StorableClass]
11  public class FixedRealVectorCreator : RealVectorCreator, IStrategyParameterCreator {
12    [Storable]
13    private RealVector Point;
14
15    [StorableConstructor]
16    protected FixedRealVectorCreator(bool deserializing) : base(deserializing) { }
17    protected FixedRealVectorCreator(FixedRealVectorCreator original, Cloner cloner) : base(original, cloner) {
18      Point = cloner.Clone(original.Point);
19    }
20    public FixedRealVectorCreator(RealVector r) : base() {
21      Point = r;
22    }
23    public override IDeepCloneable Clone(Cloner cloner) { return new FixedRealVectorCreator(this, cloner); }
24    protected override RealVector Create(IRandom random, IntValue length, DoubleMatrix bounds) {
25      return (RealVector)Point.Clone();
26    }
27  }
28
29}
30
Note: See TracBrowser for help on using the repository browser.