using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Encodings.RealVectorEncoding; using HeuristicLab.Parameters; using HEAL.Attic; namespace HeuristicLab.Analysis.FitnessLandscape.MultiTrajectory { [StorableType("A690FC7E-A8B1-4CAB-AABD-18401330F01D")] public class PreassignedRealVectorCreator : PreassignedSolutionCreator, IRealVectorCreator { public IValueLookupParameter BoundsParameter { get { return (IValueLookupParameter)Parameters["Bounds"]; } } public IValueLookupParameter LengthParameter { get { return (IValueLookupParameter)Parameters["Length"]; } } public ILookupParameter RealVectorParameter { get { return (ILookupParameter)Parameters["RealVector"]; } } [StorableConstructor] protected PreassignedRealVectorCreator(StorableConstructorFlag _) : base(_) { } protected PreassignedRealVectorCreator(PreassignedRealVectorCreator original, Cloner cloner) : base(original, cloner) { } public override IDeepCloneable Clone(Cloner cloner) { return new PreassignedRealVectorCreator(this, cloner); } public PreassignedRealVectorCreator() { Parameters.Add(new ValueLookupParameter("Bounds", "Bounds of the real vector to create.")); Parameters.Add(new ValueLookupParameter("Length", "Length of the real vector.")); Parameters.Add(new LookupParameter("RealVector", "The created real vector")); } public override void Create(IScope scope) { if (scope.Variables.ContainsKey(RealVectorParameter.ActualName)) RealVectorParameter.ActualValue = scope.Variables[RealVectorParameter.ActualName].Value as RealVector; } } }