Free cookie consent management tool by TermsFeed Policy Generator

source: addons/HeuristicLab.FitnessLandscapeAnalysis/HeuristicLab.Analysis.FitnessLandscape/MultiTrajectory/PreassignedPermutationCreator.cs @ 17514

Last change on this file since 17514 was 16995, checked in by gkronber, 6 years ago

#2520 Update plugin dependencies and references for HL.FLA for new persistence

File size: 1.8 KB
RevLine 
[7128]1using HeuristicLab.Common;
2using HeuristicLab.Core;
3using HeuristicLab.Data;
4using HeuristicLab.Parameters;
5using HeuristicLab.Encodings.PermutationEncoding;
[16573]6using HEAL.Attic;
[7128]7
8namespace HeuristicLab.Analysis.FitnessLandscape.MultiTrajectory {
9
[16573]10  [StorableType("4653B893-A98F-4FF4-A280-C402848F8A06")]
[7128]11  public class PreassignePermutationCreator : PreassignedSolutionCreator, IPermutationCreator {
12
13    public IValueParameter<PermutationType> PermutationTypeParameter {
14      get { return (IValueParameter<PermutationType>)Parameters["PermutationType"]; }
15    }
16
17    public ILookupParameter<Permutation> PermutationParameter {
18      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
19    }
20
21    public IValueLookupParameter<IntValue> LengthParameter {
22      get { return (IValueLookupParameter<IntValue>)Parameters["Length"]; }
23    }
24
25    [StorableConstructor]
[16573]26    protected PreassignePermutationCreator(StorableConstructorFlag _) : base(_) { }
[7128]27    protected PreassignePermutationCreator(PreassignePermutationCreator original, Cloner cloner)
28      : base(original, cloner) {
29    }
30    public PreassignePermutationCreator() {
31      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The created permutation."));
32      Parameters.Add(new ValueLookupParameter<IntValue>("Length", "The length of the permutation."));
33      Parameters.Add(new ValueParameter<PermutationType>("PermutationType", "The type of permutation (absolute, relative (direcected/undirected)."));
34    }
35    public override IDeepCloneable Clone(Cloner cloner) {
36      return new PreassignePermutationCreator(this, cloner);
37    }
38
39    public override void Create(IScope scope) {
40      PermutationParameter.ActualValue = (Permutation)scope.Variables[PermutationParameter.ActualName].Value;
41    }
42
43  }
44}
Note: See TracBrowser for help on using the repository browser.