Changeset 14328 for branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/Integer/IntegerPushExpression.cs
- Timestamp:
- 10/08/16 12:04:25 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/Integer/IntegerPushExpression.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.Integer 4 4 { 5 5 public class IntegerPushExpression : Expression 6 6 { 7 public IntegerPushExpression(long value) : base(OpCode.IntegerPush) 7 private readonly long value; 8 public IntegerPushExpression(long value) 8 9 { 9 this. Value = value;10 this.value = value; 10 11 } 11 12 12 public long Value { get;}13 public override bool IsCodeOp { get { return false; } } 13 14 14 public override void Eval(IInterpreter Service interpreterService)15 public override void Eval(IInterpreter interpreter) 15 16 { 16 interpreter Service.IntegerStack.Push(Value);17 interpreter.IntegerStack.Push(this.value); 17 18 } 18 19 19 20 public override string ToString() 20 21 { 21 return $"{this.Value}";22 return this.value.ToString(); 22 23 } 23 24 }
Note: See TracChangeset
for help on using the changeset viewer.