Changeset 11233 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic
- Timestamp:
- 07/30/14 01:41:54 (10 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r11232 r11233 176 176 <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs" /> 177 177 <Compile Include="Analyzers\SymbolicDataAnalysisGenealogyAnalyzer.cs" /> 178 <Compile Include="Analyzers\SymbolicDataAnalysisPopulationDiversityAnalyzer.cs" />179 178 <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer.cs" /> 180 179 <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer.cs" /> … … 190 189 <SubType>Code</SubType> 191 190 </Compile> 192 <Compile Include="DirectedGraph\Arc.cs" />193 <Compile Include="DirectedGraph\DirectedGraph.cs" />194 <Compile Include="DirectedGraph\Interfaces\IArc.cs" />195 <Compile Include="DirectedGraph\Interfaces\IDirectedGraph.cs" />196 <Compile Include="DirectedGraph\Interfaces\IVertex.cs" />197 <Compile Include="DirectedGraph\Vertex.cs" />198 191 <Compile Include="Interfaces\IModelBacktransformator.cs" /> 199 192 <Compile Include="Interfaces\IDistanceCalculator.cs" /> … … 213 206 <Compile Include="SlidingWindow\SlidingWindowQualitiesAnalyzer.cs" /> 214 207 <Compile Include="SlidingWindow\SlidingWindowVisualizer.cs" /> 215 <Compile Include="SymbolGraph\FPGraph.cs" />216 <Compile Include="SymbolGraph\SymbolGraph.cs" />217 208 <Compile Include="SymbolicDataAnalysisExpressionPruningOperator.cs" /> 218 209 <Compile Include="SymbolicDataAnalysisExpressionTreeSimilarityCalculator.cs" /> -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
r11232 r11233 235 235 Operators.Add(new SingleObjectivePopulationDiversityAnalyzer()); 236 236 Operators.Add(new BottomUpSimilarityCalculator()); 237 Operators.Add(new SymbolicDataAnalysisGenealogyAnalyzer()); 237 238 ParameterizeOperators(); 238 239 } … … 361 362 op.SimilarityCalculator = operators.OfType<BottomUpSimilarityCalculator>().SingleOrDefault(); 362 363 } 364 // add tracking analyzer 365 foreach (var op in operators.OfType<SymbolicDataAnalysisGenealogyAnalyzer>()) { 366 op.BeforeCrossoverOperatorParameter.ActualValue = new SymbolicDataAnalysisExpressionBeforeCrossoverOperator(); 367 op.AfterCrossoverOperatorParameter.ActualValue = new SymbolicDataAnalysisExpressionAfterCrossoverOperator(); 368 op.BeforeManipulatorOperatorParameter.ActualValue = new SymbolicDataAnalysisExpressionBeforeManipulatorOperator(); 369 op.AfterManipulatorOperatorParameter.ActualValue = new SymbolicDataAnalysisExpressionAfterManipulatorOperator(); 370 // get crossover parameter names 371 var crossover = operators.OfType<ISymbolicExpressionTreeCrossover>().FirstOrDefault(); 372 if (crossover != null) { 373 op.BeforeCrossoverOperator.ParentsParameter.ActualName = crossover.ParentsParameter.Name; 374 op.AfterCrossoverOperator.ParentsParameter.ActualName = crossover.ParentsParameter.Name; 375 op.BeforeCrossoverOperator.ChildParameter.ActualName = crossover.ChildParameter.Name; 376 op.AfterCrossoverOperator.ChildParameter.ActualName = crossover.ChildParameter.Name; 377 } 378 // get manipulator parameter names 379 var manipulator = operators.OfType<ISymbolicExpressionTreeManipulator>().FirstOrDefault(); 380 if (manipulator != null) { 381 op.BeforeManipulatorOperator.ChildParameter.ActualName = manipulator.SymbolicExpressionTreeParameter.Name; 382 op.AfterManipulatorOperator.ChildParameter.ActualName = manipulator.SymbolicExpressionTreeParameter.Name; 383 } 384 var creator = operators.OfType<ISymbolicExpressionTreeCreator>().FirstOrDefault(); 385 if (creator != null) { 386 op.PopulationParameter.ActualName = creator.SymbolicExpressionTreeParameter.ActualName; 387 } 388 } 363 389 } 364 390 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterCrossoverOperator.cs
r10897 r11233 30 30 public class SymbolicDataAnalysisExpressionAfterCrossoverOperator : AfterCrossoverOperator<ISymbolicExpressionTree> { 31 31 public override IOperation Apply() { 32 var childVertex = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph.Get Vertex(ChildParameter.ActualValue);32 var childVertex = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph.GetByContent(ChildParameter.ActualValue); 33 33 var arcs = childVertex.InArcs.ToList(); 34 34 var nodes0 = (List<ISymbolicExpressionTreeNode>)arcs[0].Data; -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs
r10897 r11233 40 40 41 41 public override IOperation Apply() { 42 var vChild = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph.Get Vertex(ChildParameter.ActualValue);42 var vChild = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph.GetByContent(ChildParameter.ActualValue); 43 43 var nodesBefore = (List<ISymbolicExpressionTreeNode>)vChild.InArcs.First().Data; 44 44 var nodesAfter = ChildParameter.ActualValue.IterateNodesPrefix().ToList(); -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeCrossoverOperator.cs
r10897 r11233 30 30 var result = base.Apply(); // the base operator will add the child to the graph before the actual crossover operation takes place 31 31 var parents = ParentsParameter.ActualValue.ToList(); 32 var childVertex = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph.Get Vertex(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) 33 33 var arcs = childVertex.InArcs.ToList(); 34 34 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeManipulatorOperator.cs
r10897 r11233 30 30 var result = base.Apply(); // add the vertex in the genealogy graph 31 31 32 var vChild = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph.Get Vertex(ChildParameter.ActualValue);32 var vChild = (IGenealogyGraphNode<ISymbolicExpressionTree>)GenealogyGraph.GetByContent(ChildParameter.ActualValue); 33 33 var vClone = vChild.Parents.Last(); 34 34 vChild.InArcs.First().Data = vClone.Content.IterateNodesPrefix().ToList(); -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionTracing.cs
r10888 r11233 30 30 public static class SymbolicDataAnalysisExpressionTracing { 31 31 public static FragmentGraph TraceSubtree(IGenealogyGraphNode<ISymbolicExpressionTree> graphNode, int subtreeIndex) { 32 var graph = new FragmentGraph { AllowDuplicateContent = true };32 var graph = new FragmentGraph(); 33 33 var nodes = Trace(graphNode, subtreeIndex); 34 34 foreach (var n in nodes) { … … 51 51 while (true) { 52 52 if (!node.Parents.Any()) { 53 var fragmentNode = new FragmentNode { 54 Content = node, 53 var fragmentNode = new FragmentNode(node) { 55 54 SubtreeIndex = index, 56 55 }; 57 56 if (parent != null) { 58 57 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); 61 63 } 62 64 yield return fragmentNode; // no tracing if there are no parents … … 79 81 if (parents.Count == 1) { 80 82 // we are tracing a mutation operation 81 var fragmentNode = new FragmentNode { 82 Content = node, 83 var fragmentNode = new FragmentNode(node) { 83 84 SubtreeIndex = index, 84 85 FragmentIndex = fragment.Index1 … … 86 87 if (parent != null) { 87 88 var arc = new Arc(parent, fragmentNode); 88 parent.Add ForwardArc(arc);89 fragmentNode.Add ReverseArc(arc);89 parent.AddArc(arc); 90 fragmentNode.AddArc(arc); 90 91 } 91 92 node = parents[0]; … … 138 139 if (fragment.Index1 < index + subtreeLength) { 139 140 // subtree contains fragment => bifurcation point in the fragment graph 140 var fragmentNode = new FragmentNode { 141 Content = node, 141 var fragmentNode = new FragmentNode(node) { 142 142 SubtreeIndex = index, 143 143 FragmentIndex = fragment.Index1 … … 145 145 if (parent != null) { 146 146 var arc = new Arc(parent, fragmentNode); 147 parent.Add ForwardArc(arc);148 fragmentNode.Add ReverseArc(arc);147 parent.AddArc(arc); 148 fragmentNode.AddArc(arc); 149 149 } 150 150 yield return fragmentNode;
Note: See TracChangeset
for help on using the changeset viewer.