Changeset 14746 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Interpreter/PushInterpreter.cs
- Timestamp:
- 03/11/17 20:07:13 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Interpreter/PushInterpreter.cs
r14745 r14746 2 2 using System; 3 3 using System.Collections.Generic; 4 #if DEBUG 5 using System.Linq; 6 #endif 4 7 using System.Runtime.CompilerServices; 5 8 using System.Threading; … … 7 10 using HeuristicLab.Core; 8 11 using HeuristicLab.Problems.ProgramSynthesis.Push.Configuration; 12 using HeuristicLab.Problems.ProgramSynthesis.Push.Data.Pool; 9 13 using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions; 10 14 using HeuristicLab.Problems.ProgramSynthesis.Push.Parser; … … 82 86 } 83 87 88 public IManagedPool<PushProgram> PushProgramPool { get; set; } 89 84 90 public IReadonlyPushConfiguration Configuration { get; protected set; } 85 91 … … 249 255 } 250 256 257 #if DEBUG 258 private Expression last; 259 private bool DoStep() { 260 var expression = ExecStack.Pop(); 261 262 if (ExecStack.Any(e => e == null)) { 263 throw new InvalidProgramException(); 264 } 265 266 var succ = expression.Eval(this); 267 last = expression; 268 269 return succ; 270 } 271 #else 251 272 [MethodImpl(MethodImplOptions.AggressiveInlining)] 252 273 private bool DoStep() { 253 274 return ExecStack.Pop().Eval(this); 254 275 } 276 #endif 255 277 256 278 private Task InterpretAsync() {
Note: See TracChangeset
for help on using the changeset viewer.