Changeset 3107 for trunk/sources/HeuristicLab.Algorithms.SGA/3.3
- Timestamp:
- 03/19/10 04:56:06 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.SGA/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.SGA/3.3/SGA.cs
r3095 r3107 183 183 ParameterizeStochasticOperator(Problem.SolutionCreator); 184 184 ParameterizeStochasticOperator(Problem.Evaluator); 185 ParameterizeStochasticOperator(Problem.Visualizer); 185 186 foreach (IOperator op in Problem.Operators) ParameterizeStochasticOperator(op); 186 187 ParameterizeSolutionsCreator(); … … 204 205 Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged); 205 206 base.Problem_EvaluatorChanged(sender, e); 207 } 208 protected override void Problem_VisualizerChanged(object sender, EventArgs e) { 209 ParameterizeStochasticOperator(Problem.Visualizer); 210 ParameterizeSGAMainLoop(); 211 base.Problem_VisualizerChanged(sender, e); 206 212 } 207 213 protected override void Problem_OperatorsChanged(object sender, EventArgs e) { … … 253 259 SGAMainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 254 260 SGAMainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 261 SGAMainLoop.VisualizerParameter.ActualName = Problem.VisualizerParameter.Name; 262 SGAMainLoop.VisualizationParameter.ActualName = Problem.Visualizer.VisualizationParameter.ActualName; 255 263 } 256 264 private void ParameterizeStochasticOperator(IOperator op) { -
trunk/sources/HeuristicLab.Algorithms.SGA/3.3/SGAMainLoop.cs
r3096 r3107 74 74 get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; } 75 75 } 76 public ValueLookupParameter<IOperator> VisualizerParameter { 77 get { return (ValueLookupParameter<IOperator>)Parameters["Visualizer"]; } 78 } 79 public LookupParameter<IItem> VisualizationParameter { 80 get { return (LookupParameter<IItem>)Parameters["Visualization"]; } 81 } 76 82 private ScopeParameter CurrentScopeParameter { 77 83 get { return (ScopeParameter)Parameters["CurrentScope"]; } … … 104 110 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.")); 105 111 Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored.")); 112 Parameters.Add(new ValueLookupParameter<IOperator>("Visualizer", "The operator used to visualize solutions.")); 113 Parameters.Add(new LookupParameter<IItem>("Visualization", "The item which represents the visualization of solutions.")); 106 114 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the SGA should be applied.")); 107 115 #endregion … … 114 122 DataTableValuesCollector dataTableValuesCollector1 = new DataTableValuesCollector(); 115 123 QualityDifferenceCalculator qualityDifferenceCalculator1 = new QualityDifferenceCalculator(); 124 Placeholder visualizer1 = new Placeholder(); 116 125 ResultsCollector resultsCollector = new ResultsCollector(); 117 126 Placeholder selector = new Placeholder(); … … 135 144 DataTableValuesCollector dataTableValuesCollector2 = new DataTableValuesCollector(); 136 145 QualityDifferenceCalculator qualityDifferenceCalculator2 = new QualityDifferenceCalculator(); 146 Placeholder visualizer2 = new Placeholder(); 137 147 ConditionalBranch conditionalBranch = new ConditionalBranch(); 138 148 … … 164 174 qualityDifferenceCalculator1.RelativeDifferenceParameter.ActualName = "RelativeDifferenceBestKnownToBest"; 165 175 qualityDifferenceCalculator1.SecondQualityParameter.ActualName = "BestQuality"; 176 177 visualizer1.Name = "Visualizer"; 178 visualizer1.OperatorParameter.ActualName = "Visualizer"; 166 179 167 180 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); … … 173 186 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Absolute Difference of Best Known Quality to Best Quality", null, "AbsoluteDifferenceBestKnownToBest")); 174 187 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Relative Difference of Best Known Quality to Best Quality", null, "RelativeDifferenceBestKnownToBest")); 188 resultsCollector.CollectedValues.Add(new LookupParameter<IItem>("Solution Visualization", null, "Visualization")); 175 189 resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("Qualities")); 176 190 resultsCollector.ResultsParameter.ActualName = "Results"; … … 233 247 qualityDifferenceCalculator2.RelativeDifferenceParameter.ActualName = "RelativeDifferenceBestKnownToBest"; 234 248 qualityDifferenceCalculator2.SecondQualityParameter.ActualName = "BestQuality"; 249 250 visualizer2.Name = "Visualizer"; 251 visualizer2.OperatorParameter.ActualName = "Visualizer"; 235 252 236 253 conditionalBranch.ConditionParameter.ActualName = "Terminate"; … … 244 261 bestAverageWorstQualityCalculator1.Successor = dataTableValuesCollector1; 245 262 dataTableValuesCollector1.Successor = qualityDifferenceCalculator1; 246 qualityDifferenceCalculator1.Successor = resultsCollector; 263 qualityDifferenceCalculator1.Successor = visualizer1; 264 visualizer1.Successor = resultsCollector; 247 265 resultsCollector.Successor = selector; 248 266 selector.Successor = sequentialSubScopesProcessor1; … … 272 290 bestAverageWorstQualityCalculator2.Successor = dataTableValuesCollector2; 273 291 dataTableValuesCollector2.Successor = qualityDifferenceCalculator2; 274 qualityDifferenceCalculator2.Successor = conditionalBranch; 292 qualityDifferenceCalculator2.Successor = visualizer2; 293 visualizer2.Successor = conditionalBranch; 275 294 conditionalBranch.FalseBranch = selector; 276 295 conditionalBranch.TrueBranch = null;
Note: See TracChangeset
for help on using the changeset viewer.