Changeset 4722 for trunk/sources/HeuristicLab.Optimization.Operators
- Timestamp:
- 11/06/10 01:56:04 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/CloningRefactoring (added) merged: 4656-4693,4696-4697,4711-4714,4718-4719
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Optimization.Operators/3.3/ChildrenCreator.cs
r4068 r4722 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 53 54 } 54 55 56 [StorableConstructor] 57 private ChildrenCreator(bool deserializing) : base(deserializing) { } 58 private ChildrenCreator(ChildrenCreator original, Cloner cloner) : base(original, cloner) { } 55 59 public ChildrenCreator() 56 60 : base() { 57 61 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope whose sub-scopes represent the parents.")); 58 62 Parameters.Add(new ValueLookupParameter<IntValue>("ParentsPerChild", "The number of parents that should be crossed per child. Note that some of the typical crossover operators require exactly two parents.", new IntValue(2))); 63 } 64 65 public override IDeepCloneable Clone(Cloner cloner) { 66 return new ChildrenCreator(this, cloner); 59 67 } 60 68 -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/DiscreteDoubleValueModifier.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 70 71 } 71 72 73 [StorableConstructor] 74 protected DiscreteDoubleValueModifier(bool deserializing) : base(deserializing) { } 75 protected DiscreteDoubleValueModifier(DiscreteDoubleValueModifier original, Cloner cloner) : base(original, cloner) { } 72 76 /// <summary> 73 77 /// Initializes a new instance of <see cref="DiscreteDoubleValueModifier"/> with 6 parameters -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/ExponentialDiscreteDoubleValueModifier.cs
r4068 r4722 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 31 32 [StorableClass] 32 33 public class ExponentialDiscreteDoubleValueModifier : DiscreteDoubleValueModifier { 34 [StorableConstructor] 35 protected ExponentialDiscreteDoubleValueModifier(bool deserializing) : base(deserializing) { } 36 protected ExponentialDiscreteDoubleValueModifier(ExponentialDiscreteDoubleValueModifier original, Cloner cloner) : base(original, cloner) { } 37 public ExponentialDiscreteDoubleValueModifier() : base() { } 38 39 public override IDeepCloneable Clone(Cloner cloner) { 40 return new ExponentialDiscreteDoubleValueModifier(this, cloner); 41 } 42 33 43 /// <summary> 34 44 /// Calculates a new value based on exponential decay or growth. -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/LinearDiscreteDoubleValueModifier.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 30 31 [StorableClass] 31 32 public class LinearDiscreteDoubleValueModifier : DiscreteDoubleValueModifier { 33 [StorableConstructor] 34 protected LinearDiscreteDoubleValueModifier(bool deserializing) : base(deserializing) { } 35 protected LinearDiscreteDoubleValueModifier(LinearDiscreteDoubleValueModifier original, Cloner cloner) : base(original, cloner) { } 36 public LinearDiscreteDoubleValueModifier() : base() { } 37 38 public override IDeepCloneable Clone(Cloner cloner) { 39 return new LinearDiscreteDoubleValueModifier(this, cloner); 40 } 41 32 42 protected override double Modify(double value, double startValue, double endValue, int index, int startIndex, int endIndex) { 33 43 double k = (endValue - startValue) / (endIndex - startIndex); -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/ProbabilisticQualityComparator.cs
r4068 r4722 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 45 46 } 46 47 48 [StorableConstructor] 49 protected ProbabilisticQualityComparator(bool deserializing) : base(deserializing) { } 50 protected ProbabilisticQualityComparator(ProbabilisticQualityComparator original, Cloner cloner) : base(original, cloner) { } 47 51 public ProbabilisticQualityComparator() 48 52 : base() { 49 53 Parameters.Add(new LookupParameter<DoubleValue>("Dampening", "The dampening factor that influences the probability.")); 50 54 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator.")); 55 } 56 57 public override IDeepCloneable Clone(Cloner cloner) { 58 return new ProbabilisticQualityComparator(this, cloner); 51 59 } 52 60 -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/QuadraticDiscreteDoubleValueModifier.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 30 31 [StorableClass] 31 32 public class QuadraticDiscreteDoubleValueModifier : DiscreteDoubleValueModifier { 33 [StorableConstructor] 34 protected QuadraticDiscreteDoubleValueModifier(bool deserializing) : base(deserializing) { } 35 protected QuadraticDiscreteDoubleValueModifier(QuadraticDiscreteDoubleValueModifier original, Cloner cloner) : base(original, cloner) { } 36 public QuadraticDiscreteDoubleValueModifier() : base() { } 37 38 public override IDeepCloneable Clone(Cloner cloner) { 39 return new QuadraticDiscreteDoubleValueModifier(this, cloner); 40 } 41 32 42 protected override double Modify(double value, double startValue, double endValue, int index, int startIndex, int endIndex) { 33 43 double a = (endValue - startValue) / ((endIndex - startIndex) * (endIndex - startIndex)); -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/QualityComparator.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 43 44 } 44 45 46 [StorableConstructor] 47 protected QualityComparator(bool deserializing) : base(deserializing) { } 48 protected QualityComparator(QualityComparator original, Cloner cloner) : base(original, cloner) { } 45 49 public QualityComparator() 46 50 : base() { … … 49 53 Parameters.Add(new LookupParameter<BoolValue>("Result", "The result of the comparison.")); 50 54 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false.")); 55 } 56 57 public override IDeepCloneable Clone(Cloner cloner) { 58 return new QualityComparator(this, cloner); 51 59 } 52 60 -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/ResultsCollector.cs
r4068 r4722 21 21 22 22 using System.Collections; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 46 47 } 47 48 49 [StorableConstructor] 50 protected ResultsCollector(bool deserializing) : base(deserializing) { } 51 protected ResultsCollector(ResultsCollector original, Cloner cloner) : base(original, cloner) { } 48 52 public ResultsCollector() 49 53 : base() { 50 54 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the collected values should be stored.")); 51 55 Parameters.Add(new ValueParameter<BoolValue>("CopyValue", "True if the collected result value should be copied, otherwise false.", new BoolValue(false))); 56 } 57 58 public override IDeepCloneable Clone(Cloner cloner) { 59 return new ResultsCollector(this, cloner); 52 60 } 53 61 -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/SASEGASAReunificator.cs
r4489 r4722 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Data; … … 41 42 } 42 43 44 [StorableConstructor] 45 protected SASEGASAReunificator(bool deserializing) : base(deserializing) { } 46 protected SASEGASAReunificator(SASEGASAReunificator original, Cloner cloner) : base(original, cloner) { } 43 47 public SASEGASAReunificator() 44 48 : base() { 45 49 Parameters.Add(new LookupParameter<IntValue>("VillageCount", "The number of villages left after the reunification.")); 46 50 } 51 52 public override IDeepCloneable Clone(Cloner cloner) { 53 return new SASEGASAReunificator(this, cloner); 54 } 55 47 56 /// <summary> 48 57 /// Joins all sub sub scopes of the given <paramref name="scope"/>, reduces the number of sub -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/SolutionsCreator.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 53 54 } 54 55 56 [StorableConstructor] 57 private SolutionsCreator(bool deserializing) : base(deserializing) { } 58 private SolutionsCreator(SolutionsCreator original, Cloner cloner) : base(original, cloner) { } 55 59 public SolutionsCreator() 56 60 : base() { … … 59 63 Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator which is used to evaluate new solutions.")); 60 64 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope to which the new solutions are added as sub-scopes.")); 65 } 66 67 public override IDeepCloneable Clone(Cloner cloner) { 68 return new SolutionsCreator(this, cloner); 61 69 } 62 70 -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/SquareRootDiscreteDoubleValueModifier.cs
r4068 r4722 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 31 32 [StorableClass] 32 33 public class SquareRootDiscreteDoubleValueModifier : DiscreteDoubleValueModifier { 34 [StorableConstructor] 35 protected SquareRootDiscreteDoubleValueModifier(bool deserializing) : base(deserializing) { } 36 protected SquareRootDiscreteDoubleValueModifier(SquareRootDiscreteDoubleValueModifier original, Cloner cloner) : base(original, cloner) { } 37 public SquareRootDiscreteDoubleValueModifier() : base() { } 38 39 public override IDeepCloneable Clone(Cloner cloner) { 40 return new SquareRootDiscreteDoubleValueModifier(this, cloner); 41 } 42 33 43 protected override double Modify(double value, double startValue, double endValue, int index, int startIndex, int endIndex) { 34 44 double a = (endValue - startValue) / Math.Sqrt(endIndex - startIndex); -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/TabuMaker.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 49 50 } 50 51 52 [StorableConstructor] 53 protected TabuMaker(bool deserializing) : base(deserializing) { } 54 protected TabuMaker(TabuMaker original, Cloner cloner) : base(original, cloner) { } 51 55 protected TabuMaker() 52 56 : base() { -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/UnidirectionalRingMigrator.cs
r4477 r4722 21 21 22 22 using System.Collections.Generic; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Operators; … … 32 33 [StorableClass] 33 34 public class UnidirectionalRingMigrator : SingleSuccessorOperator, IMigrator { 35 [StorableConstructor] 36 protected UnidirectionalRingMigrator(bool deserializing) : base(deserializing) { } 37 protected UnidirectionalRingMigrator(UnidirectionalRingMigrator original, Cloner cloner) : base(original, cloner) { } 38 public UnidirectionalRingMigrator() : base() { } 39 40 public override IDeepCloneable Clone(Cloner cloner) { 41 return new UnidirectionalRingMigrator(this, cloner); 42 } 43 34 44 /// <summary> 35 45 /// Migrates every first sub scope of each child to its left neighbour (like a ring). -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/UserDefinedCrossover.cs
r3871 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 27 28 [StorableClass] 28 29 public class UserDefinedCrossover : UserDefinedOperator, ICrossover { 30 [StorableConstructor] 31 protected UserDefinedCrossover(bool deserializing) : base(deserializing) { } 32 protected UserDefinedCrossover(UserDefinedCrossover original, Cloner cloner) : base(original, cloner) { } 33 public UserDefinedCrossover() : base() { } 34 35 public override IDeepCloneable Clone(Cloner cloner) { 36 return new UserDefinedCrossover(this, cloner); 37 } 29 38 } 30 39 } -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/UserDefinedEvaluator.cs
r3871 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 33 34 } 34 35 36 [StorableConstructor] 37 protected UserDefinedEvaluator(bool deserializing) : base(deserializing) { } 38 protected UserDefinedEvaluator(UserDefinedEvaluator original, Cloner cloner) : base(original, cloner) { } 35 39 public UserDefinedEvaluator() 36 40 : base() { 37 41 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality value of the solution.")); 38 42 } 43 44 public override IDeepCloneable Clone(Cloner cloner) { 45 return new UserDefinedEvaluator(this, cloner); 46 } 39 47 } 40 48 } -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/UserDefinedManipulator.cs
r3871 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 27 28 [StorableClass] 28 29 public class UserDefinedManipulator : UserDefinedOperator, IManipulator { 30 [StorableConstructor] 31 protected UserDefinedManipulator(bool deserializing) : base(deserializing) { } 32 protected UserDefinedManipulator(UserDefinedManipulator original, Cloner cloner) : base(original, cloner) { } 33 public UserDefinedManipulator() : base() { } 34 35 public override IDeepCloneable Clone(Cloner cloner) { 36 return new UserDefinedManipulator(this, cloner); 37 } 29 38 } 30 39 } -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/UserDefinedOperator.cs
r3871 r4722 21 21 22 22 using System.Linq; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Operators; … … 29 30 [StorableClass] 30 31 public abstract class UserDefinedOperator : CheckedMultiOperator<IOperator> { 32 [StorableConstructor] 33 protected UserDefinedOperator(bool deserializing) : base(deserializing) { } 34 protected UserDefinedOperator(UserDefinedOperator original, Cloner cloner) : base(original, cloner) { } 35 public UserDefinedOperator() : base() { } 36 31 37 public override IOperation Apply() { 32 38 OperationCollection result = new OperationCollection(); -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/UserDefinedSolutionCreator.cs
r3871 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 27 28 [StorableClass] 28 29 public class UserDefinedSolutionCreator : UserDefinedOperator, ISolutionCreator { 30 [StorableConstructor] 31 protected UserDefinedSolutionCreator(bool deserializing) : base(deserializing) { } 32 protected UserDefinedSolutionCreator(UserDefinedSolutionCreator original, Cloner cloner) : base(original, cloner) { } 33 public UserDefinedSolutionCreator() : base() { } 34 35 public override IDeepCloneable Clone(Cloner cloner) { 36 return new UserDefinedSolutionCreator(this, cloner); 37 } 29 38 } 30 39 } -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/WeightedParentsQualityComparator.cs
r3868 r4722 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 26 27 using HeuristicLab.Data; … … 49 50 } 50 51 52 [StorableConstructor] 53 protected WeightedParentsQualityComparator(bool deserializing) : base(deserializing) { } 54 protected WeightedParentsQualityComparator(WeightedParentsQualityComparator original, Cloner cloner) : base(original, cloner) { } 51 55 public WeightedParentsQualityComparator() 52 56 : base() { … … 56 60 Parameters.Add(new LookupParameter<BoolValue>("Result", "The result of the comparison: True means Quality is better, False means it is worse than parents.")); 57 61 Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactor", "Determines if the quality should be compared to the better parent (1.0), to the worse (0.0) or to any linearly interpolated value between them.")); 62 } 63 64 public override IDeepCloneable Clone(Cloner cloner) { 65 return new WeightedParentsQualityComparator(this, cloner); 58 66 } 59 67
Note: See TracChangeset
for help on using the changeset viewer.