Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/19/15 09:57:06 (9 years ago)
Author:
mkommend
Message:

#2472: Moved cloning and persistence code near the default ctor for all new GP problems.

Location:
trunk/sources/HeuristicLab.Problems.GeneticProgramming/3.3/ArtificialAnt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.GeneticProgramming/3.3/ArtificialAnt/Interpreter.cs

    r12911 r13269  
    3232    public int FoodEaten { get; private set; }
    3333    public BoolMatrix World { get; private set; }
    34 
    3534    public ISymbolicExpressionTree Expression { get; private set; }
    3635
     36    public int ElapsedTime { get; set; }
    3737
    38     public int ElapsedTime { get; set; }
    3938    private int currentDirection;
    4039    private int currentAntLocationRow;
  • trunk/sources/HeuristicLab.Problems.GeneticProgramming/3.3/ArtificialAnt/Problem.cs

    r13055 r13269  
    2222using System;
    2323using System.Diagnostics.Contracts;
    24 using System.Drawing.Text;
    2524using System.Linq;
    2625using HeuristicLab.Common;
     
    103102    }
    104103
     104    #region item cloning and persistence
     105    // persistence
     106    [StorableConstructor]
     107    private Problem(bool deserializing) : base(deserializing) { }
     108    [StorableHook(HookType.AfterDeserialization)]
     109    private void AfterDeserialization() { }
     110
     111    // cloning
     112    private Problem(Problem original, Cloner cloner) : base(original, cloner) { }
     113    public override IDeepCloneable Clone(Cloner cloner) {
     114      return new Problem(this, cloner);
     115    }
     116    #endregion
     117
    105118    public Problem()
    106119      : base() {
     
    136149    }
    137150
    138     // persistence
    139     [StorableConstructor]
    140     private Problem(bool deserializing) : base(deserializing) { }
    141     [StorableHook(HookType.AfterDeserialization)]
    142     private void AfterDeserialization() {
    143     }
    144 
    145     // cloning
    146     private Problem(Problem original, Cloner cloner)
    147       : base(original, cloner) {
    148     }
    149     public override IDeepCloneable Clone(Cloner cloner) {
    150       return new Problem(this, cloner);
    151     }
    152 
    153151    #region helpers
    154152    private bool[,] ToBoolMatrix(char[][] ch) {
  • trunk/sources/HeuristicLab.Problems.GeneticProgramming/3.3/ArtificialAnt/Trail.cs

    r12911 r13269  
    2020#endregion
    2121
    22 using System;
    2322using System.Drawing;
    2423using HeuristicLab.Common;
     
    5453    }
    5554
     55    #region item cloning and persistence
    5656    [StorableConstructor]
    5757    private Solution(bool deserializing) : base(deserializing) { }
     
    7070      return new Solution(this, cloner);
    7171    }
     72    #endregion
    7273  }
    7374}
Note: See TracChangeset for help on using the changeset viewer.