- Timestamp:
- 05/10/10 16:19:43 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs
r3735 r3744 312 312 mainLoop.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name; 313 313 mainLoop.ComparisonFactorParameter.ActualName = "ComparisonFactor"; 314 mainLoop.ComparisonFactorStartParameter.ActualName = ComparisonFactorLowerBoundParameter.Name; 314 315 mainLoop.ComparisonFactorModifierParameter.ActualName = ComparisonFactorModifierParameter.Name; 315 316 mainLoop.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name; -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs
r3715 r3744 111 111 public LookupParameter<DoubleValue> ComparisonFactorParameter { 112 112 get { return (LookupParameter<DoubleValue>)Parameters["ComparisonFactor"]; } 113 } 114 public ValueLookupParameter<DoubleValue> ComparisonFactorStartParameter { 115 get { return (ValueLookupParameter<DoubleValue>)Parameters["ComparisonFactorStart"]; } 113 116 } 114 117 public ValueLookupParameter<IOperator> ComparisonFactorModifierParameter { … … 157 160 Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved.")); 158 161 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].")); 162 Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorStart", "The initial value for the comparison factor.")); 159 163 Parameters.Add(new ValueLookupParameter<IOperator>("ComparisonFactorModifier", "The operator used to modify the comparison factor.")); 160 164 Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm.")); … … 170 174 Placeholder islandAnalyzer1 = new Placeholder(); 171 175 ResultsCollector islandResultsCollector1 = new ResultsCollector(); 172 Placeholder comparisonFactorModifier1 = new Placeholder();176 Assigner comparisonFactorInitializer = new Assigner(); 173 177 Placeholder analyzer1 = new Placeholder(); 174 178 ResultsCollector resultsCollector1 = new ResultsCollector(); … … 199 203 Comparator generationsComparator = new Comparator(); 200 204 Comparator terminatedIslandsComparator = new Comparator(); 201 Placeholder comparisonFactorModifier 2= new Placeholder();205 Placeholder comparisonFactorModifier = new Placeholder(); 202 206 Placeholder analyzer2 = new Placeholder(); 203 207 ResultsCollector resultsCollector3 = new ResultsCollector(); … … 211 215 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0))); 212 216 213 islandVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>( "Results", new ResultCollection()));217 islandVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>(ResultsParameter.Name, new ResultCollection())); 214 218 islandVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("IslandEvaluatedSolutions", new IntValue(0))); 215 219 islandVariableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("TerminateSelectionPressure", new BoolValue(false))); … … 221 225 islandResultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Selection Pressure", null, "SelectionPressure")); 222 226 islandResultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Success Ratio", null, "CurrentSuccessRatio")); 223 islandResultsCollector1.ResultsParameter.ActualName = "Results"; 224 225 comparisonFactorModifier1.Name = "Initialize Comparison Factor (Placeholder)"; 226 comparisonFactorModifier1.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name; 227 islandResultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 228 229 comparisonFactorInitializer.Name = "Initialize Comparison Factor"; 230 comparisonFactorInitializer.LeftSideParameter.ActualName = ComparisonFactorParameter.Name; 231 comparisonFactorInitializer.RightSideParameter.ActualName = ComparisonFactorStartParameter.Name; 227 232 228 233 analyzer1.Name = "Analyzer (placeholder)"; … … 232 237 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Migrations")); 233 238 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 234 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Comparison Factor", null, "ComparisonFactor"));235 resultsCollector1.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("IslandResults", "Result set for each island", "Results"));239 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Comparison Factor", null, ComparisonFactorParameter.Name)); 240 resultsCollector1.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("IslandResults", "Result set for each island", ResultsParameter.Name)); 236 241 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 237 242 … … 343 348 terminatedIslandsComparator.ResultParameter.ActualName = "TerminateTerminatedIslands"; 344 349 345 comparisonFactorModifier 2.Name = "Update Comparison Factor (Placeholder)";346 comparisonFactorModifier 2.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name;350 comparisonFactorModifier.Name = "Update Comparison Factor (Placeholder)"; 351 comparisonFactorModifier.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name; 347 352 348 353 analyzer2.Name = "Analyzer (placeholder)"; … … 364 369 variableCreator.Successor = uniformSubScopesProcessor0; 365 370 uniformSubScopesProcessor0.Operator = islandVariableCreator; 366 uniformSubScopesProcessor0.Successor = comparisonFactor Modifier1;371 uniformSubScopesProcessor0.Successor = comparisonFactorInitializer; 367 372 islandVariableCreator.Successor = islandAnalyzer1; 368 373 islandAnalyzer1.Successor = islandResultsCollector1; 369 374 islandResultsCollector1.Successor = null; 370 comparisonFactor Modifier1.Successor = analyzer1;375 comparisonFactorInitializer.Successor = analyzer1; 371 376 analyzer1.Successor = resultsCollector1; 372 377 resultsCollector1.Successor = resultsCollector2; … … 404 409 immigrationReplacer.Successor = null; 405 410 generationsComparator.Successor = terminatedIslandsComparator; 406 terminatedIslandsComparator.Successor = comparisonFactorModifier 2;407 comparisonFactorModifier 2.Successor = analyzer2;411 terminatedIslandsComparator.Successor = comparisonFactorModifier; 412 comparisonFactorModifier.Successor = analyzer2; 408 413 analyzer2.Successor = resultsCollector3; 409 414 resultsCollector3.Successor = generationsTerminationCondition; -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
r3735 r3744 227 227 solutionsCreator.Successor = mainLoop; 228 228 229 mainLoop.SelectorParameter.ActualName = SelectorParameter.Name; 229 mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; 230 mainLoop.ComparisonFactorModifierParameter.ActualName = ComparisonFactorModifierParameter.Name; 231 mainLoop.ComparisonFactorParameter.ActualName = "ComparisonFactor"; 232 mainLoop.ComparisonFactorStartParameter.ActualName = ComparisonFactorLowerBoundParameter.Name; 230 233 mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name; 231 234 mainLoop.ElitesParameter.ActualName = ElitesParameter.Name; 232 235 mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name; 236 mainLoop.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name; 237 mainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name; 233 238 mainLoop.MutatorParameter.ActualName = MutatorParameter.Name; 234 mainLoop. MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;239 mainLoop.OffspringSelectionBeforeMutationParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name; 235 240 mainLoop.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 236 241 mainLoop.ResultsParameter.ActualName = "Results"; 242 mainLoop.SelectorParameter.ActualName = SelectorParameter.Name; 243 mainLoop.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name; 237 244 238 245 foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name)) -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs
r3698 r3744 75 75 public ValueLookupParameter<DoubleValue> SuccessRatioParameter { 76 76 get { return (ValueLookupParameter<DoubleValue>)Parameters["SuccessRatio"]; } 77 } 78 public LookupParameter<DoubleValue> ComparisonFactorParameter { 79 get { return (LookupParameter<DoubleValue>)Parameters["ComparisonFactor"]; } 80 } 81 public ValueLookupParameter<DoubleValue> ComparisonFactorStartParameter { 82 get { return (ValueLookupParameter<DoubleValue>)Parameters["ComparisonFactorStart"]; } 77 83 } 78 84 public ValueLookupParameter<IOperator> ComparisonFactorModifierParameter { … … 110 116 Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation.")); 111 117 Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved.")); 118 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].")); 119 Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorStart", "The initial value for the comparison factor.")); 112 120 Parameters.Add(new ValueLookupParameter<IOperator>("ComparisonFactorModifier", "The operator used to modify the comparison factor.")); 113 121 Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm.")); … … 117 125 #region Create operators 118 126 VariableCreator variableCreator = new VariableCreator(); 119 Placeholder comparisonFactorModifier1 = new Placeholder();127 Assigner comparisonFactorInitializer = new Assigner(); 120 128 Placeholder analyzer1 = new Placeholder(); 121 129 ResultsCollector resultsCollector1 = new ResultsCollector(); … … 125 133 Comparator maxGenerationsComparator = new Comparator(); 126 134 Comparator maxSelectionPressureComparator = new Comparator(); 127 Placeholder comparisonFactorModifier 2= new Placeholder();135 Placeholder comparisonFactorModifier = new Placeholder(); 128 136 Placeholder analyzer2 = new Placeholder(); 129 137 ResultsCollector resultsCollector3 = new ResultsCollector(); … … 135 143 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("SelectionPressure", new DoubleValue(0))); 136 144 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("CurrentSuccessRatio", new DoubleValue(0))); 137 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("ComparisonFactor", new DoubleValue(0))); 138 139 comparisonFactor Modifier1.Name = "Initialize ComparisonFactor (placeholder)";140 comparisonFactor Modifier1.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name;145 146 comparisonFactorInitializer.Name = "Initialize ComparisonFactor (placeholder)"; 147 comparisonFactorInitializer.LeftSideParameter.ActualName = ComparisonFactorParameter.Name; 148 comparisonFactorInitializer.RightSideParameter.ActualName = ComparisonFactorStartParameter.Name; 141 149 142 150 analyzer1.Name = "Analyzer (placeholder)"; … … 145 153 resultsCollector1.CopyValue = new BoolValue(false); 146 154 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 147 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Curent Comparison Factor", null, "ComparisonFactor"));155 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Curent Comparison Factor", null, ComparisonFactorParameter.Name)); 148 156 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Selection Pressure", null, "SelectionPressure")); 149 157 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Success Ratio", null, "CurrentSuccessRatio")); … … 154 162 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name; 155 163 156 mainOperator.ComparisonFactorParameter.ActualName = "ComparisonFactor";164 mainOperator.ComparisonFactorParameter.ActualName = ComparisonFactorParameter.Name; 157 165 mainOperator.CrossoverParameter.ActualName = CrossoverParameter.Name; 158 166 mainOperator.CurrentSuccessRatioParameter.ActualName = "CurrentSuccessRatio"; … … 184 192 maxSelectionPressureComparator.RightSideParameter.ActualName = MaximumSelectionPressureParameter.Name; 185 193 186 comparisonFactorModifier 2.Name = "Update ComparisonFactor (placeholder)";187 comparisonFactorModifier 2.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name;194 comparisonFactorModifier.Name = "Update ComparisonFactor (placeholder)"; 195 comparisonFactorModifier.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name; 188 196 189 197 analyzer2.Name = "Analyzer (placeholder)"; … … 203 211 #region Create operator graph 204 212 OperatorGraph.InitialOperator = variableCreator; 205 variableCreator.Successor = comparisonFactor Modifier1;206 comparisonFactor Modifier1.Successor = analyzer1;213 variableCreator.Successor = comparisonFactorInitializer; 214 comparisonFactorInitializer.Successor = analyzer1; 207 215 analyzer1.Successor = resultsCollector1; 208 216 resultsCollector1.Successor = resultsCollector2; … … 211 219 generationsCounter.Successor = maxGenerationsComparator; 212 220 maxGenerationsComparator.Successor = maxSelectionPressureComparator; 213 maxSelectionPressureComparator.Successor = comparisonFactorModifier 2;214 comparisonFactorModifier 2.Successor = analyzer2;221 maxSelectionPressureComparator.Successor = comparisonFactorModifier; 222 comparisonFactorModifier.Successor = analyzer2; 215 223 analyzer2.Successor = resultsCollector3; 216 224 resultsCollector3.Successor = conditionalBranch1; -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs
r3735 r3744 278 278 mainLoop.ResultsParameter.ActualName = "Results"; 279 279 mainLoop.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name; 280 mainLoop.ComparisonFactor LowerBoundParameter.ActualName = ComparisonFactorLowerBoundParameter.Name;280 mainLoop.ComparisonFactorStartParameter.ActualName = ComparisonFactorLowerBoundParameter.Name; 281 281 mainLoop.ComparisonFactorModifierParameter.ActualName = ComparisonFactorModifierParameter.Name; 282 mainLoop.ComparisonFactorUpperBoundParameter.ActualName = ComparisonFactorUpperBoundParameter.Name;283 282 mainLoop.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name; 284 283 mainLoop.FinalMaximumSelectionPressureParameter.ActualName = FinalMaximumSelectionPressureParameter.Name; -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASAMainLoop.cs
r3715 r3744 94 94 get { return (LookupParameter<DoubleValue>)Parameters["ComparisonFactor"]; } 95 95 } 96 public ValueLookupParameter<DoubleValue> ComparisonFactorLowerBoundParameter { 97 get { return (ValueLookupParameter<DoubleValue>)Parameters["ComparisonFactorLowerBound"]; } 98 } 99 public ValueLookupParameter<DoubleValue> ComparisonFactorUpperBoundParameter { 100 get { return (ValueLookupParameter<DoubleValue>)Parameters["ComparisonFactorUpperBound"]; } 96 public ValueLookupParameter<DoubleValue> ComparisonFactorStartParameter { 97 get { return (ValueLookupParameter<DoubleValue>)Parameters["ComparisonFactorStart"]; } 101 98 } 102 99 public ValueLookupParameter<IOperator> ComparisonFactorModifierParameter { … … 139 136 Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved.")); 140 137 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].")); 141 Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorLowerBound", "The lower bound of the comparison factor (start).")); 142 Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorUpperBound", "The upper bound of the comparison factor (end).")); 138 Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorStart", "The lower bound of the comparison factor (start).")); 143 139 Parameters.Add(new ValueLookupParameter<IOperator>("ComparisonFactorModifier", "The operator used to modify the comparison factor.")); 144 140 Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm.")); … … 206 202 maxSelPressAssigner.RightSideParameter.ActualName = MaximumSelectionPressureParameter.Name; 207 203 208 comparisonFactorInitializer.LeftSideParameter.ActualName = "ComparisonFactor";209 comparisonFactorInitializer.RightSideParameter.ActualName = ComparisonFactor LowerBoundParameter.Name;204 comparisonFactorInitializer.LeftSideParameter.ActualName = ComparisonFactorParameter.Name; 205 comparisonFactorInitializer.RightSideParameter.ActualName = ComparisonFactorStartParameter.Name; 210 206 211 207 villageVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>("Results", new ResultCollection())); … … 227 223 resultsCollector1.CopyValue = new BoolValue(false); 228 224 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Generations")); 229 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("ComparisonFactor", null, "ComparisonFactor"));225 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("ComparisonFactor", null, ComparisonFactorParameter.Name)); 230 226 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Terminated Villages", null, "TerminatedVillages")); 231 227 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Total Active Villages", null, "VillageCount")); … … 335 331 reunificationCounter.IncrementParameter.Value = new IntValue(1); 336 332 333 comparisonFactorModifier.Name = "Update comparison factor (placeholder)"; 337 334 comparisonFactorModifier.OperatorParameter.ActualName = ComparisonFactorModifierParameter.Name; 338 335
Note: See TracChangeset
for help on using the changeset viewer.