Changeset 15341 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Interpreter/PushInterpreter.cs
- Timestamp:
- 08/28/17 09:03:34 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Interpreter/PushInterpreter.cs
r15334 r15341 17 17 public class PushInterpreter : IInternalPushInterpreter, IDisposable { 18 18 private Task currentTask; 19 private Expression currentProgram;19 private int evalPushLimit; 20 20 21 21 /// <summary> … … 30 30 Configuration = config ?? new PushConfiguration(); 31 31 32 // setting the capacity of the Stacks to max points ensures that there will be enough memory at runtime33 32 ExecStack = new PushStack<Expression>(Configuration.MaxProgramLength); 34 33 CodeStack = new PushStack<Expression>(); … … 66 65 PoolContainer = poolContainer ?? new InterpreterPoolContainer(); 67 66 67 InitEvalPushLimit(); 68 68 ConfigureStacks(); 69 69 } … … 92 92 !IsPaused && 93 93 !IsAborted && 94 (ExecCounter < Configuration.EvalPushLimit);94 (ExecCounter < evalPushLimit); 95 95 } 96 96 } … … 261 261 public void Run(Expression expression, bool stepwise = false) { 262 262 IsPaused = stepwise; 263 currentProgram = expression;264 263 265 264 /* Push top expression so the loop is able to enter … … 347 346 Random = (IRandom)randomOrigin.Clone(); 348 347 348 InitEvalPushLimit(); 349 349 350 ExecCounter = 0; 350 351 IsAborted = false; 351 352 IsPaused = false; 352 353 currentTask = null; 353 currentProgram = null;354 354 355 355 inputExpressions.Clear(); 356 356 ClearStacks(); 357 357 ConfigureStacks(); 358 } 359 360 private void InitEvalPushLimit() { 361 // evalPushLimit is accessed very often and using the getter of the configuration object is rather expensive as the values is capsuled within a parameter 362 evalPushLimit = Configuration.EvalPushLimit; 363 } 364 365 private void EvalPushLimitChanged(object sender, EventArgs e) { 366 this.evalPushLimit = Configuration.EvalPushLimit; 358 367 } 359 368
Note: See TracChangeset
for help on using the changeset viewer.