Changeset 4696 for branches/CloningRefactoring
- Timestamp:
- 10/31/10 11:36:07 (14 years ago)
- Location:
- branches/CloningRefactoring
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeStringFormatter.cs
r4068 r4696 24 24 25 25 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { 26 [StorableClass]26 27 27 public class SymbolicExpressionTreeStringFormatter { 28 [Storable]28 29 29 public bool Indent { get; set; } 30 30 31 31 public SymbolicExpressionTreeStringFormatter() 32 32 : base() { -
branches/CloningRefactoring/HeuristicLab.Operators.Views.GraphVisualization/3.3/General/ConnectionInfo.cs
r4673 r4696 29 29 public class ConnectionInfo : DeepCloneable, IConnectionInfo { 30 30 [StorableConstructor] 31 pr ivateConnectionInfo(bool deserializing) : base() { }32 pr ivateConnectionInfo(ConnectionInfo original, Cloner cloner)31 protected ConnectionInfo(bool deserializing) : base() { } 32 protected ConnectionInfo(ConnectionInfo original, Cloner cloner) 33 33 : base(original, cloner) { 34 34 from = cloner.Clone(original.from); -
branches/CloningRefactoring/HeuristicLab.Optimization/3.3/UserDefinedProblem.cs
r4670 r4696 221 221 [Item("EmptyUserDefinedProblemEvaluator", "A dummy evaluator that will throw an exception when executed.")] 222 222 [StorableClass] 223 private class EmptyUserDefinedProblemEvaluator : ParameterizedNamedItem, ISingleObjectiveEvaluator {223 private sealed class EmptyUserDefinedProblemEvaluator : ParameterizedNamedItem, ISingleObjectiveEvaluator { 224 224 225 225 [StorableConstructor] -
branches/CloningRefactoring/HeuristicLab.Problems.DataAnalysis.Classification/3.3/Symbolic/Analyzer/ValidationBestSymbolicClassificationSolutionAnalyzer.cs
r4678 r4696 182 182 183 183 [StorableConstructor] 184 pr ivateValidationBestSymbolicClassificationSolutionAnalyzer(bool deserializing) : base(deserializing) { }184 protected ValidationBestSymbolicClassificationSolutionAnalyzer(bool deserializing) : base(deserializing) { } 185 185 protected ValidationBestSymbolicClassificationSolutionAnalyzer(ValidationBestSymbolicClassificationSolutionAnalyzer original, Cloner cloner) 186 186 : base(original, cloner) { -
branches/CloningRefactoring/HeuristicLab.Problems.TestFunctions/3.3/MoveEvaluators/RealVectorAdditiveMoveWrapper.cs
r4688 r4696 21 21 22 22 using HeuristicLab.Encodings.RealVectorEncoding; 23 using HeuristicLab.Common; 23 24 24 25 namespace HeuristicLab.Problems.TestFunctions { … … 26 27 /// This wrapper disguises as real vector for use in the evaluation functions. 27 28 /// </summary> 28 internal class RealVectorAdditiveMoveWrapper : RealVector {29 internal sealed class RealVectorAdditiveMoveWrapper : RealVector { 29 30 private int dimension; 30 31 private double moveDistance; 31 32 private RealVector vector; 32 33 34 private RealVectorAdditiveMoveWrapper(bool deserializing) : base(deserializing) { } 35 private RealVectorAdditiveMoveWrapper(RealVectorAdditiveMoveWrapper original, Cloner cloner) 36 : base(original, cloner) { 37 this.dimension = original.dimension; 38 this.moveDistance = original.moveDistance; 39 this.vector = cloner.Clone(vector); 40 } 33 41 public RealVectorAdditiveMoveWrapper() { 34 42 dimension = -1; … … 40 48 moveDistance = move.MoveDistance; 41 49 this.vector = vector; 50 } 51 52 public override IDeepCloneable Clone(Cloner cloner) { 53 return new RealVectorAdditiveMoveWrapper(this, cloner); 42 54 } 43 55 -
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/IntraRouteInversion/AlbaIntraRouteInversionMoveMaker.cs
r4690 r4696 46 46 47 47 [StorableConstructor] 48 private AlbaIntraRouteInversionMoveMaker(bool deserializing) : base(deserializing) { } 49 private AlbaIntraRouteInversionMoveMaker(AlbaIntraRouteInversionMoveMaker original, Cloner cloner) 50 : base(original, cloner) { 51 } 48 protected AlbaIntraRouteInversionMoveMaker(bool deserializing) : base(deserializing) { } 49 protected AlbaIntraRouteInversionMoveMaker(AlbaIntraRouteInversionMoveMaker original, Cloner cloner) : base(original, cloner) { } 52 50 public AlbaIntraRouteInversionMoveMaker() 53 51 : base() { -
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/LambdaInterchange/AlbaLambdaInterchangeMoveMaker.cs
r4690 r4696 47 47 48 48 [StorableConstructor] 49 pr ivateAlbaLambdaInterchangeMoveMaker(bool deserializing) : base(deserializing) { }49 protected AlbaLambdaInterchangeMoveMaker(bool deserializing) : base(deserializing) { } 50 50 protected AlbaLambdaInterchangeMoveMaker(AlbaLambdaInterchangeMoveMaker original, Cloner cloner) 51 51 : base(original, cloner) { -
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Creators/MultiVRPSolutionCreator.cs
r4687 r4696 79 79 80 80 [StorableConstructor] 81 pr ivateMultiVRPSolutionCreator(bool deserializing) : base(deserializing) { }81 protected MultiVRPSolutionCreator(bool deserializing) : base(deserializing) { } 82 82 protected MultiVRPSolutionCreator(MultiVRPSolutionCreator original, Cloner cloner) : base(original, cloner) { } 83 83 public override IDeepCloneable Clone(Cloner cloner) { -
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Crossovers/MultiVRPSolutionCrossover.cs
r4687 r4696 83 83 84 84 [StorableConstructor] 85 pr ivateMultiVRPSolutionCrossover(bool deserializing) : base(deserializing) { }85 protected MultiVRPSolutionCrossover(bool deserializing) : base(deserializing) { } 86 86 protected MultiVRPSolutionCrossover(MultiVRPSolutionCrossover original, Cloner cloner) : base(original, cloner) { } 87 87 public override IDeepCloneable Clone(Cloner cloner) { -
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Manipulators/MultiVRPSolutionManipulator.cs
r4687 r4696 79 79 80 80 [StorableConstructor] 81 pr ivateMultiVRPSolutionManipulator(bool deserializing) : base(deserializing) { }81 protected MultiVRPSolutionManipulator(bool deserializing) : base(deserializing) { } 82 82 protected MultiVRPSolutionManipulator(MultiVRPSolutionManipulator original, Cloner cloner) : base(original, cloner) { } 83 83 public override IDeepCloneable Clone(Cloner cloner) { -
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveGenerator.cs
r4687 r4696 98 98 99 99 [StorableConstructor] 100 pr ivateMultiVRPMoveGenerator(bool deserializing) : base(deserializing) { }101 pr ivateMultiVRPMoveGenerator(MultiVRPMoveGenerator original, Cloner cloner) : base(original, cloner) { }100 protected MultiVRPMoveGenerator(bool deserializing) : base(deserializing) { } 101 protected MultiVRPMoveGenerator(MultiVRPMoveGenerator original, Cloner cloner) : base(original, cloner) { } 102 102 public override IDeepCloneable Clone(Cloner cloner) { 103 103 return new MultiVRPMoveGenerator(this, cloner); -
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveMaker.cs
r4687 r4696 80 80 81 81 [StorableConstructor] 82 pr ivateLambdaInterchangeMoveMaker(bool deserializing) : base(deserializing) { }82 protected LambdaInterchangeMoveMaker(bool deserializing) : base(deserializing) { } 83 83 protected LambdaInterchangeMoveMaker(LambdaInterchangeMoveMaker original, Cloner cloner) : base(original, cloner) { } 84 84 public override IDeepCloneable Clone(Cloner cloner) { -
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/PotvinEncoding.cs
r4691 r4696 34 34 public List<int> Unrouted { get; set; } 35 35 36 public PotvinEncoding() 37 : base() { 38 Unrouted = new List<int>(); 39 } 36 [StorableConstructor] 37 protected PotvinEncoding(bool deserializing) : base(deserializing) { } 40 38 protected PotvinEncoding(PotvinEncoding original, Cloner cloner) 41 39 : base(original, cloner) { … … 43 41 Unrouted = new List<int>(original.Unrouted); 44 42 } 43 public PotvinEncoding() 44 : base() { 45 Unrouted = new List<int>(); 46 } 47 45 48 public override IDeepCloneable Clone(Cloner cloner) { 46 49 return new PotvinEncoding(this, cloner); 47 }48 [StorableConstructor]49 private PotvinEncoding(bool serializing)50 : base() {51 50 } 52 51 -
branches/CloningRefactoring/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Zhu/ZhuEncoding.cs
r4693 r4696 125 125 126 126 [StorableConstructor] 127 private ZhuEncoding(bool serializing) 128 : base(serializing) { 129 } 130 127 protected ZhuEncoding(bool deserializing) : base(deserializing) { } 131 128 protected ZhuEncoding(ZhuEncoding original, Cloner cloner) 132 129 : base(original, cloner) { -
branches/CloningRefactoring/HeuristicLab.Selection/3.3/GenderSpecificSelector.cs
r4670 r4696 81 81 82 82 [StorableConstructor] 83 private GenderSpecificSelector(bool deserializing) : base(deserializing) { } 84 [StorableHook(HookType.AfterDeserialization)] 85 private void AfterDeserialization() { 86 Initialize(); 87 } 88 83 protected GenderSpecificSelector(bool deserializing) : base(deserializing) { } 89 84 protected GenderSpecificSelector(GenderSpecificSelector original, Cloner cloner) 90 85 : base(original, cloner) { 91 86 Initialize(); 92 }93 public override IDeepCloneable Clone(Cloner cloner) {94 return new GenderSpecificSelector(this, cloner);95 87 } 96 88 … … 131 123 #endregion 132 124 125 Initialize(); 126 } 127 128 public override IDeepCloneable Clone(Cloner cloner) { 129 return new GenderSpecificSelector(this, cloner); 130 } 131 132 [StorableHook(HookType.AfterDeserialization)] 133 private void AfterDeserialization() { 133 134 Initialize(); 134 135 } -
branches/CloningRefactoring/HeuristicLab.Selection/3.3/OffspringSelector.cs
r4670 r4696 63 63 64 64 [StorableConstructor] 65 private OffspringSelector(bool deserializing) : base(deserializing) { } 66 private OffspringSelector(OffspringSelector original, Cloner cloner) 67 : base(original, cloner) { 68 } 65 protected OffspringSelector(bool deserializing) : base(deserializing) { } 66 protected OffspringSelector(OffspringSelector original, Cloner cloner) : base(original, cloner) { } 69 67 public override IDeepCloneable Clone(Cloner cloner) { 70 68 return new OffspringSelector(this, cloner); -
branches/CloningRefactoring/HeuristicLab/3.3/Tests/StorableConstructorTest.cs
r4658 r4696 31 31 if (storableType.IsSealed && !storableConstructor.IsPrivate) 32 32 errorMessage.Append(Environment.NewLine + storableType.ToString() + ": Storable constructor must be private in sealed classes."); 33 else if (!storableType.IsSealed && ! storableConstructor.IsFamily)34 errorMessage.Append(Environment.NewLine + storableType.ToString() + ": Storable constructor must be protected .");33 else if (!storableType.IsSealed && !(storableConstructor.IsFamily || storableConstructor.IsPublic)) 34 errorMessage.Append(Environment.NewLine + storableType.ToString() + ": Storable constructor must be protected (can be public in rare cases)."); 35 35 } 36 36 }
Note: See TracChangeset
for help on using the changeset viewer.