Changeset 3656
- Timestamp:
- 05/05/10 23:10:11 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs
r3616 r3656 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Analysis; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; … … 112 113 get { return (ValueLookupParameter<IntValue>)Parameters["SelectedParents"]; } 113 114 } 115 private ValueParameter<MultiAnalyzer<IMultiPopulationAnalyzer>> AnalyzerParameter { 116 get { return (ValueParameter<MultiAnalyzer<IMultiPopulationAnalyzer>>)Parameters["Analyzer"]; } 117 } 118 private ValueParameter<MultiAnalyzer<IPopulationAnalyzer>> VillageAnalyzerParameter { 119 get { return (ValueParameter<MultiAnalyzer<IPopulationAnalyzer>>)Parameters["VillageAnalyzer"]; } 120 } 114 121 #endregion 115 122 … … 191 198 set { SelectedParentsParameter.Value = value; } 192 199 } 200 public MultiAnalyzer<IMultiPopulationAnalyzer> Analyzer { 201 get { return AnalyzerParameter.Value; } 202 set { AnalyzerParameter.Value = value; } 203 } 204 public MultiAnalyzer<IPopulationAnalyzer> VillageAnalyzer { 205 get { return VillageAnalyzerParameter.Value; } 206 set { VillageAnalyzerParameter.Value = value; } 207 } 193 208 private List<ISelector> selectors; 194 209 private IEnumerable<ISelector> Selectors { … … 208 223 get { return (SASEGASAMainLoop)VillageProcessor.Successor; } 209 224 } 225 private PopulationBestAverageWorstQualityAnalyzer villageQualityAnalyzer; 226 //private MultipopulationBestAverageWorstQualityAnalyzer qualityAnalyzer; 210 227 #endregion 211 228 … … 233 250 Parameters.Add(new ValueLookupParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation.", new BoolValue(false))); 234 251 Parameters.Add(new ValueLookupParameter<IntValue>("SelectedParents", "Should be about 2 * PopulationSize, for large problems use a smaller value to decrease memory footprint.", new IntValue(200))); 235 252 Parameters.Add(new ValueParameter<MultiAnalyzer<IMultiPopulationAnalyzer>>("Analyzer", "The operator used to analyze the villages.", new MultiAnalyzer<IMultiPopulationAnalyzer>())); 253 Parameters.Add(new ValueParameter<MultiAnalyzer<IPopulationAnalyzer>>("VillageAnalyzer", "The operator used to analyze each village.", new MultiAnalyzer<IPopulationAnalyzer>())); 254 236 255 RandomCreator randomCreator = new RandomCreator(); 237 256 SubScopesCreator populationCreator = new SubScopesCreator(); … … 299 318 ParameterizeMainLoop(); 300 319 ParameterizeSelectors(); 320 ParameterizeAnalyzers(); 301 321 UpdateCrossovers(); 302 322 UpdateMutators(); 323 UpdateAnalyzers(); 303 324 Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged); 304 325 base.OnProblemChanged(); … … 315 336 ParameterizeMainLoop(); 316 337 ParameterizeSelectors(); 338 ParameterizeAnalyzers(); 317 339 Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged); 318 340 base.Problem_EvaluatorChanged(sender, e); … … 322 344 UpdateCrossovers(); 323 345 UpdateMutators(); 346 UpdateAnalyzers(); 324 347 base.Problem_OperatorsChanged(sender, e); 325 348 } … … 341 364 ParameterizeMainLoop(); 342 365 ParameterizeSelectors(); 366 ParameterizeAnalyzers(); 343 367 } 344 368 private void MaximumGenerationsParameter_ValueChanged(object sender, EventArgs e) { … … 365 389 private void Initialize() { 366 390 InitializeSelectors(); 391 InitializeAnalyzers(); 367 392 UpdateSelectors(); 393 UpdateAnalyzers(); 368 394 InitializeComparisonFactorModifiers(); 369 395 UpdateComparisonFactorModifiers(); … … 402 428 ParameterizeSelectors(); 403 429 } 430 private void InitializeAnalyzers() { 431 villageQualityAnalyzer = new PopulationBestAverageWorstQualityAnalyzer(); 432 //qualityAnalyzer = new MultipopulationBestAverageWorstQualityAnalyzer(); 433 ParameterizeAnalyzers(); 434 } 404 435 private void InitializeComparisonFactorModifiers() { 405 436 comparisonFactorModifiers = new List<IDiscreteDoubleValueModifier>(); … … 419 450 selector.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 420 451 } 452 } 453 } 454 private void ParameterizeAnalyzers() { 455 villageQualityAnalyzer.ResultsParameter.ActualName = "Results"; 456 //qualityAnalyzer.ResultsParameter.ActualName = "Results"; 457 if (Problem != null) { 458 villageQualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 459 villageQualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 460 villageQualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name; 421 461 } 422 462 } … … 477 517 } 478 518 } 519 private void UpdateAnalyzers() { 520 VillageAnalyzer.Operators.Clear(); 521 Analyzer.Operators.Clear(); 522 VillageAnalyzer.Operators.Add(villageQualityAnalyzer); 523 //Analyzer.Operators.Add(qualityAnalyzer); 524 if (Problem != null) { 525 foreach (IPopulationAnalyzer analyzer in Problem.Operators.OfType<IPopulationAnalyzer>().OrderBy(x => x.Name)) { 526 VillageAnalyzer.Operators.Add(analyzer); 527 } 528 foreach (IMultiPopulationAnalyzer analyzer in Problem.Operators.OfType<IMultiPopulationAnalyzer>().OrderBy(x => x.Name)) 529 Analyzer.Operators.Add(analyzer); 530 } 531 } 479 532 #endregion 480 533 } -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASAMainLoop.cs
r3615 r3656 82 82 get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; } 83 83 } 84 public ValueLookupParameter<IOperator> VisualizerParameter {85 get { return (ValueLookupParameter<IOperator>)Parameters[" Visualizer"]; }86 } 87 public LookupParameter<IItem> VisualizationParameter {88 get { return ( LookupParameter<IItem>)Parameters["Visualization"]; }84 public ValueLookupParameter<IOperator> AnalyzerParameter { 85 get { return (ValueLookupParameter<IOperator>)Parameters["Analyzer"]; } 86 } 87 public ValueLookupParameter<IOperator> VillageAnalyzerParameter { 88 get { return (ValueLookupParameter<IOperator>)Parameters["VillageAnalyzer"]; } 89 89 } 90 90 public ValueLookupParameter<DoubleValue> SuccessRatioParameter { … … 135 135 Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.")); 136 136 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The results collection to store the results.")); 137 Parameters.Add(new ValueLookupParameter<IOperator>(" Visualizer", "The operator used to visualize solutions."));138 Parameters.Add(new LookupParameter<IItem>("Visualization", "The item which represents the visualization of solutions."));137 Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to the analyze the villages.")); 138 Parameters.Add(new ValueLookupParameter<IOperator>("VillageAnalyzer", "The operator used to analyze each village.")); 139 139 Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved.")); 140 140 Parameters.Add(new LookupParameter<DoubleValue>("ComparisonFactor", "The comparison factor is used to determine whether the offspring should be compared to the better parent, the worse parent or a quality value linearly interpolated between them. It is in the range [0;1].")); … … 155 155 UniformSubScopesProcessor uniformSubScopesProcessor0 = new UniformSubScopesProcessor(); 156 156 VariableCreator villageVariableCreator = new VariableCreator(); 157 BestQualityMemorizer villageBestQualityMemorizer1 = new BestQualityMemorizer(); 158 BestAverageWorstQualityCalculator villageBestAverageWorstQualityCalculator1 = new BestAverageWorstQualityCalculator(); 159 DataTableValuesCollector villageDataTableValuesCollector1 = new DataTableValuesCollector(); 160 DataTableValuesCollector villageDataTableValuesCollector2 = new DataTableValuesCollector(); 161 QualityDifferenceCalculator villageQualityDifferenceCalculator1 = new QualityDifferenceCalculator(); 162 ResultsCollector villageResultsCollector = new ResultsCollector(); 163 BestQualityMemorizer bestQualityMemorizer1 = new BestQualityMemorizer(); 164 BestQualityMemorizer bestQualityMemorizer2 = new BestQualityMemorizer(); 165 BestAverageWorstQualityCalculator bestAverageWorstQualityCalculator1 = new BestAverageWorstQualityCalculator(); 166 DataTableValuesCollector dataTableValuesCollector1 = new DataTableValuesCollector(); 167 DataTableValuesCollector dataTableValuesCollector2 = new DataTableValuesCollector(); 168 QualityDifferenceCalculator qualityDifferenceCalculator1 = new QualityDifferenceCalculator(); 169 ResultsCollector resultsCollector = new ResultsCollector(); 157 Placeholder villageAnalyzer1 = new Placeholder(); 158 ResultsCollector villageResultsCollector1 = new ResultsCollector(); 159 Placeholder analyzer1 = new Placeholder(); 160 ResultsCollector resultsCollector1 = new ResultsCollector(); 161 ResultsCollector resultsCollector2 = new ResultsCollector(); 170 162 UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor(); 171 163 ConditionalBranch villageTerminatedBySelectionPressure1 = new ConditionalBranch(); 172 164 OffspringSelectionGeneticAlgorithmMainOperator mainOperator = new OffspringSelectionGeneticAlgorithmMainOperator(); 173 BestQualityMemorizer villageBestQualityMemorizer2 = new BestQualityMemorizer(); 174 BestAverageWorstQualityCalculator villageBestAverageWorstQualityCalculator2 = new BestAverageWorstQualityCalculator(); 175 DataTableValuesCollector villageDataTableValuesCollector3 = new DataTableValuesCollector(); 176 DataTableValuesCollector villageDataTableValuesCollector4 = new DataTableValuesCollector(); 177 QualityDifferenceCalculator villageQualityDifferenceCalculator2 = new QualityDifferenceCalculator(); 165 Placeholder villageAnalyzer2 = new Placeholder(); 166 ResultsCollector villageResultsCollector2 = new ResultsCollector(); 178 167 IntCounter evaluatedSolutionsCounter = new IntCounter(); 179 168 Assigner villageEvaluatedSolutionsAssigner = new Assigner(); … … 200 189 Assigner finalMaxSelPressAssigner = new Assigner(); 201 190 Comparator maximumGenerationsComparator = new Comparator(); 202 BestQualityMemorizer bestQualityMemorizer3 = new BestQualityMemorizer(); 203 BestQualityMemorizer bestQualityMemorizer4 = new BestQualityMemorizer(); 204 BestAverageWorstQualityCalculator bestAverageWorstQualityCalculator2 = new BestAverageWorstQualityCalculator(); 205 DataTableValuesCollector dataTableValuesCollector3 = new DataTableValuesCollector(); 206 DataTableValuesCollector dataTableValuesCollector4 = new DataTableValuesCollector(); 207 QualityDifferenceCalculator qualityDifferenceCalculator2 = new QualityDifferenceCalculator(); 191 Placeholder analyzer2 = new Placeholder(); 192 ResultsCollector resultsCollector3 = new ResultsCollector(); 208 193 ConditionalBranch terminationCondition = new ConditionalBranch(); 209 194 ConditionalBranch maximumGenerationsTerminationCondition = new ConditionalBranch(); … … 224 209 comparisonFactorInitializer.RightSideParameter.ActualName = ComparisonFactorLowerBoundParameter.Name; 225 210 226 villageVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>(" VillageResults", new ResultCollection()));211 villageVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>("Results", new ResultCollection())); 227 212 villageVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("VillageEvaluatedSolutions", new IntValue(0))); 228 213 villageVariableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("TerminateSelectionPressure", new BoolValue(false))); … … 230 215 villageVariableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("CurrentSuccessRatio", new DoubleValue(0))); 231 216 232 villageBestQualityMemorizer1.BestQualityParameter.ActualName = "BestQuality"; 233 villageBestQualityMemorizer1.MaximizationParameter.ActualName = MaximizationParameter.Name; 234 villageBestQualityMemorizer1.QualityParameter.ActualName = QualityParameter.Name; 235 236 villageBestAverageWorstQualityCalculator1.AverageQualityParameter.ActualName = "CurrentAverageQuality"; 237 villageBestAverageWorstQualityCalculator1.BestQualityParameter.ActualName = "CurrentBestQuality"; 238 villageBestAverageWorstQualityCalculator1.MaximizationParameter.ActualName = MaximizationParameter.Name; 239 villageBestAverageWorstQualityCalculator1.QualityParameter.ActualName = QualityParameter.Name; 240 villageBestAverageWorstQualityCalculator1.WorstQualityParameter.ActualName = "CurrentWorstQuality"; 241 242 villageDataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best BestQuality", null, "CurrentBestQuality")); 243 villageDataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average BestQuality", null, "CurrentAverageQuality")); 244 villageDataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst BestQuality", null, "CurrentWorstQuality")); 245 villageDataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality")); 246 villageDataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name)); 247 villageDataTableValuesCollector1.DataTableParameter.ActualName = "Qualities"; 248 249 villageDataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Selection Pressure", null, "SelectionPressure")); 250 villageDataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Maximum Selection Pressure", null, "MaximumSelectionPressure")); 251 villageDataTableValuesCollector2.DataTableParameter.ActualName = "SelectionPressures"; 252 253 villageQualityDifferenceCalculator1.AbsoluteDifferenceParameter.ActualName = "AbsoluteDifferenceBestKnownToBest"; 254 villageQualityDifferenceCalculator1.FirstQualityParameter.ActualName = BestKnownQualityParameter.Name; 255 villageQualityDifferenceCalculator1.RelativeDifferenceParameter.ActualName = "RelativeDifferenceBestKnownToBest"; 256 villageQualityDifferenceCalculator1.SecondQualityParameter.ActualName = "BestQuality"; 257 258 villageResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Success Ratio", null, "CurrentSuccessRatio")); 259 villageResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best Quality", null, "CurrentBestQuality")); 260 villageResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average Quality", null, "CurrentAverageQuality")); 261 villageResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst Quality", null, "CurrentWorstQuality")); 262 villageResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality")); 263 villageResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name)); 264 villageResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Absolute Difference of Best Known Quality to Best Quality", null, "AbsoluteDifferenceBestKnownToBest")); 265 villageResultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Relative Difference of Best Known Quality to Best Quality", null, "RelativeDifferenceBestKnownToBest")); 266 villageResultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("Qualities")); 267 villageResultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("SelectionPressures")); 268 villageResultsCollector.ResultsParameter.ActualName = "VillageResults"; 269 270 bestQualityMemorizer1.BestQualityParameter.ActualName = "BestQuality"; 271 bestQualityMemorizer1.MaximizationParameter.ActualName = MaximizationParameter.Name; 272 bestQualityMemorizer1.QualityParameter.ActualName = "BestQuality"; 273 274 bestQualityMemorizer2.BestQualityParameter.ActualName = BestKnownQualityParameter.Name; 275 bestQualityMemorizer2.MaximizationParameter.ActualName = MaximizationParameter.Name; 276 bestQualityMemorizer2.QualityParameter.ActualName = "BestQuality"; 277 278 bestAverageWorstQualityCalculator1.AverageQualityParameter.ActualName = "CurrentAverageBestQuality"; 279 bestAverageWorstQualityCalculator1.BestQualityParameter.ActualName = "CurrentBestBestQuality"; 280 bestAverageWorstQualityCalculator1.MaximizationParameter.ActualName = MaximizationParameter.Name; 281 bestAverageWorstQualityCalculator1.QualityParameter.ActualName = "CurrentBestQuality"; 282 bestAverageWorstQualityCalculator1.WorstQualityParameter.ActualName = "CurrentWorstBestQuality"; 283 284 dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best BestQuality", null, "CurrentBestBestQuality")); 285 dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average BestQuality", null, "CurrentAverageBestQuality")); 286 dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst BestQuality", null, "CurrentWorstBestQuality")); 287 dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality")); 288 dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name)); 289 dataTableValuesCollector1.DataTableParameter.ActualName = "BestQualities"; 290 291 dataTableValuesCollector2.CollectedValues.Add(new SubScopesLookupParameter<DoubleValue>("Selection Pressure Village", null, "SelectionPressure")); 292 dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Maximum Selection Pressure", null, "MaximumSelectionPressure")); 293 dataTableValuesCollector2.DataTableParameter.ActualName = "VillageSelectionPressures"; 294 295 qualityDifferenceCalculator1.AbsoluteDifferenceParameter.ActualName = "AbsoluteDifferenceBestKnownToBest"; 296 qualityDifferenceCalculator1.FirstQualityParameter.ActualName = BestKnownQualityParameter.Name; 297 qualityDifferenceCalculator1.RelativeDifferenceParameter.ActualName = "RelativeDifferenceBestKnownToBest"; 298 qualityDifferenceCalculator1.SecondQualityParameter.ActualName = "BestQuality"; 299 300 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 301 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions")); 302 resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Active Villages", null, "VillageCount")); 303 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best BestQuality", null, "CurrentBestBestQuality")); 304 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average BestQuality", null, "CurrentAverageBestQuality")); 305 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst BestQuality", null, "CurrentWorstBestQuality")); 306 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality")); 307 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name)); 308 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Absolute Difference of Best Known Quality to Best Quality", null, "AbsoluteDifferenceBestKnownToBest")); 309 resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Relative Difference of Best Known Quality to Best Quality", null, "RelativeDifferenceBestKnownToBest")); 310 resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("BestQualities")); 311 resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("VillageSelectionPressures")); 312 resultsCollector.CollectedValues.Add(new SubScopesLookupParameter<ResultCollection>("VillageResults", "Result set for each village")); 313 resultsCollector.ResultsParameter.ActualName = ResultsParameter.Name; 217 villageAnalyzer1.Name = "Village Analyzer (placeholder)"; 218 villageAnalyzer1.OperatorParameter.ActualName = VillageAnalyzerParameter.Name; 219 220 villageResultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Success Ratio", null, "CurrentSuccessRatio")); 221 villageResultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Selection Pressure", null, "SelectionPressure")); 222 villageResultsCollector1.ResultsParameter.ActualName = "Results"; 223 224 analyzer1.Name = "Analyzer (placeholder)"; 225 analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name; 226 227 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 228 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions")); 229 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("ComparisonFactor", null, "ComparisonFactor")); 230 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Terminated Villages", null, "TerminatedVillages")); 231 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Total Active Villages", null, "VillageCount")); 232 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 233 234 resultsCollector2.Name = "Reference Village Results"; 235 resultsCollector2.CopyValue = new BoolValue(false); 236 resultsCollector2.CollectedValues.Add(new SubScopesLookupParameter<ResultCollection>("VillageResults", "Result set for each village", "Results")); 237 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name; 314 238 315 239 villageTerminatedBySelectionPressure1.Name = "Village Terminated ?"; … … 333 257 mainOperator.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name; 334 258 335 villageBestQualityMemorizer2.BestQualityParameter.ActualName = "BestQuality"; 336 villageBestQualityMemorizer2.MaximizationParameter.ActualName = MaximizationParameter.Name; 337 villageBestQualityMemorizer2.QualityParameter.ActualName = QualityParameter.Name; 338 339 villageBestAverageWorstQualityCalculator2.AverageQualityParameter.ActualName = "CurrentAverageQuality"; 340 villageBestAverageWorstQualityCalculator2.BestQualityParameter.ActualName = "CurrentBestQuality"; 341 villageBestAverageWorstQualityCalculator2.MaximizationParameter.ActualName = MaximizationParameter.Name; 342 villageBestAverageWorstQualityCalculator2.QualityParameter.ActualName = QualityParameter.Name; 343 villageBestAverageWorstQualityCalculator2.WorstQualityParameter.ActualName = "CurrentWorstQuality"; 344 345 villageDataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best BestQuality", null, "CurrentBestQuality")); 346 villageDataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average BestQuality", null, "CurrentAverageQuality")); 347 villageDataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst BestQuality", null, "CurrentWorstQuality")); 348 villageDataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality")); 349 villageDataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name)); 350 villageDataTableValuesCollector3.DataTableParameter.ActualName = "Qualities"; 351 352 villageDataTableValuesCollector4.CollectedValues.Add(new LookupParameter<DoubleValue>("Selection Pressure", null, "SelectionPressure")); 353 villageDataTableValuesCollector4.CollectedValues.Add(new LookupParameter<DoubleValue>("Maximum Selection Pressure", null, "MaximumSelectionPressure")); 354 villageDataTableValuesCollector4.DataTableParameter.ActualName = "SelectionPressures"; 355 356 villageQualityDifferenceCalculator2.AbsoluteDifferenceParameter.ActualName = "AbsoluteDifferenceBestKnownToBest"; 357 villageQualityDifferenceCalculator2.FirstQualityParameter.ActualName = BestKnownQualityParameter.Name; 358 villageQualityDifferenceCalculator2.RelativeDifferenceParameter.ActualName = "RelativeDifferenceBestKnownToBest"; 359 villageQualityDifferenceCalculator2.SecondQualityParameter.ActualName = "BestQuality"; 259 villageAnalyzer2.Name = "Village Analyzer (placeholder)"; 260 villageAnalyzer2.OperatorParameter.ActualName = VillageAnalyzerParameter.Name; 261 262 villageResultsCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Success Ratio", null, "CurrentSuccessRatio")); 263 villageResultsCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Selection Pressure", null, "SelectionPressure")); 264 villageResultsCollector2.ResultsParameter.ActualName = "Results"; 360 265 361 266 evaluatedSolutionsCounter.Name = "Update EvaluatedSolutions"; … … 454 359 maximumGenerationsComparator.ResultParameter.ActualName = "TerminateMaximumGenerations"; 455 360 456 bestQualityMemorizer3.BestQualityParameter.ActualName = "BestQuality"; 457 bestQualityMemorizer3.MaximizationParameter.ActualName = MaximizationParameter.Name; 458 bestQualityMemorizer3.QualityParameter.ActualName = "BestQuality"; 459 460 bestQualityMemorizer4.BestQualityParameter.ActualName = "BestQuality"; 461 bestQualityMemorizer4.MaximizationParameter.ActualName = MaximizationParameter.Name; 462 bestQualityMemorizer4.QualityParameter.ActualName = "BestQuality"; 463 464 bestAverageWorstQualityCalculator2.AverageQualityParameter.ActualName = "CurrentAverageBestQuality"; 465 bestAverageWorstQualityCalculator2.BestQualityParameter.ActualName = "CurrentBestBestQuality"; 466 bestAverageWorstQualityCalculator2.MaximizationParameter.ActualName = MaximizationParameter.Name; 467 bestAverageWorstQualityCalculator2.QualityParameter.ActualName = "CurrentBestQuality"; 468 bestAverageWorstQualityCalculator2.WorstQualityParameter.ActualName = "CurrentWorstBestQuality"; 469 470 dataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Best BestQuality", null, "CurrentBestBestQuality")); 471 dataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Average BestQuality", null, "CurrentAverageBestQuality")); 472 dataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Worst BestQuality", null, "CurrentWorstBestQuality")); 473 dataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality")); 474 dataTableValuesCollector3.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name)); 475 dataTableValuesCollector3.DataTableParameter.ActualName = "BestQualities"; 476 477 dataTableValuesCollector4.CollectedValues.Add(new SubScopesLookupParameter<DoubleValue>("Selection Pressure Village", null, "SelectionPressure")); 478 dataTableValuesCollector4.CollectedValues.Add(new LookupParameter<DoubleValue>("Maximum Selection Pressure", null, "MaximumSelectionPressure")); 479 dataTableValuesCollector4.DataTableParameter.ActualName = "VillageSelectionPressures"; 480 481 qualityDifferenceCalculator2.AbsoluteDifferenceParameter.ActualName = "AbsoluteDifferenceBestKnownToBest"; 482 qualityDifferenceCalculator2.FirstQualityParameter.ActualName = BestKnownQualityParameter.Name; 483 qualityDifferenceCalculator2.RelativeDifferenceParameter.ActualName = "RelativeDifferenceBestKnownToBest"; 484 qualityDifferenceCalculator2.SecondQualityParameter.ActualName = "BestQuality"; 361 analyzer2.Name = "Analyzer (placeholder)"; 362 analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name; 363 364 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 365 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions")); 366 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("ComparisonFactor", null, "ComparisonFactor")); 367 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Terminated Villages", null, "TerminatedVillages")); 368 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Total Active Villages", null, "VillageCount")); 369 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name; 485 370 486 371 terminationCondition.ConditionParameter.ActualName = "TerminateSASEGASA"; … … 495 380 comparisonFactorInitializer.Successor = uniformSubScopesProcessor0; 496 381 uniformSubScopesProcessor0.Operator = villageVariableCreator; 497 uniformSubScopesProcessor0.Successor = bestQualityMemorizer1; 498 villageVariableCreator.Successor = villageBestQualityMemorizer1; 499 villageBestQualityMemorizer1.Successor = villageBestAverageWorstQualityCalculator1; 500 villageBestAverageWorstQualityCalculator1.Successor = villageDataTableValuesCollector1; 501 villageDataTableValuesCollector1.Successor = villageDataTableValuesCollector2; 502 villageDataTableValuesCollector2.Successor = villageQualityDifferenceCalculator1; 503 villageQualityDifferenceCalculator1.Successor = villageResultsCollector; 504 bestQualityMemorizer1.Successor = bestQualityMemorizer2; 505 bestQualityMemorizer2.Successor = bestAverageWorstQualityCalculator1; 506 bestAverageWorstQualityCalculator1.Successor = dataTableValuesCollector1; 507 dataTableValuesCollector1.Successor = dataTableValuesCollector2; 508 dataTableValuesCollector2.Successor = qualityDifferenceCalculator1; 509 qualityDifferenceCalculator1.Successor = resultsCollector; 510 resultsCollector.Successor = uniformSubScopesProcessor1; 382 uniformSubScopesProcessor0.Successor = analyzer1; 383 villageVariableCreator.Successor = villageAnalyzer1; 384 villageAnalyzer1.Successor = villageResultsCollector1; 385 analyzer1.Successor = resultsCollector1; 386 resultsCollector1.Successor = resultsCollector2; 387 resultsCollector2.Successor = uniformSubScopesProcessor1; 511 388 uniformSubScopesProcessor1.Operator = villageTerminatedBySelectionPressure1; 512 389 uniformSubScopesProcessor1.Successor = generationsCounter; … … 514 391 villageTerminatedBySelectionPressure1.FalseBranch = mainOperator; 515 392 villageTerminatedBySelectionPressure1.Successor = null; 516 mainOperator.Successor = villageBestQualityMemorizer2; 517 villageBestQualityMemorizer2.Successor = villageBestAverageWorstQualityCalculator2; 518 villageBestAverageWorstQualityCalculator2.Successor = villageDataTableValuesCollector3; 519 villageDataTableValuesCollector3.Successor = villageDataTableValuesCollector4; 520 villageDataTableValuesCollector4.Successor = villageQualityDifferenceCalculator2; 521 villageQualityDifferenceCalculator2.Successor = evaluatedSolutionsCounter; 393 mainOperator.Successor = villageAnalyzer2; 394 villageAnalyzer2.Successor = villageResultsCollector2; 395 villageResultsCollector2.Successor = evaluatedSolutionsCounter; 522 396 evaluatedSolutionsCounter.Successor = villageEvaluatedSolutionsAssigner; 523 397 villageEvaluatedSolutionsAssigner.Successor = villageSelectionPressureComparator; … … 554 428 villageCountConditionalBranch.Successor = null; 555 429 finalMaxSelPressAssigner.Successor = null; 556 maximumGenerationsComparator.Successor = bestQualityMemorizer3; 557 bestQualityMemorizer3.Successor = bestQualityMemorizer4; 558 bestQualityMemorizer4.Successor = bestAverageWorstQualityCalculator2; 559 bestAverageWorstQualityCalculator2.Successor = dataTableValuesCollector3; 560 dataTableValuesCollector3.Successor = dataTableValuesCollector4; 561 dataTableValuesCollector4.Successor = qualityDifferenceCalculator2; 562 qualityDifferenceCalculator2.Successor = terminationCondition; 430 maximumGenerationsComparator.Successor = analyzer2; 431 analyzer2.Successor = resultsCollector3; 432 resultsCollector3.Successor = terminationCondition; 563 433 terminationCondition.TrueBranch = null; 564 434 terminationCondition.FalseBranch = maximumGenerationsTerminationCondition;
Note: See TracChangeset
for help on using the changeset viewer.