Changeset 7669 for branches/HeuristicLab.Hive.Azure/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3
- Timestamp:
- 03/28/12 15:47:26 (13 years ago)
- Location:
- branches/HeuristicLab.Hive.Azure
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive.Azure
- Property svn:ignore
-
old new 3 3 *.resharper 4 4 *.suo 5 *.user 5 6 *.vsp 6 7 Doxygen 8 FxCopResults.txt 7 9 Google.ProtocolBuffers-0.9.1.dll 8 10 HeuristicLab 3.3.5.1.ReSharper.user
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HeuristicLab.Hive.Azure/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimization.cs
r7270 r7669 288 288 if (Problem != null) { 289 289 IParticleCreator oldParticleCreator = ParticleCreator; 290 IParticleCreator defaultParticleCreator = Problem.Operators.OfType<IParticleCreator>().FirstOrDefault(); 290 291 ParticleCreatorParameter.ValidValues.Clear(); 291 292 foreach (IParticleCreator Creator in Problem.Operators.OfType<IParticleCreator>().OrderBy(x => x.Name)) { … … 295 296 IParticleCreator creator = ParticleCreatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleCreator.GetType()); 296 297 if (creator != null) ParticleCreator = creator; 297 } 298 else oldParticleCreator = null; 299 } 300 if (oldParticleCreator == null && defaultParticleCreator != null) 301 ParticleCreator = defaultParticleCreator; 298 302 } 299 303 } … … 372 376 ClearTopologyParameters(); 373 377 if (Problem != null) { 378 IParticleUpdater defaultParticleUpdater = null; 374 379 if (TopologyInitializer != null) { 375 380 foreach (ITopologyUpdater topologyUpdater in ApplicationManager.Manager.GetInstances<ITopologyUpdater>()) 376 381 TopologyUpdaterParameter.ValidValues.Add(topologyUpdater); 382 defaultParticleUpdater = Problem.Operators.OfType<ILocalParticleUpdater>().FirstOrDefault(); 377 383 foreach (IParticleUpdater particleUpdater in Problem.Operators.OfType<ILocalParticleUpdater>().OrderBy(x => x.Name)) 378 384 ParticleUpdaterParameter.ValidValues.Add(particleUpdater); 379 385 } else { 386 defaultParticleUpdater = Problem.Operators.OfType<IGlobalParticleUpdater>().FirstOrDefault(); 380 387 foreach (IParticleUpdater particleUpdater in Problem.Operators.OfType<IGlobalParticleUpdater>().OrderBy(x => x.Name)) 381 388 ParticleUpdaterParameter.ValidValues.Add(particleUpdater); … … 388 395 IParticleUpdater newParticleUpdater = ParticleUpdaterParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleUpdater.GetType()); 389 396 if (newParticleUpdater != null) ParticleUpdater = newParticleUpdater; 390 } 397 else oldParticleUpdater = null; 398 } 399 if (oldParticleUpdater == null && defaultParticleUpdater != null) 400 ParticleUpdater = defaultParticleUpdater; 391 401 392 402 ParameterizeTopologyUpdaters();
Note: See TracChangeset
for help on using the changeset viewer.