Changeset 14952 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/Expression.cs
- Timestamp:
- 05/10/17 11:23:05 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/Expression.cs
r14908 r14952 2 2 using System; 3 3 using System.Collections.Generic; 4 5 using HeuristicLab.Common; 6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 4 7 using HeuristicLab.Problems.ProgramSynthesis.Push.Data.Pool; 5 8 … … 7 10 8 11 [Serializable] 9 public abstract class Expression : IPooledObject { 12 [StorableClass] 13 public abstract class Expression : IDeepCloneable, IPooledObject { 14 15 protected Expression() { } 16 17 [StorableConstructor] 18 protected Expression(bool deserializing) { } 19 10 20 public bool IsProgram { get { return GetType() == typeof(PushProgram); } } 11 21 … … 20 30 } 21 31 22 //public abstract bool IsNoop(IInternalPushInterpreter interpreter); 32 public abstract bool IsNoop(IInternalPushInterpreter interpreter); 33 public abstract void Eval(IInternalPushInterpreter interpreter); 23 34 24 public abstract bool Eval(IInternalPushInterpreter interpreter); 35 public bool TryEval(IInternalPushInterpreter interpreter) { 36 if (IsNoop(interpreter)) 37 return false; 38 39 Eval(interpreter); 40 return true; 41 } 25 42 26 43 public override string ToString() { … … 28 45 } 29 46 47 public object Clone() { 48 return this; 49 } 50 51 public IDeepCloneable Clone(Cloner cloner) { 52 return this; 53 } 54 30 55 void IPooledObject.Reset() { } 31 56 }
Note: See TracChangeset
for help on using the changeset viewer.