Changeset 6090 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding
- Timestamp:
- 05/01/11 22:02:28 (14 years ago)
- Location:
- branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/DoubleValueRange.cs
r5522 r6090 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.Linq;4 using System.Text;3 using HeuristicLab.Common; 4 using HeuristicLab.Core; 5 5 using HeuristicLab.Data; 6 using HeuristicLab.Common;7 6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 8 using HeuristicLab.Core;9 7 10 8 namespace HeuristicLab.Problems.MetaOptimization { … … 12 10 public class DoubleValueRange : Range<DoubleValue> { 13 11 12 public override DoubleValue LowerBound { 13 get { 14 return base.LowerBound; 15 } 16 set { 17 base.LowerBound = value; 18 } 19 } 20 14 21 public DoubleValueRange(DoubleValue lowerBound, DoubleValue upperBound, DoubleValue stepSize) : base(lowerBound, upperBound, stepSize) { } 15 22 public DoubleValueRange() { } -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/Range.cs
r5576 r6090 12 12 [Storable] 13 13 private T lowerBound; 14 public T LowerBound {14 public virtual T LowerBound { 15 15 get { return lowerBound; } 16 16 set { … … 30 30 [Storable] 31 31 private T upperBound; 32 public T UpperBound {32 public virtual T UpperBound { 33 33 get { return upperBound; } 34 34 set { … … 48 48 [Storable] 49 49 private T stepSize; 50 public T StepSize {50 public virtual T StepSize { 51 51 get { return stepSize; } 52 52 set { … … 197 197 if (random.NextDouble() < 0.1) { 198 198 if (random.NextDouble() < 0.5) { 199 return LowerBound;199 return (T)LowerBound.Clone(); 200 200 } else { 201 return UpperBound;201 return (T)UpperBound.Clone(); 202 202 } 203 203 } -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ValueConfigurations/RangeValueConfiguration.cs
r5653 r6090 36 36 : base(value, valueDataType) { 37 37 if (actualValue.ValueDataType == typeof(IntValue)) { 38 RangeConstraint = new IntValueRange(new IntValue(0), (IntValue)value , new IntValue(1));38 RangeConstraint = new IntValueRange(new IntValue(0), (IntValue)value.Clone(), new IntValue(1)); 39 39 } else if (actualValue.ValueDataType == typeof(DoubleValue)) { 40 RangeConstraint = new DoubleValueRange(new DoubleValue(0), (DoubleValue)value , new DoubleValue(0.01));40 RangeConstraint = new DoubleValueRange(new DoubleValue(0), (DoubleValue)value.Clone(), new DoubleValue(0.01)); 41 41 } else if (actualValue.ValueDataType == typeof(PercentValue)) { 42 42 RangeConstraint = new PercentValueRange(new PercentValue(0), new PercentValue(1), new PercentValue(0.01));
Note: See TracChangeset
for help on using the changeset viewer.