Changeset 9363 for branches/OaaS/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs
- Timestamp:
- 04/16/13 13:13:41 (12 years ago)
- Location:
- branches/OaaS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 23 24 packages
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/OaaS/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/IslandGeneticAlgorithm.cs
r8121 r9363 181 181 } 182 182 private UniformSubScopesProcessor IslandProcessor { 183 get { return ((RandomCreator.Successor as SubScopesCreator).Successor as UniformSubScopesProcessor); }183 get { return OperatorGraph.Iterate().OfType<UniformSubScopesProcessor>().First(x => x.Operator is SolutionsCreator); } 184 184 } 185 185 private SolutionsCreator SolutionsCreator { … … 232 232 233 233 RandomCreator randomCreator = new RandomCreator(); 234 UniformSubScopesProcessor ussp0 = new UniformSubScopesProcessor(); 235 LocalRandomCreator localRandomCreator = new LocalRandomCreator(); 236 RandomCreator globalRandomResetter = new RandomCreator(); 234 237 SubScopesCreator populationCreator = new SubScopesCreator(); 235 238 UniformSubScopesProcessor ussp1 = new UniformSubScopesProcessor(); … … 250 253 251 254 populationCreator.NumberOfSubScopesParameter.ActualName = NumberOfIslandsParameter.Name; 252 populationCreator.Successor = ussp1; 255 populationCreator.Successor = ussp0; 256 257 ussp0.Operator = localRandomCreator; 258 ussp0.Successor = globalRandomResetter; 259 260 // BackwardsCompatibility3.3 261 // the global random is resetted to ensure the same algorithm results 262 #region Backwards compatible code, remove global random resetter with 3.4 and rewire the operator graph 263 globalRandomResetter.RandomParameter.ActualName = "GlobalRandom"; 264 globalRandomResetter.SeedParameter.ActualName = SeedParameter.Name; 265 globalRandomResetter.SeedParameter.Value = null; 266 globalRandomResetter.SetSeedRandomlyParameter.Value = new BoolValue(false); 267 globalRandomResetter.Successor = ussp1; 268 #endregion 253 269 254 270 ussp1.Operator = solutionsCreator; … … 325 341 protected override void OnProblemChanged() { 326 342 ParameterizeStochasticOperator(Problem.SolutionCreator); 327 ParameterizeStochasticOperator (Problem.Evaluator);343 ParameterizeStochasticOperatorForIsland(Problem.Evaluator); 328 344 foreach (IOperator op in Problem.Operators.OfType<IOperator>()) ParameterizeStochasticOperator(op); 329 345 ParameterizeSolutionsCreator(); … … 345 361 } 346 362 protected override void Problem_EvaluatorChanged(object sender, EventArgs e) { 347 ParameterizeStochasticOperator (Problem.Evaluator);363 ParameterizeStochasticOperatorForIsland(Problem.Evaluator); 348 364 ParameterizeSolutionsCreator(); 349 365 ParameterizeMainLoop();
Note: See TracChangeset
for help on using the changeset viewer.