Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8644


Ignore:
Timestamp:
09/13/12 14:06:56 (12 years ago)
Author:
jkarder
Message:

#1853:

  • removed multi-crossovers for integer and double values
  • restructured crossovers and manipulators for integer and double values
Location:
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3
Files:
3 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/HeuristicLab.Encodings.ParameterConfigurationEncoding-3.3.csproj

    r8590 r8644  
    119119    <Compile Include="Operators\Crossovers\DoubleValue\AverageDoubleValueCrossover.cs" />
    120120    <Compile Include="Operators\Crossovers\DoubleValue\DiscreteDoubleValueCrossover.cs" />
    121     <Compile Include="Operators\Crossovers\DoubleValue\MultiDoubleValueCrossover.cs" />
    122121    <Compile Include="Operators\Crossovers\DoubleValue\NormalDoubleValueCrossover.cs" />
    123122    <Compile Include="Operators\Crossovers\IntValue\AverageIntValueCrossover.cs" />
    124123    <Compile Include="Operators\Crossovers\IntValue\DiscreteIntValueCrossover.cs" />
    125     <Compile Include="Operators\Crossovers\IntValue\MultiIntValueCrossover.cs" />
    126124    <Compile Include="Operators\Crossovers\IntValue\NormalIntValueCrossover.cs" />
    127125    <Compile Include="Operators\Interfaces\IDoubleValueCrossover.cs" />
     
    129127    <Compile Include="Operators\Interfaces\IIntValueCrossover.cs" />
    130128    <Compile Include="Operators\Interfaces\IIntValueManipulator.cs" />
    131     <Compile Include="Operators\Interfaces\IValueManipulator.cs" />
    132129    <Compile Include="Operators\Manipulators\DoubleValue\NormalDoubleValueManipulator.cs" />
    133130    <Compile Include="Operators\Manipulators\DoubleValue\UniformDoubleValueManipulator.cs" />
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Crossovers/DoubleValue/AverageDoubleValueCrossover.cs

    r8590 r8644  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Data;
    25 using HeuristicLab.Operators;
    26 using HeuristicLab.Optimization;
    27 using HeuristicLab.Parameters;
    2825using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2926
     
    3431  [Item("AverageDoubleValueCrossover", "An operator which crosses two double values. TODO")]
    3532  [StorableClass]
    36   public class AverageDoubleValueCrossover : SingleSuccessorOperator, IDoubleValueCrossover, IStochasticOperator {
    37     public ILookupParameter<IRandom> RandomParameter {
    38       get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    39     }
    40 
     33  public class AverageDoubleValueCrossover : Item, IDoubleValueCrossover {
    4134    #region Constructors and Cloning
    4235    public AverageDoubleValueCrossover() : base() { }
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Crossovers/DoubleValue/DiscreteDoubleValueCrossover.cs

    r8590 r8644  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Data;
    25 using HeuristicLab.Operators;
    26 using HeuristicLab.Optimization;
    27 using HeuristicLab.Parameters;
    2825using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2926
     
    3431  [Item("DiscreteDoubleValueCrossover", "An operator which crosses two double values. TODO")]
    3532  [StorableClass]
    36   public class DiscreteDoubleValueCrossover : SingleSuccessorOperator, IDoubleValueCrossover, IStochasticOperator {
    37     public ILookupParameter<IRandom> RandomParameter {
    38       get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    39     }
    40 
     33  public class DiscreteDoubleValueCrossover : Item, IDoubleValueCrossover {
    4134    #region Constructors and Cloning
    4235    public DiscreteDoubleValueCrossover() : base() { }
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Crossovers/DoubleValue/NormalDoubleValueCrossover.cs

    r8590 r8644  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Data;
    26 using HeuristicLab.Operators;
    27 using HeuristicLab.Optimization;
    28 using HeuristicLab.Parameters;
    2926using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3027using HeuristicLab.Random;
     
    3633  [Item("NormalDoubleValueCrossover", "An operator which crosses two double values. TODO")]
    3734  [StorableClass]
    38   public class NormalDoubleValueCrossover : SingleSuccessorOperator, IDoubleValueCrossover, IStochasticOperator {
    39     public ILookupParameter<IRandom> RandomParameter {
    40       get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    41     }
    42 
     35  public class NormalDoubleValueCrossover : Item, IDoubleValueCrossover {
    4336    #region Constructors and Cloning
    4437    public NormalDoubleValueCrossover() : base() { }
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Crossovers/IntValue/AverageIntValueCrossover.cs

    r8574 r8644  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Data;
    25 using HeuristicLab.Operators;
    26 using HeuristicLab.Optimization;
    27 using HeuristicLab.Parameters;
    2825using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2926
     
    3431  [Item("AverageIntValueCrossover", "An operator which crosses two integer values. TODO")]
    3532  [StorableClass]
    36   public class AverageIntValueCrossover : SingleSuccessorOperator, IIntValueCrossover, IStochasticOperator {
    37     public ILookupParameter<IRandom> RandomParameter {
    38       get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    39     }
    40 
     33  public class AverageIntValueCrossover : Item, IIntValueCrossover {
    4134    #region Constructors and Cloning
    4235    public AverageIntValueCrossover() : base() { }
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Crossovers/IntValue/DiscreteIntValueCrossover.cs

    r8590 r8644  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Data;
    25 using HeuristicLab.Operators;
    26 using HeuristicLab.Optimization;
    27 using HeuristicLab.Parameters;
    2825using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2926
     
    3431  [Item("DiscreteIntValueCrossover", "An operator which crosses two integer values. TODO")]
    3532  [StorableClass]
    36   public class DiscreteIntValueCrossover : SingleSuccessorOperator, IIntValueCrossover, IStochasticOperator {
    37     public ILookupParameter<IRandom> RandomParameter {
    38       get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    39     }
    40 
     33  public class DiscreteIntValueCrossover : Item, IIntValueCrossover {
    4134    #region Constructors and Cloning
    4235    public DiscreteIntValueCrossover() : base() { }
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Crossovers/IntValue/NormalIntValueCrossover.cs

    r8590 r8644  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Data;
    26 using HeuristicLab.Operators;
    27 using HeuristicLab.Optimization;
    28 using HeuristicLab.Parameters;
    2926using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3027using HeuristicLab.Random;
     
    3633  [Item("NormalIntValueCrossover", "An operator which crosses two integer values. TODO")]
    3734  [StorableClass]
    38   public class NormalIntValueCrossover : SingleSuccessorOperator, IIntValueCrossover, IStochasticOperator {
    39     public ILookupParameter<IRandom> RandomParameter {
    40       get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    41     }
    42 
     35  public class NormalIntValueCrossover : Item, IIntValueCrossover {
    4336    #region Constructors and Cloning
    4437    public NormalIntValueCrossover() : base() { }
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Interfaces/IDoubleValueCrossover.cs

    r8574 r8644  
    2222using HeuristicLab.Core;
    2323using HeuristicLab.Data;
    24 using HeuristicLab.Optimization;
    2524
    2625namespace HeuristicLab.Encodings.ParameterConfigurationEncoding {
     
    2827  /// An interface which represents a crossover operator for double values.
    2928  /// </summary>
    30   public interface IDoubleValueCrossover : ICrossover {
     29  public interface IDoubleValueCrossover : IItem {
    3130    void Apply(IRandom random, DoubleValue value, DoubleValue other, DoubleValueRange range);
    3231  }
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Interfaces/IDoubleValueManipulator.cs

    r8574 r8644  
    2727  /// An interface which represents a manipulation operator for double values.
    2828  /// </summary>
    29   public interface IDoubleValueManipulator : IValueManipulator {
     29  public interface IDoubleValueManipulator : IItem {
    3030    void Apply(IRandom random, DoubleValue value, DoubleValueRange range);
    3131  }
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Interfaces/IIntValueCrossover.cs

    r8574 r8644  
    2828  /// An interface which represents a crossover operator for integer values.
    2929  /// </summary>
    30   public interface IIntValueCrossover : ICrossover {
     30  public interface IIntValueCrossover : IItem {
    3131    void Apply(IRandom random, IntValue value, IntValue other, IntValueRange range);
    3232  }
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Interfaces/IIntValueManipulator.cs

    r8574 r8644  
    2727  /// An interface which represents a manipulation operator for integer values.
    2828  /// </summary>
    29   public interface IIntValueManipulator : IValueManipulator {
     29  public interface IIntValueManipulator : IItem {
    3030    void Apply(IRandom random, IntValue value, IntValueRange range);
    3131  }
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Manipulators/DoubleValue/NormalDoubleValueManipulator.cs

    r8590 r8644  
    2424using HeuristicLab.Data;
    2525using HeuristicLab.Encodings.RealVectorEncoding;
    26 using HeuristicLab.Operators;
    27 using HeuristicLab.Optimization;
    28 using HeuristicLab.Parameters;
    2926using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3027
     
    3532  [Item("NormalDoubleValueManipulator", "An operator which manipulates two double values. TODO")]
    3633  [StorableClass]
    37   public class NormalDoubleValueManipulator : SingleSuccessorOperator, IDoubleValueManipulator, IStochasticOperator {
    38     public ILookupParameter<IRandom> RandomParameter {
    39       get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    40     }
    41 
     34  public class NormalDoubleValueManipulator : Item, IDoubleValueManipulator {
    4235    #region Constructors and Cloning
    4336    public NormalDoubleValueManipulator() : base() { }
     
    5144    #endregion
    5245
    53     // TODO: override Apply
    5446    public void Apply(IRandom random, DoubleValue value, DoubleValueRange range) {
    5547      ApplyStatic(random, value, range);
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Manipulators/DoubleValue/UniformDoubleValueManipulator.cs

    r8574 r8644  
    2424using HeuristicLab.Data;
    2525using HeuristicLab.Encodings.RealVectorEncoding;
    26 using HeuristicLab.Operators;
    27 using HeuristicLab.Optimization;
    28 using HeuristicLab.Parameters;
    2926using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3027
     
    3532  [Item("UniformDoubleValueManipulator", "An operator which manipulates two double values. TODO")]
    3633  [StorableClass]
    37   public class UniformDoubleValueManipulator : SingleSuccessorOperator, IDoubleValueManipulator, IStochasticOperator {
    38     public ILookupParameter<IRandom> RandomParameter {
    39       get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    40     }
    41 
     34  public class UniformDoubleValueManipulator : Item, IDoubleValueManipulator {
    4235    #region Constructors and Cloning
    4336    public UniformDoubleValueManipulator() : base() { }
     
    5144    #endregion
    5245
    53     // TODO: override Apply
    5446    public void Apply(IRandom random, DoubleValue value, DoubleValueRange range) {
    5547      ApplyStatic(random, value, range);
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Manipulators/IntValue/NormalIntValueManipulator.cs

    r8590 r8644  
    2424using HeuristicLab.Data;
    2525using HeuristicLab.Encodings.RealVectorEncoding;
    26 using HeuristicLab.Operators;
    27 using HeuristicLab.Optimization;
    28 using HeuristicLab.Parameters;
    2926using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3027
     
    3532  [Item("NormalIntValueManipulator", "An operator which manipulates two integer values. TODO")]
    3633  [StorableClass]
    37   public class NormalIntValueManipulator : SingleSuccessorOperator, IIntValueManipulator, IStochasticOperator {
    38     public ILookupParameter<IRandom> RandomParameter {
    39       get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    40     }
    41 
     34  public class NormalIntValueManipulator : Item, IIntValueManipulator {
    4235    #region Constructors and Cloning
    4336    public NormalIntValueManipulator() : base() { }
     
    5144    #endregion
    5245
    53     // TODO: override Apply
    5446    public void Apply(IRandom random, IntValue value, IntValueRange range) {
    5547      ApplyStatic(random, value, range);
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Manipulators/IntValue/UniformIntValueManipulator.cs

    r8590 r8644  
    2424using HeuristicLab.Data;
    2525using HeuristicLab.Encodings.IntegerVectorEncoding;
    26 using HeuristicLab.Operators;
    27 using HeuristicLab.Optimization;
    28 using HeuristicLab.Parameters;
    2926using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3027
     
    3532  [Item("UniformIntValueManipulator", "An operator which manipulates two integer values. TODO")]
    3633  [StorableClass]
    37   public class UniformIntValueManipulator : SingleSuccessorOperator, IIntValueManipulator, IStochasticOperator {
    38     public ILookupParameter<IRandom> RandomParameter {
    39       get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    40     }
    41 
     34  public class UniformIntValueManipulator : Item, IIntValueManipulator {
    4235    #region Constructors and Cloning
    4336    public UniformIntValueManipulator() : base() { }
     
    5144    #endregion
    5245
    53     // TODO: override Apply
    5446    public void Apply(IRandom random, IntValue value, IntValueRange range) {
    5547      ApplyStatic(random, value, range);
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/RangeConstraints/Range.cs

    r8574 r8644  
    206206    }
    207207    public bool Validate(string value, out string errorMessage) {
    208       // TODO: check that stepsize < upper - lower
    209208      T lower = (T)lowerBound.Clone();
    210209      T upper = (T)upperBound.Clone();
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/ValueConfigurations/CheckedValueConfigurationCollection.cs

    r8535 r8644  
    2929namespace HeuristicLab.Encodings.ParameterConfigurationEncoding {
    3030  // TODO: check that at least 1 element needs to be selected
    31   // TODO: control creatable item types
     31  // TODO: control creatable item types ### EDIT: done?
    3232  [StorableClass]
    3333  public class CheckedValueConfigurationList : CheckedItemList<IValueConfiguration>, ICheckedValueConfigurationList {
     
    8181    private void RegisterEvents() {
    8282      this.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(CheckedValueConfigurationList_ItemsAdded);
     83      this.CheckedItemsChanged += new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(CheckedValueConfigurationList_CheckedItemsChanged);
    8384    }
    8485
    8586    private void DeregisterEvents() {
     87      this.CheckedItemsChanged -= new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(CheckedValueConfigurationList_CheckedItemsChanged);
    8688      this.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(CheckedValueConfigurationList_ItemsAdded);
    8789    }
    8890
     91    #region Events
    8992    private void CheckedValueConfigurationList_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) {
    9093      foreach (var item in e.Items) {
    9194        var matchingItems = this.Where(x => x != item.Value && x.ActualValue.ValueDataType == item.Value.ActualValue.ValueDataType);
    92         if (matchingItems.Count() > 0) {
     95        if (matchingItems.Any()) {
    9396          int maxNumber = matchingItems.Select(x => x.Number).Max();
    9497          item.Value.Number = maxNumber + 1;
     
    9699      }
    97100    }
     101    private void CheckedValueConfigurationList_CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) {
     102      // TODO: view does not get notified
     103      if (!this.CheckedItems.Any()) this.SetItemCheckedState(e.Items.Single().Value, true);
     104    }
     105    #endregion
     106
    98107  }
    99108}
Note: See TracChangeset for help on using the changeset viewer.