- Timestamp:
- 04/20/10 16:35:42 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Crossovers/MultiIntegerVectorCrossover.cs
r3425 r3445 31 31 [Item("MultiIntegerVectorCrossover", "Randomly selects and applies one of its crossovers every time it is called.")] 32 32 [StorableClass] 33 public class MultiIntegerVectorCrossover : StochasticMultiOperator<IIntegerVectorCrossover>, IIntegerVectorCrossover {33 public class MultiIntegerVectorCrossover : StochasticMultiOperator<IIntegerVectorCrossover>, IIntegerVectorCrossover, IStochasticOperator { 34 34 public override bool CanChangeName { 35 35 get { return false; } 36 36 } 37 37 protected override bool CreateChildOperation { 38 get { return true; }39 }40 public override bool AutomaticTypeDiscovery {41 38 get { return true; } 42 39 } … … 58 55 Parameters.Add(new LookupParameter<IntegerVector>("Child", "The child integer vector resulting from the crossover.")); 59 56 ChildParameter.ActualName = "IntegerVector"; 57 } 60 58 61 Initialize(); 59 protected override void Operators_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<IIntegerVectorCrossover>> e) { 60 base.Operators_ItemsReplaced(sender, e); 62 61 ParameterizeCrossovers(); 63 62 } 64 63 65 [StorableHook(HookType.AfterDeserialization)] 66 private void Initialize() { 67 Operators.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IIntegerVectorCrossover>>(Operators_ItemsAdded); 68 Operators.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<IIntegerVectorCrossover>>(Operators_ItemsReplaced); 69 } 70 71 private void Operators_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<IIntegerVectorCrossover>> e) { 72 ParameterizeCrossovers(); 73 } 74 75 private void Operators_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IIntegerVectorCrossover>> e) { 64 protected override void Operators_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IIntegerVectorCrossover>> e) { 65 base.Operators_ItemsAdded(sender, e); 76 66 ParameterizeCrossovers(); 77 67 }
Note: See TracChangeset
for help on using the changeset viewer.