Changeset 12304 for branches/TerminationCriteria
- Timestamp:
- 04/13/15 16:52:31 (10 years ago)
- Location:
- branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.csproj
r12301 r12304 199 199 </BootstrapperPackage> 200 200 </ItemGroup> 201 <ItemGroup> 202 <ProjectReference Include="..\..\HeuristicLab.Termination\3.3\HeuristicLab.Termination-3.3.csproj"> 203 <Project>{5AB79EEE-33AC-4E7A-8AF1-E409AB63A3D3}</Project> 204 <Name>HeuristicLab.Termination-3.3</Name> 205 </ProjectReference> 206 </ItemGroup> 201 207 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 202 208 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
r12012 r12304 33 33 using HeuristicLab.PluginInfrastructure; 34 34 using HeuristicLab.Random; 35 using HeuristicLab.Termination; 35 36 36 37 namespace HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm { … … 114 115 private IFixedValueParameter<BoolValue> FillPopulationWithParentsParameter { 115 116 get { return (IFixedValueParameter<BoolValue>)Parameters["FillPopulationWithParents"]; } 117 } 118 private IValueParameter<MultiTerminationCriterion> TerminationCriteriaParameter { 119 get { return (IValueParameter<MultiTerminationCriterion>)Parameters["TerminationCriteria"]; } 116 120 } 117 121 #endregion … … 264 268 Parameters.Add(new ValueParameter<IntValue>("MaximumEvaluatedSolutions", "The maximum number of evaluated solutions (approximately).", new IntValue(int.MaxValue))); 265 269 Parameters.Add(new FixedValueParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded.", new BoolValue(false)) { Hidden = true }); 270 Parameters.Add(new ValueParameter<MultiTerminationCriterion>("TerminationCriteria", "The termination criteria which sould be checked.", new MultiTerminationCriterion())); 266 271 267 272 RandomCreator randomCreator = new RandomCreator(); … … 321 326 ParameterizeComparisonFactorModifiers(); 322 327 328 var maximumGenerationsTerminationCriteria = new MaximumIterationsTerminationCriterion(); 329 maximumGenerationsTerminationCriteria.IterationsParameter.ActualName = "Generations"; 330 maximumGenerationsTerminationCriteria.MaximumIterationsParameter.ActualName = "MaximumGenerations"; 331 TerminationCriteriaParameter.Value.Operators.Add(maximumGenerationsTerminationCriteria); 332 323 333 qualityAnalyzer = new BestAverageWorstQualityAnalyzer(); 324 334 selectionPressureAnalyzer = new ValueAnalyzer(); -
branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs
r12012 r12304 27 27 using HeuristicLab.Parameters; 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Termination; 29 30 30 31 namespace HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm { … … 159 160 OffspringSelectionGeneticAlgorithmMainOperator mainOperator = new OffspringSelectionGeneticAlgorithmMainOperator(); 160 161 IntCounter generationsCounter = new IntCounter(); 161 Comparator maxGenerationsComparator = new Comparator();162 Comparator maxSelectionPressureComparator = new Comparator();163 Comparator maxEvaluatedSolutionsComparator = new Comparator();162 //Comparator maxGenerationsComparator = new Comparator(); 163 //Comparator maxSelectionPressureComparator = new Comparator(); 164 //Comparator maxEvaluatedSolutionsComparator = new Comparator(); 164 165 Placeholder comparisonFactorModifier = new Placeholder(); 165 166 Placeholder analyzer2 = new Placeholder(); 166 ConditionalBranch conditionalBranch1 = new ConditionalBranch(); 167 ConditionalBranch conditionalBranch2 = new ConditionalBranch(); 168 ConditionalBranch conditionalBranch3 = new ConditionalBranch(); 167 var termination = new TerminationOperator(); 168 //ConditionalBranch conditionalBranch1 = new ConditionalBranch(); 169 //ConditionalBranch conditionalBranch2 = new ConditionalBranch(); 170 //ConditionalBranch conditionalBranch3 = new ConditionalBranch(); 169 171 170 172 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class OffspringSelectionGeneticAlgorithm expects this to be called Generations … … 208 210 generationsCounter.ValueParameter.ActualName = "Generations"; 209 211 210 maxGenerationsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);211 maxGenerationsComparator.LeftSideParameter.ActualName = "Generations";212 maxGenerationsComparator.ResultParameter.ActualName = "TerminateMaximumGenerations";213 maxGenerationsComparator.RightSideParameter.ActualName = MaximumGenerationsParameter.Name;214 215 maxSelectionPressureComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);216 maxSelectionPressureComparator.LeftSideParameter.ActualName = "SelectionPressure";217 maxSelectionPressureComparator.ResultParameter.ActualName = "TerminateSelectionPressure";218 maxSelectionPressureComparator.RightSideParameter.ActualName = MaximumSelectionPressureParameter.Name;219 220 maxEvaluatedSolutionsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);221 maxEvaluatedSolutionsComparator.LeftSideParameter.ActualName = EvaluatedSolutionsParameter.Name;222 maxEvaluatedSolutionsComparator.ResultParameter.ActualName = "TerminateEvaluatedSolutions";223 maxEvaluatedSolutionsComparator.RightSideParameter.ActualName = "MaximumEvaluatedSolutions";212 //maxGenerationsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual); 213 //maxGenerationsComparator.LeftSideParameter.ActualName = "Generations"; 214 //maxGenerationsComparator.ResultParameter.ActualName = "TerminateMaximumGenerations"; 215 //maxGenerationsComparator.RightSideParameter.ActualName = MaximumGenerationsParameter.Name; 216 217 //maxSelectionPressureComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual); 218 //maxSelectionPressureComparator.LeftSideParameter.ActualName = "SelectionPressure"; 219 //maxSelectionPressureComparator.ResultParameter.ActualName = "TerminateSelectionPressure"; 220 //maxSelectionPressureComparator.RightSideParameter.ActualName = MaximumSelectionPressureParameter.Name; 221 222 //maxEvaluatedSolutionsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual); 223 //maxEvaluatedSolutionsComparator.LeftSideParameter.ActualName = EvaluatedSolutionsParameter.Name; 224 //maxEvaluatedSolutionsComparator.ResultParameter.ActualName = "TerminateEvaluatedSolutions"; 225 //maxEvaluatedSolutionsComparator.RightSideParameter.ActualName = "MaximumEvaluatedSolutions"; 224 226 225 227 comparisonFactorModifier.Name = "Update ComparisonFactor (placeholder)"; … … 229 231 analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name; 230 232 231 conditionalBranch1.Name = "MaximumSelectionPressure reached?";232 conditionalBranch1.ConditionParameter.ActualName = "TerminateSelectionPressure";233 234 conditionalBranch2.Name = "MaximumGenerations reached?";235 conditionalBranch2.ConditionParameter.ActualName = "TerminateMaximumGenerations";236 237 conditionalBranch3.Name = "MaximumEvaluatedSolutions reached?";238 conditionalBranch3.ConditionParameter.ActualName = "TerminateEvaluatedSolutions";233 //conditionalBranch1.Name = "MaximumSelectionPressure reached?"; 234 //conditionalBranch1.ConditionParameter.ActualName = "TerminateSelectionPressure"; 235 236 //conditionalBranch2.Name = "MaximumGenerations reached?"; 237 //conditionalBranch2.ConditionParameter.ActualName = "TerminateMaximumGenerations"; 238 239 //conditionalBranch3.Name = "MaximumEvaluatedSolutions reached?"; 240 //conditionalBranch3.ConditionParameter.ActualName = "TerminateEvaluatedSolutions"; 239 241 #endregion 240 242 … … 246 248 resultsCollector1.Successor = mainOperator; 247 249 mainOperator.Successor = generationsCounter; 248 generationsCounter.Successor = maxGenerationsComparator;249 maxGenerationsComparator.Successor = maxSelectionPressureComparator;250 maxSelectionPressureComparator.Successor = maxEvaluatedSolutionsComparator;251 maxEvaluatedSolutionsComparator.Successor = comparisonFactorModifier;250 generationsCounter.Successor = comparisonFactorModifier; //maxGenerationsComparator; 251 //maxGenerationsComparator.Successor = maxSelectionPressureComparator; 252 //maxSelectionPressureComparator.Successor = maxEvaluatedSolutionsComparator; 253 //maxEvaluatedSolutionsComparator.Successor = comparisonFactorModifier; 252 254 comparisonFactorModifier.Successor = analyzer2; 253 analyzer2.Successor = conditionalBranch1; 254 conditionalBranch1.FalseBranch = conditionalBranch2; 255 conditionalBranch1.TrueBranch = null; 256 conditionalBranch1.Successor = null; 257 conditionalBranch2.FalseBranch = conditionalBranch3; 258 conditionalBranch2.TrueBranch = null; 259 conditionalBranch2.Successor = null; 260 conditionalBranch3.FalseBranch = mainOperator; 261 conditionalBranch3.TrueBranch = null; 262 conditionalBranch3.Successor = null; 255 analyzer2.Successor = termination; //conditionalBranch1; 256 //conditionalBranch1.FalseBranch = conditionalBranch2; 257 //conditionalBranch1.TrueBranch = null; 258 //conditionalBranch1.Successor = null; 259 //conditionalBranch2.FalseBranch = conditionalBranch3; 260 //conditionalBranch2.TrueBranch = null; 261 //conditionalBranch2.Successor = null; 262 //conditionalBranch3.FalseBranch = mainOperator; 263 //conditionalBranch3.TrueBranch = null; 264 //conditionalBranch3.Successor = null; 265 termination.ContinueBranch = mainOperator; 263 266 #endregion 264 267 } -
branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/Plugin.cs.frame
r12012 r12304 40 40 [PluginDependency("HeuristicLab.Random", "3.3")] 41 41 [PluginDependency("HeuristicLab.Selection", "3.3")] 42 [PluginDependency("HeuristicLab.Termination", "3.3")] 42 43 public class HeuristicLabAlgorithmsOffspringSelectionGeneticAlgorithmPlugin : PluginBase { 43 44 }
Note: See TracChangeset
for help on using the changeset viewer.