Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/29/17 15:26:16 (7 years ago)
Author:
abeham
Message:

#2797:

  • Updated PSO to make it more compatible with SPSO 2011
  • Removed truncation of velocity vector and instead rescaled it given the maximum velocity
  • Added non-zero initial velocity according to SPSO 2011
  • Removed complicated bouncing code due to box constraints and instead implemented as described in SPSO 2011
  • Calculating neighbor best has been changed to use personal best
  • Avoiding local and global particle update and instead relying on neighborbest
  • More randomization during velocity update by using a separate random numbers per dimension
  • Reusing problem specific solution creator in RealVectorParticleCreator instead of always using UniformRandomRealVectorCreator
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RingTopologyInitializer.cs

    r14185 r15091  
    4343
    4444    public override IOperation Apply() {
    45       ItemArray<IntArray> neighbors = new ItemArray<IntArray>(SwarmSize);
    46       for (int i = 0; i < SwarmSize; i++) {
    47         neighbors[i] = new IntArray(new[] { (SwarmSize + i - 1) % SwarmSize, (i + 1) % SwarmSize });
     45      var swarmSize = SwarmSizeParameter.ActualValue.Value;
     46
     47      ItemArray<IntArray> neighbors = new ItemArray<IntArray>(swarmSize);
     48      for (int i = 0; i < swarmSize; i++) {
     49        neighbors[i] = new IntArray(new[] { (swarmSize + i - 1) % swarmSize, (i + 1) % swarmSize });
    4850      }
    49       Neighbors = neighbors;
     51      NeighborsParameter.ActualValue = neighbors;
    5052      return base.Apply();
    5153    }
Note: See TracChangeset for help on using the changeset viewer.