1 | using HeuristicLab.Common;
|
---|
2 | using HeuristicLab.Core;
|
---|
3 | using HeuristicLab.Data;
|
---|
4 | using HeuristicLab.Encodings.BinaryVectorEncoding;
|
---|
5 | using HeuristicLab.Parameters;
|
---|
6 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
7 | using HeuristicLab.Encodings.PermutationEncoding;
|
---|
8 | using HEAL.Attic;
|
---|
9 |
|
---|
10 | namespace 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 | }
|
---|