Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/23/10 14:27:06 (14 years ago)
Author:
gkronber
Message:

Implemented manipulation operators. #937 (Data types and operators for symbolic expression tree encoding)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/VariableTreeNode.cs

    r3485 r3512  
    6969      var normalDistributedRNG = new NormalDistributedRandom(random, Symbol.WeightNu, Symbol.WeightSigma);
    7070      weight = normalDistributedRNG.NextDouble();
    71       var variableList = new List<string>(Symbol.VariableNames);
    72       int variableIndex = random.Next(0, variableList.Count);
    73       variableName = variableList[variableIndex];
     71      variableName = Symbol.VariableNames.SelectRandom(random);
    7472    }
     73
     74    public override void ShakeLocalParameters(IRandom random, double shakingFactor) {
     75      base.ShakeLocalParameters(random, shakingFactor);
     76      var normalDistributedRNG = new NormalDistributedRandom(random, Symbol.WeightManipulatorNu, Symbol.WeightManipulatorSigma);
     77      double x = normalDistributedRNG.NextDouble();
     78      weight = weight + x * shakingFactor;
     79      variableName = Symbol.VariableNames.SelectRandom(random);
     80    }
     81
    7582
    7683    public override object Clone() {
Note: See TracChangeset for help on using the changeset viewer.