Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14951 for trunk


Ignore:
Timestamp:
05/10/17 10:31:21 (8 years ago)
Author:
mkommend
Message:

#2686: Code clean up in ConstantOptimization.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs

    r14946 r14951  
    194194        int col = 0;
    195195        foreach (var info in parameterEntries) {
    196           int lag = info.lag;
    197196          if (ds.VariableHasType<double>(info.variableName)) {
    198197            x[row, col] = ds.GetDoubleValue(info.variableName, r + info.lag);
     
    242241      foreach (var node in tree.Root.IterateNodesPrefix().OfType<SymbolicExpressionTreeTerminalNode>()) {
    243242        ConstantTreeNode constantTreeNode = node as ConstantTreeNode;
    244         VariableTreeNode variableTreeNode = node as VariableTreeNode;
    245         LaggedVariableTreeNode laggedVarTreeNode = node as LaggedVariableTreeNode;
    246         BinaryFactorVariableTreeNode binFactorVarTreeNode = node as BinaryFactorVariableTreeNode;
     243        VariableTreeNodeBase variableTreeNodeBase = node as VariableTreeNodeBase;
    247244        FactorVariableTreeNode factorVarTreeNode = node as FactorVariableTreeNode;
    248245        if (constantTreeNode != null)
    249246          constantTreeNode.Value = constants[i++];
    250         else if (updateVariableWeights && variableTreeNode != null)
    251           variableTreeNode.Weight = constants[i++];
    252         else if (updateVariableWeights && laggedVarTreeNode != null)
    253           laggedVarTreeNode.Weight = constants[i++];
    254         else if (updateVariableWeights && binFactorVarTreeNode != null)
    255           binFactorVarTreeNode.Weight = constants[i++];
     247        else if (updateVariableWeights && variableTreeNodeBase != null)
     248          variableTreeNodeBase.Weight = constants[i++];
    256249        else if (factorVarTreeNode != null) {
    257250          for (int j = 0; j < factorVarTreeNode.Weights.Length; j++)
Note: See TracChangeset for help on using the changeset viewer.