Last change
on this file since 9593 was
9570,
checked in by melkaref, 11 years ago
|
Fixed SolutionCodeView to use the specified Path variable
|
File size:
2.0 KB
|
Rev | Line | |
---|
[9565] | 1 | using HeuristicLab.Common;
|
---|
| 2 | using HeuristicLab.Core;
|
---|
| 3 | using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
|
---|
| 4 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
| 5 |
|
---|
| 6 | namespace HeuristicLab.Problems.Robocode
|
---|
| 7 | {
|
---|
| 8 | [StorableClass]
|
---|
| 9 | public sealed class Solution : NamedItem
|
---|
| 10 | {
|
---|
| 11 | //private int moves;
|
---|
| 12 | //[Storable]
|
---|
| 13 | //public int Moves
|
---|
| 14 | //{
|
---|
| 15 | // get { return moves; }
|
---|
| 16 | // private set { this.moves = value; }
|
---|
| 17 | //}
|
---|
| 18 | //private int shots;
|
---|
| 19 | //[Storable]
|
---|
| 20 | //public int Shots
|
---|
| 21 | //{
|
---|
| 22 | // get { return shots; }
|
---|
| 23 | // private set { this.shots = value; }
|
---|
| 24 | //}
|
---|
| 25 | private ISymbolicExpressionTree tree;
|
---|
| 26 | [Storable]
|
---|
| 27 | public ISymbolicExpressionTree Tree
|
---|
| 28 | {
|
---|
| 29 | get { return tree; }
|
---|
| 30 | private set { this.tree = value; }
|
---|
| 31 | }
|
---|
| 32 |
|
---|
[9570] | 33 | private string path;
|
---|
[9565] | 34 | [Storable]
|
---|
[9570] | 35 | public string Path
|
---|
[9565] | 36 | {
|
---|
[9570] | 37 | get { return path; }
|
---|
| 38 | private set { this.path = value; }
|
---|
[9565] | 39 | }
|
---|
| 40 |
|
---|
| 41 | [StorableConstructor]
|
---|
| 42 | private Solution(bool deserializing) : base(deserializing) { }
|
---|
| 43 | private Solution(Solution original, Cloner cloner)
|
---|
| 44 | : base(original, cloner)
|
---|
| 45 | {
|
---|
| 46 | //this.moves = original.moves;
|
---|
| 47 | //this.shots = original.shots;
|
---|
| 48 | this.tree = cloner.Clone(tree);
|
---|
| 49 | }
|
---|
| 50 |
|
---|
[9570] | 51 | public Solution(ISymbolicExpressionTree tree, string path)// int moves, int shots)
|
---|
[9565] | 52 | : base("Solution", "A tank program.")
|
---|
| 53 | {
|
---|
| 54 | this.tree = tree;
|
---|
[9570] | 55 | this.path = path;
|
---|
[9565] | 56 | //this.moves = moves;
|
---|
| 57 | //this.shots = shots;
|
---|
| 58 | }
|
---|
| 59 | [StorableHook(HookType.AfterDeserialization)]
|
---|
| 60 | private void AfterDeserialization()
|
---|
| 61 | {
|
---|
| 62 | }
|
---|
| 63 | public override IDeepCloneable Clone(Cloner cloner)
|
---|
| 64 | {
|
---|
| 65 | return new Solution(this, cloner);
|
---|
| 66 | }
|
---|
| 67 | }
|
---|
| 68 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.