Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/12/17 16:49:16 (7 years ago)
Author:
abeham
Message:

#2797:

  • Fixed adaptive random topology updater
  • Adapted default values of the best attraction parameters
  • Changed code of the new topology initializer
  • Fixed the parameters of the SPSO particle updaters (c parameter is actually (personal|neighbor)bestattraction), reordered the method signature and provided defaults
  • Removed the max beyond parameter again
  • Updated the sample and updated the unit test
    • In the sample no inertia updating is used, but the topology initializers / updaters of SPSO are used
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  
    8686      var successor = new OperationCollection(new[] { base.Apply() });
    8787      var max = MaximizationParameter.ActualValue.Value;
    88       if (max && swarmBest.Value >= previousBest.Value
    89         || !max && swarmBest.Value <= previousBest.Value)
     88      if (max && swarmBest.Value <= previousBest.Value
     89        || !max && swarmBest.Value >= previousBest.Value)
    9090        successor.Insert(0, ExecutionContext.CreateOperation(TopologyInitializerParameter.ActualValue));
    9191
  • trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimization.cs

    r15181 r15214  
    181181      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));
    182182      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)));
    185185      Parameters.Add(new ConstrainedValueParameter<IParticleCreator>("ParticleCreator", "Operator that creates a new particle."));
    186186      Parameters.Add(new ConstrainedValueParameter<IParticleUpdater>("ParticleUpdater", "Operator that updates a particle."));
  • trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RandomTopologyInitializer.cs

    r15181 r15214  
    3030
    3131namespace 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).")]
    3333  [StorableClass]
    3434  public sealed class RandomTopologyInitializer : TopologyInitializer, IStochasticOperator {
  • trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/SPSORandomTopologyInitializer.cs

    r15181 r15214  
    6262
    6363      // 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      }
    6673
    6774      var neighbors = new ItemArray<IntArray>(swarmSize);
Note: See TracChangeset for help on using the changeset viewer.