Changeset 14905 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/Expression.cs
- Timestamp:
- 05/02/17 20:42:40 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/Expression.cs
r14834 r14905 2 2 using System; 3 3 using System.Collections.Generic; 4 5 using HeuristicLab.Problems.ProgramSynthesis.Push.Attributes;6 4 using HeuristicLab.Problems.ProgramSynthesis.Push.Data.Pool; 7 5 … … 10 8 [Serializable] 11 9 public abstract class Expression : IPooledObject { 12 public bool IsProgram { get { return this.GetType() == typeof(PushProgram); } }10 public bool IsProgram { get { return GetType() == typeof(PushProgram); } } 13 11 14 12 public static readonly IReadOnlyCollection<Expression> EmptyContainer = new Expression[0]; … … 18 16 get 19 17 { 20 var attribute = (PushExpressionAttribute)Attribute.GetCustomAttribute(this.GetType(), typeof(PushExpressionAttribute)); 21 22 return attribute != null 23 ? attribute.ExpressionName 24 : string.Empty; 18 return ExpressionTable.TypeToAttributeTable[GetType()].ExpressionName; 25 19 } 26 20 } 21 22 //public abstract bool IsNoop(IInternalPushInterpreter interpreter); 27 23 28 24 public abstract bool Eval(IInternalPushInterpreter interpreter);
Note: See TracChangeset
for help on using the changeset viewer.