Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/22/11 10:56:48 (13 years ago)
Author:
cneumuel
Message:

#1215

  • reduced significance of NormalCrossovers
  • small fixes
File:
1 edited

Legend:

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

    r6017 r6038  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
     1using HeuristicLab.Common;
     2using HeuristicLab.Core;
     3using HeuristicLab.Data;
     4using HeuristicLab.Encodings.RealVectorEncoding;
    55using HeuristicLab.Operators;
    66using HeuristicLab.Optimization;
     7using HeuristicLab.Parameters;
    78using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    8 using HeuristicLab.Core;
    9 using HeuristicLab.Parameters;
    10 using HeuristicLab.Common;
    11 using HeuristicLab.Encodings.IntegerVectorEncoding;
    12 using HeuristicLab.Data;
    13 using HeuristicLab.Encodings.RealVectorEncoding;
    149
    1510namespace HeuristicLab.Problems.MetaOptimization {
     
    3833
    3934    public static void ApplyStatic(IRandom random, IntValue value, IntValueRange range) {
    40       bool ok = false;
    4135      var strategy = new RealVector(new double[] { (range.UpperBound.Value - range.LowerBound.Value) / 10 }); // todo: add strategy parameter
    4236      var vector = new RealVector(new double[] { value.Value });
    4337      int val = value.Value;
    4438
    45       while (!ok) {
     39      do {
    4640        vector[0] = val;
    4741        NormalAllPositionsManipulator.Apply(random, vector, strategy);
    4842        value.Value = (int)vector[0];
    4943        value.Value = range.ApplyStepSize(value.Value);
    50         ok = range.IsInRange(value.Value);
    51       }
     44      } while (!range.IsInRange(value.Value));
    5245    }
    5346  }
Note: See TracChangeset for help on using the changeset viewer.