Changeset 14328 for branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/Boolean/BooleanPushExpression.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/Boolean/BooleanPushExpression.cs
r14323 r14328 1 using HeuristicLab.Algorithms.PushGP.Stack; 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 using HeuristicLab.Algorithms.PushGP.Interpreter; 2 7 3 namespace HeuristicLab.Algorithms.PushGP.Expressions 8 namespace HeuristicLab.Algorithms.PushGP.Expressions.Boolean 4 9 { 5 10 public class BooleanPushExpression : Expression 6 11 { 7 public BooleanPushExpression(bool value) : base(OpCode.BooleanPush) 12 private readonly bool value; 13 public BooleanPushExpression(bool value) 8 14 { 9 this. Value = value;15 this.value = value; 10 16 } 11 17 12 public bool Value { get;}18 public override bool IsCodeOp { get { return false; } } 13 19 14 public override void Eval(IInterpreter Service interpreterService)20 public override void Eval(IInterpreter interpreter) 15 21 { 16 interpreter Service.BooleanStack.Push(Value);22 interpreter.BooleanStack.Push(this.value); 17 23 } 18 24 19 25 public override string ToString() 20 26 { 21 return $"{this.Value.ToString().ToUpper()}";27 return this.value.ToString().ToUpper(); 22 28 } 23 29 }
Note: See TracChangeset
for help on using the changeset viewer.