using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Encodings.BinaryVectorEncoding; using HeuristicLab.Parameters; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; using HeuristicLab.Encodings.PermutationEncoding; namespace HeuristicLab.Analysis.FitnessLandscape.MultiTrajectory { [StorableClass] 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(bool deserializing) : base(deserializing) { } 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; } } }