Free cookie consent management tool by TermsFeed Policy Generator

source: branches/FitnessLandscapeAnalysis/HeuristicLab.Analysis.FitnessLandscape/MultiTrajectory/PreassignedPermutationCreator.cs @ 9331

Last change on this file since 9331 was 7128, checked in by epitzer, 13 years ago

#1696 Integrate fitness landscape analysis plugins from Heureka! repository.

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;
8
9namespace HeuristicLab.Analysis.FitnessLandscape.MultiTrajectory {
10
11  [StorableClass]
12  public class PreassignePermutationCreator : PreassignedSolutionCreator, IPermutationCreator {
13
14    public IValueParameter<PermutationType> PermutationTypeParameter {
15      get { return (IValueParameter<PermutationType>)Parameters["PermutationType"]; }
16    }
17
18    public ILookupParameter<Permutation> PermutationParameter {
19      get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
20    }
21
22    public IValueLookupParameter<IntValue> LengthParameter {
23      get { return (IValueLookupParameter<IntValue>)Parameters["Length"]; }
24    }
25
26    [StorableConstructor]
27    protected PreassignePermutationCreator(bool deserializing) : base(deserializing) { }
28    protected PreassignePermutationCreator(PreassignePermutationCreator original, Cloner cloner)
29      : base(original, cloner) {
30    }
31    public PreassignePermutationCreator() {
32      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The created permutation."));
33      Parameters.Add(new ValueLookupParameter<IntValue>("Length", "The length of the permutation."));
34      Parameters.Add(new ValueParameter<PermutationType>("PermutationType", "The type of permutation (absolute, relative (direcected/undirected)."));
35    }
36    public override IDeepCloneable Clone(Cloner cloner) {
37      return new PreassignePermutationCreator(this, cloner);
38    }
39
40    public override void Create(IScope scope) {
41      PermutationParameter.ActualValue = (Permutation)scope.Variables[PermutationParameter.ActualName].Value;
42    }
43
44  }
45}
Note: See TracBrowser for help on using the repository browser.