Index: trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimization.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimization.cs	(revision 15088)
+++ trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimization.cs	(revision 15091)
@@ -21,4 +21,5 @@
 
 using System;
+using System.Collections.Generic;
 using System.Linq;
 using HeuristicLab.Analysis;
@@ -179,7 +180,7 @@
       Parameters.Add(new ValueParameter<IntValue>("MaxIterations", "Maximal number of iterations.", new IntValue(1000)));
       Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));
-      Parameters.Add(new ValueParameter<DoubleValue>("Inertia", "Inertia weight on a particle's movement (omega).", new DoubleValue(1)));
-      Parameters.Add(new ValueParameter<DoubleValue>("PersonalBestAttraction", "Weight for particle's pull towards its personal best soution (phi_p).", new DoubleValue(-0.01)));
-      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(3.7)));
+      Parameters.Add(new ValueParameter<DoubleValue>("Inertia", "Inertia weight on a particle's movement (omega).", new DoubleValue(0.9)));
+      Parameters.Add(new ValueParameter<DoubleValue>("PersonalBestAttraction", "Weight for particle's pull towards its personal best soution (phi_p).", new DoubleValue(0.05)));
+      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(0.5)));
       Parameters.Add(new ConstrainedValueParameter<IParticleCreator>("ParticleCreator", "Operator that creates a new particle."));
       Parameters.Add(new ConstrainedValueParameter<IParticleUpdater>("ParticleUpdater", "Operator that updates a particle."));
@@ -262,4 +263,5 @@
       UpdateAnalyzers();
       ParameterizeAnalyzers();
+      UpdateParticleUpdaterParameter();
       UpdateTopologyParameters();
       InitializeParticleCreator();
@@ -280,13 +282,13 @@
 
     private void InitializeParticleCreator() {
+      ParticleCreatorParameter.ValidValues.Clear();
       if (Problem != null) {
         IParticleCreator oldParticleCreator = ParticleCreator;
         IParticleCreator defaultParticleCreator = Problem.Operators.OfType<IParticleCreator>().FirstOrDefault();
-        ParticleCreatorParameter.ValidValues.Clear();
-        foreach (IParticleCreator Creator in Problem.Operators.OfType<IParticleCreator>().OrderBy(x => x.Name)) {
-          ParticleCreatorParameter.ValidValues.Add(Creator);
+        foreach (var creator in Problem.Operators.OfType<IParticleCreator>().OrderBy(x => x.Name)) {
+          ParticleCreatorParameter.ValidValues.Add(creator);
         }
         if (oldParticleCreator != null) {
-          IParticleCreator creator = ParticleCreatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleCreator.GetType());
+          var creator = ParticleCreatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleCreator.GetType());
           if (creator != null) ParticleCreator = creator;
           else oldParticleCreator = null;
@@ -328,6 +330,6 @@
         updater.IndexParameter.ActualName = "Iterations";
         updater.ValueParameter.ActualName = "CurrentInertia";
-        updater.StartValueParameter.Value = new DoubleValue(1);
-        updater.EndValueParameter.Value = new DoubleValue(1E-10);
+        updater.StartValueParameter.ActualName = InertiaParameter.Name;
+        updater.EndValueParameter.Value = new DoubleValue(0.70);
       }
     }
@@ -346,9 +348,10 @@
 
     private void UpdateTopologyInitializer() {
-      ITopologyInitializer oldTopologyInitializer = TopologyInitializer;
+      var oldTopologyInitializer = TopologyInitializer;
       TopologyInitializerParameter.ValidValues.Clear();
       foreach (ITopologyInitializer topologyInitializer in ApplicationManager.Manager.GetInstances<ITopologyInitializer>().OrderBy(x => x.Name)) {
         TopologyInitializerParameter.ValidValues.Add(topologyInitializer);
       }
+
       if (oldTopologyInitializer != null && TopologyInitializerParameter.ValidValues.Any(x => x.GetType() == oldTopologyInitializer.GetType()))
         TopologyInitializer = TopologyInitializerParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldTopologyInitializer.GetType());
@@ -357,35 +360,20 @@
 
     private void ParameterizeTopologyUpdaters() {
-      foreach (var updater in TopologyUpdaterParameter.ValidValues) {
-        var multiPsoUpdater = updater as MultiPSOTopologyUpdater;
-        if (multiPsoUpdater != null) {
-          multiPsoUpdater.CurrentIterationParameter.ActualName = "Iterations";
-        }
-      }
-    }
-
-    private void UpdateTopologyParameters() {
-      ITopologyUpdater oldTopologyUpdater = TopologyUpdater;
-      IParticleUpdater oldParticleUpdater = ParticleUpdater;
-      ClearTopologyParameters();
-      if (Problem != null) {
-        IParticleUpdater defaultParticleUpdater = null;
-        if (TopologyInitializer != null) {
-          foreach (ITopologyUpdater topologyUpdater in ApplicationManager.Manager.GetInstances<ITopologyUpdater>())
-            TopologyUpdaterParameter.ValidValues.Add(topologyUpdater);
-          defaultParticleUpdater = Problem.Operators.OfType<ILocalParticleUpdater>().FirstOrDefault();
-          foreach (IParticleUpdater particleUpdater in Problem.Operators.OfType<ILocalParticleUpdater>().OrderBy(x => x.Name))
-            ParticleUpdaterParameter.ValidValues.Add(particleUpdater);
-        } else {
-          defaultParticleUpdater = Problem.Operators.OfType<IGlobalParticleUpdater>().FirstOrDefault();
-          foreach (IParticleUpdater particleUpdater in Problem.Operators.OfType<IGlobalParticleUpdater>().OrderBy(x => x.Name))
-            ParticleUpdaterParameter.ValidValues.Add(particleUpdater);
-        }
-        if (oldTopologyUpdater != null) {
-          ITopologyUpdater newTopologyUpdater = TopologyUpdaterParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleUpdater.GetType());
-          if (newTopologyUpdater != null) TopologyUpdater = newTopologyUpdater;
-        }
+      foreach (var updater in TopologyUpdaterParameter.ValidValues.OfType<MultiPSOTopologyUpdater>()) {
+        updater.CurrentIterationParameter.ActualName = "Iterations";
+      }
+    }
+
+    private void UpdateParticleUpdaterParameter() {
+      var oldParticleUpdater = ParticleUpdater;
+      ParticleUpdaterParameter.ValidValues.Clear();
+      if (Problem != null) {
+        var defaultParticleUpdater = Problem.Operators.OfType<IParticleUpdater>().FirstOrDefault();
+
+        foreach (var particleUpdater in Problem.Operators.OfType<IParticleUpdater>().OrderBy(x => x.Name))
+          ParticleUpdaterParameter.ValidValues.Add(particleUpdater);
+
         if (oldParticleUpdater != null) {
-          IParticleUpdater newParticleUpdater = ParticleUpdaterParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleUpdater.GetType());
+          var newParticleUpdater = ParticleUpdaterParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleUpdater.GetType());
           if (newParticleUpdater != null) ParticleUpdater = newParticleUpdater;
           else oldParticleUpdater = null;
@@ -393,12 +381,22 @@
         if (oldParticleUpdater == null && defaultParticleUpdater != null)
           ParticleUpdater = defaultParticleUpdater;
-
-        ParameterizeTopologyUpdaters();
-      }
-    }
-
-    private void ClearTopologyParameters() {
+      }
+    }
+
+    private void UpdateTopologyParameters() {
+      ITopologyUpdater oldTopologyUpdater = TopologyUpdater;
       TopologyUpdaterParameter.ValidValues.Clear();
-      ParticleUpdaterParameter.ValidValues.Clear();
+      if (Problem != null) {
+        if (TopologyInitializerParameter.Value != null) {
+          foreach (ITopologyUpdater topologyUpdater in ApplicationManager.Manager.GetInstances<ITopologyUpdater>())
+            TopologyUpdaterParameter.ValidValues.Add(topologyUpdater);
+
+          if (oldTopologyUpdater != null) {
+            ITopologyUpdater newTopologyUpdater = TopologyUpdaterParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldTopologyUpdater.GetType());
+            if (newTopologyUpdater != null) TopologyUpdater = newTopologyUpdater;
+          }
+          ParameterizeTopologyUpdaters();
+        }
+      }
     }
 
