Changeset 10830
- Timestamp:
- 05/09/14 15:11:16 (11 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs
r10827 r10830 53 53 54 54 private void Clear() { 55 if (nodeMap == null) 56 nodeMap = new Dictionary<IGenealogyGraphNode, VisualGenealogyGraphNode>(); 57 else nodeMap.Clear(); 58 59 if (arcMap == null) 60 arcMap = new Dictionary<Tuple<VisualGenealogyGraphNode, VisualGenealogyGraphNode>, VisualGenealogyGraphArc>(); 61 else arcMap.Clear(); 55 nodeMap = new Dictionary<IGenealogyGraphNode, VisualGenealogyGraphNode>(); 56 arcMap = new Dictionary<Tuple<VisualGenealogyGraphNode, VisualGenealogyGraphNode>, VisualGenealogyGraphArc>(); 62 57 63 58 Chart.Group.Clear(); … … 118 113 foreach (var node in nodes) { 119 114 var brush = new SolidBrush(node.GetColor()); 120 121 115 var visualNode = new VisualGenealogyGraphNode(Chart, x, y, x + diameter, y + diameter, defaultPen, brush) { 122 116 Data = node, … … 145 139 var pen = Pens.Transparent; 146 140 var visualArc = AddArc(Chart, visualParent, visualNode, pen); 147 if (!arcMap.ContainsKey(Tuple.Create(visualParent, visualNode))) 141 if (!arcMap.ContainsKey(Tuple.Create(visualParent, visualNode))) { 148 142 arcMap.Add(Tuple.Create(visualParent, visualNode), visualArc); 143 } 149 144 } 150 145 } … … 233 228 brush.Color = node.Data.GetColor(); 234 229 var arcs = arcSelector(node); 230 var pen = new Pen(Color.Transparent); 235 231 foreach (var arc in arcs) { 236 232 var source = arc.Source.Data; … … 238 234 var start = new Point((int)arc.Start.X, (int)arc.Start.Y); 239 235 var end = new Point((int)arc.End.X, (int)arc.End.Y); 240 arc.Pen = new Pen(Color.Transparent);236 arc.Pen = pen; 241 237 arc.Pen.Brush = new LinearGradientBrush(start, end, source.GetColor(), target.GetColor()); 242 238 DrawLineage(nodeSelector(arc), arcSelector, nodeSelector); … … 273 269 primitive.Pen = Pens.Transparent; 274 270 } else if (primitive is VisualGenealogyGraphNode) { 275 primitive.Brush = Brushes.Transparent;276 primitive.Pen = Pens.DarkGray;271 primitive.Brush = new SolidBrush(Color.Transparent); 272 primitive.Pen = new Pen(Color.DarkGray); 277 273 } 278 274 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs
r10755 r10830 13 13 public class GenealogyAnalyzer<T> : SingleSuccessorOperator, IAnalyzer 14 14 where T : class,IItem { 15 private const string GenerationsParameterName = "Generations"; 16 private const string ResultsParameterName = "Results"; 17 private const string PopulationGraphParameterName = "PopulationGraph"; 18 public const string QualityParameterName = "Quality"; 19 public const string PopulationParameterName = "SymbolicExpressionTree"; 20 21 private const string CrossoverParameterName = "Crossover"; 22 private const string ManipulatorParameterName = "Mutator"; 23 private const string SolutionCreatorParameterName = "SolutionCreator"; 24 25 private const string BeforeCrossoverOperatorParameterName = "BeforeCrossoverOperator"; 26 private const string AfterCrossoverOperatorParameterName = "AfterCrossoverOperator"; 27 28 private const string BeforeManipulatorOperatorParameterName = "BeforeManipulatorOperator"; 29 private const string AfterManipulatorOperatorParameterName = "AfterManipulatorOperator"; 30 31 private const string EnableCrossoverTrackingParameterName = "EnableCrossoverTracking"; 32 private const string EnableManipulatorTrackingParameterName = "EnableManipulatorTracking"; 33 private const string EnableSolutionCreatorTrackingParameterName = "EnableSolutionCreatorTracking"; // should always be enabled. maybe superfluous 15 34 16 35 public string CrossoverParentsParameterName { get; set; } … … 18 37 public string ManipulatorChildParameterName { get; set; } 19 38 20 public IScopeTreeLookupParameter<DoubleValue> QualityParameter; 21 public IScopeTreeLookupParameter<T> PopulationParameter; 22 23 public ICrossoverOperator<T> BeforeCrossoverOperator { get; set; } 24 public ICrossoverOperator<T> AfterCrossoverOperator { get; set; } 25 public IManipulatorOperator<T> BeforeManipulatorOperator { get; set; } 26 public IManipulatorOperator<T> AfterManipulatorOperator { get; set; } 27 28 private const string PopulationParameterName = "Population"; 29 private const string QualityParameterName = "Quality"; 30 31 private const string GenerationsParameterName = "Generations"; 32 private const string ResultsParameterName = "Results"; 33 private const string PopulationGraphParameterName = "PopulationGraph"; 34 35 private const string CrossoverParameterName = "Crossover"; 36 private const string ManipulatorParameterName = "Mutator"; 37 private const string SolutionCreatorParameterName = "SolutionCreator"; 38 39 private const string EnableCrossoverTrackingParameterName = "EnableCrossoverTracking"; 40 private const string EnableManipulatorTrackingParameterName = "EnableManipulatorTracking"; 41 private const string EnableSolutionCreatorTrackingParameterName = "EnableSolutionCreatorTracking"; // should always be enabled. maybe superfluous 39 public IScopeTreeLookupParameter<DoubleValue> QualityParameter { 40 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters[QualityParameterName]; } 41 } 42 43 public IScopeTreeLookupParameter<T> PopulationParameter { 44 get { return (IScopeTreeLookupParameter<T>)Parameters[PopulationParameterName]; } 45 } 46 47 public IValueParameter<ICrossoverOperator<T>> BeforeCrossoverOperatorParameter { 48 get { return (IValueParameter<ICrossoverOperator<T>>)Parameters[BeforeCrossoverOperatorParameterName]; } 49 } 50 public IValueParameter<ICrossoverOperator<T>> AfterCrossoverOperatorParameter { 51 get { return (IValueParameter<ICrossoverOperator<T>>)Parameters[AfterCrossoverOperatorParameterName]; } 52 } 53 public IValueParameter<IManipulatorOperator<T>> BeforeManipulatorOperatorParameter { 54 get { return (IValueParameter<IManipulatorOperator<T>>)Parameters[BeforeManipulatorOperatorParameterName]; } 55 } 56 public IValueParameter<IManipulatorOperator<T>> AfterManipulatorOperatorParameter { 57 get { return (IValueParameter<IManipulatorOperator<T>>)Parameters[AfterManipulatorOperatorParameterName]; } 58 } 42 59 43 60 #region parameter properties … … 63 80 get { return (ILookupParameter<IManipulator>)Parameters[ManipulatorParameterName]; } 64 81 } 82 65 83 public ILookupParameter<ISolutionCreator> SolutionCreatorParameter { 66 84 get { return (ILookupParameter<ISolutionCreator>)Parameters[SolutionCreatorParameterName]; } … … 74 92 public IManipulator Manipulator { 75 93 get { return ManipulatorParameter.ActualValue; } 94 } 95 public ICrossoverOperator<T> BeforeCrossoverOperator { 96 get { return BeforeCrossoverOperatorParameter.Value; } 97 } 98 public ICrossoverOperator<T> AfterCrossoverOperator { 99 get { return AfterCrossoverOperatorParameter.Value; } 100 } 101 public IManipulatorOperator<T> BeforeManipulatorOperator { 102 get { return BeforeManipulatorOperatorParameter.Value; } 103 } 104 public IManipulatorOperator<T> AfterManipulatorOperator { 105 get { return AfterManipulatorOperatorParameter.Value; } 76 106 } 77 107 public ISolutionCreator SolutionCreator { … … 120 150 Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName, "The number of generations so far.")); 121 151 Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName)); 122 PopulationParameter = new ScopeTreeLookupParameter<T>(PopulationParameterName); 123 QualityParameter = new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName); 124 Parameters.Add(PopulationParameter); 125 Parameters.Add(QualityParameter); 152 Parameters.Add(new ScopeTreeLookupParameter<T>(PopulationParameterName, "The population of individuals.")); 153 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName, "The individual qualities.")); 154 Parameters.Add(new ValueParameter<ICrossoverOperator<T>>(BeforeCrossoverOperatorParameterName)); 155 Parameters.Add(new ValueParameter<ICrossoverOperator<T>>(AfterCrossoverOperatorParameterName)); 156 Parameters.Add(new ValueParameter<IManipulatorOperator<T>>(BeforeManipulatorOperatorParameterName)); 157 Parameters.Add(new ValueParameter<IManipulatorOperator<T>>(AfterManipulatorOperatorParameterName)); 126 158 } 127 159 public override IDeepCloneable Clone(Cloner cloner) { … … 153 185 Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName)); 154 186 if (!Parameters.ContainsKey(PopulationParameterName)) { 155 PopulationParameter = new ScopeTreeLookupParameter<T>(PopulationParameterName); 156 Parameters.Add(PopulationParameter); 187 Parameters.Add(new ScopeTreeLookupParameter<T>(PopulationParameterName, "The population of individuals.")); 157 188 } 158 189 if (!Parameters.ContainsKey(QualityParameterName)) { 159 QualityParameter = new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName); 160 Parameters.Add(QualityParameter); 190 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName, "The individual qualities.")); 161 191 } 162 192 } … … 175 205 if (EnableCrossoverTracking.Value) { 176 206 if (BeforeCrossoverOperator != null) { 177 BeforeCrossoverOperator.ParentsParameter.ActualName = CrossoverParentsParameterName;178 BeforeCrossoverOperator.ChildParameter.ActualName = CrossoverChildParameterName;207 // BeforeCrossoverOperator.ParentsParameter.ActualName = CrossoverParentsParameterName; 208 // BeforeCrossoverOperator.ChildParameter.ActualName = CrossoverChildParameterName; 179 209 instrumentedCrossover.BeforeExecutionOperators.Add(BeforeCrossoverOperator); 180 210 } 181 211 if (AfterCrossoverOperator != null) { 182 AfterCrossoverOperator.ParentsParameter.ActualName = CrossoverParentsParameterName;183 AfterCrossoverOperator.ChildParameter.ActualName = CrossoverChildParameterName;212 // AfterCrossoverOperator.ParentsParameter.ActualName = CrossoverParentsParameterName; 213 // AfterCrossoverOperator.ChildParameter.ActualName = CrossoverChildParameterName; 184 214 instrumentedCrossover.AfterExecutionOperators.Add(AfterCrossoverOperator); 185 215 } … … 194 224 if (EnableManipulatorTracking.Value) { 195 225 if (BeforeManipulatorOperator != null) { 196 BeforeManipulatorOperator.ChildParameter.ActualName = ManipulatorChildParameterName;226 // BeforeManipulatorOperator.ChildParameter.ActualName = ManipulatorChildParameterName; 197 227 instrumentedManipulator.BeforeExecutionOperators.Add(BeforeManipulatorOperator); 198 228 } 199 229 if (AfterManipulatorOperator != null) { 200 AfterManipulatorOperator.ChildParameter.ActualName = ManipulatorChildParameterName;230 // AfterManipulatorOperator.ChildParameter.ActualName = ManipulatorChildParameterName; 201 231 instrumentedManipulator.AfterExecutionOperators.Add(AfterManipulatorOperator); 202 232 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Fragment.cs
r10755 r10830 5 5 namespace HeuristicLab.EvolutionTracking { 6 6 [StorableClass] 7 [Item("Fragment", "A fragment is an object that represents a piece of genetic information that was transferred from parent to child.")]7 [Item("Fragment", "A fragment is an object that represents a piece of inherited genetic information.")] 8 8 public class Fragment : Item, IFragment { 9 9 [Storable] … … 20 20 } 21 21 22 [StorableConstructor] 23 protected Fragment(bool deserializable) : base(deserializable) { } 24 22 25 protected Fragment(Fragment original, Cloner cloner) 23 26 : base(original, cloner) { … … 32 35 } 33 36 37 [StorableClass] 38 [Item("Fragment", "A fragment is an object that represents a piece of inherited genetic information.")] 34 39 public class Fragment<T> : Fragment, IFragment<T> where T : class { 35 40 public new T Root { … … 37 42 set { base.Root = value; } 38 43 } 44 45 protected Fragment(Fragment original, Cloner cloner) 46 : base(original, cloner) { 47 } 48 49 [StorableConstructor] 50 private Fragment(bool deserializable) : base(deserializable) { } 51 52 public Fragment() { } 39 53 } 40 54 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs
r10755 r10830 32 32 public class GenealogyGraph : DirectedGraph, IGenealogyGraph { 33 33 [Storable] 34 private Dictionary<double, Li nkedList<IGenealogyGraphNode>> ranks; // use a linked list for fast insertion/removal35 public Dictionary<double, Li nkedList<IGenealogyGraphNode>> Ranks {34 private Dictionary<double, List<IGenealogyGraphNode>> ranks; // use a linked list for fast insertion/removal 35 public Dictionary<double, List<IGenealogyGraphNode>> Ranks { 36 36 get { return ranks; } 37 37 set { ranks = value; } … … 49 49 protected GenealogyGraph(bool deserializing) : base(deserializing) { } 50 50 public GenealogyGraph() { 51 Ranks = new Dictionary<double, Li nkedList<IGenealogyGraphNode>>();51 Ranks = new Dictionary<double, List<IGenealogyGraphNode>>(); 52 52 } 53 53 public override void AddVertex(IVertex vertex) { 54 54 var node = (IGenealogyGraphNode)vertex; 55 55 if (!Ranks.ContainsKey(node.Rank)) 56 Ranks[node.Rank] = new Li nkedList<IGenealogyGraphNode>();57 Ranks[node.Rank].Add Last(node);56 Ranks[node.Rank] = new List<IGenealogyGraphNode>(); 57 Ranks[node.Rank].Add(node); 58 58 base.AddVertex(vertex); 59 59 } … … 89 89 // members and properties 90 90 [Storable] 91 private Dictionary<double, Li nkedList<IGenealogyGraphNode>> ranks;92 public Dictionary<double, Li nkedList<IGenealogyGraphNode>> Ranks {91 private Dictionary<double, List<IGenealogyGraphNode>> ranks; 92 public Dictionary<double, List<IGenealogyGraphNode>> Ranks { 93 93 get { return ranks; } 94 94 set { ranks = value; } … … 107 107 protected GenealogyGraph(bool deserializing) : base(deserializing) { } 108 108 public GenealogyGraph() { 109 Ranks = new Dictionary<double, Li nkedList<IGenealogyGraphNode>>();109 Ranks = new Dictionary<double, List<IGenealogyGraphNode>>(); 110 110 } 111 111 // methods … … 113 113 var node = (IGenealogyGraphNode<T>)vertex; 114 114 if (!Ranks.ContainsKey(node.Rank)) { 115 Ranks[node.Rank] = new Li nkedList<IGenealogyGraphNode>();115 Ranks[node.Rank] = new List<IGenealogyGraphNode>(); 116 116 } 117 Ranks[node.Rank].Add Last(node);117 Ranks[node.Rank].Add(node); 118 118 base.AddVertex(vertex); 119 119 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraph.cs
r10677 r10830 25 25 namespace HeuristicLab.EvolutionTracking { 26 26 public interface IGenealogyGraph : IDirectedGraph { 27 Dictionary<double, Li nkedList<IGenealogyGraphNode>> Ranks { get; }27 Dictionary<double, List<IGenealogyGraphNode>> Ranks { get; } 28 28 new IEnumerable<IGenealogyGraphNode> Nodes { get; } 29 29 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterCrossoverOperator.cs
r10650 r10830 29 29 [Item("AfterCrossoverOperator", "A generic operator that can record genealogical relationships between crossover parents and children.")] 30 30 public class AfterCrossoverOperator<T> : EvolutionTrackingOperator<T>, ICrossoverOperator<T> where T : class,IItem { 31 private const string DefaultParentsParameterName = "Parents"; 32 private const string DefaultChildParameterName = "Child"; 33 public IScopeTreeLookupParameter<T> ParentsParameter { get; set; } 34 public ILookupParameter<T> ChildParameter { get; set; } 31 private const string ParentsParameterName = "Parents"; 32 private const string ChildParameterName = "Child"; 33 34 public IScopeTreeLookupParameter<T> ParentsParameter { 35 get { return (IScopeTreeLookupParameter<T>)Parameters[ParentsParameterName]; } 36 } 37 public ILookupParameter<T> ChildParameter { 38 get { return (ILookupParameter<T>)Parameters[ChildParameterName]; } 39 } 35 40 36 41 protected AfterCrossoverOperator(AfterCrossoverOperator<T> original, Cloner cloner) … … 42 47 43 48 public AfterCrossoverOperator() { 44 ParentsParameter = new ScopeTreeLookupParameter<T>(DefaultParentsParameterName); 45 ChildParameter = new LookupParameter<T>(DefaultChildParameterName); 46 Parameters.Add(ParentsParameter); 47 Parameters.Add(ChildParameter); 49 Parameters.Add(new ScopeTreeLookupParameter<T>(ParentsParameterName)); 50 Parameters.Add(new LookupParameter<T>(ChildParameterName)); 48 51 } 49 52 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/AfterManipulatorOperator.cs
r10650 r10830 29 29 [Item("AfterCrossoverOperator", "Performs an action after the crossover operator is applied.")] 30 30 public class AfterManipulatorOperator<T> : EvolutionTrackingOperator<T>, IManipulatorOperator<T> where T : class,IItem { 31 private const string ChildParameterName = "Child"; 31 32 32 private const string ChildParameterName = "Child"; 33 public ILookupParameter<T> ChildParameter { get; set; } 33 public ILookupParameter<T> ChildParameter { 34 get { return (ILookupParameter<T>)Parameters[ChildParameterName]; } 35 } 34 36 35 37 protected AfterManipulatorOperator(AfterManipulatorOperator<T> original, Cloner cloner) … … 41 43 42 44 public AfterManipulatorOperator() { 43 ChildParameter = new LookupParameter<T>(ChildParameterName); 44 Parameters.Add(ChildParameter); 45 Parameters.Add(new LookupParameter<T>(ChildParameterName)); 45 46 } 46 47 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeCrossoverOperator.cs
r10675 r10830 33 33 [Item("AfterCrossoverOperator", "A generic operator that can record genealogical relationships between crossover parents and children.")] 34 34 public class BeforeCrossoverOperator<T> : EvolutionTrackingOperator<T>, ICrossoverOperator<T> where T : class,IItem { 35 private const string defaultParentsParameterName = "Parents";36 private const string defaultChildParameterName = "Child";35 private const string ParentsParameterName = "Parents"; 36 private const string ChildParameterName = "Child"; 37 37 38 public IScopeTreeLookupParameter<T> ParentsParameter { get; set; } 39 public ILookupParameter<T> ChildParameter { get; set; } 38 public IScopeTreeLookupParameter<T> ParentsParameter { 39 get { return (IScopeTreeLookupParameter<T>)Parameters[ParentsParameterName]; } 40 } 41 public ILookupParameter<T> ChildParameter { 42 get { return (ILookupParameter<T>)Parameters[ChildParameterName]; } 43 } 40 44 41 45 protected BeforeCrossoverOperator(BeforeCrossoverOperator<T> original, Cloner cloner) … … 47 51 48 52 public BeforeCrossoverOperator() { 49 ParentsParameter = new ScopeTreeLookupParameter<T>(defaultParentsParameterName); 50 ChildParameter = new LookupParameter<T>(defaultChildParameterName); 51 Parameters.Add(ParentsParameter); 52 Parameters.Add(ChildParameter); 53 Parameters.Add(new ScopeTreeLookupParameter<T>(ParentsParameterName)); 54 Parameters.Add(new LookupParameter<T>(ChildParameterName)); 53 55 } 54 56 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs
r10822 r10830 33 33 34 34 private const string ChildParameterName = "Child"; 35 public ILookupParameter<T> ChildParameter { get; set; } 35 36 public ILookupParameter<T> ChildParameter { 37 get { return (ILookupParameter<T>)Parameters[ChildParameterName]; } 38 } 36 39 37 40 protected BeforeManipulatorOperator(BeforeManipulatorOperator<T> original, Cloner cloner) … … 43 46 44 47 public BeforeManipulatorOperator() { 45 ChildParameter = new LookupParameter<T>(ChildParameterName); 46 Parameters.Add(ChildParameter); 48 Parameters.Add(new LookupParameter<T>(ChildParameterName)); 47 49 } 48 50 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/Interfaces/ICrossoverOperator.cs
r10347 r10830 3 3 namespace HeuristicLab.EvolutionTracking { 4 4 public interface ICrossoverOperator<T> : IOperator where T : class,IItem { 5 IScopeTreeLookupParameter<T> ParentsParameter { get; set;}6 ILookupParameter<T> ChildParameter { get; set;}5 IScopeTreeLookupParameter<T> ParentsParameter { get; } 6 ILookupParameter<T> ChildParameter { get; } 7 7 } 8 8 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/Interfaces/IManipulatorOperator.cs
r10347 r10830 3 3 namespace HeuristicLab.EvolutionTracking { 4 4 public interface IManipulatorOperator<T> : IOperator where T : class,IItem { 5 ILookupParameter<T> ChildParameter { get; set;}5 ILookupParameter<T> ChildParameter { get; } 6 6 } 7 7 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
r10822 r10830 355 355 // add tracking analyzer 356 356 foreach (var op in operators.OfType<SymbolicDataAnalysisGenealogyAnalyzer>()) { 357 op.BeforeCrossoverOperator = new SymbolicDataAnalysisExpressionBeforeCrossoverOperator();358 op.AfterCrossoverOperator = new SymbolicDataAnalysisExpressionAfterCrossoverOperator();359 op.BeforeManipulatorOperator = new SymbolicDataAnalysisExpressionBeforeManipulatorOperator();360 op.AfterManipulatorOperator = new SymbolicDataAnalysisExpressionAfterManipulatorOperator();357 op.BeforeCrossoverOperatorParameter.ActualValue = new SymbolicDataAnalysisExpressionBeforeCrossoverOperator(); 358 op.AfterCrossoverOperatorParameter.ActualValue = new SymbolicDataAnalysisExpressionAfterCrossoverOperator(); 359 op.BeforeManipulatorOperatorParameter.ActualValue = new SymbolicDataAnalysisExpressionBeforeManipulatorOperator(); 360 op.AfterManipulatorOperatorParameter.ActualValue = new SymbolicDataAnalysisExpressionAfterManipulatorOperator(); 361 361 // get crossover parameter names 362 362 var crossover = operators.OfType<ISymbolicExpressionTreeCrossover>().FirstOrDefault(); 363 363 if (crossover != null) { 364 op.CrossoverParentsParameterName = crossover.ParentsParameter.Name; 365 op.CrossoverChildParameterName = crossover.ChildParameter.Name; 366 } 367 // get munipulator parameter names 364 op.BeforeCrossoverOperator.ParentsParameter.ActualName = crossover.ParentsParameter.Name; 365 op.AfterCrossoverOperator.ParentsParameter.ActualName = crossover.ParentsParameter.Name; 366 op.BeforeCrossoverOperator.ChildParameter.ActualName = crossover.ChildParameter.Name; 367 op.AfterCrossoverOperator.ChildParameter.ActualName = crossover.ChildParameter.Name; 368 } 369 // get manipulator parameter names 368 370 var manipulator = operators.OfType<ISymbolicExpressionTreeManipulator>().FirstOrDefault(); 369 371 if (manipulator != null) { 370 op. ManipulatorChildParameterName = manipulator.SymbolicExpressionTreeParameter.Name;372 op.BeforeManipulatorOperator.ChildParameter.ActualName = manipulator.SymbolicExpressionTreeParameter.Name; 371 373 } 372 374 var creator = operators.OfType<ISymbolicExpressionTreeCreator>().FirstOrDefault(); -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs
r10347 r10830 387 387 if (TSPGenealogyAnalyzer != null) { 388 388 if (TSPCrossover != null) { 389 TSPGenealogyAnalyzer.BeforeCrossoverOperator = new BeforeCrossoverOperator<Permutation>();390 TSPGenealogyAnalyzer.AfterCrossoverOperator = new AfterCrossoverOperator<Permutation>();389 TSPGenealogyAnalyzer.BeforeCrossoverOperatorParameter.ActualValue = new BeforeCrossoverOperator<Permutation>(); 390 TSPGenealogyAnalyzer.AfterCrossoverOperatorParameter.ActualValue = new AfterCrossoverOperator<Permutation>(); 391 391 TSPGenealogyAnalyzer.CrossoverParentsParameterName = TSPCrossover.ParentsParameter.Name; 392 392 TSPGenealogyAnalyzer.CrossoverChildParameterName = TSPCrossover.ChildParameter.Name; 393 393 } 394 394 if (TSPManipulator != null) { 395 TSPGenealogyAnalyzer.BeforeManipulatorOperator = new BeforeManipulatorOperator<Permutation>();396 TSPGenealogyAnalyzer.AfterManipulatorOperator = new AfterManipulatorOperator<Permutation>();395 TSPGenealogyAnalyzer.BeforeManipulatorOperatorParameter.ActualValue = new BeforeManipulatorOperator<Permutation>(); 396 TSPGenealogyAnalyzer.AfterManipulatorOperatorParameter.ActualValue = new AfterManipulatorOperator<Permutation>(); 397 397 TSPGenealogyAnalyzer.ManipulatorChildParameterName = TSPManipulator.PermutationParameter.Name; 398 398 }
Note: See TracChangeset
for help on using the changeset viewer.