Changeset 8644 for branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding
- Timestamp:
- 09/13/12 14:06:56 (12 years ago)
- 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 119 119 <Compile Include="Operators\Crossovers\DoubleValue\AverageDoubleValueCrossover.cs" /> 120 120 <Compile Include="Operators\Crossovers\DoubleValue\DiscreteDoubleValueCrossover.cs" /> 121 <Compile Include="Operators\Crossovers\DoubleValue\MultiDoubleValueCrossover.cs" />122 121 <Compile Include="Operators\Crossovers\DoubleValue\NormalDoubleValueCrossover.cs" /> 123 122 <Compile Include="Operators\Crossovers\IntValue\AverageIntValueCrossover.cs" /> 124 123 <Compile Include="Operators\Crossovers\IntValue\DiscreteIntValueCrossover.cs" /> 125 <Compile Include="Operators\Crossovers\IntValue\MultiIntValueCrossover.cs" />126 124 <Compile Include="Operators\Crossovers\IntValue\NormalIntValueCrossover.cs" /> 127 125 <Compile Include="Operators\Interfaces\IDoubleValueCrossover.cs" /> … … 129 127 <Compile Include="Operators\Interfaces\IIntValueCrossover.cs" /> 130 128 <Compile Include="Operators\Interfaces\IIntValueManipulator.cs" /> 131 <Compile Include="Operators\Interfaces\IValueManipulator.cs" />132 129 <Compile Include="Operators\Manipulators\DoubleValue\NormalDoubleValueManipulator.cs" /> 133 130 <Compile Include="Operators\Manipulators\DoubleValue\UniformDoubleValueManipulator.cs" /> -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Crossovers/DoubleValue/AverageDoubleValueCrossover.cs
r8590 r8644 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Data; 25 using HeuristicLab.Operators;26 using HeuristicLab.Optimization;27 using HeuristicLab.Parameters;28 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 26 … … 34 31 [Item("AverageDoubleValueCrossover", "An operator which crosses two double values. TODO")] 35 32 [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 { 41 34 #region Constructors and Cloning 42 35 public AverageDoubleValueCrossover() : base() { } -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Crossovers/DoubleValue/DiscreteDoubleValueCrossover.cs
r8590 r8644 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Data; 25 using HeuristicLab.Operators;26 using HeuristicLab.Optimization;27 using HeuristicLab.Parameters;28 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 26 … … 34 31 [Item("DiscreteDoubleValueCrossover", "An operator which crosses two double values. TODO")] 35 32 [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 { 41 34 #region Constructors and Cloning 42 35 public DiscreteDoubleValueCrossover() : base() { } -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Crossovers/DoubleValue/NormalDoubleValueCrossover.cs
r8590 r8644 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Data; 26 using HeuristicLab.Operators;27 using HeuristicLab.Optimization;28 using HeuristicLab.Parameters;29 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 27 using HeuristicLab.Random; … … 36 33 [Item("NormalDoubleValueCrossover", "An operator which crosses two double values. TODO")] 37 34 [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 { 43 36 #region Constructors and Cloning 44 37 public NormalDoubleValueCrossover() : base() { } -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Crossovers/IntValue/AverageIntValueCrossover.cs
r8574 r8644 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Data; 25 using HeuristicLab.Operators;26 using HeuristicLab.Optimization;27 using HeuristicLab.Parameters;28 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 26 … … 34 31 [Item("AverageIntValueCrossover", "An operator which crosses two integer values. TODO")] 35 32 [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 { 41 34 #region Constructors and Cloning 42 35 public AverageIntValueCrossover() : base() { } -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Crossovers/IntValue/DiscreteIntValueCrossover.cs
r8590 r8644 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Data; 25 using HeuristicLab.Operators;26 using HeuristicLab.Optimization;27 using HeuristicLab.Parameters;28 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 26 … … 34 31 [Item("DiscreteIntValueCrossover", "An operator which crosses two integer values. TODO")] 35 32 [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 { 41 34 #region Constructors and Cloning 42 35 public DiscreteIntValueCrossover() : base() { } -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Crossovers/IntValue/NormalIntValueCrossover.cs
r8590 r8644 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Data; 26 using HeuristicLab.Operators;27 using HeuristicLab.Optimization;28 using HeuristicLab.Parameters;29 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 27 using HeuristicLab.Random; … … 36 33 [Item("NormalIntValueCrossover", "An operator which crosses two integer values. TODO")] 37 34 [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 { 43 36 #region Constructors and Cloning 44 37 public NormalIntValueCrossover() : base() { } -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Interfaces/IDoubleValueCrossover.cs
r8574 r8644 22 22 using HeuristicLab.Core; 23 23 using HeuristicLab.Data; 24 using HeuristicLab.Optimization;25 24 26 25 namespace HeuristicLab.Encodings.ParameterConfigurationEncoding { … … 28 27 /// An interface which represents a crossover operator for double values. 29 28 /// </summary> 30 public interface IDoubleValueCrossover : I Crossover{29 public interface IDoubleValueCrossover : IItem { 31 30 void Apply(IRandom random, DoubleValue value, DoubleValue other, DoubleValueRange range); 32 31 } -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Interfaces/IDoubleValueManipulator.cs
r8574 r8644 27 27 /// An interface which represents a manipulation operator for double values. 28 28 /// </summary> 29 public interface IDoubleValueManipulator : I ValueManipulator{29 public interface IDoubleValueManipulator : IItem { 30 30 void Apply(IRandom random, DoubleValue value, DoubleValueRange range); 31 31 } -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Interfaces/IIntValueCrossover.cs
r8574 r8644 28 28 /// An interface which represents a crossover operator for integer values. 29 29 /// </summary> 30 public interface IIntValueCrossover : I Crossover{30 public interface IIntValueCrossover : IItem { 31 31 void Apply(IRandom random, IntValue value, IntValue other, IntValueRange range); 32 32 } -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Interfaces/IIntValueManipulator.cs
r8574 r8644 27 27 /// An interface which represents a manipulation operator for integer values. 28 28 /// </summary> 29 public interface IIntValueManipulator : I ValueManipulator{29 public interface IIntValueManipulator : IItem { 30 30 void Apply(IRandom random, IntValue value, IntValueRange range); 31 31 } -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Manipulators/DoubleValue/NormalDoubleValueManipulator.cs
r8590 r8644 24 24 using HeuristicLab.Data; 25 25 using HeuristicLab.Encodings.RealVectorEncoding; 26 using HeuristicLab.Operators;27 using HeuristicLab.Optimization;28 using HeuristicLab.Parameters;29 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 27 … … 35 32 [Item("NormalDoubleValueManipulator", "An operator which manipulates two double values. TODO")] 36 33 [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 { 42 35 #region Constructors and Cloning 43 36 public NormalDoubleValueManipulator() : base() { } … … 51 44 #endregion 52 45 53 // TODO: override Apply54 46 public void Apply(IRandom random, DoubleValue value, DoubleValueRange range) { 55 47 ApplyStatic(random, value, range); -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Manipulators/DoubleValue/UniformDoubleValueManipulator.cs
r8574 r8644 24 24 using HeuristicLab.Data; 25 25 using HeuristicLab.Encodings.RealVectorEncoding; 26 using HeuristicLab.Operators;27 using HeuristicLab.Optimization;28 using HeuristicLab.Parameters;29 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 27 … … 35 32 [Item("UniformDoubleValueManipulator", "An operator which manipulates two double values. TODO")] 36 33 [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 { 42 35 #region Constructors and Cloning 43 36 public UniformDoubleValueManipulator() : base() { } … … 51 44 #endregion 52 45 53 // TODO: override Apply54 46 public void Apply(IRandom random, DoubleValue value, DoubleValueRange range) { 55 47 ApplyStatic(random, value, range); -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Manipulators/IntValue/NormalIntValueManipulator.cs
r8590 r8644 24 24 using HeuristicLab.Data; 25 25 using HeuristicLab.Encodings.RealVectorEncoding; 26 using HeuristicLab.Operators;27 using HeuristicLab.Optimization;28 using HeuristicLab.Parameters;29 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 27 … … 35 32 [Item("NormalIntValueManipulator", "An operator which manipulates two integer values. TODO")] 36 33 [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 { 42 35 #region Constructors and Cloning 43 36 public NormalIntValueManipulator() : base() { } … … 51 44 #endregion 52 45 53 // TODO: override Apply54 46 public void Apply(IRandom random, IntValue value, IntValueRange range) { 55 47 ApplyStatic(random, value, range); -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/Operators/Manipulators/IntValue/UniformIntValueManipulator.cs
r8590 r8644 24 24 using HeuristicLab.Data; 25 25 using HeuristicLab.Encodings.IntegerVectorEncoding; 26 using HeuristicLab.Operators;27 using HeuristicLab.Optimization;28 using HeuristicLab.Parameters;29 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 27 … … 35 32 [Item("UniformIntValueManipulator", "An operator which manipulates two integer values. TODO")] 36 33 [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 { 42 35 #region Constructors and Cloning 43 36 public UniformIntValueManipulator() : base() { } … … 51 44 #endregion 52 45 53 // TODO: override Apply54 46 public void Apply(IRandom random, IntValue value, IntValueRange range) { 55 47 ApplyStatic(random, value, range); -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/RangeConstraints/Range.cs
r8574 r8644 206 206 } 207 207 public bool Validate(string value, out string errorMessage) { 208 // TODO: check that stepsize < upper - lower209 208 T lower = (T)lowerBound.Clone(); 210 209 T upper = (T)upperBound.Clone(); -
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/ValueConfigurations/CheckedValueConfigurationCollection.cs
r8535 r8644 29 29 namespace HeuristicLab.Encodings.ParameterConfigurationEncoding { 30 30 // 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? 32 32 [StorableClass] 33 33 public class CheckedValueConfigurationList : CheckedItemList<IValueConfiguration>, ICheckedValueConfigurationList { … … 81 81 private void RegisterEvents() { 82 82 this.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(CheckedValueConfigurationList_ItemsAdded); 83 this.CheckedItemsChanged += new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(CheckedValueConfigurationList_CheckedItemsChanged); 83 84 } 84 85 85 86 private void DeregisterEvents() { 87 this.CheckedItemsChanged -= new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(CheckedValueConfigurationList_CheckedItemsChanged); 86 88 this.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<IValueConfiguration>>(CheckedValueConfigurationList_ItemsAdded); 87 89 } 88 90 91 #region Events 89 92 private void CheckedValueConfigurationList_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IValueConfiguration>> e) { 90 93 foreach (var item in e.Items) { 91 94 var matchingItems = this.Where(x => x != item.Value && x.ActualValue.ValueDataType == item.Value.ActualValue.ValueDataType); 92 if (matchingItems. Count() > 0) {95 if (matchingItems.Any()) { 93 96 int maxNumber = matchingItems.Select(x => x.Number).Max(); 94 97 item.Value.Number = maxNumber + 1; … … 96 99 } 97 100 } 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 98 107 } 99 108 }
Note: See TracChangeset
for help on using the changeset viewer.