Changeset 14328 for branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/Exec/ExecYExpression.cs
- Timestamp:
- 10/08/16 12:04:25 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/Exec/ExecYExpression.cs
r14323 r14328 1 using HeuristicLab.Algorithms.PushGP. Stack;1 using HeuristicLab.Algorithms.PushGP.Interpreter; 2 2 3 namespace HeuristicLab.Algorithms.PushGP.Expressions 3 namespace HeuristicLab.Algorithms.PushGP.Expressions.Exec 4 4 { 5 5 public class ExecYExpression : Expression 6 6 { 7 public ExecYExpression() : base(OpCode.ExecY) 8 { } 7 public override bool IsCodeOp { get { return false; } } 9 8 10 public override void Eval(IInterpreter Service interpreterService)9 public override void Eval(IInterpreter interpreter) 11 10 { 12 11 // not enough arguments on stack 13 if (interpreter Service.ExecStack.Count == 0)12 if (interpreter.ExecStack.Count == 0) 14 13 return; 15 14 16 15 var expandExpression = new ExecExpandExpression(new[] 17 16 { 18 interpreter Service.ExecStack.Top,17 interpreter.ExecStack.Top, 19 18 new ExecYExpression() 20 19 }); 21 20 22 interpreterService.ExecStack.Insert(interpreterService.ExecStack.Count - 1, expandExpression); 21 interpreter.ExecStack.Insert(interpreter.ExecStack.Count - 1, expandExpression); 22 } 23 24 public override string ToString() 25 { 26 return Symbols.ExecY; 23 27 } 24 28 }
Note: See TracChangeset
for help on using the changeset viewer.