using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Parameters; using HeuristicLab.Encodings.PermutationEncoding; using HEAL.Attic; namespace HeuristicLab.Analysis.FitnessLandscape.MultiTrajectory { [StorableType("4653B893-A98F-4FF4-A280-C402848F8A06")] public class PreassignePermutationCreator : PreassignedSolutionCreator, IPermutationCreator { public IValueParameter PermutationTypeParameter { get { return (IValueParameter)Parameters["PermutationType"]; } } public ILookupParameter PermutationParameter { get { return (ILookupParameter)Parameters["Permutation"]; } } public IValueLookupParameter LengthParameter { get { return (IValueLookupParameter)Parameters["Length"]; } } [StorableConstructor] protected PreassignePermutationCreator(StorableConstructorFlag _) : base(_) { } protected PreassignePermutationCreator(PreassignePermutationCreator original, Cloner cloner) : base(original, cloner) { } public PreassignePermutationCreator() { Parameters.Add(new LookupParameter("Permutation", "The created permutation.")); Parameters.Add(new ValueLookupParameter("Length", "The length of the permutation.")); Parameters.Add(new ValueParameter("PermutationType", "The type of permutation (absolute, relative (direcected/undirected).")); } public override IDeepCloneable Clone(Cloner cloner) { return new PreassignePermutationCreator(this, cloner); } public override void Create(IScope scope) { PermutationParameter.ActualValue = (Permutation)scope.Variables[PermutationParameter.ActualName].Value; } } }