Index: trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RandomTopologyInitializer.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RandomTopologyInitializer.cs	(revision 15088)
+++ trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RandomTopologyInitializer.cs	(revision 15091)
@@ -25,4 +25,5 @@
 using HeuristicLab.Core;
 using HeuristicLab.Data;
+using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
@@ -31,5 +32,5 @@
   [Item("Random Topology Initializer", "Randomly connectes every particle with k other particles.")]
   [StorableClass]
-  public sealed class RandomTopologyInitializer : TopologyInitializer {
+  public sealed class RandomTopologyInitializer : TopologyInitializer, IStochasticOperator {
     #region Parameters
     public ILookupParameter<IRandom> RandomParameter {
@@ -40,14 +41,5 @@
     }
     #endregion
-
-    #region Parameter Values
-    private IRandom Random {
-      get { return RandomParameter.ActualValue; }
-    }
-    private int NrOfConnections {
-      get { return NrOfConnectionsParameter.ActualValue.Value; }
-    }
-    #endregion
-
+    
     #region Construction & Cloning
     [StorableConstructor]
@@ -65,11 +57,15 @@
 
     public override IOperation Apply() {
-      ItemArray<IntArray> neighbors = new ItemArray<IntArray>(SwarmSize);
-      for (int i = 0; i < SwarmSize; i++) {
-        var numbers = Enumerable.Range(0, SwarmSize).ToList();
+      var random = RandomParameter.ActualValue;
+      var swarmSize = SwarmSizeParameter.ActualValue.Value;
+      var nrOfConnections = NrOfConnectionsParameter.ActualValue.Value;
+
+      ItemArray<IntArray> neighbors = new ItemArray<IntArray>(swarmSize);
+      for (int i = 0; i < swarmSize; i++) {
+        var numbers = Enumerable.Range(0, swarmSize).ToList();
         numbers.RemoveAt(i);
-        var selectedNumbers = new List<int>(NrOfConnections);
-        for (int j = 0; j < NrOfConnections && numbers.Count > 0; j++) {
-          int index = Random.Next(numbers.Count);
+        var selectedNumbers = new List<int>(nrOfConnections);
+        for (int j = 0; j < nrOfConnections && numbers.Count > 0; j++) {
+          int index = random.Next(numbers.Count);
           selectedNumbers.Add(numbers[index]);
           numbers.RemoveAt(index);
@@ -77,5 +73,5 @@
         neighbors[i] = new IntArray(selectedNumbers.ToArray());
       }
-      Neighbors = neighbors;
+      NeighborsParameter.ActualValue = neighbors;
       return base.Apply();
     }
Index: trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RingTopologyInitializer.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RingTopologyInitializer.cs	(revision 15088)
+++ trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RingTopologyInitializer.cs	(revision 15091)
@@ -43,9 +43,11 @@
 
     public override IOperation Apply() {
-      ItemArray<IntArray> neighbors = new ItemArray<IntArray>(SwarmSize);
-      for (int i = 0; i < SwarmSize; i++) {
-        neighbors[i] = new IntArray(new[] { (SwarmSize + i - 1) % SwarmSize, (i + 1) % SwarmSize });
+      var swarmSize = SwarmSizeParameter.ActualValue.Value;
+
+      ItemArray<IntArray> neighbors = new ItemArray<IntArray>(swarmSize);
+      for (int i = 0; i < swarmSize; i++) {
+        neighbors[i] = new IntArray(new[] { (swarmSize + i - 1) % swarmSize, (i + 1) % swarmSize });
       }
-      Neighbors = neighbors;
+      NeighborsParameter.ActualValue = neighbors;
       return base.Apply();
     }
Index: trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/TopologyInitializer.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/TopologyInitializer.cs	(revision 15088)
+++ trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/TopologyInitializer.cs	(revision 15091)
@@ -40,18 +40,6 @@
       get { return (IScopeTreeLookupParameter<IntArray>)Parameters["Neighbors"]; }
     }
-
     public ILookupParameter<IntValue> SwarmSizeParameter {
       get { return (ILookupParameter<IntValue>)Parameters["SwarmSize"]; }
-    }
-
-    #endregion
-
-    #region Parameter Values
-    protected ItemArray<IntArray> Neighbors {
-      get { return NeighborsParameter.ActualValue; }
-      set { NeighborsParameter.ActualValue = value; }
-    }
-    protected int SwarmSize {
-      get { return SwarmSizeParameter.ActualValue.Value; }
     }
     #endregion
Index: trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/VonNeumannTopologyInitializer.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/VonNeumannTopologyInitializer.cs	(revision 15088)
+++ trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/VonNeumannTopologyInitializer.cs	(revision 15091)
@@ -44,14 +44,16 @@
 
     public override IOperation Apply() {
-      ItemArray<IntArray> neighbors = new ItemArray<IntArray>(SwarmSize);
-      for (int i = 0; i < SwarmSize; i++) {
+      var swarmSize = SwarmSizeParameter.ActualValue.Value;
+
+      ItemArray<IntArray> neighbors = new ItemArray<IntArray>(swarmSize);
+      for (int i = 0; i < swarmSize; i++) {
         neighbors[i] = new IntArray(new[] {
-          (SwarmSize + i-2) % SwarmSize,
-          (SwarmSize + i-1) % SwarmSize,
-          (i+1) % SwarmSize,
-          (i+2) % SwarmSize
+          (swarmSize + i-2) % swarmSize,
+          (swarmSize + i-1) % swarmSize,
+          (i+1) % swarmSize,
+          (i+2) % swarmSize
         });
       }
-      Neighbors = neighbors;
+      NeighborsParameter.ActualValue = neighbors;
       return base.Apply();
     }
Index: trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/HeuristicLab.Encodings.RealVectorEncoding-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/HeuristicLab.Encodings.RealVectorEncoding-3.3.csproj	(revision 15088)
+++ trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/HeuristicLab.Encodings.RealVectorEncoding-3.3.csproj	(revision 15091)
@@ -132,4 +132,5 @@
     <Compile Include="ParticleOperators\RealVectorSwarmUpdater.cs" />
     <Compile Include="ParticleOperators\RealVectorTotallyConnectedParticleUpdater.cs" />
+    <Compile Include="ParticleOperators\RealVectorVelocityInitializer.cs" />
     <Compile Include="Plugin.cs" />
     <Compile Include="RealVectorCreator.cs" />
Index: trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorParticleCreator.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorParticleCreator.cs	(revision 15088)
+++ trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorParticleCreator.cs	(revision 15091)
@@ -26,5 +26,4 @@
 namespace HeuristicLab.Encodings.RealVectorEncoding {
   public interface IRealVectorParticleCreator : IParticleCreator, IRealVectorOperator {
-    ILookupParameter<IntValue> ProblemSizeParameter { get; }
     ILookupParameter<RealVector> RealVectorParameter { get; }
     ILookupParameter<RealVector> PersonalBestParameter { get; }
Index: trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorParticleUpdater.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorParticleUpdater.cs	(revision 15088)
+++ trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorParticleUpdater.cs	(revision 15091)
@@ -27,5 +27,5 @@
   public interface IRealVectorParticleUpdater : IParticleUpdater, IRealVectorOperator {
     ILookupParameter<RealVector> VelocityParameter { get; }
-    ILookupParameter<DoubleMatrix> CurrentVelocityBoundsParameter { get; }
+    ILookupParameter<DoubleValue> CurrentMaxVelocityParameter { get; }
     ILookupParameter<RealVector> RealVectorParameter { get; }
     ILookupParameter<DoubleMatrix> BoundsParameter { get; }
Index: trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorNeighborhoodParticleUpdater.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorNeighborhoodParticleUpdater.cs	(revision 15088)
+++ trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorNeighborhoodParticleUpdater.cs	(revision 15091)
@@ -22,5 +22,4 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Optimization;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 
@@ -28,5 +27,5 @@
   [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.")]
   [StorableClass]
-  public sealed class RealVectorNeighborhoodParticleUpdater : RealVectorParticleUpdater, ILocalParticleUpdater {
+  public sealed class RealVectorNeighborhoodParticleUpdater : RealVectorParticleUpdater {
 
     #region Construction & Cloning
@@ -41,21 +40,6 @@
 
     public override IOperation Apply() {
-      double inertia = Inertia.Value;
-      double personalBestAttraction = PersonalBestAttraction.Value;
-      double neighborBestAttraction = NeighborBestAttraction.Value;
-
-      RealVector velocity = new RealVector(Velocity.Length);
-      RealVector position = new RealVector(RealVector.Length);
-      double r_p = Random.NextDouble();
-      double r_g = Random.NextDouble();
-
-      for (int i = 0; i < velocity.Length; i++) {
-        velocity[i] =
-          Velocity[i] * inertia +
-          (PersonalBest[i] - RealVector[i]) * personalBestAttraction * r_p +
-          (BestPoint[i] - RealVector[i]) * neighborBestAttraction * r_g;
-      }
-
-      MoveParticle(velocity, position);
+      UpdateVelocity();
+      UpdatePosition();
 
       return base.Apply();
Index: trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorParticleCreator.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorParticleCreator.cs	(revision 15088)
+++ trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorParticleCreator.cs	(revision 15091)
@@ -24,4 +24,5 @@
 using HeuristicLab.Data;
 using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
@@ -30,9 +31,9 @@
   [Item("RealVectorParticleCreator", "Creates a particle with position, zero velocity vector and personal best.")]
   [StorableClass]
-  public class RealVectorParticleCreator : AlgorithmOperator, IRealVectorParticleCreator {
+  public class RealVectorParticleCreator : AlgorithmOperator, IRealVectorParticleCreator, IStochasticOperator {
 
     #region Parameters
-    public ILookupParameter<IntValue> ProblemSizeParameter {
-      get { return (ILookupParameter<IntValue>)Parameters["ProblemSize"]; }
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
     }
     public IValueLookupParameter<DoubleMatrix> BoundsParameter {
@@ -48,15 +49,9 @@
       get { return (ILookupParameter<RealVector>)Parameters["Velocity"]; }
     }
-    #endregion
-
-    #region Parameter Values
-    protected int ProblemSize {
-      get { return ProblemSizeParameter.ActualValue.Value; }
-    }
-    protected RealVector Velocity {
-      set { VelocityParameter.ActualValue = value; }
+    public ILookupParameter<ISolutionCreator> SolutionCreatorParameter {
+      get { return (ILookupParameter<ISolutionCreator>)Parameters["SolutionCreator"]; }
     }
     #endregion
-
+    
     #region Construction & Cloning
     [StorableConstructor]
@@ -65,23 +60,29 @@
     public RealVectorParticleCreator()
       : base() {
-      Parameters.Add(new LookupParameter<IntValue>("ProblemSize", "The dimension of the problem."));
+      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
       Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Bounds", "The lower and upper bounds in each dimension."));
       Parameters.Add(new LookupParameter<RealVector>("RealVector", "Particle's current solution"));
       Parameters.Add(new LookupParameter<RealVector>("PersonalBest", "Particle's personal best solution."));
       Parameters.Add(new LookupParameter<RealVector>("Velocity", "Particle's current velocity."));
+      Parameters.Add(new LookupParameter<ISolutionCreator>("SolutionCreator", "The operator that creates the initial position."));
 
-      UniformRandomRealVectorCreator realVectorCreater = new UniformRandomRealVectorCreator();
+      Placeholder realVectorCreater = new Placeholder();
       Assigner personalBestPositionAssigner = new Assigner();
+      RealVectorVelocityInitializer velocityInitializer = new RealVectorVelocityInitializer();
 
       OperatorGraph.InitialOperator = realVectorCreater;
 
-      realVectorCreater.RealVectorParameter.ActualName = RealVectorParameter.Name;
-      realVectorCreater.LengthParameter.ActualName = ProblemSizeParameter.Name;
-      realVectorCreater.BoundsParameter.ActualName = BoundsParameter.Name;
+      realVectorCreater.OperatorParameter.ActualName = SolutionCreatorParameter.Name;
       realVectorCreater.Successor = personalBestPositionAssigner;
 
       personalBestPositionAssigner.LeftSideParameter.ActualName = PersonalBestParameter.Name;
       personalBestPositionAssigner.RightSideParameter.ActualName = RealVectorParameter.Name;
-      personalBestPositionAssigner.Successor = null;
+      personalBestPositionAssigner.Successor = velocityInitializer;
+
+      velocityInitializer.BoundsParameter.ActualName = BoundsParameter.Name;
+      velocityInitializer.RandomParameter.ActualName = RandomParameter.Name;
+      velocityInitializer.RealVectorParameter.ActualName = RealVectorParameter.Name;
+      velocityInitializer.VelocityParameter.ActualName = VelocityParameter.Name;
+      velocityInitializer.Successor = null;
     }
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -89,11 +90,4 @@
     }
     #endregion
-
-    public override IOperation Apply() {
-      Velocity = new RealVector(ProblemSize);
-      return base.Apply();
-    }
-
-
   }
 }
Index: trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorParticleUpdater.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorParticleUpdater.cs	(revision 15088)
+++ trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorParticleUpdater.cs	(revision 15091)
@@ -51,7 +51,4 @@
       get { return (ILookupParameter<RealVector>)Parameters["NeighborBest"]; }
     }
-    public LookupParameter<RealVector> BestRealVectorParameter {
-      get { return (LookupParameter<RealVector>)Parameters["BestRealVector"]; }
-    }
     public ILookupParameter<RealVector> RealVectorParameter {
       get { return (ILookupParameter<RealVector>)Parameters["RealVector"]; }
@@ -60,6 +57,6 @@
       get { return (ILookupParameter<DoubleMatrix>)Parameters["Bounds"]; }
     }
-    public ILookupParameter<DoubleMatrix> CurrentVelocityBoundsParameter {
-      get { return (ILookupParameter<DoubleMatrix>)Parameters["CurrentVelocityBounds"]; }
+    public ILookupParameter<DoubleValue> CurrentMaxVelocityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["CurrentMaxVelocity"]; }
     }
     public ILookupParameter<DoubleValue> InertiaParameter {
@@ -73,43 +70,5 @@
     }
     #endregion
-
-    #region Parameter Values
-    protected IRandom Random {
-      get { return RandomParameter.ActualValue; }
-    }
-    protected RealVector Velocity {
-      get { return VelocityParameter.ActualValue; }
-      set { VelocityParameter.ActualValue = value; }
-    }
-    protected RealVector PersonalBest {
-      get { return PersonalBestParameter.ActualValue; }
-    }
-    protected RealVector BestPoint {
-      get { return BestRealVectorParameter.ActualValue; }
-    }
-    protected RealVector RealVector {
-      get { return RealVectorParameter.ActualValue; }
-      set { RealVectorParameter.ActualValue = value; }
-    }
-    protected RealVector NeighborBest {
-      get { return NeighborBestParameter.ActualValue; }
-    }
-    protected DoubleMatrix Bounds {
-      get { return BoundsParameter.ActualValue; }
-    }
-    protected DoubleMatrix CurrentVelocityBounds {
-      get { return CurrentVelocityBoundsParameter.ActualValue; }
-    }
-    protected DoubleValue Inertia {
-      get { return InertiaParameter.ActualValue; }
-    }
-    protected DoubleValue PersonalBestAttraction {
-      get { return PersonalBestAttractionParameter.ActualValue; }
-    }
-    protected DoubleValue NeighborBestAttraction {
-      get { return NeighborBestAttractionParameter.ActualValue; }
-    }
-    #endregion
-
+    
     #region Construction & Cloning
     [StorableConstructor]
@@ -122,8 +81,7 @@
       Parameters.Add(new LookupParameter<RealVector>("Velocity", "Particle's current velocity."));
       Parameters.Add(new LookupParameter<RealVector>("PersonalBest", "Particle's personal best solution."));
-      Parameters.Add(new LookupParameter<RealVector>("BestRealVector", "Global best position."));
       Parameters.Add(new LookupParameter<RealVector>("NeighborBest", "Best neighboring solution."));
       Parameters.Add(new LookupParameter<DoubleMatrix>("Bounds", "The lower and upper bounds for each dimension of the position vector for the current problem."));
-      Parameters.Add(new LookupParameter<DoubleMatrix>("CurrentVelocityBounds", "Upper and lower bounds for the particle's velocity vector."));
+      Parameters.Add(new LookupParameter<DoubleValue>("CurrentMaxVelocity", "Maximum for the particle's velocity vector."));
       Parameters.Add(new LookupParameter<DoubleValue>("CurrentInertia", "The weight for the particle's velocity vector."));
       Parameters.Add(new LookupParameter<DoubleValue>("PersonalBestAttraction", "The weight for the particle's personal best position."));
@@ -132,41 +90,54 @@
     #endregion
 
-    protected void MoveParticle(RealVector velocity, RealVector position) {
-      BoundsChecker.Apply(velocity, CurrentVelocityBounds);
+    protected void UpdateVelocity() {
+      var velocity = VelocityParameter.ActualValue;
+      var position = RealVectorParameter.ActualValue;
+      var inertia = InertiaParameter.ActualValue.Value;
+      var personalBest = PersonalBestParameter.ActualValue;
+      var personalBestAttraction = PersonalBestAttractionParameter.ActualValue.Value;
+      var neighborBest = NeighborBestParameter.ActualValue;
+      var neighborBestAttraction = NeighborBestAttractionParameter.ActualValue.Value;
+
+      var random = RandomParameter.ActualValue;
+
       for (int i = 0; i < velocity.Length; i++) {
-        position[i] = RealVector[i] + velocity[i];
+        double r_p = random.NextDouble();
+        double r_g = random.NextDouble();
+        velocity[i] =
+          velocity[i] * inertia +
+          (personalBest[i] - position[i]) * personalBestAttraction * r_p +
+          (neighborBest[i] - position[i]) * neighborBestAttraction * r_g;
       }
+
+      var maxVelocity = CurrentMaxVelocityParameter.ActualValue.Value;
+      var speed = Math.Sqrt(velocity.DotProduct(velocity));
+      if (speed > maxVelocity) {
+        for (var i = 0; i < velocity.Length; i++) {
+          velocity[i] *= maxVelocity / speed;
+        }
+      }
+    }
+
+    protected void UpdatePosition() {
+      var velocity = VelocityParameter.ActualValue;
+      var position = RealVectorParameter.ActualValue;
+
+      for (int i = 0; i < velocity.Length; i++) {
+        position[i] += velocity[i];
+      }
+
+      var bounds = BoundsParameter.ActualValue;
       for (int i = 0; i < position.Length; i++) {
-        double min = Bounds[i % Bounds.Rows, 0];
-        double max = Bounds[i % Bounds.Rows, 1];
+        double min = bounds[i % bounds.Rows, 0];
+        double max = bounds[i % bounds.Rows, 1];
         if (position[i] < min) {
-          int reflectionCount = (int)Math.Truncate((min - position[i]) / (max - min)) + 1;
-          double reflection = (min - position[i]) % (max - min);
-          if (IsOdd(reflectionCount)) {
-            position[i] = min + reflection;
-            velocity[i] = -velocity[i];
-
-          } else {
-            position[i] = max - reflection;
-          }
+          position[i] = min;
+          velocity[i] = -0.5 * velocity[i]; // SPSO 2011
         }
         if (position[i] > max) {
-          int reflectionCount = (int)Math.Truncate((position[i] - max) / (max - min)) + 1;
-          double reflection = (position[i] - max) % (max - min);
-          if (IsOdd(reflectionCount)) {
-            position[i] = max - reflection;
-            velocity[i] = -velocity[i];
-          } else {
-            position[i] = min + reflection;
-          }
+          position[i] = max;
+          velocity[i] = -0.5 * velocity[i]; // SPSO 2011
         }
       }
-
-      RealVector = position;
-      Velocity = velocity;
-    }
-
-    private static bool IsOdd(int number) {
-      return number % 2 == 1;
     }
   }
Index: trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorSwarmUpdater.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorSwarmUpdater.cs	(revision 15088)
+++ trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorSwarmUpdater.cs	(revision 15091)
@@ -76,9 +76,9 @@
       get { return (IScopeTreeLookupParameter<IntArray>)Parameters["Neighbors"]; }
     }
-    public IValueLookupParameter<DoubleMatrix> VelocityBoundsParameter {
-      get { return (ValueLookupParameter<DoubleMatrix>)Parameters["VelocityBounds"]; }
-    }
-    public ILookupParameter<DoubleMatrix> CurrentVelocityBoundsParameter {
-      get { return (ILookupParameter<DoubleMatrix>)Parameters["CurrentVelocityBounds"]; }
+    public IValueLookupParameter<DoubleValue> MaxVelocityParameter {
+      get { return (ValueLookupParameter<DoubleValue>)Parameters["MaxVelocity"]; }
+    }
+    public ILookupParameter<DoubleValue> CurrentMaxVelocityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["CurrentMaxVelocity"]; }
     }
     public LookupParameter<ResultCollection> ResultsParameter {
@@ -86,25 +86,19 @@
     }
 
-    #region Velocity Bounds Updating
-    public ILookupParameter<DoubleValue> VelocityBoundsScaleParameter {
-      get { return (ILookupParameter<DoubleValue>)Parameters["VelocityBoundsScale"]; }
-    }
-    public IConstrainedValueParameter<IDiscreteDoubleValueModifier> VelocityBoundsScalingOperatorParameter {
-      get { return (IConstrainedValueParameter<IDiscreteDoubleValueModifier>)Parameters["VelocityBoundsScalingOperator"]; }
-    }
-    public IValueLookupParameter<DoubleValue> VelocityBoundsStartValueParameter {
-      get { return (IValueLookupParameter<DoubleValue>)Parameters["VelocityBoundsStartValue"]; }
-    }
-    public IValueLookupParameter<DoubleValue> VelocityBoundsEndValueParameter {
-      get { return (IValueLookupParameter<DoubleValue>)Parameters["VelocityBoundsEndValue"]; }
-    }
-    public ILookupParameter<IntValue> VelocityBoundsIndexParameter {
-      get { return (ILookupParameter<IntValue>)Parameters["VelocityBoundsIndex"]; }
-    }
-    public IValueLookupParameter<IntValue> VelocityBoundsStartIndexParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters["VelocityBoundsStartIndex"]; }
-    }
-    public IValueLookupParameter<IntValue> VelocityBoundsEndIndexParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters["VelocityBoundsEndIndex"]; }
+    #region Max Velocity Updating
+    public IConstrainedValueParameter<IDiscreteDoubleValueModifier> MaxVelocityScalingOperatorParameter {
+      get { return (IConstrainedValueParameter<IDiscreteDoubleValueModifier>)Parameters["MaxVelocityScalingOperator"]; }
+    }
+    public IValueLookupParameter<DoubleValue> FinalMaxVelocityParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters["FinalMaxVelocity"]; }
+    }
+    public ILookupParameter<IntValue> MaxVelocityIndexParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["MaxVelocityIndex"]; }
+    }
+    public IValueLookupParameter<IntValue> MaxVelocityStartIndexParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["MaxVelocityStartIndex"]; }
+    }
+    public IValueLookupParameter<IntValue> MaxVelocityEndIndexParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters["MaxVelocityEndIndex"]; }
     }
     #endregion
