Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/27/09 17:27:57 (15 years ago)
Author:
gkronber
Message:

Fixed #765 (GP Predictor should output NaN if the predicted value for a row can't be calculated).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Predictor.cs

    r2381 r2393  
    5454      double[] result = new double[end - start];
    5555      for (int i = 0; i < result.Length; i++) {
    56         result[i] = treeEvaluator.Evaluate(i + start);
     56        try {
     57          result[i] = treeEvaluator.Evaluate(i + start);
     58        }
     59        catch (ArgumentException) {
     60          result[i] = double.NaN;
     61        }
    5762      }
    5863      return result;
     
    6368      foreach (IFunctionTree ft in FunctionTreeIterator.IteratePrefix(functionTree.FunctionTree)) {
    6469        if (ft is VariableFunctionTree) {
    65           VariableFunctionTree variable = (VariableFunctionTree) ft;
     70          VariableFunctionTree variable = (VariableFunctionTree)ft;
    6671          inputVariables.Add(variable.VariableName);
    6772        }
Note: See TracChangeset for help on using the changeset viewer.