Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/Float/FloatPushExpression.cs @ 14328

Last change on this file since 14328 was 14328, checked in by pkimmesw, 8 years ago

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

File size: 648 bytes
Line 
1using HeuristicLab.Algorithms.PushGP.Interpreter;
2
3namespace HeuristicLab.Algorithms.PushGP.Expressions.Float
4{
5    public class FloatPushExpression : Expression
6    {
7        private readonly double value;
8        public FloatPushExpression(double value)
9        {
10            this.value = value;
11        }
12
13        public override bool IsCodeOp { get { return false; } }
14
15        public override void Eval(IInterpreter interpreter)
16        {
17            interpreter.FloatStack.Push(this.value);
18        }
19
20        public override string ToString()
21        {
22            return this.value.ToString();
23        }
24    }
25}
Note: See TracBrowser for help on using the repository browser.