Changeset 3698
- Timestamp:
- 05/07/10 13:46:21 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs
r3689 r3698 259 259 Parameters.Add(new ConstrainedValueParameter<IMigrator>("Migrator", "The migration strategy.")); 260 260 Parameters.Add(new ConstrainedValueParameter<ISelector>("EmigrantsSelector", "Selects the individuals that will be migrated.")); 261 Parameters.Add(new ConstrainedValueParameter<IReplacer>("ImmigrationReplacer", " Selects the population from the unification of the original population andthe immigrants."));261 Parameters.Add(new ConstrainedValueParameter<IReplacer>("ImmigrationReplacer", "Replaces part of the original population with the immigrants.")); 262 262 Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The size of the population of solutions of each island.", new IntValue(100))); 263 263 Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations that should be processed.", new IntValue(100))); … … 318 318 mainLoop.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name; 319 319 mainLoop.ComparisonFactorParameter.ActualName = "ComparisonFactor"; 320 mainLoop.ComparisonFactorLowerBoundParameter.ActualName = ComparisonFactorLowerBoundParameter.Name;321 320 mainLoop.ComparisonFactorModifierParameter.ActualName = ComparisonFactorModifierParameter.Name; 322 mainLoop.ComparisonFactorUpperBoundParameter.ActualName = ComparisonFactorUpperBoundParameter.Name;323 321 mainLoop.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name; 324 322 mainLoop.OffspringSelectionBeforeMutationParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name; -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs
r3673 r3698 111 111 public LookupParameter<DoubleValue> ComparisonFactorParameter { 112 112 get { return (LookupParameter<DoubleValue>)Parameters["ComparisonFactor"]; } 113 }114 public ValueLookupParameter<DoubleValue> ComparisonFactorLowerBoundParameter {115 get { return (ValueLookupParameter<DoubleValue>)Parameters["ComparisonFactorLowerBound"]; }116 }117 public ValueLookupParameter<DoubleValue> ComparisonFactorUpperBoundParameter {118 get { return (ValueLookupParameter<DoubleValue>)Parameters["ComparisonFactorUpperBound"]; }119 113 } 120 114 public ValueLookupParameter<IOperator> ComparisonFactorModifierParameter { … … 163 157 Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved.")); 164 158 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].")); 165 Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorLowerBound", "The lower bound of the comparison factor (start)."));166 Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorUpperBound", "The upper bound of the comparison factor (end)."));167 159 Parameters.Add(new ValueLookupParameter<IOperator>("ComparisonFactorModifier", "The operator used to modify the comparison factor.")); 168 160 Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm.")); … … 178 170 Placeholder islandAnalyzer1 = new Placeholder(); 179 171 ResultsCollector islandResultsCollector1 = new ResultsCollector(); 172 Placeholder comparisonFactorModifier1 = new Placeholder(); 180 173 Placeholder analyzer1 = new Placeholder(); 181 174 ResultsCollector resultsCollector1 = new ResultsCollector(); 182 175 ResultsCollector resultsCollector2 = new ResultsCollector(); 183 Placeholder comparisonFactorModifier = new Placeholder();184 176 UniformSubScopesProcessor uniformSubScopesProcessor1 = new UniformSubScopesProcessor(); 185 177 ConditionalBranch islandTerminatedBySelectionPressure1 = new ConditionalBranch(); … … 207 199 Comparator generationsComparator = new Comparator(); 208 200 Comparator terminatedIslandsComparator = new Comparator(); 201 Placeholder comparisonFactorModifier2 = new Placeholder(); 209 202 Placeholder analyzer2 = new Placeholder(); 210 203 ResultsCollector resultsCollector3 = new ResultsCollector(); … … 230 223 islandResultsCollector1.ResultsParameter.ActualName = "Results"; 231 224 225 comparisonFactorModifier1.Name = "Initialize Comparison Factor (Placeholder)"; 226 comparisonFactorModifier1.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name; 227 232 228 analyzer1.Name = "Analyzer (placeholder)"; 233 229 analyzer1.OperatorParameter.ActualName = AnalyzerParameter.Name; … … 236 232 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Migrations")); 237 233 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 234 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Comparison Factor", null, "ComparisonFactor")); 238 235 resultsCollector1.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("IslandResults", "Result set for each island", "Results")); 239 236 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; … … 242 239 resultsCollector2.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions")); 243 240 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name; 244 245 comparisonFactorModifier.Name = "ComparisonFactorModifier (Placeholder)";246 comparisonFactorModifier.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name;247 241 248 242 islandTerminatedBySelectionPressure1.Name = "Island Terminated ?"; … … 349 343 terminatedIslandsComparator.ResultParameter.ActualName = "TerminateTerminatedIslands"; 350 344 345 comparisonFactorModifier2.Name = "Update Comparison Factor (Placeholder)"; 346 comparisonFactorModifier2.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name; 347 351 348 analyzer2.Name = "Analyzer (placeholder)"; 352 349 analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name; … … 367 364 variableCreator.Successor = uniformSubScopesProcessor0; 368 365 uniformSubScopesProcessor0.Operator = islandVariableCreator; 369 uniformSubScopesProcessor0.Successor = analyzer1;366 uniformSubScopesProcessor0.Successor = comparisonFactorModifier1; 370 367 islandVariableCreator.Successor = islandAnalyzer1; 371 368 islandAnalyzer1.Successor = islandResultsCollector1; 372 369 islandResultsCollector1.Successor = null; 370 comparisonFactorModifier1.Successor = analyzer1; 373 371 analyzer1.Successor = resultsCollector1; 374 372 resultsCollector1.Successor = resultsCollector2; 375 resultsCollector2.Successor = comparisonFactorModifier; 376 comparisonFactorModifier.Successor = uniformSubScopesProcessor1; 373 resultsCollector2.Successor = uniformSubScopesProcessor1; 377 374 uniformSubScopesProcessor1.Operator = islandTerminatedBySelectionPressure1; 378 375 uniformSubScopesProcessor1.Successor = generationsCounter; … … 407 404 immigrationReplacer.Successor = null; 408 405 generationsComparator.Successor = terminatedIslandsComparator; 409 terminatedIslandsComparator.Successor = analyzer2; 406 terminatedIslandsComparator.Successor = comparisonFactorModifier2; 407 comparisonFactorModifier2.Successor = analyzer2; 410 408 analyzer2.Successor = resultsCollector3; 411 409 resultsCollector3.Successor = generationsTerminationCondition; … … 414 412 generationsTerminationCondition.Successor = null; 415 413 terminatedIslandsCondition.TrueBranch = null; 416 terminatedIslandsCondition.FalseBranch = comparisonFactorModifier;414 terminatedIslandsCondition.FalseBranch = uniformSubScopesProcessor1; 417 415 terminatedIslandsCondition.Successor = null; 418 416 #endregion -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs
r3673 r3698 75 75 public ValueLookupParameter<DoubleValue> SuccessRatioParameter { 76 76 get { return (ValueLookupParameter<DoubleValue>)Parameters["SuccessRatio"]; } 77 }78 public ValueLookupParameter<DoubleValue> ComparisonFactorLowerBoundParameter {79 get { return (ValueLookupParameter<DoubleValue>)Parameters["ComparisonFactorLowerBound"]; }80 }81 public ValueLookupParameter<DoubleValue> ComparisonFactorUpperBoundParameter {82 get { return (ValueLookupParameter<DoubleValue>)Parameters["ComparisonFactorUpperBound"]; }83 77 } 84 78 public ValueLookupParameter<IOperator> ComparisonFactorModifierParameter { … … 116 110 Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation.")); 117 111 Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved.")); 118 Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorLowerBound", "The lower bound of the comparison factor (start)."));119 Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorUpperBound", "The upper bound of the comparison factor (end)."));120 112 Parameters.Add(new ValueLookupParameter<IOperator>("ComparisonFactorModifier", "The operator used to modify the comparison factor.")); 121 113 Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm.")); … … 125 117 #region Create operators 126 118 VariableCreator variableCreator = new VariableCreator(); 127 Placeholder comparisonFactorModifier = new Placeholder();119 Placeholder comparisonFactorModifier1 = new Placeholder(); 128 120 Placeholder analyzer1 = new Placeholder(); 129 121 ResultsCollector resultsCollector1 = new ResultsCollector(); … … 133 125 Comparator maxGenerationsComparator = new Comparator(); 134 126 Comparator maxSelectionPressureComparator = new Comparator(); 127 Placeholder comparisonFactorModifier2 = new Placeholder(); 135 128 Placeholder analyzer2 = new Placeholder(); 136 129 ResultsCollector resultsCollector3 = new ResultsCollector(); … … 142 135 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("SelectionPressure", new DoubleValue(0))); 143 136 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("CurrentSuccessRatio", new DoubleValue(0))); 144 145 comparisonFactorModifier.Name = "Modify ComparisonFactor (placeholder)"; 146 comparisonFactorModifier.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name; 137 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("ComparisonFactor", new DoubleValue(0))); 138 139 comparisonFactorModifier1.Name = "Initialize ComparisonFactor (placeholder)"; 140 comparisonFactorModifier1.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name; 147 141 148 142 analyzer1.Name = "Analyzer (placeholder)"; … … 190 184 maxSelectionPressureComparator.RightSideParameter.ActualName = MaximumSelectionPressureParameter.Name; 191 185 186 comparisonFactorModifier2.Name = "Update ComparisonFactor (placeholder)"; 187 comparisonFactorModifier2.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name; 188 192 189 analyzer2.Name = "Analyzer (placeholder)"; 193 190 analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name; … … 206 203 #region Create operator graph 207 204 OperatorGraph.InitialOperator = variableCreator; 208 variableCreator.Successor = comparisonFactorModifier ;209 comparisonFactorModifier .Successor = analyzer1;205 variableCreator.Successor = comparisonFactorModifier1; 206 comparisonFactorModifier1.Successor = analyzer1; 210 207 analyzer1.Successor = resultsCollector1; 211 208 resultsCollector1.Successor = resultsCollector2; … … 214 211 generationsCounter.Successor = maxGenerationsComparator; 215 212 maxGenerationsComparator.Successor = maxSelectionPressureComparator; 216 maxSelectionPressureComparator.Successor = analyzer2; 213 maxSelectionPressureComparator.Successor = comparisonFactorModifier2; 214 comparisonFactorModifier2.Successor = analyzer2; 217 215 analyzer2.Successor = resultsCollector3; 218 216 resultsCollector3.Successor = conditionalBranch1;
Note: See TracChangeset
for help on using the changeset viewer.