Changeset 14834 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/DoRangeExpressions.cs
- Timestamp:
- 04/10/17 00:27:31 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/DoRangeExpressions.cs
r14777 r14834 10 10 protected DoRangeExpression() { } 11 11 protected DoRangeExpression(LoopState state) : base(state) { } 12 protected override bool HasInsufficientArguments(I PushInterpreter interpreter, IStack<Expression> sourceStack) {12 protected override bool HasInsufficientArguments(IInternalPushInterpreter interpreter, IPushStack<Expression> sourceStack) { 13 13 return interpreter.IntegerStack.Count < 2 || 14 14 sourceStack.Count == 0 || … … 16 16 } 17 17 18 protected override LoopState InitState(I PushInterpreter interpreter, IStack<Expression> sourceStack) {18 protected override LoopState InitState(IInternalPushInterpreter interpreter, IPushStack<Expression> sourceStack) { 19 19 var destinationIndex = interpreter.IntegerStack.Pop(); 20 20 var incrementor = destinationIndex < interpreter.IntegerStack.Top ? -1 : 1; … … 33 33 /// execution of 34 34 /// the body of the loop. The top integer is the "destination index" and the second integer is the "current index." 35 /// First the code35 /// Last the code 36 36 /// and the integer arguments are saved locally and popped. Then the integers are compared. If the integers are equal 37 37 /// then the current … … 56 56 57 57 public CodeDoRangeExpression(LoopState state) : base(state) { } 58 public override bool Eval(I PushInterpreter interpreter) {58 public override bool Eval(IInternalPushInterpreter interpreter) { 59 59 return this.Eval(interpreter, interpreter.CodeStack); 60 60 } 61 61 62 protected override LoopExpression Clone(LoopState state, I PushInterpreter interpreter) {62 protected override LoopExpression Clone(LoopState state, IInternalPushInterpreter interpreter) { 63 63 var expression = interpreter.PoolContainer.GetStatefulExpression<CodeDoRangeExpression>(); 64 64 expression.State = state; … … 74 74 /// the loop. 75 75 /// This is similar to CODE.DO*COUNT except that it takes its code argument from the EXEC stack. The top integer is the 76 /// "destination index" and the second integer is the "current index." First the code and the integer arguments are76 /// "destination index" and the second integer is the "current index." Last the code and the integer arguments are 77 77 /// saved locally 78 78 /// and popped. Then the integers are compared. If the integers are equal then the current index is pushed onto the … … 98 98 99 99 public ExecDoRangeExpression(LoopState state) : base(state) { } 100 public override bool Eval(I PushInterpreter interpreter) {100 public override bool Eval(IInternalPushInterpreter interpreter) { 101 101 return this.Eval(interpreter, interpreter.ExecStack); 102 102 } 103 protected override LoopExpression Clone(LoopState state, I PushInterpreter interpreter) {103 protected override LoopExpression Clone(LoopState state, IInternalPushInterpreter interpreter) { 104 104 var expression = interpreter.PoolContainer.GetStatefulExpression<ExecDoRangeExpression>(); 105 105 expression.State = state;
Note: See TracChangeset
for help on using the changeset viewer.