Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/10/17 11:23:05 (8 years ago)
Author:
pkimmesw
Message:

#2665 Added IsNoop to Expression, Made Expressions storable, Fixed Debugger, Fixed and improved problem data and result visualisation, Added custom ErcOption view, Added problem difficulty to problem data name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/StatefulExpression.cs

    r14908 r14952  
    11namespace HeuristicLab.Problems.ProgramSynthesis.Push.Expressions {
    22  using System;
    3 
     3  using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    44  using HeuristicLab.Problems.ProgramSynthesis.Push.Data.Pool;
    55
    66  [Serializable]
     7  [StorableClass]
    78  public abstract class StatefulExpression<T> : Expression, IPooledObject {
     9    [Storable]
    810    public T State { get; protected set; }
    911    private int? hashCode;
     
    1315      State = state;
    1416    }
     17
     18    [StorableConstructor]
     19    protected StatefulExpression(bool deserializing) : base(deserializing) { }
    1520
    1621    protected virtual int CalcHashCode() {
     
    2227      get
    2328      {
    24         if (stringRepresentation == null) stringRepresentation = State.ToString();
    25         return stringRepresentation;
     29        return stringRepresentation ?? (stringRepresentation = State.ToString());
    2630      }
    2731    }
Note: See TracChangeset for help on using the changeset viewer.