Changeset 9171 for branches/sluengo
- Timestamp:
- 01/16/13 15:27:40 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sluengo/HeuristicLab.Problems.TradeRules/Interpreter.cs
r9147 r9171 30 30 [ThreadStatic] 31 31 private static double lastRSI; 32 33 // [ThreadStatic] 34 // private Dictionary<Instruction, double> lastEMACache; 35 32 36 #region private classes 33 37 //This class manipulate the instructions of the stack … … 377 381 double timeValue = (int)Evaluate(dataset, ref row, state); 378 382 383 // with caching 384 // if (lastEmaCache.ContainsKey(currentInst) 385 // lastEma = lastEmaCache[currentInstr] 386 // else 387 // lastEma = 1; 388 379 389 //get all mean values from row - timeValue up to the actual row 380 390 double[] meanValues = dataset.GetDoubleValues("insert variable name", Enumerable.Range(row - (int)timeValue, timeValue)).ToArray(); … … 386 396 EMA = meanValues[i] * factor + (1 - factor) * EMA; 387 397 } 398 399 // save in cache for next evaluation 400 // lastEmaCache[currentInstr] = EMA; 401 388 402 return EMA; 389 403 } … … 563 577 } 564 578 } 579 580 // with caching 581 // if (lastEmaCache == null) lastEmaCache = new Dictionary<Instruction, double>(); 582 // else lastEmaCache.Clear(); 583 565 584 var state = new InterpreterState(code, necessaryArgStackSize); 566 585 //Evaluate each row of the datase
Note: See TracChangeset
for help on using the changeset viewer.