@@ -132,22 +126,19 @@
       Parameters.Add(new ScopeTreeLookupParameter<IntArray>("Neighbors", "The list of neighbors for each particle."));
       Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
-      Parameters.Add(new ValueLookupParameter<DoubleMatrix>("VelocityBounds", "Maximum velocity for each dimension.", new DoubleMatrix(new double[,] { { -1, 1 } })));
-      Parameters.Add(new LookupParameter<DoubleMatrix>("CurrentVelocityBounds", "Current value of velocity bounds."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("MaxVelocity", "Speed limit for each particle.", new DoubleValue(1)));
+      Parameters.Add(new LookupParameter<DoubleValue>("CurrentMaxVelocity", "Current value of the speed limit."));
       Parameters.Add(new LookupParameter<ResultCollection>("Results", "Results"));
 
       #region Velocity Bounds Updating
-      Parameters.Add(new LookupParameter<DoubleValue>("VelocityBoundsScale", "Scale parameter."));
-      Parameters.Add(new OptionalConstrainedValueParameter<IDiscreteDoubleValueModifier>("VelocityBoundsScalingOperator", "Modifies the value"));
-      Parameters.Add(new ValueLookupParameter<DoubleValue>("VelocityBoundsStartValue", "The start value of 'Value'.", new DoubleValue(1)));
-      Parameters.Add(new ValueLookupParameter<DoubleValue>("VelocityBoundsEndValue", "The end value of 'Value'.", new DoubleValue(1E-10)));
-      Parameters.Add(new LookupParameter<IntValue>("VelocityBoundsIndex", "The current index.", "Iterations"));
-      Parameters.Add(new ValueLookupParameter<IntValue>("VelocityBoundsStartIndex", "The start index at which to start modifying 'Value'.", new IntValue(0)));
-      Parameters.Add(new ValueLookupParameter<IntValue>("VelocityBoundsEndIndex", "The end index by which 'Value' should have reached 'EndValue'.", "MaxIterations"));
-      VelocityBoundsStartIndexParameter.Hidden = true;
-      VelocityBoundsEndIndexParameter.Hidden = true;
+      Parameters.Add(new OptionalConstrainedValueParameter<IDiscreteDoubleValueModifier>("MaxVelocityScalingOperator", "Modifies the value"));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("FinalMaxVelocity", "The value of maximum velocity if PSO has reached maximum iterations.", new DoubleValue(1E-10)));
+      Parameters.Add(new LookupParameter<IntValue>("MaxVelocityIndex", "The current index.", "Iterations"));
+      Parameters.Add(new ValueLookupParameter<IntValue>("MaxVelocityStartIndex", "The start index at which to start modifying 'Value'.", new IntValue(0)));
+      Parameters.Add(new ValueLookupParameter<IntValue>("MaxVelocityEndIndex", "The end index by which 'Value' should have reached 'EndValue'.", "MaxIterations"));
+      MaxVelocityStartIndexParameter.Hidden = true;
+      MaxVelocityEndIndexParameter.Hidden = true;
       #endregion
 
       Initialize();
