Changeset 363 for trunk/sources/HeuristicLab.Functions
- Timestamp:
- 07/04/08 17:30:24 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Functions
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Functions/BakedFunctionTree.cs
r344 r363 262 262 } 263 263 264 bool evaluatorReset = false; 265 public double Evaluate(Dataset dataset, int sampleIndex) { 264 public void PrepareEvaluation(Dataset dataset) { 266 265 FlattenVariables(); 267 266 FlattenTrees(); 268 if(!evaluatorReset) {269 BakedTreeEvaluator.ResetEvaluator(linearRepresentation);270 evaluatorReset = true; 271 }272 return BakedTreeEvaluator.Evaluate( dataset,sampleIndex);267 BakedTreeEvaluator.ResetEvaluator(dataset, linearRepresentation); 268 } 269 270 public double Evaluate(int sampleIndex) { 271 return BakedTreeEvaluator.Evaluate(sampleIndex); 273 272 } 274 273 -
trunk/sources/HeuristicLab.Functions/BakedTreeEvaluator.cs
r322 r363 53 53 } 54 54 55 public static void ResetEvaluator( List<LightWeightFunction> linearRepresentation) {55 public static void ResetEvaluator(Dataset dataset, List<LightWeightFunction> linearRepresentation) { 56 56 int i = 0; 57 BakedTreeEvaluator.dataset = dataset; 57 58 foreach(LightWeightFunction f in linearRepresentation) { 58 59 TranslateToInstr(f, codeArr[i++]); … … 78 79 } 79 80 80 internal static double Evaluate( Dataset dataset,int sampleIndex) {81 internal static double Evaluate(int sampleIndex) { 81 82 PC = 0; 82 83 BakedTreeEvaluator.sampleIndex = sampleIndex; 83 BakedTreeEvaluator.dataset = dataset;84 84 return EvaluateBakedCode(); 85 85 } -
trunk/sources/HeuristicLab.Functions/IFunctionTree.cs
r324 r363 40 40 void RemoveSubTree(int index); 41 41 42 double Evaluate(Dataset dataset, int sampleIndex); 42 void PrepareEvaluation(Dataset dataset); 43 double Evaluate(int sampleIndex); 43 44 } 44 45 }
Note: See TracChangeset
for help on using the changeset viewer.