Changeset 14733 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/DoTimesExpressions.cs
- Timestamp:
- 03/08/17 11:57:42 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/DoTimesExpressions.cs
r14727 r14733 7 7 protected DoTimesExpression() { } 8 8 protected DoTimesExpression(LoopState state) : base(state) { } 9 protected override bool HasInsufficientArguments(IPush GpInterpreter interpreter, IStack<Expression> sourceStack) {9 protected override bool HasInsufficientArguments(IPushInterpreter interpreter, IStack<Expression> sourceStack) { 10 10 return (interpreter.IntegerStack.Count < 1) || (sourceStack.Count == 0) || (interpreter.IntegerStack.Top <= 0); 11 11 } 12 12 13 protected override LoopState InitState(IPush GpInterpreter interpreter, IStack<Expression> sourceStack) {13 protected override LoopState InitState(IPushInterpreter interpreter, IStack<Expression> sourceStack) { 14 14 //this.State.Body = sourceStack.Pop(); 15 15 //this.State.DestinationIndex = interpreter.IntegerStack.Pop(); … … 24 24 } 25 25 26 protected override void PushIteration(IPush GpInterpreter interpreter) {26 protected override void PushIteration(IPushInterpreter interpreter) { 27 27 var newState = new LoopState(State.Body, State.CurrentIndex + this.State.Incrementor, State.DestinationIndex, State.Incrementor); 28 28 var nextLoopExpression = Clone(newState); … … 31 31 } 32 32 33 protected override void PushLastIteration(IPush GpInterpreter interpreter) {33 protected override void PushLastIteration(IPushInterpreter interpreter) { 34 34 interpreter.ExecStack.Push(this.State.Body); 35 35 } … … 47 47 public CodeDoTimesExpression(LoopState state) : base(state) { } 48 48 49 public override void Eval(IPush GpInterpreter interpreter) {49 public override void Eval(IPushInterpreter interpreter) { 50 50 this.Eval(interpreter, interpreter.CodeStack); 51 51 } … … 70 70 public ExecDoTimesExpression(LoopState state) : base(state) { } 71 71 72 public override void Eval(IPush GpInterpreter interpreter) {72 public override void Eval(IPushInterpreter interpreter) { 73 73 this.Eval(interpreter, interpreter.ExecStack); 74 74 }
Note: See TracChangeset
for help on using the changeset viewer.