- Timestamp:
- 04/21/10 22:05:40 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3
- Files:
-
- 2 added
- 3 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.csproj
r3429 r3479 80 80 </ItemGroup> 81 81 <ItemGroup> 82 <Compile Include="SASEGASA.cs" /> 83 <Compile Include="SASEGASAMainLoop.cs" /> 82 84 <Compile Include="HeuristicLabAlgorithmsOffspringSelectionGeneticAlgorithmPlugin.cs" /> 83 <Compile Include=" OffspringSelectionIslandGeneticAlgorithm.cs" />84 <Compile Include=" OffspringSelectionIslandGeneticAlgorithmMainLoop.cs" />85 <Compile Include="IslandOffspringSelectionGeneticAlgorithm.cs" /> 86 <Compile Include="IslandOffspringSelectionGeneticAlgorithmMainLoop.cs" /> 85 87 <Compile Include="OffspringSelectionGeneticAlgorithm.cs" /> 86 88 <Compile Include="OffspringSelectionGeneticAlgorithmMainLoop.cs" /> -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs
r3450 r3479 39 39 /// An offspring selection island genetic algorithm. 40 40 /// </summary> 41 [Item(" Offspring Selection Island Genetic Algorithm", "An offspring selection islandgenetic algorithm.")]41 [Item("Island Offspring Selection Genetic Algorithm", "An island offspring selection genetic algorithm.")] 42 42 [Creatable("Algorithms")] 43 43 [StorableClass] 44 public sealed class OffspringSelectionIslandGeneticAlgorithm : EngineAlgorithm {44 public sealed class IslandOffspringSelectionGeneticAlgorithm : EngineAlgorithm { 45 45 46 46 #region Problem Properties … … 229 229 get { return (SolutionsCreator)IslandProcessor.Operator; } 230 230 } 231 private OffspringSelectionIslandGeneticAlgorithmMainLoop MainLoop {232 get { return ( OffspringSelectionIslandGeneticAlgorithmMainLoop)IslandProcessor.Successor; }231 private IslandOffspringSelectionGeneticAlgorithmMainLoop MainLoop { 232 get { return (IslandOffspringSelectionGeneticAlgorithmMainLoop)IslandProcessor.Successor; } 233 233 } 234 234 #endregion 235 235 236 236 [StorableConstructor] 237 private OffspringSelectionIslandGeneticAlgorithm(bool deserializing) : base(deserializing) { }238 public OffspringSelectionIslandGeneticAlgorithm()237 private IslandOffspringSelectionGeneticAlgorithm(bool deserializing) : base(deserializing) { } 238 public IslandOffspringSelectionGeneticAlgorithm() 239 239 : base() { 240 240 Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0))); … … 246 246 Parameters.Add(new ConstrainedValueParameter<ISelector>("EmigrantsSelector", "Selects the individuals that will be migrated.")); 247 247 Parameters.Add(new ConstrainedValueParameter<ISelector>("ImmigrationSelector", "Selects the population from the unification of the original population and the immigrants.")); 248 Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The size of the population of solutions .", new IntValue(100)));248 Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The size of the population of solutions of each island.", new IntValue(100))); 249 249 Parameters.Add(new ValueParameter<IntValue>("MaximumMigrations", "The maximum number of migrations that should occur.", new IntValue(100))); 250 250 Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction.")); … … 265 265 UniformSubScopesProcessor ussp1 = new UniformSubScopesProcessor(); 266 266 SolutionsCreator solutionsCreator = new SolutionsCreator(); 267 OffspringSelectionIslandGeneticAlgorithmMainLoop mainLoop = new OffspringSelectionIslandGeneticAlgorithmMainLoop();267 IslandOffspringSelectionGeneticAlgorithmMainLoop mainLoop = new IslandOffspringSelectionGeneticAlgorithmMainLoop(); 268 268 OperatorGraph.InitialOperator = randomCreator; 269 269 … … 313 313 314 314 public override IDeepCloneable Clone(Cloner cloner) { 315 OffspringSelectionIslandGeneticAlgorithm clone = (OffspringSelectionIslandGeneticAlgorithm)base.Clone(cloner);315 IslandOffspringSelectionGeneticAlgorithm clone = (IslandOffspringSelectionGeneticAlgorithm)base.Clone(cloner); 316 316 clone.Initialize(); 317 317 return clone; -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs
r3450 r3479 37 37 namespace HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm { 38 38 /// <summary> 39 /// An offspring selection islandgenetic algorithm main loop operator.39 /// An island offspring selection genetic algorithm main loop operator. 40 40 /// </summary> 41 [Item(" OffspringSelectionIslandGeneticAlgorithmMainLoop", "An offspring selection islandgenetic algorithm main loop operator.")]41 [Item("IslandOffspringSelectionGeneticAlgorithmMainLoop", "An island offspring selection genetic algorithm main loop operator.")] 42 42 [StorableClass] 43 public sealed class OffspringSelectionIslandGeneticAlgorithmMainLoop : AlgorithmOperator {43 public sealed class IslandOffspringSelectionGeneticAlgorithmMainLoop : AlgorithmOperator { 44 44 #region Parameter Properties 45 45 public ValueLookupParameter<IRandom> RandomParameter { … … 127 127 128 128 [StorableConstructor] 129 private OffspringSelectionIslandGeneticAlgorithmMainLoop(bool deserializing) : base() { }130 public OffspringSelectionIslandGeneticAlgorithmMainLoop()129 private IslandOffspringSelectionGeneticAlgorithmMainLoop(bool deserializing) : base() { } 130 public IslandOffspringSelectionGeneticAlgorithmMainLoop() 131 131 : base() { 132 132 #region Create parameters -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
r3426 r3479 212 212 solutionsCreator.Successor = mainLoop; 213 213 214 mainLoop.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name;215 214 mainLoop.SelectorParameter.ActualName = SelectorParameter.Name; 216 215 mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name; … … 285 284 private void PopulationSizeParameter_ValueChanged(object sender, EventArgs e) { 286 285 PopulationSize.ValueChanged += new EventHandler(PopulationSize_ValueChanged); 287 MainLoop.PopulationSizeParameter.Value = new IntValue(PopulationSize.Value - Elites.Value);288 286 ParameterizeSelectors(); 289 287 } 290 288 private void PopulationSize_ValueChanged(object sender, EventArgs e) { 291 MainLoop.PopulationSizeParameter.Value = new IntValue(PopulationSize.Value - Elites.Value);292 289 ParameterizeSelectors(); 293 290 } -
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs
r3446 r3479 43 43 get { return (ValueLookupParameter<BoolValue>)Parameters["Maximization"]; } 44 44 } 45 public ValueLookupParameter<IntValue> PopulationSizeParameter {46 get { return (ValueLookupParameter<IntValue>)Parameters["PopulationSize"]; }47 }48 45 public SubScopesLookupParameter<DoubleValue> QualityParameter { 49 46 get { return (SubScopesLookupParameter<DoubleValue>)Parameters["Quality"]; } … … 113 110 Parameters.Add(new ValueLookupParameter<IRandom>("Random", "A pseudo random number generator.")); 114 111 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false.")); 115 Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population."));116 112 Parameters.Add(new SubScopesLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution.")); 117 113 Parameters.Add(new ValueLookupParameter<DoubleValue>("BestKnownQuality", "The best known quality value found so far.")); … … 189 185 initializationBranch.ConditionParameter.ActualName = "IsInitialized"; 190 186 191 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); 187 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // this variable is referenced in SASEGASAMainLoop, do not change! 192 188 variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("EvaluatedSolutions", new IntValue(0))); 193 189 variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("SelectionPressure", new DoubleValue(0))); … … 196 192 variableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("IsInitialized", new BoolValue(true))); 197 193 198 variableAssigner.LeftSideParameter.ActualName = "ComparisonFactor"; 194 variableAssigner.LeftSideParameter.ActualName = "ComparisonFactor"; // this variable is referenced in SASEGASA, OffspringSelectionGeneticAlgorithm, do not change! 199 195 variableAssigner.RightSideParameter.ActualName = ComparisonFactorLowerBoundParameter.Name; 200 196 … … 313 309 offspringSelector.LuckyLosersParameter.ActualName = "OSLuckyLosers"; 314 310 offspringSelector.MaximumSelectionPressureParameter.ActualName = MaximumSelectionPressureParameter.Name; 315 offspringSelector.PopulationSizeParameter.ActualName = PopulationSizeParameter.Name;316 311 offspringSelector.SelectionPressureParameter.ActualName = "SelectionPressure"; 317 312 offspringSelector.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name; … … 382 377 383 378 conditionalBranch2.Name = "MaximumGenerations reached?"; 384 conditionalBranch2.ConditionParameter.ActualName = "TerminateMaximumGenerations"; 379 conditionalBranch2.ConditionParameter.ActualName = "TerminateMaximumGenerations"; // this variable is referenced in SASEGASAMainLoop, do not change! 385 380 #endregion 386 381
Note: See TracChangeset
for help on using the changeset viewer.