Changeset 14328 for branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/Float/FloatPushExpression.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/Float/FloatPushExpression.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.Float 4 4 { 5 5 public class FloatPushExpression : Expression 6 6 { 7 public FloatPushExpression(double value) : base(OpCode.FloatPush) 7 private readonly double value; 8 public FloatPushExpression(double value) 8 9 { 9 this. Value = value;10 this.value = value; 10 11 } 11 12 12 public double 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.FloatStack.Push(Value);17 interpreter.FloatStack.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.