Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/05/13 10:27:17 (11 years ago)
Author:
ascheibe
Message:

#1886 renamed some properties in SolutionInformation as suggested by swagner

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.SolutionCaching/3.3/SolutionInformation.cs

    r10096 r10105  
    2727
    2828namespace HeuristicLab.Analysis.SolutionCaching {
    29   public enum ProducedBy { Crossover, Mutation, CrossoverAndMutation, Move, Other };
     29  public enum ProducedBy { Other = 0, Crossover = 1, Mutation = 2, CrossoverAndMutation = 3, Move = 4 };
    3030
    3131  [Item("SolutionInformation", "Stores meta-information about a solution.")]
     
    3535    public ProducedBy ProducedBy { get; set; }
    3636    [Storable]
    37     public List<T> ParentList { get; set; }
     37    public List<T> Predecessors { get; set; }
    3838    [Storable]
    39     public int Generation { get; set; }
     39    public int Iteration { get; set; }
    4040    [Storable]
    4141    public ResultCollection InfoStore { get; set; }
    4242
    4343    public SolutionInformation() {
    44       ParentList = new List<T>();
     44      Predecessors = new List<T>();
    4545      InfoStore = new ResultCollection();
    4646    }
     
    5151      : base(original, cloner) {
    5252      this.ProducedBy = original.ProducedBy;
    53       this.ParentList = new List<T>(original.ParentList);
    54       this.Generation = original.Generation;
     53      this.Predecessors = new List<T>(original.Predecessors);
     54      this.Iteration = original.Iteration;
    5555      this.InfoStore = (ResultCollection)original.InfoStore.Clone(cloner);
    5656    }
     
    6464      if (pi == null) return false;
    6565
    66       if (ProducedBy == pi.ProducedBy && Generation == pi.Generation) {
    67         if (pi.ParentList == null && ParentList == null) return true;
    68         if (pi.ParentList != null && ParentList == null ||
    69           pi.ParentList == null && ParentList != null) return false;
    70         if (pi.ParentList.Count != ParentList.Count) return false;
     66      if (ProducedBy == pi.ProducedBy && Iteration == pi.Iteration) {
     67        if (pi.Predecessors == null && Predecessors == null) return true;
     68        if (pi.Predecessors != null && Predecessors == null ||
     69          pi.Predecessors == null && Predecessors != null) return false;
     70        if (pi.Predecessors.Count != Predecessors.Count) return false;
    7171
    72         foreach (var p in ParentList) {
    73           if (!pi.ParentList.Contains(p)) return false;
     72        foreach (var p in Predecessors) {
     73          if (!pi.Predecessors.Contains(p)) return false;
    7474        }
    7575        foreach (IResult info in InfoStore) {
Note: See TracChangeset for help on using the changeset viewer.