00001 using System; 00002 using System.Collections.Generic; 00003 using System.Linq; 00004 using System.Text; 00005 00006 namespace GEP.Core.Float 00007 { 00011 [Serializable] 00012 public class Constant : Symbol 00013 { 00017 public float _value; 00018 00023 public Constant(string name) 00024 : base(name) { } 00025 00031 public Constant(float value, string name) 00032 : this(name) 00033 { 00034 _value = value; 00035 } 00036 00043 public override float Value(float[] parameters, int startIndex) 00044 { 00045 return _value; 00046 } 00047 00052 public override string ToString() 00053 { 00054 return _name + ", " + _value; 00055 } 00056 00061 public Constant(Constant symbol) 00062 :base(symbol) 00063 { 00064 _value = symbol._value; 00065 } 00066 00067 public override GEP.Core.Common.Symbol Clone() 00068 { 00069 return new Constant(this); 00070 } 00071 } 00072 }