Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/23/17 01:11:18 (8 years ago)
Author:
pkimmesw
Message:

#2665 simplifier, push solution results view, performance improvements, small bug fixes, ui fixes

File:
1 edited

Legend:

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

    r14746 r14777  
    11namespace HeuristicLab.Problems.ProgramSynthesis.Push.Expressions {
    2   public abstract class StatefulExpression<T> : Expression {
    3     public readonly T State;
     2  using System;
     3
     4  using HeuristicLab.Problems.ProgramSynthesis.Push.Data.Pool;
     5
     6  [Serializable]
     7  public abstract class StatefulExpression<T> : Expression, IPooledObject {
     8    public T State { get; protected set; }
    49    private int? hashCode;
     10    private string stringRepresentation;
    511
    612    protected StatefulExpression(T state) {
     
    1016    protected virtual int CalcHashCode() {
    1117      return this.State.GetHashCode();
     18    }
     19
     20    public override string StringRepresentation
     21    {
     22      get
     23      {
     24        if (stringRepresentation == null) stringRepresentation = this.State.ToString();
     25        return stringRepresentation;
     26      }
    1227    }
    1328
     
    4055      return hashCode.Value;
    4156    }
     57
     58    public void Reset() {
     59      State = default(T);
     60    }
    4261  }
    4362}
Note: See TracChangeset for help on using the changeset viewer.