[7128] | 1 | using HeuristicLab.Common;
|
---|
| 2 | using HeuristicLab.Core;
|
---|
| 3 | using HeuristicLab.Data;
|
---|
| 4 | using HeuristicLab.Parameters;
|
---|
| 5 | using HeuristicLab.Encodings.PermutationEncoding;
|
---|
[16573] | 6 | using HEAL.Attic;
|
---|
[7128] | 7 |
|
---|
| 8 | namespace 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 | }
|
---|