Changeset 7392
- Timestamp:
- 01/22/12 22:02:38 (13 years ago)
- Location:
- branches/HiveHiveEngine
- Files:
-
- 2 added
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveHiveEngine/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs
r7391 r7392 297 297 if (proportionalSelector != null) SelectorParameter.Value = proportionalSelector; 298 298 299 foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name)) { 300 var stochasticOperator = selector as IStochasticOperator; 301 if (stochasticOperator != null) 302 stochasticOperator.RandomParameter.ActualName = "Global Random"; 299 foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name)) 303 300 EmigrantsSelectorParameter.ValidValues.Add(selector); 304 }305 301 306 302 foreach (IReplacer replacer in ApplicationManager.Manager.GetInstances<IReplacer>().OrderBy(x => x.Name)) -
branches/HiveHiveEngine/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/ParallelIslandGeneticAlgorithm.cs
r7322 r7392 242 242 OperatorGraph.InitialOperator = randomCreator; 243 243 244 randomCreator.RandomParameter.ActualName = " Random";244 randomCreator.RandomParameter.ActualName = "GlobalRandom"; 245 245 randomCreator.SeedParameter.ActualName = SeedParameter.Name; 246 246 randomCreator.SeedParameter.Value = null; … … 418 418 } 419 419 } 420 private void ParameterizeStochasticOperatorForIsland(IOperator op) { 421 IStochasticOperator stochasticOp = op as IStochasticOperator; 422 if (stochasticOp != null) { 423 stochasticOp.RandomParameter.ActualName = "LocalRandom"; 424 stochasticOp.RandomParameter.Hidden = true; 425 } 426 } 420 427 private void ParameterizeSelectors() { 421 428 foreach (ISelector selector in SelectorParameter.ValidValues) { … … 423 430 selector.NumberOfSelectedSubScopesParameter.Value = new IntValue(2 * (PopulationSize.Value - Elites.Value)); 424 431 selector.NumberOfSelectedSubScopesParameter.Hidden = true; 425 ParameterizeStochasticOperator (selector);432 ParameterizeStochasticOperatorForIsland(selector); 426 433 } 427 434 foreach (ISelector selector in EmigrantsSelectorParameter.ValidValues) { … … 491 498 ICrossover oldCrossover = CrossoverParameter.Value; 492 499 CrossoverParameter.ValidValues.Clear(); 493 foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name)) 500 foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>().OrderBy(x => x.Name)) { 501 ParameterizeStochasticOperatorForIsland(crossover); 494 502 CrossoverParameter.ValidValues.Add(crossover); 503 } 495 504 if (oldCrossover != null) { 496 505 ICrossover crossover = CrossoverParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldCrossover.GetType()); … … 501 510 IManipulator oldMutator = MutatorParameter.Value; 502 511 MutatorParameter.ValidValues.Clear(); 503 foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name)) 512 foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>().OrderBy(x => x.Name)) { 513 ParameterizeStochasticOperatorForIsland(mutator); 504 514 MutatorParameter.ValidValues.Add(mutator); 515 } 505 516 if (oldMutator != null) { 506 517 IManipulator mutator = MutatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldMutator.GetType()); -
branches/HiveHiveEngine/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/ParallelIslandGeneticAlgorithmMainLoop.cs
r7391 r7392 158 158 VariableCreator islandVariableCreator = new VariableCreator(); 159 159 Placeholder islandAnalyzer1 = new Placeholder(); 160 SubScopesRandomCreator subScopesRandomCreator = new SubScopesRandomCreator();160 LocalRandomGenerator localRandomGenerator = new LocalRandomGenerator(); 161 161 Placeholder analyzer1 = new Placeholder(); 162 162 ResultsCollector resultsCollector1 = new ResultsCollector(); … … 182 182 Comparator checkIslandGenerationsReachedMaximum = new Comparator(); 183 183 ConditionalBranch checkContinueEvolution = new ConditionalBranch(); 184 IntDataReducer generationsReducer = new IntDataReducer();185 IntDataReducer evaluatedSolutionsReducer = new IntDataReducer();184 DataReducer generationsReducer = new DataReducer(); 185 DataReducer evaluatedSolutionsReducer = new DataReducer(); 186 186 Placeholder islandAnalyzer2 = new Placeholder(); 187 187 UniformSubScopesProcessor uniformSubScopesProcessor5 = new UniformSubScopesProcessor(); … … 234 234 235 235 stochasticBranch.ProbabilityParameter.ActualName = MutationProbabilityParameter.Name; 236 stochasticBranch.RandomParameter.ActualName = RandomParameter.Name; 236 //set it to the random number generator of the island 237 stochasticBranch.RandomParameter.ActualName = "LocalRandom"; 237 238 238 239 mutator.Name = "Mutator (placeholder)"; … … 312 313 uniformSubScopesProcessor0.Successor = analyzer1; 313 314 islandVariableCreator.Successor = islandAnalyzer1; 314 islandAnalyzer1.Successor = subScopesRandomCreator;315 subScopesRandomCreator.Successor = null;315 islandAnalyzer1.Successor = localRandomGenerator; 316 localRandomGenerator.Successor = null; 316 317 analyzer1.Successor = resultsCollector1; 317 318 resultsCollector1.Successor = uniformSubScopesProcessor1; -
branches/HiveHiveEngine/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj
r7391 r7392 118 118 <Compile Include="Assigner.cs" /> 119 119 <Compile Include="AlgorithmOperator.cs" /> 120 <Compile Include=" SubScopesRandomCreator.cs" />121 <Compile Include=" IntDataReducer.cs" />120 <Compile Include="LocalRandomGenerator.cs" /> 121 <Compile Include="DataReducer.cs" /> 122 122 <Compile Include="ReductionOperation.cs" /> 123 123 <Compile Include="ReductionOperations.cs" />
Note: See TracChangeset
for help on using the changeset viewer.