Changeset 14612


Ignore:
Timestamp:
01/26/17 14:31:45 (3 years ago)
Author:
bwerth
Message:

#2592 made initialization solutionspace-scaling invariant

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/MOCMAEvolutionStrategy/HeuristicLab.Algorithms.MOCMAEvolutionStrategy/3.3/MOCMASEvolutionStrategy.cs

    r14577 r14612  
    328328    #region Initialization
    329329    private MOCMAESIndividual InitializeIndividual(RealVector x) {
    330       var zeros = new RealVector(x.Length);
     330      var zeros = new RealVector(Enumerable.Range(0, Problem.Encoding.Length).Select(i => (Problem.Encoding.Bounds[i, 1] + Problem.Encoding.Bounds[i, 0]) / 2).ToArray());
    331331      var identity = new double[x.Length, x.Length];
    332       for (var i = 0; i < x.Length; i++) identity[i, i] = 1;
     332      for (var i = 0; i < x.Length; i++) identity[i, i] = (Problem.Encoding.Bounds[i % Problem.Encoding.Bounds.Rows, 1] - Problem.Encoding.Bounds[i % Problem.Encoding.Bounds.Rows, 0]);
    333333      return new MOCMAESIndividual(x, internals.TargetSuccessProbability, InitialSigma, zeros, identity, internals);
    334334    }
Note: See TracChangeset for help on using the changeset viewer.