Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/20/10 16:35:42 (15 years ago)
Author:
abeham
Message:

Updated StochasticMultiOperator and Multicrossover/Multimutation #976

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MultiRealVectorManipulator.cs

    r3425 r3445  
    3232  [Item("MultiRealVectorManipulator", "Randomly selects and applies one of its manipulators every time it is called.")]
    3333  [StorableClass]
    34   public class MultiRealVectorManipulator : StochasticMultiOperator<IRealVectorManipulator>, IRealVectorManipulator {
     34  public class MultiRealVectorManipulator : StochasticMultiOperator<IRealVectorManipulator>, IRealVectorManipulator, IStochasticOperator {
    3535    public override bool CanChangeName {
    3636      get { return false; }
    3737    }
    3838    protected override bool CreateChildOperation {
    39       get { return true; }
    40     }
    41     public override bool AutomaticTypeDiscovery {
    4239      get { return true; }
    4340    }
     
    5653      Parameters.Add(new LookupParameter<RealVector>("RealVector", "The real vector that is being manipulating."));
    5754      Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Bounds", "The lower and upper bounds for each dimension of the vector."));
     55    }
    5856
    59       Initialize();
     57    protected override void Operators_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<IRealVectorManipulator>> e) {
     58      base.Operators_ItemsReplaced(sender, e);
    6059      ParameterizeManipulators();
    6160    }
    6261
    63     [StorableHook(HookType.AfterDeserialization)]
    64     private void Initialize() {
    65       Operators.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IRealVectorManipulator>>(Operators_ItemsAdded);
    66       Operators.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<IRealVectorManipulator>>(Operators_ItemsReplaced);
    67     }
    68 
    69     private void Operators_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<IRealVectorManipulator>> e) {
    70       ParameterizeManipulators();
    71     }
    72 
    73     private void Operators_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IRealVectorManipulator>> e) {
     62    protected override void Operators_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IRealVectorManipulator>> e) {
     63      base.Operators_ItemsAdded(sender, e);
    7464      ParameterizeManipulators();
    7565    }
Note: See TracChangeset for help on using the changeset viewer.