Changeset 14029 for branches/crossvalidation-2434/HeuristicLab.Problems.GeneticProgramming/3.3/LawnMower
- Timestamp:
- 07/08/16 14:40:02 (8 years ago)
- Location:
- branches/crossvalidation-2434
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/crossvalidation-2434
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Problems.GeneticProgramming/3.3/LawnMower/Interpreter.cs
r12911 r14029 26 26 27 27 namespace HeuristicLab.Problems.GeneticProgramming.LawnMower { 28 public class Interpreter {28 public static class Interpreter { 29 29 private enum Heading { 30 30 South, … … 45 45 } 46 46 47 48 47 public static bool[,] EvaluateLawnMowerProgram(int length, int width, ISymbolicExpressionTree tree) { 49 50 48 bool[,] lawn = new bool[length, width]; 51 49 var mowerState = new MowerState(); … … 56 54 return lawn; 57 55 } 58 59 56 60 57 private static Tuple<int, int> EvaluateLawnMowerProgram(ISymbolicExpressionTreeNode node, MowerState mowerState, bool[,] lawn, IEnumerable<ISymbolicExpressionTreeNode> adfs) { -
branches/crossvalidation-2434/HeuristicLab.Problems.GeneticProgramming/3.3/LawnMower/Problem.cs
r12911 r14029 50 50 } 51 51 52 #region item cloning and persistence 52 53 [StorableConstructor] 53 protected Problem(bool deserializing) 54 : base(deserializing) { 54 protected Problem(bool deserializing) : base(deserializing) { } 55 [StorableHook(HookType.AfterDeserialization)] 56 private void AfterDeserialization() { } 57 58 protected Problem(Problem original, Cloner cloner) : base(original, cloner) { } 59 public override IDeepCloneable Clone(Cloner cloner) { 60 return new Problem(this, cloner); 55 61 } 56 protected Problem(Problem original, Cloner cloner) 57 : base(original, cloner) { 58 } 62 #endregion 63 59 64 public Problem() 60 65 : base() { … … 87 92 } 88 93 89 90 [StorableHook(HookType.AfterDeserialization)]91 private void AfterDeserialization() { }92 93 94 public override double Evaluate(ISymbolicExpressionTree tree, IRandom random) { 94 95 var length = LawnLengthParameter.Value.Value; … … 105 106 return numberOfMowedCells; 106 107 } 107 108 public override IDeepCloneable Clone(Cloner cloner) {109 return new Problem(this, cloner);110 }111 108 } 112 109 } -
branches/crossvalidation-2434/HeuristicLab.Problems.GeneticProgramming/3.3/LawnMower/Solution.cs
r12911 r14029 37 37 public double Quality { get; private set; } 38 38 39 #region item cloning and persistence 39 40 [StorableConstructor] 40 41 private Solution(bool deserializing) : base(deserializing) { } 42 [StorableHook(HookType.AfterDeserialization)] 43 private void AfterDeserialization() { } 44 41 45 private Solution(Solution original, Cloner cloner) 42 46 : base(original, cloner) { … … 46 50 this.Quality = original.Quality; 47 51 } 52 public override IDeepCloneable Clone(Cloner cloner) { 53 return new Solution(this, cloner); 54 } 55 #endregion 48 56 49 57 public Solution(ISymbolicExpressionTree tree, int length, int width, double quality) … … 54 62 this.Quality = quality; 55 63 } 56 [StorableHook(HookType.AfterDeserialization)]57 private void AfterDeserialization() {58 }59 public override IDeepCloneable Clone(Cloner cloner) {60 return new Solution(this, cloner);61 }62 64 } 63 65 }
Note: See TracChangeset
for help on using the changeset viewer.