Free cookie consent management tool by TermsFeed Policy Generator

source: branches/FitnessLandscapeAnalysis/HeuristicLab.Analysis.FitnessLandscape/MultiTrajectory/PreassignedBinaryVectorCreator.cs @ 11038

Last change on this file since 11038 was 7128, checked in by epitzer, 13 years ago

#1696 Integrate fitness landscape analysis plugins from Heureka! repository.

File size: 1.5 KB
Line 
1using HeuristicLab.Common;
2using HeuristicLab.Core;
3using HeuristicLab.Data;
4using HeuristicLab.Encodings.BinaryVectorEncoding;
5using HeuristicLab.Parameters;
6using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
7
8namespace HeuristicLab.Analysis.FitnessLandscape.MultiTrajectory {
9
10  [StorableClass]
11  public class PreassignedBinaryVectorCreator : PreassignedSolutionCreator, IBinaryVectorCreator {
12
13    public ILookupParameter<BinaryVector> BinaryVectorParameter {
14      get { return (ILookupParameter<BinaryVector>)Parameters["BinaryVector"]; }
15    }
16
17    public IValueLookupParameter<IntValue> LengthParameter {
18      get { return (IValueLookupParameter<IntValue>)Parameters["Length"]; }
19    }
20
21    [StorableConstructor]
22    protected PreassignedBinaryVectorCreator(bool deserializing) : base(deserializing) { }
23    protected PreassignedBinaryVectorCreator(PreassignedBinaryVectorCreator original, Cloner cloner)
24      : base(original, cloner) {
25    }
26    public PreassignedBinaryVectorCreator() {
27      Parameters.Add(new LookupParameter<BinaryVector>("BinaryVector", "The created binary vector."));
28      Parameters.Add(new ValueLookupParameter<IntValue>("Length", "The length of the binary vector."));
29    }
30    public override IDeepCloneable Clone(Cloner cloner) {
31      return new PreassignedBinaryVectorCreator(this, cloner);
32    }
33
34    public override void Create(IScope scope) {
35      BinaryVectorParameter.ActualValue = (BinaryVector)scope.Variables[BinaryVectorParameter.ActualName].Value;
36    }
37
38  }
39}
Note: See TracBrowser for help on using the repository browser.