-      RegisterEvents();
     }
 
@@ -167,74 +158,44 @@
         Parameters.Remove("BestQuality");
       }
-      RegisterEvents();
-    }
-
-    private void RegisterEvents() {
-      VelocityBoundsStartValueParameter.ValueChanged += new EventHandler(VelocityBoundsStartValueParameter_ValueChanged);
-      VelocityBoundsStartValueParameter.Value.ValueChanged += new EventHandler(VelocityBoundsStartValueParameter_Value_ValueChanged);
-    }
-
-    void VelocityBoundsStartValueParameter_Value_ValueChanged(object sender, EventArgs e) {
-      UpdateVelocityBoundsParamater();
-    }
-
-    void UpdateVelocityBoundsParamater() {
-      if (VelocityBoundsParameter.Value == null) {
-        VelocityBoundsParameter.Value = new DoubleMatrix(1, 2);
-      } else if (VelocityBoundsParameter.Value.Columns != 2) {
-        VelocityBoundsParameter.Value = new DoubleMatrix(VelocityBoundsParameter.Value.Rows, 2);
-      }
-      if (VelocityBoundsStartValueParameter.Value != null) {
-        DoubleMatrix matrix = VelocityBoundsParameter.Value;
-        for (int i = 0; i < matrix.Rows; i++) {
-          matrix[i, 0] = (-1) * VelocityBoundsStartValueParameter.Value.Value;
-          matrix[i, 1] = VelocityBoundsStartValueParameter.Value.Value;
-        }
-      }
-    }
-
-    void VelocityBoundsStartValueParameter_ValueChanged(object sender, EventArgs e) {
-      if (VelocityBoundsStartValueParameter.Value != null) {
-        VelocityBoundsStartValueParameter.Value.ValueChanged += new EventHandler(VelocityBoundsStartValueParameter_Value_ValueChanged);
-      }
-      UpdateVelocityBoundsParamater();
-    }
-
+    }
     private void Initialize() {
       ResultsCollector = new ResultsCollector();
-      ResultsCollector.CollectedValues.Add(CurrentVelocityBoundsParameter);
-      ResultsCollector.CollectedValues.Add(VelocityBoundsParameter);
+      ResultsCollector.CollectedValues.Add(CurrentMaxVelocityParameter);
+      ResultsCollector.CollectedValues.Add(MaxVelocityParameter);
 
       foreach (IDiscreteDoubleValueModifier op in ApplicationManager.Manager.GetInstances<IDiscreteDoubleValueModifier>()) {
-        VelocityBoundsScalingOperatorParameter.ValidValues.Add(op);
-        op.ValueParameter.ActualName = VelocityBoundsScaleParameter.Name;
-        op.StartValueParameter.ActualName = VelocityBoundsStartValueParameter.Name;
-        op.EndValueParameter.ActualName = VelocityBoundsEndValueParameter.Name;
-        op.IndexParameter.ActualName = VelocityBoundsIndexParameter.Name;
-        op.StartIndexParameter.ActualName = VelocityBoundsStartIndexParameter.Name;
-        op.EndIndexParameter.ActualName = VelocityBoundsEndIndexParameter.Name;
-      }
-      VelocityBoundsScalingOperatorParameter.Value = null;
+        MaxVelocityScalingOperatorParameter.ValidValues.Add(op);
+        op.ValueParameter.ActualName = CurrentMaxVelocityParameter.Name;
+        op.StartValueParameter.ActualName = MaxVelocityParameter.Name;
+        op.EndValueParameter.ActualName = FinalMaxVelocityParameter.Name;
+        op.IndexParameter.ActualName = MaxVelocityIndexParameter.Name;
+        op.StartIndexParameter.ActualName = MaxVelocityStartIndexParameter.Name;
+        op.EndIndexParameter.ActualName = MaxVelocityEndIndexParameter.Name;
+      }
+      MaxVelocityScalingOperatorParameter.Value = null;
     }
 
     public override IOperation Apply() {
       var max = MaximizationParameter.ActualValue.Value;
+      // Update of the personal bests
       var points = RealVectorParameter.ActualValue;
       var qualities = QualityParameter.ActualValue;
       var particles = points.Select((p, i) => new { Particle = p, Index = i })
         .Zip(qualities, (p, q) => Tuple.Create(p.Index, p.Particle, q.Value)).ToList();
-      UpdateGlobalBest(max, particles);
+      UpdatePersonalBest(max, particles);
+
+      // SPSO: update of the neighbor bests from the personal bests
+      var personalBestPoints = PersonalBestParameter.ActualValue;
+      var personalBestQualities = PersonalBestQualityParameter.ActualValue;
+      particles = personalBestPoints.Select((p, i) => new { Particle = p, Index = i })
+        .Zip(personalBestQualities, (p, q) => Tuple.Create(p.Index, p.Particle, q.Value)).ToList();
       UpdateNeighborBest(max, particles);
-      UpdatePersonalBest(max, particles);
-      return UpdateVelocityBounds();
-    }
-
-    private void UpdateGlobalBest(bool maximization, IList<Tuple<int, RealVector, double>> particles) {
-      var best = maximization ? particles.MaxItems(x => x.Item3).First() : particles.MinItems(x => x.Item3).First();
-      var bestQuality = SwarmBestQualityParameter.ActualValue;
-      if (bestQuality == null) {
-        SwarmBestQualityParameter.ActualValue = new DoubleValue(best.Item3);
-      } else bestQuality.Value = best.Item3;
-      BestRealVectorParameter.ActualValue = (RealVector)best.Item2.Clone();
+
+      var next = new OperationCollection() { base.Apply() };
+      next.Insert(0, ExecutionContext.CreateChildOperation(ResultsCollector));
+      if (MaxVelocityScalingOperatorParameter.Value != null) {
+        next.Insert(0, ExecutionContext.CreateChildOperation(MaxVelocityScalingOperatorParameter.Value));
+      } else CurrentMaxVelocityParameter.ActualValue = new DoubleValue(MaxVelocityParameter.ActualValue.Value);
+      return next;
     }
 
