- Timestamp:
- 07/12/17 16:49:16 (8 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/AdaptiveRandomTopologyUpdater.cs
r15181 r15214 86 86 var successor = new OperationCollection(new[] { base.Apply() }); 87 87 var max = MaximizationParameter.ActualValue.Value; 88 if (max && swarmBest.Value >= previousBest.Value89 || !max && swarmBest.Value <= previousBest.Value)88 if (max && swarmBest.Value <= previousBest.Value 89 || !max && swarmBest.Value >= previousBest.Value) 90 90 successor.Insert(0, ExecutionContext.CreateOperation(TopologyInitializerParameter.ActualValue)); 91 91 -
trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimization.cs
r15181 r15214 181 181 Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer())); 182 182 Parameters.Add(new ValueParameter<DoubleValue>("Inertia", "Inertia weight on a particle's movement (omega).", new DoubleValue(0.721))); 183 Parameters.Add(new ValueParameter<DoubleValue>("PersonalBestAttraction", "Weight for particle's pull towards its personal best soution (phi_p).", new DoubleValue(1 )));184 Parameters.Add(new ValueParameter<DoubleValue>("NeighborBestAttraction", "Weight for pull towards the neighborhood best solution or global best solution in case of a totally connected topology (phi_g).", new DoubleValue(1 )));183 Parameters.Add(new ValueParameter<DoubleValue>("PersonalBestAttraction", "Weight for particle's pull towards its personal best soution (phi_p).", new DoubleValue(1.193))); 184 Parameters.Add(new ValueParameter<DoubleValue>("NeighborBestAttraction", "Weight for pull towards the neighborhood best solution or global best solution in case of a totally connected topology (phi_g).", new DoubleValue(1.193))); 185 185 Parameters.Add(new ConstrainedValueParameter<IParticleCreator>("ParticleCreator", "Operator that creates a new particle.")); 186 186 Parameters.Add(new ConstrainedValueParameter<IParticleUpdater>("ParticleUpdater", "Operator that updates a particle.")); -
trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RandomTopologyInitializer.cs
r15181 r15214 30 30 31 31 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 32 [Item("Random Topology Initializer", "Each particle is informed by exactly k+1 distinct other particles (including itself).")]32 [Item("Random Distinct Topology Initializer", "Each particle is informed by exactly k+1 distinct other particles (including itself).")] 33 33 [StorableClass] 34 34 public sealed class RandomTopologyInitializer : TopologyInitializer, IStochasticOperator { -
trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/SPSORandomTopologyInitializer.cs
r15181 r15214 62 62 63 63 // SPSO: Each particle informs at most K+1 particles (at least itself and K others) 64 var particlesInform = Enumerable.Repeat(k + 1, swarmSize) 65 .Select((v, i) => new HashSet<int>(Enumerable.Range(0, v).Select(x => x == 0 ? i : random.Next(swarmSize)))).ToList(); 64 // it is by design that we draw from the particles with repetition 65 var particlesInform = new List<HashSet<int>>(swarmSize); 66 for (var i = 0; i < swarmSize; i++) { 67 var informs = new HashSet<int>() { i }; 68 for (var j = 0; j < k; j++) { 69 informs.Add(random.Next(swarmSize)); 70 } 71 particlesInform.Add(informs); 72 } 66 73 67 74 var neighbors = new ItemArray<IntArray>(swarmSize);
Note: See TracChangeset
for help on using the changeset viewer.