Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/06/17 10:22:27 (7 years ago)
Author:
gkronber
Message:

#2650: merged r14827, r14829:14832 from trunk to stable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableTreeNodeBase.cs

    r15131 r15132  
    7979      }
    8080
    81       if (Symbol.VariableChangeProbability >= 1.0 || random.NextDouble() < Symbol.VariableChangeProbability) {
    82         var oldName = variableName;
     81      if (Symbol.VariableChangeProbability >= 1.0) {
     82        // old behaviour for backwards compatibility
     83        #region Backwards compatible code, remove with 3.4
    8384#pragma warning disable 612, 618
    8485        variableName = Symbol.VariableNames.SelectRandom(random);
    8586#pragma warning restore 612, 618
     87        #endregion
     88      } else if (random.NextDouble() < Symbol.VariableChangeProbability) {
     89        var oldName = variableName;
     90        variableName = Symbol.VariableNames.SampleRandom(random);
    8691        if (oldName != variableName) {
     92          // re-initialize weight if the variable is changed
    8793          weight = NormalDistributedRandom.NextDouble(random, Symbol.WeightMu, Symbol.WeightSigma);
    8894        }
Note: See TracChangeset for help on using the changeset viewer.