Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/30/14 01:41:54 (10 years ago)
Author:
bburlacu
Message:

#1772: Worked towards integrating the new graph api with the tracking operators.

Location:
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterCrossoverOperator.cs

    r10897 r11233  
    3030  public class SymbolicDataAnalysisExpressionAfterCrossoverOperator : AfterCrossoverOperator<ISymbolicExpressionTree> {
    3131    public override IOperation Apply() {
    32       var childVertex = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph.GetVertex(ChildParameter.ActualValue);
     32      var childVertex = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph.GetByContent(ChildParameter.ActualValue);
    3333      var arcs = childVertex.InArcs.ToList();
    3434      var nodes0 = (List<ISymbolicExpressionTreeNode>)arcs[0].Data;
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs

    r10897 r11233  
    4040
    4141    public override IOperation Apply() {
    42       var vChild = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph.GetVertex(ChildParameter.ActualValue);
     42      var vChild = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph.GetByContent(ChildParameter.ActualValue);
    4343      var nodesBefore = (List<ISymbolicExpressionTreeNode>)vChild.InArcs.First().Data;
    4444      var nodesAfter = ChildParameter.ActualValue.IterateNodesPrefix().ToList();
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeCrossoverOperator.cs

    r10897 r11233  
    3030      var result = base.Apply(); // the base operator will add the child to the graph before the actual crossover operation takes place
    3131      var parents = ParentsParameter.ActualValue.ToList();
    32       var childVertex = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph.GetVertex(parents[0]); // use the parent since it is actually the child before crossover (and the ChildParameter doesn't have a value yet)
     32      var childVertex = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph.GetByContent(parents[0]); // use the parent since it is actually the child before crossover (and the ChildParameter doesn't have a value yet)
    3333      var arcs = childVertex.InArcs.ToList();
    3434
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeManipulatorOperator.cs

    r10897 r11233  
    3030      var result = base.Apply(); // add the vertex in the genealogy graph
    3131
    32       var vChild = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph.GetVertex(ChildParameter.ActualValue);
     32      var vChild = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph.GetByContent(ChildParameter.ActualValue);
    3333      var vClone = vChild.Parents.Last();
    3434      vChild.InArcs.First().Data = vClone.Content.IterateNodesPrefix().ToList();
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionTracing.cs

    r10888 r11233  
    3030  public static class SymbolicDataAnalysisExpressionTracing {
    3131    public static FragmentGraph TraceSubtree(IGenealogyGraphNode<ISymbolicExpressionTree> graphNode, int subtreeIndex) {
    32       var graph = new FragmentGraph { AllowDuplicateContent = true };
     32      var graph = new FragmentGraph();
    3333      var nodes = Trace(graphNode, subtreeIndex);
    3434      foreach (var n in nodes) {
     
    5151      while (true) {
    5252        if (!node.Parents.Any()) {
    53           var fragmentNode = new FragmentNode {
    54             Content = node,
     53          var fragmentNode = new FragmentNode(node) {
    5554            SubtreeIndex = index,
    5655          };
    5756          if (parent != null) {
    5857            var arc = new Arc(parent, fragmentNode);
    59             parent.AddForwardArc(arc);
    60             fragmentNode.AddReverseArc(arc);
     58            parent.AddArc(arc);
     59            fragmentNode.AddArc(arc);
     60
     61            //            parent.AddForwardArc(arc);
     62            //            fragmentNode.AddReverseArc(arc);
    6163          }
    6264          yield return fragmentNode; // no tracing if there are no parents
     
    7981        if (parents.Count == 1) {
    8082          // we are tracing a mutation operation
    81           var fragmentNode = new FragmentNode {
    82             Content = node,
     83          var fragmentNode = new FragmentNode(node) {
    8384            SubtreeIndex = index,
    8485            FragmentIndex = fragment.Index1
     
    8687          if (parent != null) {
    8788            var arc = new Arc(parent, fragmentNode);
    88             parent.AddForwardArc(arc);
    89             fragmentNode.AddReverseArc(arc);
     89            parent.AddArc(arc);
     90            fragmentNode.AddArc(arc);
    9091          }
    9192          node = parents[0];
     
    138139            if (fragment.Index1 < index + subtreeLength) {
    139140              // subtree contains fragment => bifurcation point in the fragment graph
    140               var fragmentNode = new FragmentNode {
    141                 Content = node,
     141              var fragmentNode = new FragmentNode(node) {
    142142                SubtreeIndex = index,
    143143                FragmentIndex = fragment.Index1
     
    145145              if (parent != null) {
    146146                var arc = new Arc(parent, fragmentNode);
    147                 parent.AddForwardArc(arc);
    148                 fragmentNode.AddReverseArc(arc);
     147                parent.AddArc(arc);
     148                fragmentNode.AddArc(arc);
    149149              }
    150150              yield return fragmentNode;
Note: See TracChangeset for help on using the changeset viewer.