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.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorNeighborhoodParticleUpdater.cs

    r14185 r15091  
    2222using HeuristicLab.Common;
    2323using HeuristicLab.Core;
    24 using HeuristicLab.Optimization;
    2524using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2625
     
    2827  [Item("Neighborhood Particle Updater", "Updates the particle's position using (among other things) the best neighbor's position. Point = Point + Velocity*Inertia + (PersonalBestPoint-Point)*Phi_P*r_p + (BestNeighborPoint-Point)*Phi_G*r_g.")]
    2928  [StorableClass]
    30   public sealed class RealVectorNeighborhoodParticleUpdater : RealVectorParticleUpdater, ILocalParticleUpdater {
     29  public sealed class RealVectorNeighborhoodParticleUpdater : RealVectorParticleUpdater {
    3130
    3231    #region Construction & Cloning
     
    4140
    4241    public override IOperation Apply() {
    43       double inertia = Inertia.Value;
    44       double personalBestAttraction = PersonalBestAttraction.Value;
    45       double neighborBestAttraction = NeighborBestAttraction.Value;
    46 
    47       RealVector velocity = new RealVector(Velocity.Length);
    48       RealVector position = new RealVector(RealVector.Length);
    49       double r_p = Random.NextDouble();
    50       double r_g = Random.NextDouble();
    51 
    52       for (int i = 0; i < velocity.Length; i++) {
    53         velocity[i] =
    54           Velocity[i] * inertia +
    55           (PersonalBest[i] - RealVector[i]) * personalBestAttraction * r_p +
    56           (BestPoint[i] - RealVector[i]) * neighborBestAttraction * r_g;
    57       }
    58 
    59       MoveParticle(velocity, position);
     42      UpdateVelocity();
     43      UpdatePosition();
    6044
    6145      return base.Apply();
Note: See TracChangeset for help on using the changeset viewer.