Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/08/16 12:04:25 (8 years ago)
Author:
pkimmesw
Message:

#2665 Set .NET version to 4.5, C# version to 5.0, Added expression templates and factory

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;
     1using System;
     2using System.Collections.Generic;
     3using System.Linq;
     4using System.Text;
     5using System.Threading.Tasks;
     6using HeuristicLab.Algorithms.PushGP.Interpreter;
    27
    3 namespace HeuristicLab.Algorithms.PushGP.Expressions
     8namespace HeuristicLab.Algorithms.PushGP.Expressions.Boolean
    49{
    510    public class BooleanPushExpression : Expression
    611    {
    7         public BooleanPushExpression(bool value) : base(OpCode.BooleanPush)
     12        private readonly bool value;
     13        public BooleanPushExpression(bool value)
    814        {
    9             this.Value = value;
     15            this.value = value;
    1016        }
    1117
    12         public bool Value { get; }
     18        public override bool IsCodeOp { get { return false; } }
    1319
    14         public override void Eval(IInterpreterService interpreterService)
     20        public override void Eval(IInterpreter interpreter)
    1521        {
    16             interpreterService.BooleanStack.Push(Value);
     22            interpreter.BooleanStack.Push(this.value);
    1723        }
    1824
    1925        public override string ToString()
    2026        {
    21             return $"{this.Value.ToString().ToUpper()}";
     27            return this.value.ToString().ToUpper();
    2228        }
    2329    }
Note: See TracChangeset for help on using the changeset viewer.