Changeset 14466 for branches/MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3/LinearLinkage/LinearLinkageMemPRContext.cs
- Timestamp:
- 12/07/16 23:46:29 (8 years ago)
- Location:
- branches/MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3/LinearLinkage
- Files:
-
- 1 added
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3/LinearLinkage/LinearLinkageMemPRContext.cs
r14450 r14466 23 23 using HeuristicLab.Common; 24 24 using HeuristicLab.Core; 25 using HeuristicLab.Encodings. PermutationEncoding;25 using HeuristicLab.Encodings.LinearLinkageEncoding; 26 26 using HeuristicLab.Optimization; 27 27 using HeuristicLab.Parameters; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 30 namespace HeuristicLab.Algorithms.MemPR. Permutation{31 [Item("MemPR Population Context ( permutation)", "MemPR population context for permutationencoded problems.")]30 namespace HeuristicLab.Algorithms.MemPR.LinearLinkage { 31 [Item("MemPR Population Context (linear linkage)", "MemPR population context for linear linkage encoded problems.")] 32 32 [StorableClass] 33 public sealed class PermutationMemPRPopulationContext : MemPRPopulationContext<SingleObjectiveBasicProblem<PermutationEncoding>, Encodings.PermutationEncoding.Permutation, PermutationMemPRPopulationContext, PermutationMemPRSolutionContext> {33 public sealed class LinearLinkageMemPRPopulationContext : MemPRPopulationContext<SingleObjectiveBasicProblem<LinearLinkageEncoding>, Encodings.LinearLinkageEncoding.LinearLinkage, LinearLinkageMemPRPopulationContext, LinearLinkageMemPRSolutionContext> { 34 34 35 35 [StorableConstructor] 36 private PermutationMemPRPopulationContext(bool deserializing) : base(deserializing) { }37 private PermutationMemPRPopulationContext(PermutationMemPRPopulationContext original, Cloner cloner)36 private LinearLinkageMemPRPopulationContext(bool deserializing) : base(deserializing) { } 37 private LinearLinkageMemPRPopulationContext(LinearLinkageMemPRPopulationContext original, Cloner cloner) 38 38 : base(original, cloner) { } 39 public PermutationMemPRPopulationContext() : base("PermutationMemPRPopulationContext") { }40 public PermutationMemPRPopulationContext(string name) : base(name) { }39 public LinearLinkageMemPRPopulationContext() : base("LinearLinkageMemPRPopulationContext") { } 40 public LinearLinkageMemPRPopulationContext(string name) : base(name) { } 41 41 42 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new PermutationMemPRPopulationContext(this, cloner);43 return new LinearLinkageMemPRPopulationContext(this, cloner); 44 44 } 45 45 46 public override PermutationMemPRSolutionContext CreateSingleSolutionContext(ISingleObjectiveSolutionScope<Encodings.PermutationEncoding.Permutation> solution) {47 return new PermutationMemPRSolutionContext(this, solution);46 public override LinearLinkageMemPRSolutionContext CreateSingleSolutionContext(ISingleObjectiveSolutionScope<Encodings.LinearLinkageEncoding.LinearLinkage> solution) { 47 return new LinearLinkageMemPRSolutionContext(this, solution); 48 48 } 49 49 } 50 50 51 [Item("MemPR Solution Context ( permutation)", "MemPR solution context for permutationencoded problems.")]51 [Item("MemPR Solution Context (linear linkage)", "MemPR solution context for linear linkage encoded problems.")] 52 52 [StorableClass] 53 public sealed class PermutationMemPRSolutionContext : MemPRSolutionContext<SingleObjectiveBasicProblem<PermutationEncoding>, Encodings.PermutationEncoding.Permutation, PermutationMemPRPopulationContext, PermutationMemPRSolutionContext>, IPermutationSubspaceContext {53 public sealed class LinearLinkageMemPRSolutionContext : MemPRSolutionContext<SingleObjectiveBasicProblem<LinearLinkageEncoding>, Encodings.LinearLinkageEncoding.LinearLinkage, LinearLinkageMemPRPopulationContext, LinearLinkageMemPRSolutionContext>, ILinearLinkageSubspaceContext { 54 54 55 55 [Storable] 56 private IValueParameter< PermutationSolutionSubspace> subspace;57 public PermutationSolutionSubspace Subspace {56 private IValueParameter<LinearLinkageSolutionSubspace> subspace; 57 public LinearLinkageSolutionSubspace Subspace { 58 58 get { return subspace.Value; } 59 59 } 60 ISolutionSubspace<Encodings. PermutationEncoding.Permutation> ISolutionSubspaceContext<Encodings.PermutationEncoding.Permutation>.Subspace {60 ISolutionSubspace<Encodings.LinearLinkageEncoding.LinearLinkage> ISolutionSubspaceContext<Encodings.LinearLinkageEncoding.LinearLinkage>.Subspace { 61 61 get { return Subspace; } 62 62 } 63 63 64 64 [StorableConstructor] 65 private PermutationMemPRSolutionContext(bool deserializing) : base(deserializing) { }66 private PermutationMemPRSolutionContext(PermutationMemPRSolutionContext original, Cloner cloner)65 private LinearLinkageMemPRSolutionContext(bool deserializing) : base(deserializing) { } 66 private LinearLinkageMemPRSolutionContext(LinearLinkageMemPRSolutionContext original, Cloner cloner) 67 67 : base(original, cloner) { 68 68 69 69 } 70 public PermutationMemPRSolutionContext(PermutationMemPRPopulationContext baseContext, ISingleObjectiveSolutionScope<Encodings.PermutationEncoding.Permutation> solution)70 public LinearLinkageMemPRSolutionContext(LinearLinkageMemPRPopulationContext baseContext, ISingleObjectiveSolutionScope<Encodings.LinearLinkageEncoding.LinearLinkage> solution) 71 71 : base(baseContext, solution) { 72 72 73 Parameters.Add(subspace = new ValueParameter< PermutationSolutionSubspace>("Subspace", new PermutationSolutionSubspace(null)));73 Parameters.Add(subspace = new ValueParameter<LinearLinkageSolutionSubspace>("Subspace", new LinearLinkageSolutionSubspace(null))); 74 74 } 75 75 76 76 public override IDeepCloneable Clone(Cloner cloner) { 77 return new PermutationMemPRSolutionContext(this, cloner);77 return new LinearLinkageMemPRSolutionContext(this, cloner); 78 78 } 79 79 }
Note: See TracChangeset
for help on using the changeset viewer.