- Timestamp:
- 05/25/09 17:46:17 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/TreeEvaluatorBase.cs
r1873 r1891 62 62 } 63 63 64 public void PrepareForEvaluation(IFunctionTree functionTree) { 65 BakedFunctionTree bakedTree = functionTree as BakedFunctionTree; 66 if (bakedTree == null) throw new ArgumentException("TreeEvaluators can only evaluate BakedFunctionTrees"); 67 68 List<LightWeightFunction> linearRepresentation = bakedTree.LinearRepresentation; 69 codeArr = new Instr[linearRepresentation.Count]; 70 int i = 0; 71 foreach (LightWeightFunction f in linearRepresentation) { 72 codeArr[i++] = TranslateToInstr(f); 73 } 74 } 75 64 76 private Instr TranslateToInstr(LightWeightFunction f) { 65 77 Instr instr = new Instr(); … … 86 98 } 87 99 88 public double Evaluate(IFunctionTree functionTree, int sampleIndex) { 89 BakedFunctionTree bakedTree = functionTree as BakedFunctionTree; 90 if (bakedTree == null) throw new ArgumentException("TreeEvaluators can only evaluate BakedFunctionTrees"); 91 92 List<LightWeightFunction> linearRepresentation = bakedTree.LinearRepresentation; 93 codeArr = new Instr[linearRepresentation.Count]; 94 int i = 0; 95 foreach (LightWeightFunction f in linearRepresentation) { 96 codeArr[i++] = TranslateToInstr(f); 97 } 98 100 public double Evaluate(int sampleIndex) { 99 101 PC = 0; 100 102 this.sampleIndex = sampleIndex;
Note: See TracChangeset
for help on using the changeset viewer.