1 | namespace 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 ProblemData 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 | [Storable]
|
---|
26 | public readonly bool Simplify;
|
---|
27 |
|
---|
28 | public PushSolution(IntegerVector integerVector, double quality, ProblemData data, IRandom random, IReadOnlyPushConfiguration config, int dataStart, int dataEnd, bool simplify = false)
|
---|
29 | : base("Solution", "A push solution.") {
|
---|
30 | IntegerVector = integerVector;
|
---|
31 | Quality = quality;
|
---|
32 | Data = data;
|
---|
33 | Random = random;
|
---|
34 | Config = config;
|
---|
35 | DataStart = dataStart;
|
---|
36 | DataEnd = dataEnd;
|
---|
37 | Simplify = simplify;
|
---|
38 | }
|
---|
39 |
|
---|
40 | public PushSolution(PushSolution origin, Cloner cloner) : base(origin, cloner) {
|
---|
41 | IntegerVector = cloner.Clone(origin.IntegerVector);
|
---|
42 | Quality = origin.Quality;
|
---|
43 | Data = cloner.Clone(origin.Data);
|
---|
44 | Random = cloner.Clone(origin.Random);
|
---|
45 | Config = cloner.Clone(origin.Config);
|
---|
46 | DataStart = origin.DataStart;
|
---|
47 | DataEnd = origin.DataEnd;
|
---|
48 | Simplify = origin.Simplify;
|
---|
49 | }
|
---|
50 |
|
---|
51 | [StorableConstructor]
|
---|
52 | private PushSolution(bool deserializing) : base(deserializing) { }
|
---|
53 |
|
---|
54 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
55 | return new PushSolution(this, cloner);
|
---|
56 | }
|
---|
57 | }
|
---|
58 | }
|
---|