Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/30/11 18:04:03 (13 years ago)
Author:
gkronber
Message:

#1453: Added an ErrorState property to online evaluators to indicate if the result value is valid or if there has been an error in the calculation. Adapted all classes that use one of the online evaluators to check this property.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeInterpreter.cs

    r5809 r5894  
    208208          var variableTreeNode = instr.dynamicNode as VariableTreeNode;
    209209          instr.iArg0 = (ushort)dataset.GetVariableIndex(variableTreeNode.VariableName);
    210           code[i] = instr;
     210          instr.dArg0 = variableTreeNode.Weight;
    211211        } else if (instr.opCode == OpCodes.LagVariable) {
    212212          var variableTreeNode = instr.dynamicNode as LaggedVariableTreeNode;
    213213          instr.iArg0 = (ushort)dataset.GetVariableIndex(variableTreeNode.VariableName);
    214           code[i] = instr;
     214          instr.dArg0 = variableTreeNode.Weight;
    215215        } else if (instr.opCode == OpCodes.VariableCondition) {
    216216          var variableConditionTreeNode = instr.dynamicNode as VariableConditionTreeNode;
    217217          instr.iArg0 = (ushort)dataset.GetVariableIndex(variableConditionTreeNode.VariableName);
     218          instr.dArg0 = variableConditionTreeNode.Threshold;
     219        } else if (instr.opCode == OpCodes.Constant) {
     220          var constTreeNode = instr.dynamicNode as ConstantTreeNode;
     221          instr.dArg0 = constTreeNode.Value;
    218222        }
    219223      }
     
    408412          }
    409413        case OpCodes.Variable: {
    410             var variableTreeNode = currentInstr.dynamicNode as VariableTreeNode;
    411             return dataset[row, currentInstr.iArg0] * variableTreeNode.Weight;
     414            return dataset[row, currentInstr.iArg0] * currentInstr.dArg0;
    412415          }
    413416        case OpCodes.LagVariable: {
     
    415418            int actualRow = row + laggedVariableTreeNode.Lag;
    416419            if (actualRow < 0 || actualRow >= dataset.Rows) throw new ArgumentException("Out of range access to dataset row: " + row);
    417             return dataset[actualRow, currentInstr.iArg0] * laggedVariableTreeNode.Weight;
     420            return dataset[actualRow, currentInstr.iArg0] * currentInstr.dArg0;
    418421          }
    419422        case OpCodes.Constant: {
    420             var constTreeNode = currentInstr.dynamicNode as ConstantTreeNode;
    421             return constTreeNode.Value;
     423            return currentInstr.dArg0;
    422424          }
    423425
     
    427429            var variableConditionTreeNode = (VariableConditionTreeNode)currentInstr.dynamicNode;
    428430            double variableValue = dataset[row, currentInstr.iArg0];
    429             double x = variableValue - variableConditionTreeNode.Threshold;
     431            double x = variableValue - currentInstr.dArg0;
    430432            double p = 1 / (1 + Math.Exp(-variableConditionTreeNode.Slope * x));
    431433
Note: See TracChangeset for help on using the changeset viewer.