Changeset 2393 for trunk/sources/HeuristicLab.GP.StructureIdentification
- Timestamp:
- 09/27/09 17:27:57 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/HL3TreeEvaluator.cs
r2328 r2393 38 38 case EvaluatorSymbolTable.VARIABLE: { 39 39 int row = sampleIndex + currInstr.i_arg1; 40 if (row < 0 || row >= dataset.Rows) throw new InvalidOperationException("Out of range access to dataset row: " + row);40 if (row < 0 || row >= dataset.Rows) throw new ArgumentException("Out of range access to dataset row: " + row); 41 41 else return currInstr.d_arg0 * dataset.GetValue(row, currInstr.i_arg0); 42 42 } … … 46 46 case EvaluatorSymbolTable.DIFFERENTIAL: { 47 47 int row = sampleIndex + currInstr.i_arg1; 48 if (row < 0 || row >= dataset.Rows) throw new InvalidOperationException("Out of range access to dataset row: " + row);48 if (row < 0 || row >= dataset.Rows) throw new ArgumentException("Out of range access to dataset row: " + row); 49 49 else if (row < 1) return 0.0; 50 50 else { -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Predictor.cs
r2381 r2393 54 54 double[] result = new double[end - start]; 55 55 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 } 57 62 } 58 63 return result; … … 63 68 foreach (IFunctionTree ft in FunctionTreeIterator.IteratePrefix(functionTree.FunctionTree)) { 64 69 if (ft is VariableFunctionTree) { 65 VariableFunctionTree variable = (VariableFunctionTree) 70 VariableFunctionTree variable = (VariableFunctionTree)ft; 66 71 inputVariables.Add(variable.VariableName); 67 72 }
Note: See TracChangeset
for help on using the changeset viewer.