Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/17/14 18:52:37 (9 years ago)
Author:
bburlacu
Message:

#1772: Fixed cloning in tracking operators for symbolic data analysis. Added unit tests (in progress).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs

    r11639 r11694  
    4646      : base(original, cloner) {
    4747      RebuildDictionaries();
     48
     49      foreach (var arcs in Vertices.Select(v => (List<IArc>)((Vertex)v).InArcs)) {
     50        arcs.Sort((a, b) => {
     51          if (a.Data == b.Data)
     52            return 0;
     53          if (a.Data == null)
     54            return -1;
     55          return 1;
     56        });
     57      }
    4858    }
    4959
     
    6070    private void AfterDeserialization() {
    6171      RebuildDictionaries();
     72
     73      foreach (var arcs in Vertices.Select(v => (List<IArc>)((Vertex)v).InArcs)) {
     74        arcs.Sort((a, b) => {
     75          if (a.Data == b.Data)
     76            return 0;
     77          if (a.Data == null)
     78            return -1;
     79          return 1;
     80        });
     81      }
    6282    }
    6383
     
    91111        throw new InvalidOperationException("Duplicate ids are not allowed in the genealogy graph.");
    92112      idMap[genealogyGraphNode.Id] = genealogyGraphNode;
    93       if (!Ranks.ContainsKey(genealogyGraphNode.Rank))
    94         Ranks[genealogyGraphNode.Rank] = new List<IGenealogyGraphNode>();
    95       Ranks[genealogyGraphNode.Rank].Add(genealogyGraphNode);
     113      if (!ranks.ContainsKey(genealogyGraphNode.Rank))
     114        ranks[genealogyGraphNode.Rank] = new List<IGenealogyGraphNode>();
     115      ranks[genealogyGraphNode.Rank].Add(genealogyGraphNode);
    96116    }
    97117
Note: See TracChangeset for help on using the changeset viewer.