Changeset 4902
- Timestamp:
- 11/22/10 13:24:18 (14 years ago)
- Location:
- branches/NSGA2/HeuristicLab.Algorithms.NSGA2/3.3
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/NSGA2/HeuristicLab.Algorithms.NSGA2/3.3/BasicMultiObjectiveQualityAnalyzer.cs
r4601 r4902 30 30 using HeuristicLab.Optimization; 31 31 using HeuristicLab.Parameters; 32 using HeuristicLab.Common; 32 33 33 34 namespace HeuristicLab.Algorithms.NSGA2 { … … 45 46 } 46 47 48 [StorableConstructor] 49 protected BasicMultiObjectiveQualityAnalyzer(bool deserializing) : base(deserializing) { } 50 protected BasicMultiObjectiveQualityAnalyzer(BasicMultiObjectiveQualityAnalyzer original, Cloner cloner) : base(original, cloner) { } 47 51 public BasicMultiObjectiveQualityAnalyzer() { 48 52 Parameters.Add(new ScopeTreeLookupParameter<IntValue>("Rank", "The rank of solution describes to which front it belongs.")); … … 87 91 return base.Apply(); 88 92 } 93 94 public override IDeepCloneable Clone(Cloner cloner) { 95 return new BasicMultiObjectiveQualityAnalyzer(this, cloner); 96 } 89 97 } 90 98 } -
branches/NSGA2/HeuristicLab.Algorithms.NSGA2/3.3/CrowdedComparisonSorter.cs
r4067 r4902 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Algorithms.NSGA2 { … … 47 48 } 48 49 50 [StorableConstructor] 51 protected CrowdedComparisonSorter(bool deserializing) : base(deserializing) { } 52 protected CrowdedComparisonSorter(CrowdedComparisonSorter original, Cloner cloner) : base(original, cloner) { } 49 53 public CrowdedComparisonSorter() { 50 54 Parameters.Add(new ScopeTreeLookupParameter<IntValue>("Rank", "The rank of the solution.")); … … 88 92 #endregion 89 93 } 94 95 public override IDeepCloneable Clone(Cloner cloner) { 96 return new CrowdedComparisonSorter(this, cloner); 97 } 90 98 } 91 99 } -
branches/NSGA2/HeuristicLab.Algorithms.NSGA2/3.3/CrowdedTournamentSelector.cs
r4167 r4902 28 28 using HeuristicLab.Selection; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Algorithms.NSGA2 { … … 63 64 } 64 65 66 [StorableConstructor] 67 protected CrowdedTournamentSelector(bool deserializing) : base(deserializing) { } 68 protected CrowdedTournamentSelector(CrowdedTournamentSelector original, Cloner cloner) : base(original, cloner) { } 65 69 public CrowdedTournamentSelector() 66 70 : base() { … … 108 112 return selected; 109 113 } 114 115 public override IDeepCloneable Clone(Cloner cloner) { 116 return new CrowdedTournamentSelector(this, cloner); 117 } 110 118 } 111 119 } -
branches/NSGA2/HeuristicLab.Algorithms.NSGA2/3.3/CrowdingDistanceAssignment.cs
r4067 r4902 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Common; 30 31 31 32 namespace HeuristicLab.Algorithms.NSGA2 { … … 48 49 [StorableConstructor] 49 50 protected CrowdingDistanceAssignment(bool deserializing) : base(deserializing) { } 51 protected CrowdingDistanceAssignment(CrowdingDistanceAssignment original, Cloner cloner) : base(original, cloner) { } 50 52 public CrowdingDistanceAssignment() { 51 53 Parameters.Add(new ScopeTreeLookupParameter<DoubleArray>("Qualities", "The vector of quality values.")); … … 114 116 #endregion 115 117 } 118 119 public override IDeepCloneable Clone(Cloner cloner) { 120 return new CrowdingDistanceAssignment(this, cloner); 121 } 116 122 } 117 123 } -
branches/NSGA2/HeuristicLab.Algorithms.NSGA2/3.3/DefaultCrossover.cs
r4068 r4902 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Common; 27 28 28 29 namespace HeuristicLab.Algorithms.NSGA2 { … … 34 35 } 35 36 37 38 [StorableConstructor] 39 protected DefaultCrossover(bool deserializing) : base(deserializing) { } 40 protected DefaultCrossover(DefaultCrossover original, Cloner cloner) : base(original, cloner) { } 36 41 public DefaultCrossover() 37 42 : base() { … … 49 54 return base.Apply(); 50 55 } 56 57 public override IDeepCloneable Clone(Cloner cloner) { 58 return new DefaultCrossover(this, cloner); 59 } 51 60 } 52 61 } -
branches/NSGA2/HeuristicLab.Algorithms.NSGA2/3.3/FastNonDominatedSort.cs
r4067 r4902 27 27 using HeuristicLab.Parameters; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Algorithms.NSGA2 { … … 51 52 } 52 53 54 [StorableConstructor] 55 protected FastNonDominatedSort(bool deserializing) : base(deserializing) { } 56 protected FastNonDominatedSort(FastNonDominatedSort original, Cloner cloner) : base(original, cloner) { } 53 57 public FastNonDominatedSort() { 54 58 Parameters.Add(new ValueLookupParameter<BoolArray>("Maximization", "Whether each objective is maximization or minimization.")); … … 151 155 fronts[i].Add(p); 152 156 } 157 158 public override IDeepCloneable Clone(Cloner cloner) { 159 return new FastNonDominatedSort(this, cloner); 160 } 153 161 } 154 162 } -
branches/NSGA2/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2.cs
r4514 r4902 40 40 [Creatable("Algorithms")] 41 41 [StorableClass] 42 public class NSGA2 : EngineAlgorithm {42 public class NSGA2 : EngineAlgorithm, IStorableContent { 43 43 #region Problem Properties 44 44 public override Type ProblemType { … … 150 150 151 151 [StorableConstructor] 152 public NSGA2(bool deserializing) : base(deserializing) { } 152 protected NSGA2(bool deserializing) : base(deserializing) { } 153 protected NSGA2(NSGA2 original, Cloner cloner) : base (original, cloner) { 154 basicMOQualityAnalyzer = (BasicMultiObjectiveQualityAnalyzer)cloner.Clone(original.basicMOQualityAnalyzer); 155 AttachEventHandlers(); 156 } 153 157 public NSGA2() { 154 158 Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0))); … … 214 218 215 219 public override IDeepCloneable Clone(Cloner cloner) { 216 NSGA2 clone = (NSGA2)base.Clone(cloner); 217 clone.basicMOQualityAnalyzer = (BasicMultiObjectiveQualityAnalyzer)cloner.Clone(basicMOQualityAnalyzer); 218 clone.AttachEventHandlers(); 219 return clone; 220 return new NSGA2(this, cloner); 220 221 } 221 222 … … 375 376 } 376 377 #endregion 378 379 public string Filename { 380 get; 381 set; 382 } 377 383 } 378 384 } -
branches/NSGA2/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2MainLoop.cs
r4068 r4902 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 28 using HeuristicLab.Selection; 29 using HeuristicLab.Common; 29 30 30 31 namespace HeuristicLab.Algorithms.NSGA2 { … … 78 79 79 80 [StorableConstructor] 80 private NSGA2MainLoop(bool deserializing) : base() { } 81 protected NSGA2MainLoop(bool deserializing) : base(deserializing) { } 82 protected NSGA2MainLoop(NSGA2MainLoop original, Cloner cloner) : base(original, cloner) { } 81 83 public NSGA2MainLoop() 82 84 : base() { … … 218 220 #endregion 219 221 } 222 223 public override IDeepCloneable Clone(Cloner cloner) { 224 return new NSGA2MainLoop(this, cloner); 225 } 220 226 } 221 227 } -
branches/NSGA2/HeuristicLab.Algorithms.NSGA2/3.3/RankAndCrowdingSorter.cs
r4068 r4902 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Selection; 27 using HeuristicLab.Common; 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 29 28 30 namespace HeuristicLab.Algorithms.NSGA2 { … … 41 43 } 42 44 45 [StorableConstructor] 46 protected RankAndCrowdingSorter(bool deserializing) : base(deserializing) { } 47 protected RankAndCrowdingSorter(RankAndCrowdingSorter original, Cloner cloner) : base(original, cloner) { } 43 48 public RankAndCrowdingSorter() 44 49 : base() { … … 72 77 mergingReducer.Successor = null; 73 78 } 79 80 public override IDeepCloneable Clone(Cloner cloner) { 81 return new RankAndCrowdingSorter(this, cloner); 82 } 74 83 } 75 84 }
Note: See TracChangeset
for help on using the changeset viewer.