Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/04/11 02:18:27 (13 years ago)
Author:
cneumuel
Message:

#1215

  • lots of memory-consumption improvements
  • validValues -> validTypes (this saves memory!)
  • changed manipulators; modifications are less significant, out-of-bound-values are resampled instead of set to lower or upper bound
  • changed the way a base-level algorithm gets executed -> introduced AlgorithmExecutor
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Operators/Manipulators/UniformIntValueManipulator.cs

    r5111 r5207  
    3737
    3838    public static void ApplyStatic(IRandom random, IntValue value, IntValueRange range) {
     39      bool ok = false;
    3940      var vector = new IntegerVector(new int[] { value.Value });
    40       UniformOnePositionManipulator.Apply(random, vector, range.LowerBound, new IntValue(range.UpperBound.Value + 1));
    41       value.Value = vector[0];
    42       range.Fix(value);
     41      int val = value.Value;
     42
     43      while (!ok) {
     44        vector[0] = val;
     45        UniformOnePositionManipulator.Apply(random, vector, range.LowerBound, new IntValue(range.UpperBound.Value + 1));
     46        value.Value = vector[0];
     47        range.ApplyStepSize(value);
     48        ok = range.IsInRange(value.Value);
     49      }
    4350    }
    4451  }
Note: See TracChangeset for help on using the changeset viewer.