@@ -253,4 +214,9 @@
         NeighborBestParameter.ActualValue = neighborBest;
         NeighborBestQualityParameter.ActualValue = neighborBestQuality;
+      } else {
+        // Neighbor best = Global best
+        var best = maximization ? particles.MaxItems(x => x.Item3).First() : particles.MinItems(x => x.Item3).First();
+        NeighborBestParameter.ActualValue = new ItemArray<RealVector>(particles.Select(x => best.Item2));
+        NeighborBestQualityParameter.ActualValue = new ItemArray<DoubleValue>(particles.Select(x => new DoubleValue(best.Item3)));
       }
     }
@@ -268,45 +234,8 @@
           !maximization && p.Item3 < personalBestQuality[p.Item1].Value) {
           personalBestQuality[p.Item1].Value = p.Item3;
-          personalBest[p.Item1] = p.Item2;
+          personalBest[p.Item1] = (RealVector)p.Item2.Clone();
         }
       }
       PersonalBestParameter.ActualValue = personalBest;
-    }
-
-    private IOperation UpdateVelocityBounds() {
-      var currentVelocityBounds = CurrentVelocityBoundsParameter.ActualValue;
-
-      if (currentVelocityBounds == null) {
-        currentVelocityBounds = (DoubleMatrix)VelocityBoundsParameter.ActualValue.Clone();
-        CurrentVelocityBoundsParameter.ActualValue = currentVelocityBounds;
-      }
-      if (VelocityBoundsScalingOperatorParameter.Value == null)
-        return new OperationCollection() {
-          ExecutionContext.CreateChildOperation(ResultsCollector),        
-          base.Apply()
-        };
-
-      var velocityBoundsScale = VelocityBoundsScaleParameter.ActualValue;
-      var velocityBoundsStartValue = VelocityBoundsStartValueParameter.ActualValue;
-
-      if (velocityBoundsScale == null && velocityBoundsStartValue != null) {
-        velocityBoundsScale = new DoubleValue(velocityBoundsStartValue.Value);
-        VelocityBoundsScaleParameter.ActualValue = velocityBoundsScale;
-      }
-      for (int i = 0; i < currentVelocityBounds.Rows; i++) {
-        for (int j = 0; j < currentVelocityBounds.Columns; j++) {
-          if (currentVelocityBounds[i, j] >= 0) {
-            currentVelocityBounds[i, j] = velocityBoundsScale.Value;
-          } else {
-            currentVelocityBounds[i, j] = (-1) * velocityBoundsScale.Value;
-          }
-        }
-      }
-
-      return new OperationCollection() {
-        ExecutionContext.CreateChildOperation(ResultsCollector),
-        ExecutionContext.CreateChildOperation(VelocityBoundsScalingOperatorParameter.Value),
-        base.Apply()
-      };
     }
   }
