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/RealVectorTotallyConnectedParticleUpdater.cs

    r14185 r15091  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Optimization;
    2526using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.PluginInfrastructure;
    2628
    2729namespace HeuristicLab.Encodings.RealVectorEncoding {
    2830  [Item("Totally Connected Particle Updater", "Updates the particle's position using (among other things) the global best position. Use together with the empty topology initialzer. Point = Point + Velocity*Inertia + (PersonalBestPoint-Point)*Phi_P*r_p + (BestPoint-Point)*Phi_G*r_g")]
    2931  [StorableClass]
    30   public sealed class RealVectorTotallyConnectedParticleUpdater : RealVectorParticleUpdater, IGlobalParticleUpdater {
     32  [NonDiscoverableType]
     33  [Obsolete("Same as the RealVectorNeighborhoodParticleUpdate")]
     34  internal sealed class RealVectorTotallyConnectedParticleUpdater : RealVectorParticleUpdater {
    3135
    3236    #region Construction & Cloning
     
    4145
    4246    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);
     47      UpdateVelocity();
     48      UpdatePosition();
    6049
    6150      return base.Apply();
Note: See TracChangeset for help on using the changeset viewer.