Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10822


Ignore:
Timestamp:
05/07/14 17:15:34 (11 years ago)
Author:
bburlacu
Message:

#1772: Partially fixed fragment detection and tracing in the case of mutation.

Location:
branches/HeuristicLab.EvolutionTracking
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs

    r10801 r10822  
    5050      if (GenealogyGraph.Contains(ChildParameter.ActualValue)) {
    5151        // if the graph already contains a vertex representing the child, it means that the child is a product of crossover
    52         // when mutation follows after crossover, some changes need to be made
     52        // when mutation follows after crossover, some changes need to be made to the graph to maintain consistency
    5353        var child = ChildParameter.ActualValue;
    5454        var clone = (T)child.Clone();
     
    5858        // adjust parent-child(clone) relationship in the graph
    5959        var parents = vChild.Parents;
    60         // if there's a fragment, save it
    61         vChild.InArcs = new List<IGenealogyGraphArc>();
    6260        foreach (var p in parents) {
    6361          foreach (var a in p.OutArcs.Where(a => a.Target == vChild)) {
     
    6664          vClone.AddReverseArc(p);
    6765        }
     66        vClone.InArcs.Last().Data = vChild.InArcs.Last().Data;
     67        vChild.InArcs = new List<IGenealogyGraphArc>();
    6868        vChild.AddReverseArc(vClone);
    6969        vClone.AddForwardArc(vChild);
    70         vClone.InArcs.Last().Data = vChild.InArcs.Last().Data;
    71 
    7270      } else { // this needs to be checked
    7371        var vChild = new GenealogyGraphNode<T> { Content = ChildParameter.ActualValue, Rank = Generations.Value };
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs

    r10462 r10822  
    2828using HeuristicLab.Data;
    2929using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    30 using HeuristicLab.EvolutionTracking;
    3130using HeuristicLab.Optimization;
    3231using HeuristicLab.Parameters;
     
    358357        op.BeforeCrossoverOperator = new SymbolicDataAnalysisExpressionBeforeCrossoverOperator();
    359358        op.AfterCrossoverOperator = new SymbolicDataAnalysisExpressionAfterCrossoverOperator();
    360         op.BeforeManipulatorOperator = new BeforeManipulatorOperator<ISymbolicExpressionTree>();
    361         op.AfterManipulatorOperator = new AfterManipulatorOperator<ISymbolicExpressionTree>();
     359        op.BeforeManipulatorOperator = new SymbolicDataAnalysisExpressionBeforeManipulatorOperator();
     360        op.AfterManipulatorOperator = new SymbolicDataAnalysisExpressionAfterManipulatorOperator();
    362361        // get crossover parameter names
    363362        var crossover = operators.OfType<ISymbolicExpressionTreeCrossover>().FirstOrDefault();
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs

    r10755 r10822  
    3030        fragment = new Fragment<ISymbolicExpressionTreeNode> {
    3131          Root = a,
    32           Index1 = i
     32          Index1 = i,
     33          Index2 = i
    3334        };
     35        break;
    3436      }
     37
     38      //      if (fragment == null) {
     39      //        throw new Exception("SymbolicDataAnalysisExpressionAfterManipulatorOperator: Could not identify fragment");
     40      //      }
    3541
    3642      vChild.InArcs.First().Data = fragment;
Note: See TracChangeset for help on using the changeset viewer.