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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.