Changeset 6038 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/DoubleValue/UniformDoubleValueManipulator.cs
- Timestamp:
- 04/22/11 10:56:48 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/DoubleValue/UniformDoubleValueManipulator.cs
r6017 r6038 1 using System;2 using System.Collections.Generic;3 using System.Linq;4 using System.Text;1 using HeuristicLab.Common; 2 using HeuristicLab.Core; 3 using HeuristicLab.Data; 4 using HeuristicLab.Encodings.RealVectorEncoding; 5 5 using HeuristicLab.Operators; 6 6 using HeuristicLab.Optimization; 7 using HeuristicLab.Parameters; 7 8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 8 using HeuristicLab.Core;9 using HeuristicLab.Parameters;10 using HeuristicLab.Common;11 using HeuristicLab.Encodings.RealVectorEncoding;12 using HeuristicLab.Data;13 9 14 10 namespace HeuristicLab.Problems.MetaOptimization { … … 36 32 37 33 public static void ApplyStatic(IRandom random, DoubleValue value, DoubleValueRange range) { 38 bool ok = false;39 34 var vector = new RealVector(1); 40 35 var bounds = new DoubleMatrix(1, 2); … … 43 38 double val = value.Value; 44 39 45 while (!ok){40 do { 46 41 vector[0] = val; 47 42 UniformOnePositionManipulator.Apply(random, vector, bounds); 48 43 value.Value = vector[0]; 49 44 value.Value = range.ApplyStepSize(value.Value); 50 ok = range.IsInRange(value.Value); 51 } 45 } while (!range.IsInRange(value.Value)); 52 46 } 53 47 }
Note: See TracChangeset
for help on using the changeset viewer.