Changeset 17111 for stable/HeuristicLab.Optimization/3.3/BasicProblems/Operators/MultiEncodingCreator.cs
- Timestamp:
- 07/08/19 15:37:35 (5 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk merged: 16782-16783
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Optimization merged: 16782
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization/3.3/BasicProblems/Operators/MultiEncodingCreator.cs
r17097 r17111 22 22 using System; 23 23 using System.Linq; 24 using HEAL.Attic; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 26 using H EAL.Attic;27 using HeuristicLab.Parameters; 27 28 28 29 namespace HeuristicLab.Optimization { 29 30 [Item("MultiEncodingCreator", "Contains solution creators that together create a multi-encoding.")] 30 31 [StorableType("E261B506-6F74-4BC4-8164-5ACE20FBC319")] 31 public sealed class MultiEncodingCreator : MultiEncodingOperator<ISolutionCreator>, ISolutionCreator { 32 public sealed class MultiEncodingCreator : MultiEncodingOperator<ISolutionCreator>, ISolutionCreator, IStochasticOperator { 33 public ILookupParameter<IRandom> RandomParameter { 34 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } 35 } 36 37 public override string OperatorPrefix => "Creator"; 38 32 39 [StorableConstructor] 33 40 private MultiEncodingCreator(StorableConstructorFlag _) : base(_) { } 34 41 35 42 private MultiEncodingCreator(MultiEncodingCreator original, Cloner cloner) : base(original, cloner) { } 36 public MultiEncodingCreator() { } 43 public MultiEncodingCreator() { 44 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator used by the individual operators.")); 45 } 37 46 38 47 public override IDeepCloneable Clone(Cloner cloner) { 39 48 return new MultiEncodingCreator(this, cloner); 49 } 50 51 [StorableHook(HookType.AfterDeserialization)] 52 private void AfterDeserialization() { 53 if (!Parameters.ContainsKey("Random")) { 54 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator used by the individual operators.")); 55 } 40 56 } 41 57
Note: See TracChangeset
for help on using the changeset viewer.