Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/01/16 17:59:36 (8 years ago)
Author:
gkronber
Message:

#2608: simplified grammar by removing unnecessary symbols: exprch, exprins, exprgluc and added constants

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GeneticProgramming.BloodGlucosePrediction/Interpreter.cs

    r13867 r13870  
    77using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    88using HeuristicLab.Problems.DataAnalysis;
     9using HeuristicLab.Problems.DataAnalysis.Symbolic;
    910
    1011namespace HeuristicLab.Problems.GeneticProgramming.GlucosePrediction {
     
    2627      };
    2728      data.predGluc = new double[data.realGluc.Length];
     29      Array.Copy(data.realGluc, data.predGluc, data.predGluc.Length);
    2830      for (int k = 0; k < data.predGluc.Length; k++) {
    2931        if (double.IsNaN(targetGluc[k])) {
     
    122124        GetMaxValueAndDistance(data.realIns, k, out maxVal, out maxValDistance, maxDistance: 48);
    123125        return n.Weight * (sum - maxVal) * maxVal * Beta(maxValDistance / 48.0, n.Alpha, n.Beta);
     126      } else if (node.Symbol is Constant) {
     127        var n = (ConstantTreeNode)node;
     128        return n.Value;
    124129      } else {
    125130        throw new InvalidProgramException("found unknown symbol " + node.Symbol);
Note: See TracChangeset for help on using the changeset viewer.