using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Encodings.BinaryVectorEncoding; using HeuristicLab.Parameters; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; namespace HeuristicLab.Analysis.FitnessLandscape.MultiTrajectory { [StorableClass] public class PreassignedBinaryVectorCreator : PreassignedSolutionCreator, IBinaryVectorCreator { public ILookupParameter BinaryVectorParameter { get { return (ILookupParameter)Parameters["BinaryVector"]; } } public IValueLookupParameter LengthParameter { get { return (IValueLookupParameter)Parameters["Length"]; } } [StorableConstructor] protected PreassignedBinaryVectorCreator(bool deserializing) : base(deserializing) { } protected PreassignedBinaryVectorCreator(PreassignedBinaryVectorCreator original, Cloner cloner) : base(original, cloner) { } public PreassignedBinaryVectorCreator() { Parameters.Add(new LookupParameter("BinaryVector", "The created binary vector.")); Parameters.Add(new ValueLookupParameter("Length", "The length of the binary vector.")); } public override IDeepCloneable Clone(Cloner cloner) { return new PreassignedBinaryVectorCreator(this, cloner); } public override void Create(IScope scope) { BinaryVectorParameter.ActualValue = (BinaryVector)scope.Variables[BinaryVectorParameter.ActualName].Value; } } }