Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Problem/PushSolution.cs @ 14834

Last change on this file since 14834 was 14834, checked in by pkimmesw, 7 years ago

#2665 LexicaseSelector, Performance improvements, UI Fixes, Debugger only shows used stacks, fixed Debugger stepping, Added vector expressions, ERCOptions,

File size: 1.9 KB
Line 
1namespace HeuristicLab.Problems.ProgramSynthesis.Push.Problem {
2  using HeuristicLab.BenchmarkSuite.Problems;
3  using HeuristicLab.Common;
4  using HeuristicLab.Core;
5  using HeuristicLab.Encodings.IntegerVectorEncoding;
6  using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
7  using HeuristicLab.Problems.ProgramSynthesis.Push.Configuration;
8
9  [StorableClass]
10  public class PushSolution : NamedItem {
11    [Storable]
12    public readonly double Quality;
13    [Storable]
14    public readonly IntegerVector IntegerVector;
15    [Storable]
16    public readonly Data Data;
17    [Storable]
18    public readonly IRandom Random;
19    [Storable]
20    public readonly IReadOnlyPushConfiguration Config;
21    [Storable]
22    public readonly int DataStart;
23    [Storable]
24    public readonly int DataEnd;
25
26    [Storable]
27    public readonly bool Simplify;
28
29    public PushSolution(IntegerVector integerVector, double quality, Data data, IRandom random, IReadOnlyPushConfiguration config, int dataStart, int dataEnd, bool simplify = false)
30      : base("Solution", "A push solution.") {
31      IntegerVector = integerVector;
32      Quality = quality;
33      Data = data;
34      Random = random;
35      Config = config;
36      DataStart = dataStart;
37      DataEnd = dataEnd;
38      Simplify = simplify;
39    }
40
41    public PushSolution(PushSolution origin, Cloner cloner) : base(origin, cloner) {
42      IntegerVector = cloner.Clone(origin.IntegerVector);
43      Quality = origin.Quality;
44      Data = cloner.Clone(origin.Data);
45      Random = cloner.Clone(origin.Random);
46      Config = cloner.Clone(origin.Config);
47      DataStart = origin.DataStart;
48      DataEnd = origin.DataEnd;
49      Simplify = origin.Simplify;
50    }
51
52    [StorableConstructor]
53    private PushSolution(bool deserializing) : base(deserializing) { }
54
55    public override IDeepCloneable Clone(Cloner cloner) {
56      return new PushSolution(this, cloner);
57    }
58  }
59}
Note: See TracBrowser for help on using the repository browser.