Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 16573 was 16573, checked in by gkronber, 5 years ago

#2520: changed HeuristicLab.FLA addon to compile with new HL.Persistence

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