Index: trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorTotallyConnectedParticleUpdater.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorTotallyConnectedParticleUpdater.cs	(revision 15088)
+++ trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorTotallyConnectedParticleUpdater.cs	(revision 15091)
@@ -20,13 +20,17 @@
 #endregion
 
+using System;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Optimization;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
 
 namespace HeuristicLab.Encodings.RealVectorEncoding {
   [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")]
   [StorableClass]
-  public sealed class RealVectorTotallyConnectedParticleUpdater : RealVectorParticleUpdater, IGlobalParticleUpdater {
+  [NonDiscoverableType]
+  [Obsolete("Same as the RealVectorNeighborhoodParticleUpdate")]
+  internal sealed class RealVectorTotallyConnectedParticleUpdater : RealVectorParticleUpdater {
 
     #region Construction & Cloning
@@ -41,21 +45,6 @@
 
     public override IOperation Apply() {
-      double inertia = Inertia.Value;
-      double personalBestAttraction = PersonalBestAttraction.Value;
-      double neighborBestAttraction = NeighborBestAttraction.Value;
-
-      RealVector velocity = new RealVector(Velocity.Length);
-      RealVector position = new RealVector(RealVector.Length);
-      double r_p = Random.NextDouble();
-      double r_g = Random.NextDouble();
-
-      for (int i = 0; i < velocity.Length; i++) {
-        velocity[i] =
-          Velocity[i] * inertia +
-          (PersonalBest[i] - RealVector[i]) * personalBestAttraction * r_p +
-          (BestPoint[i] - RealVector[i]) * neighborBestAttraction * r_g;
-      }
-
-      MoveParticle(velocity, position);
+      UpdateVelocity();
+      UpdatePosition();
 
       return base.Apply();
Index: trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorVelocityInitializer.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorVelocityInitializer.cs	(revision 15091)
+++ trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorVelocityInitializer.cs	(revision 15091)
@@ -0,0 +1,84 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2017 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.RealVectorEncoding {
+  [Item("RealVectorVelocityInitializer", "Initializes the velocity vector.")]
+  [StorableClass]
+  public class RealVectorVelocityInitializer : SingleSuccessorOperator, IStochasticOperator {
+    #region Parameters
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
+    }
+    public IValueLookupParameter<DoubleMatrix> BoundsParameter {
+      get { return (IValueLookupParameter<DoubleMatrix>)Parameters["Bounds"]; }
+    }
+    public ILookupParameter<RealVector> RealVectorParameter {
+      get { return (ILookupParameter<RealVector>)Parameters["RealVector"]; }
+    }
+    public ILookupParameter<RealVector> VelocityParameter {
+      get { return (ILookupParameter<RealVector>)Parameters["Velocity"]; }
+    }
+    #endregion
+    
+    #region Construction & Cloning
+    [StorableConstructor]
+    protected RealVectorVelocityInitializer(bool deserializing) : base(deserializing) { }
+    protected RealVectorVelocityInitializer(RealVectorVelocityInitializer original, Cloner cloner) : base(original, cloner) { }
+    public RealVectorVelocityInitializer()
+      : base() {
+      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
+      Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Bounds", "The lower and upper bounds in each dimension."));
+      Parameters.Add(new LookupParameter<RealVector>("RealVector", "Particle's current solution"));
+      Parameters.Add(new LookupParameter<RealVector>("Velocity", "Particle's current velocity."));
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new RealVectorVelocityInitializer(this, cloner);
+    }
+    #endregion
+
+    public override IOperation Apply() {
+      var random = RandomParameter.ActualValue;
+      var bounds = BoundsParameter.ActualValue;
+      var position = RealVectorParameter.ActualValue;
+      var velocity = new RealVector(position.Length);
+      for (var i = 0; i < velocity.Length; i++) {
+        var lower = (bounds[i % bounds.Rows, 0] - position[i]);
+        var upper = (bounds[i % bounds.Rows, 1] - position[i]);
+        velocity[i] = lower + random.NextDouble() * (upper - lower); // SPSO 2011
+      }
+      VelocityParameter.ActualValue = velocity;
+      return base.Apply();
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVector.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVector.cs	(revision 15088)
+++ trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVector.cs	(revision 15091)
@@ -20,4 +20,5 @@
 #endregion
 
+using System;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -77,4 +78,11 @@
     }
 
+    public double DotProduct(RealVector other) {
+      if (other.Length != Length) throw new ArgumentException("Vectors are of unequal length.");
+      var dotProd = 0.0;
+      for (var i = 0; i < Length; i++)
+        dotProd += this[i] * other[i];
+      return dotProd;
+    }
   }
 }
Index: trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorEncoding.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorEncoding.cs	(revision 15088)
+++ trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorEncoding.cs	(revision 15091)
@@ -280,5 +280,4 @@
         particleCreator.RealVectorParameter.ActualName = Name;
         particleCreator.BoundsParameter.ActualName = BoundsParameter.Name;
-        particleCreator.ProblemSizeParameter.ActualName = LengthParameter.Name;
       }
     }
Index: trunk/sources/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj	(revision 15088)
+++ trunk/sources/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj	(revision 15091)
@@ -191,7 +191,5 @@
     <Compile Include="Interfaces\IDiscreteDoubleMatrixModifier.cs" />
     <Compile Include="Algorithms\HeuristicOptimizationEngineAlgorithm.cs" />
-    <Compile Include="Interfaces\IGlobalParticleUpdater.cs" />
     <Compile Include="Interfaces\ILocalImprovementOperator.cs" />
-    <Compile Include="Interfaces\ILocalParticleUpdater.cs" />
     <Compile Include="Algorithms\HeuristicOptimizationAlgorithm.cs" />
     <Compile Include="Interfaces\IMultiNeighborhoodShakingOperator.cs" />
Index: trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/IGlobalParticleUpdater.cs
===================================================================
--- trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/IGlobalParticleUpdater.cs	(revision 15088)
+++ 	(revision )
@@ -1,25 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-namespace HeuristicLab.Optimization {
-  public interface IGlobalParticleUpdater : IParticleUpdater {
-  }
-}
Index: trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/ILocalParticleUpdater.cs
===================================================================
--- trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/ILocalParticleUpdater.cs	(revision 15088)
+++ 	(revision )
@@ -1,25 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-namespace HeuristicLab.Optimization {
-  public interface ILocalParticleUpdater : IParticleUpdater {
-  }
-}
Index: trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/IParticleCreator.cs
===================================================================
--- trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/IParticleCreator.cs	(revision 15088)
+++ trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/IParticleCreator.cs	(revision 15091)
@@ -27,4 +27,5 @@
   /// </summary>
   public interface IParticleCreator : ISolutionCreator {
+    ILookupParameter<ISolutionCreator> SolutionCreatorParameter { get; }
   }
 }
Index: trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs	(revision 15088)
+++ trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs	(revision 15091)
@@ -359,6 +359,4 @@
         op.BoundsParameter.ActualName = BoundsParameter.Name;
         op.BoundsParameter.Hidden = true;
-        op.ProblemSizeParameter.ActualName = ProblemSizeParameter.Name;
-        op.ProblemSizeParameter.Hidden = true;
       }
       foreach (var op in Operators.OfType<IRealVectorParticleUpdater>()) {
