Changeset 4722 for trunk/sources/HeuristicLab.Selection
- Timestamp:
- 11/06/10 01:56:04 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 24 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.Selection/3.3/BestSelector.cs
r4477 r4722 22 22 using System.Collections.Generic; 23 23 using System.Linq; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Data; … … 35 36 public sealed class BestSelector : SingleObjectiveSelector, ISingleObjectiveSelector { 36 37 public BestSelector() : base() { } 38 [StorableConstructor] 39 private BestSelector(bool deserializing) : base(deserializing) { } 40 private BestSelector(BestSelector original, Cloner cloner) 41 : base(original, cloner) { 42 } 43 public override IDeepCloneable Clone(Cloner cloner) { 44 return new BestSelector(this, cloner); 45 } 46 37 47 38 48 protected override IScope[] Select(List<IScope> scopes) { -
trunk/sources/HeuristicLab.Selection/3.3/ConditionalSelector.cs
r4477 r4722 21 21 22 22 using System.Collections.Generic; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 42 43 } 43 44 45 [StorableConstructor] 46 protected ConditionalSelector(bool deserializing) : base(deserializing) { } 47 protected ConditionalSelector(ConditionalSelector original, Cloner cloner) 48 : base(original, cloner) { 49 } 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new ConditionalSelector(this, cloner); 52 } 44 53 public ConditionalSelector() 45 54 : base() { -
trunk/sources/HeuristicLab.Selection/3.3/GenderSpecificSelector.cs
r4068 r4722 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 80 81 81 82 [StorableConstructor] 82 private GenderSpecificSelector(bool deserializing) : base() { } 83 protected GenderSpecificSelector(bool deserializing) : base(deserializing) { } 84 protected GenderSpecificSelector(GenderSpecificSelector original, Cloner cloner) 85 : base(original, cloner) { 86 Initialize(); 87 } 88 83 89 public GenderSpecificSelector() 84 90 : base() { … … 120 126 } 121 127 128 public override IDeepCloneable Clone(Cloner cloner) { 129 return new GenderSpecificSelector(this, cloner); 130 } 131 132 [StorableHook(HookType.AfterDeserialization)] 133 private void AfterDeserialization() { 134 Initialize(); 135 } 136 122 137 /// <summary> 123 138 /// Sets how many sub-scopes male and female selectors should select. … … 142 157 143 158 #region Helpers 144 [StorableHook(HookType.AfterDeserialization)]145 159 private void Initialize() { 146 160 FemaleSelectorParameter.ValueChanged += new EventHandler(SelectorParameter_ValueChanged); -
trunk/sources/HeuristicLab.Selection/3.3/LeftReducer.cs
r4477 r4722 21 21 22 22 using System.Collections.Generic; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Optimization; … … 32 33 [StorableClass] 33 34 public sealed class LeftReducer : Reducer, IReducer { 35 [StorableConstructor] 36 private LeftReducer(bool deserializing) : base(deserializing) { } 37 private LeftReducer(LeftReducer original, Cloner cloner) : base(original, cloner) { } 38 public override IDeepCloneable Clone(Cloner cloner) { 39 return new LeftReducer(this, cloner); 40 } 34 41 public LeftReducer() : base() { } 35 42 -
trunk/sources/HeuristicLab.Selection/3.3/LeftSelector.cs
r4477 r4722 21 21 22 22 using System.Collections.Generic; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 43 44 get { return CopySelectedParameter.Value; } 44 45 set { CopySelectedParameter.Value = value; } 46 } 47 48 [StorableConstructor] 49 private LeftSelector(bool deserializing) : base(deserializing) { } 50 private LeftSelector(LeftSelector original, Cloner cloner) 51 : base(original, cloner) { 52 } 53 public override IDeepCloneable Clone(Cloner cloner) { 54 return new LeftSelector(this, cloner); 45 55 } 46 56 -
trunk/sources/HeuristicLab.Selection/3.3/LinearRankSelector.cs
r4477 r4722 22 22 using System.Collections.Generic; 23 23 using System.Linq; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Data; … … 34 35 [StorableClass] 35 36 public sealed class LinearRankSelector : StochasticSingleObjectiveSelector, ISingleObjectiveSelector { 37 [StorableConstructor] 38 private LinearRankSelector(bool deserializing) : base(deserializing) { } 39 private LinearRankSelector(LinearRankSelector original, Cloner cloner) 40 : base(original, cloner) { 41 } 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new LinearRankSelector(this, cloner); 44 } 36 45 public LinearRankSelector() : base() { } 37 46 -
trunk/sources/HeuristicLab.Selection/3.3/MergingReducer.cs
r4477 r4722 21 21 22 22 using System.Collections.Generic; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Optimization; … … 32 33 [StorableClass] 33 34 public sealed class MergingReducer : Reducer, IReducer { 35 [StorableConstructor] 36 private MergingReducer(bool deserializing) : base(deserializing) { } 37 private MergingReducer(MergingReducer original, Cloner cloner) 38 : base(original, cloner) { 39 } 40 public override IDeepCloneable Clone(Cloner cloner) { 41 return new MergingReducer(this, cloner); 42 } 34 43 public MergingReducer() : base() { } 35 44 -
trunk/sources/HeuristicLab.Selection/3.3/OffspringSelector.cs
r4489 r4722 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 31 32 [StorableClass] 32 33 public class OffspringSelector : SingleSuccessorOperator { 33 34 34 public ValueLookupParameter<DoubleValue> MaximumSelectionPressureParameter { 35 35 get { return (ValueLookupParameter<DoubleValue>)Parameters["MaximumSelectionPressure"]; } … … 62 62 } 63 63 64 [StorableConstructor] 65 protected OffspringSelector(bool deserializing) : base(deserializing) { } 66 protected OffspringSelector(OffspringSelector original, Cloner cloner) : base(original, cloner) { } 67 public override IDeepCloneable Clone(Cloner cloner) { 68 return new OffspringSelector(this, cloner); 69 } 64 70 public OffspringSelector() 65 71 : base() { -
trunk/sources/HeuristicLab.Selection/3.3/ProportionalSelector.cs
r4477 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; … … 45 46 } 46 47 48 [StorableConstructor] 49 private ProportionalSelector(bool deserializing) : base(deserializing) { } 50 private ProportionalSelector(ProportionalSelector original, Cloner cloner) 51 : base(original, cloner) { 52 } 53 public override IDeepCloneable Clone(Cloner cloner) { 54 return new ProportionalSelector(this, cloner); 55 } 47 56 public ProportionalSelector() 48 57 : base() { -
trunk/sources/HeuristicLab.Selection/3.3/RandomReplacer.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 49 50 [StorableConstructor] 50 51 private RandomReplacer(bool deserializing) : base(deserializing) { } 52 private RandomReplacer(RandomReplacer original, Cloner cloner) 53 : base(original, cloner) { 54 } 55 public override IDeepCloneable Clone(Cloner cloner) { 56 return new RandomReplacer(this, cloner); 57 } 51 58 public RandomReplacer() 52 59 : base() { -
trunk/sources/HeuristicLab.Selection/3.3/RandomSelector.cs
r4477 r4722 21 21 22 22 using System.Collections.Generic; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 46 47 } 47 48 49 [StorableConstructor] 50 private RandomSelector(bool deserializing) : base(deserializing) { } 51 private RandomSelector(RandomSelector original, Cloner cloner) 52 : base(original, cloner) { 53 } 54 public override IDeepCloneable Clone(Cloner cloner) { 55 return new RandomSelector(this, cloner); 56 } 48 57 public RandomSelector() 49 58 : base() { -
trunk/sources/HeuristicLab.Selection/3.3/Reducer.cs
r4068 r4722 21 21 22 22 using System.Collections.Generic; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Operators; … … 41 42 } 42 43 44 [StorableConstructor] 45 protected Reducer(bool deserializing) : base(deserializing) { } 46 protected Reducer(Reducer original, Cloner cloner) 47 : base(original, cloner) { 48 } 43 49 protected Reducer() 44 50 : base() { -
trunk/sources/HeuristicLab.Selection/3.3/Replacer.cs
r3601 r4722 21 21 22 22 using System; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 40 41 41 42 [StorableConstructor] 42 protected Replacer(bool deserializing) : base() { } 43 protected Replacer(bool deserializing) : base(deserializing) { } 44 protected Replacer(Replacer original, Cloner cloner) : base(original, cloner) { } 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new Replacer(this, cloner); 47 } 43 48 public Replacer() { 44 49 Parameters.Add(new ValueLookupParameter<ISelector>("ReplacedSelector", "The selection operator to select those scopes that are to be replaced.")); … … 74 79 int remaining = ExecutionContext.Scope.SubScopes[0].SubScopes.Count; 75 80 int selected = ExecutionContext.Scope.SubScopes[1].SubScopes.Count; 76 81 77 82 ISelector replacedSelector = ReplacedSelectorParameter.ActualValue; 78 83 ISelector selectedSelector = SelectedSelectorParameter.ActualValue; 79 84 80 85 if (replacedSelector != null) { 81 86 replacedSelector.CopySelected = new BoolValue(false); -
trunk/sources/HeuristicLab.Selection/3.3/RightChildReducer.cs
r4489 r4722 21 21 22 22 using System.Collections.Generic; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Optimization; … … 42 43 [StorableClass] 43 44 public class RightChildReducer : Reducer, IReducer { 45 [StorableConstructor] 46 protected RightChildReducer(bool deserializing) : base(deserializing) { } 47 protected RightChildReducer(RightChildReducer original, Cloner cloner) : base(original, cloner) { } 48 public override IDeepCloneable Clone(Cloner cloner) { 49 return new RightChildReducer(this, cloner); 50 } 51 public RightChildReducer() : base() { } 44 52 /// <summary> 45 53 /// Reduces the sub-scopes, so that the selected sub-scope contains all selected leaves -
trunk/sources/HeuristicLab.Selection/3.3/RightReducer.cs
r4477 r4722 21 21 22 22 using System.Collections.Generic; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Optimization; … … 32 33 [StorableClass] 33 34 public sealed class RightReducer : Reducer, IReducer { 35 [StorableConstructor] 36 private RightReducer(bool deserializing) : base(deserializing) { } 37 private RightReducer(RightReducer original, Cloner cloner) : base(original, cloner) { } 38 public override IDeepCloneable Clone(Cloner cloner) { 39 return new RightReducer(this, cloner); 40 } 34 41 public RightReducer() : base() { } 35 42 -
trunk/sources/HeuristicLab.Selection/3.3/RightSelector.cs
r4477 r4722 21 21 22 22 using System.Collections.Generic; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Data; … … 44 45 set { CopySelectedParameter.Value = value; } 45 46 } 47 [StorableConstructor] 48 private RightSelector(bool deserializing) : base(deserializing) { } 49 private RightSelector(RightSelector original, Cloner cloner) : base(original, cloner) { } 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new RightSelector(this, cloner); 52 } 53 46 54 public RightSelector() 47 55 : base() { -
trunk/sources/HeuristicLab.Selection/3.3/Selector.cs
r4068 r4722 21 21 22 22 using System.Collections.Generic; 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; 24 25 using HeuristicLab.Operators; … … 43 44 get { return CurrentScopeParameter.ActualValue; } 44 45 } 46 47 [StorableConstructor] 48 protected Selector(bool deserializing) : base(deserializing) { } 49 protected Selector(Selector original, Cloner cloner) : base(original, cloner) { } 45 50 46 51 protected Selector() -
trunk/sources/HeuristicLab.Selection/3.3/SingleObjectiveSelector.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 50 51 } 51 52 53 [StorableConstructor] 54 protected SingleObjectiveSelector(bool deserializing) : base(deserializing) { } 55 protected SingleObjectiveSelector(SingleObjectiveSelector original, Cloner cloner) : base(original, cloner) { } 56 52 57 protected SingleObjectiveSelector() 53 58 : base() { -
trunk/sources/HeuristicLab.Selection/3.3/StochasticSelector.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Optimization; … … 36 37 } 37 38 39 [StorableConstructor] 40 protected StochasticSelector(bool deserializing) : base(deserializing) { } 41 protected StochasticSelector(StochasticSelector original, Cloner cloner) : base(original, cloner) { } 38 42 protected StochasticSelector() 39 43 : base() { -
trunk/sources/HeuristicLab.Selection/3.3/StochasticSingleObjectiveSelector.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Optimization; … … 35 36 get { return (LookupParameter<IRandom>)Parameters["Random"]; } 36 37 } 37 38 [StorableConstructor] 39 protected StochasticSingleObjectiveSelector(bool deserializing) : base(deserializing) { } 40 protected StochasticSingleObjectiveSelector(StochasticSingleObjectiveSelector original, Cloner cloner) : base(original, cloner) { } 38 41 protected StochasticSingleObjectiveSelector() 39 42 : base() { -
trunk/sources/HeuristicLab.Selection/3.3/TournamentSelector.cs
r4477 r4722 22 22 using System.Collections.Generic; 23 23 using System.Linq; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Data; … … 37 38 public ValueLookupParameter<IntValue> GroupSizeParameter { 38 39 get { return (ValueLookupParameter<IntValue>)Parameters["GroupSize"]; } 40 } 41 42 [StorableConstructor] 43 private TournamentSelector(bool deserializing) : base(deserializing) { } 44 private TournamentSelector(TournamentSelector original, Cloner cloner) : base(original, cloner) { } 45 public override IDeepCloneable Clone(Cloner cloner) { 46 return new TournamentSelector(this, cloner); 39 47 } 40 48 -
trunk/sources/HeuristicLab.Selection/3.3/WorstReplacer.cs
r4068 r4722 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 46 47 [StorableConstructor] 47 48 private WorstReplacer(bool deserializing) : base(deserializing) { } 49 private WorstReplacer(WorstReplacer original, Cloner cloner) : base(original, cloner) { } 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new WorstReplacer(this, cloner); 52 } 48 53 public WorstReplacer() 49 54 : base() { -
trunk/sources/HeuristicLab.Selection/3.3/WorstSelector.cs
r4477 r4722 22 22 using System.Collections.Generic; 23 23 using System.Linq; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Data; … … 34 35 [StorableClass] 35 36 public sealed class WorstSelector : SingleObjectiveSelector, ISingleObjectiveSelector { 37 [StorableConstructor] 38 private WorstSelector(bool deserializing) : base(deserializing) { } 39 private WorstSelector(WorstSelector original, Cloner cloner) : base(original, cloner) { } 40 public override IDeepCloneable Clone(Cloner cloner) { 41 return new WorstSelector(this, cloner); 42 } 36 43 public WorstSelector() : base() { } 37 44
Note: See TracChangeset
for help on using the changeset viewer.