Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/GenericWrapper.cs @ 8557

Last change on this file since 8557 was 8557, checked in by bburlacu, 12 years ago

#1772: Introduced base class and interface for tracing operators. Introduced SymbolicExpressionTreeNodeComparer interface to be implemented by node matching operators. Fixed bug in the TracingSymbolicExpressionTreeManipulator where nodes modified by the Full- and OnePoint tree shakers were not correctly detected. The SymbolicExpressionTreeNodeSimilarityComparer is now injected in the tracing genetic operators as a parameter.

File size: 876 bytes
Line 
1using HeuristicLab.Common;
2using HeuristicLab.Core;
3using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
4
5namespace HeuristicLab.EvolutionaryTracking {
6  [Item("Generic wrapper", "Wrapper class for non-item HeuristicLab objects")]
7  [StorableClass]
8  public class GenericWrapper<T> : NamedItem where T : class, IDeepCloneable {
9    [Storable]
10    public T Content { get; private set; }
11
12    public GenericWrapper(T content) {
13      Content = content;
14    }
15
16    [StorableConstructor]
17    private GenericWrapper(bool serializing) : base(serializing) { }
18
19    private GenericWrapper(GenericWrapper<T> original, Cloner cloner)
20      : base(original, cloner) {
21      this.Content = cloner.Clone(Content);
22    }
23
24    public override IDeepCloneable Clone(Cloner cloner) {
25      return new GenericWrapper<T>(this, cloner);
26    }
27  }
28}
Note: See TracBrowser for help on using the repository browser.