Changeset 2891 for trunk/sources/HeuristicLab.Algorithms.SGA
- Timestamp:
- 03/01/10 04:46:06 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.SGA/3.3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.SGA/3.3/HeuristicLab.Algorithms.SGA-3.3.csproj
r2884 r2891 88 88 </ItemGroup> 89 89 <ItemGroup> 90 <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj"> 91 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project> 92 <Name>HeuristicLab.Analysis-3.3</Name> 93 </ProjectReference> 90 94 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 91 95 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> -
trunk/sources/HeuristicLab.Algorithms.SGA/3.3/HeuristicLabAlgorithmsSGAPlugin.cs.frame
r2884 r2891 28 28 [Plugin("HeuristicLab.Algorithms.SGA", "3.3.0.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Algorithms.SGA-3.3.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.Analysis", "3.3")] 30 31 [PluginDependency("HeuristicLab.Collections", "3.3")] 31 32 [PluginDependency("HeuristicLab.Core", "3.3")] -
trunk/sources/HeuristicLab.Algorithms.SGA/3.3/SGA.cs
r2890 r2891 43 43 private SGAOperator sgaOperator; 44 44 45 private OptionalValueParameter<IntData> PopulationSizeParameter {46 get { return ( OptionalValueParameter<IntData>)Parameters["PopulationSize"]; }45 private ValueParameter<IntData> PopulationSizeParameter { 46 get { return (ValueParameter<IntData>)Parameters["PopulationSize"]; } 47 47 } 48 48 private ConstrainedValueParameter<ISelector> SelectorParameter { … … 55 55 get { return (ConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; } 56 56 } 57 private OptionalValueParameter<IntData> ElitesParameter {58 get { return ( OptionalValueParameter<IntData>)Parameters["Elites"]; }57 private ValueParameter<IntData> ElitesParameter { 58 get { return (ValueParameter<IntData>)Parameters["Elites"]; } 59 59 } 60 60 … … 69 69 public SGA() 70 70 : base() { 71 Parameters.Add(new OptionalValueParameter<IntData>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntData(0)));72 Parameters.Add(new OptionalValueParameter<BoolData>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolData(true)));73 Parameters.Add(new OptionalValueParameter<IntData>("PopulationSize", "The size of the population of solutions.", new IntData(100)));71 Parameters.Add(new ValueParameter<IntData>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntData(0))); 72 Parameters.Add(new ValueParameter<BoolData>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolData(true))); 73 Parameters.Add(new ValueParameter<IntData>("PopulationSize", "The size of the population of solutions.", new IntData(100))); 74 74 Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction.")); 75 75 Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover", "The operator used to cross solutions.")); 76 Parameters.Add(new OptionalValueParameter<DoubleData>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new DoubleData(0.05)));76 Parameters.Add(new ValueParameter<DoubleData>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new DoubleData(0.05))); 77 77 Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 78 Parameters.Add(new OptionalValueParameter<IntData>("Elites", "The numer of elite solutions which are kept in each generation.", new IntData(1)));79 Parameters.Add(new OptionalValueParameter<IntData>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntData(1000)));78 Parameters.Add(new ValueParameter<IntData>("Elites", "The numer of elite solutions which are kept in each generation.", new IntData(1))); 79 Parameters.Add(new ValueParameter<IntData>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntData(1000))); 80 80 81 81 PopulationSizeParameter.ValueChanged += new EventHandler(PopulationSizeParameter_ValueChanged); -
trunk/sources/HeuristicLab.Algorithms.SGA/3.3/SGAOperator.cs
r2890 r2891 20 20 #endregion 21 21 22 using HeuristicLab.Analysis; 22 23 using HeuristicLab.Core; 23 24 using HeuristicLab.Data; … … 112 113 IntCounter intCounter = new IntCounter(); 113 114 Comparator comparator = new Comparator(); 115 BestAverageWorstQualityCalculator bestAverageWorstQualityCalculator = new BestAverageWorstQualityCalculator(); 114 116 ResultsCollector resultsCollector = new ResultsCollector(); 115 117 ConditionalBranch conditionalBranch = new ConditionalBranch(); … … 179 181 comparator.ResultParameter.ActualName = "Terminate"; 180 182 comparator.RightSideParameter.ActualName = "MaximumGenerations"; 181 comparator.Successor = resultsCollector; 182 183 SubScopesLookupParameter<DoubleData> quality = new SubScopesLookupParameter<DoubleData>("Qualities"); 184 quality.ActualName = "Quality"; 185 resultsCollector.CollectedValues.Add(quality); 183 comparator.Successor = bestAverageWorstQualityCalculator; 184 185 bestAverageWorstQualityCalculator.AverageQualityParameter.ActualName = "AverageQuality"; 186 bestAverageWorstQualityCalculator.BestQualityParameter.ActualName = "BestQuality"; 187 bestAverageWorstQualityCalculator.MaximizationParameter.ActualName = "Maximization"; 188 bestAverageWorstQualityCalculator.QualityParameter.ActualName = "Quality"; 189 bestAverageWorstQualityCalculator.WorstQualityParameter.ActualName = "WorstQuality"; 190 bestAverageWorstQualityCalculator.Successor = resultsCollector; 191 192 LookupParameter<DoubleData> bestQuality = new LookupParameter<DoubleData>("BestQuality"); 193 bestQuality.ActualName = "BestQuality"; 194 resultsCollector.CollectedValues.Add(bestQuality); 195 LookupParameter<DoubleData> averageQuality = new LookupParameter<DoubleData>("AverageQuality"); 196 averageQuality.ActualName = "AverageQuality"; 197 resultsCollector.CollectedValues.Add(averageQuality); 198 LookupParameter<DoubleData> worstQuality = new LookupParameter<DoubleData>("WorstQuality"); 199 worstQuality.ActualName = "WorstQuality"; 200 resultsCollector.CollectedValues.Add(worstQuality); 186 201 resultsCollector.ResultsParameter.ActualName = "Results"; 187 202 resultsCollector.Successor = conditionalBranch; -
trunk/sources/HeuristicLab.Algorithms.SGA/3.3/Tests/HeuristicLab.Algorithms.SGA-3.3.Tests.csproj
r2884 r2891 46 46 </ItemGroup> 47 47 <ItemGroup> 48 <ProjectReference Include="..\..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj"> 49 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project> 50 <Name>HeuristicLab.Analysis-3.3</Name> 51 </ProjectReference> 48 52 <ProjectReference Include="..\..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 49 53 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
Note: See TracChangeset
for help on using the changeset viewer.