Free cookie consent management tool by TermsFeed Policy Generator

Changeset 15277


Ignore:
Timestamp:
07/21/17 11:18:40 (7 years ago)
Author:
abeham
Message:

#2797: merged revisions 15071, 15076, 15091, 15092, 15093, 15096, 15102, 15114, 15181, 15201, 15214, 15223, 15224, 15228 to stable

Location:
stable
Files:
4 deleted
30 edited
12 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/AdaptiveRandomTopologyUpdater.cs

    r15181 r15277  
    8686      var successor = new OperationCollection(new[] { base.Apply() });
    8787      var max = MaximizationParameter.ActualValue.Value;
    88       if (max && swarmBest.Value >= previousBest.Value
    89         || !max && swarmBest.Value <= previousBest.Value)
     88      if (max && swarmBest.Value <= previousBest.Value
     89        || !max && swarmBest.Value >= previousBest.Value)
    9090        successor.Insert(0, ExecutionContext.CreateOperation(TopologyInitializerParameter.ActualValue));
    9191
  • stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/HeuristicLab.Algorithms.ParticleSwarmOptimization-3.3.csproj

    r11920 r15277  
    113113  </ItemGroup>
    114114  <ItemGroup>
     115    <Compile Include="AdaptiveRandomTopologyUpdater.cs" />
    115116    <Compile Include="MultiPSOTopologyUpdater.cs" />
    116117    <Compile Include="ParticleSwarmOptimizationMainLoop.cs" />
    117118    <Compile Include="Plugin.cs" />
     119    <Compile Include="SPSORandomTopologyInitializer.cs" />
    118120    <Compile Include="RandomTopologyInitializer.cs" />
    119121    <Compile Include="VonNeumannTopologyInitializer.cs" />
  • stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/MultiPSOTopologyUpdater.cs

    r14186 r15277  
    3333  [Item("Multi PSO Topology Updater", "Splits swarm into NrOfSwarms non-overlapping sub-swarms. Swarms are re-grouped every regroupingPeriod iteration. The operator is implemented as described in Liang, J.J. and Suganthan, P.N 2005. Dynamic multi-swarm particle swarm optimizer. IEEE Swarm Intelligence Symposium, pp. 124-129.")]
    3434  [StorableClass]
    35   public sealed class MultiPSOTopologyUpdater : SingleSuccessorOperator, ITopologyUpdater {
     35  public sealed class MultiPSOTopologyUpdater : SingleSuccessorOperator, ITopologyUpdater, IStochasticOperator {
    3636
    3737    public override bool CanChangeName {
  • stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimization.cs

    r14186 r15277  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Linq;
    2425using HeuristicLab.Analysis;
     
    3536
    3637namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    37   [Item("Particle Swarm Optimization (PSO)", "A particle swarm optimization algorithm based on the description in Pedersen, M.E.H. (2010). PhD thesis. University of Southampton.")]
     38  [Item("Particle Swarm Optimization (PSO)", "A particle swarm optimization algorithm based on Standard PSO (SPSO) as described in Clerc, M. (2012). Standard particle swarm optimisation.")]
    3839  [Creatable(CreatableAttribute.Categories.PopulationBasedAlgorithms, Priority = 300)]
    3940  [StorableClass]
     
    176177      Parameters.Add(new ValueParameter<IntValue>("Seed", "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
    177178      Parameters.Add(new ValueParameter<BoolValue>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
    178       Parameters.Add(new ValueParameter<IntValue>("SwarmSize", "Size of the particle swarm.", new IntValue(10)));
     179      Parameters.Add(new ValueParameter<IntValue>("SwarmSize", "Size of the particle swarm.", new IntValue(40)));
    179180      Parameters.Add(new ValueParameter<IntValue>("MaxIterations", "Maximal number of iterations.", new IntValue(1000)));
    180181      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));
    181       Parameters.Add(new ValueParameter<DoubleValue>("Inertia", "Inertia weight on a particle's movement (omega).", new DoubleValue(1)));
    182       Parameters.Add(new ValueParameter<DoubleValue>("PersonalBestAttraction", "Weight for particle's pull towards its personal best soution (phi_p).", new DoubleValue(-0.01)));
    183       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)));
     182      Parameters.Add(new ValueParameter<DoubleValue>("Inertia", "Inertia weight on a particle's movement (omega).", new DoubleValue(0.721)));
     183      Parameters.Add(new ValueParameter<DoubleValue>("PersonalBestAttraction", "Weight for particle's pull towards its personal best soution (phi_p).", new DoubleValue(1.193)));
     184      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(1.193)));
    184185      Parameters.Add(new ConstrainedValueParameter<IParticleCreator>("ParticleCreator", "Operator that creates a new particle."));
    185186      Parameters.Add(new ConstrainedValueParameter<IParticleUpdater>("ParticleUpdater", "Operator that updates a particle."));
     
    188189      Parameters.Add(new OptionalConstrainedValueParameter<IDiscreteDoubleValueModifier>("InertiaUpdater", "Updates the omega parameter."));
    189190      Parameters.Add(new ConstrainedValueParameter<ISwarmUpdater>("SwarmUpdater", "Encoding-specific parameter which is provided by the problem. May provide additional encoding-specific parameters, such as velocity bounds for real valued problems"));
    190       ParticleUpdaterParameter.Hidden = true;
    191191
    192192      RandomCreator randomCreator = new RandomCreator();
     
    262262      UpdateAnalyzers();
    263263      ParameterizeAnalyzers();
     264      UpdateParticleUpdaterParameter();
    264265      UpdateTopologyParameters();
    265266      InitializeParticleCreator();
     
    280281
    281282    private void InitializeParticleCreator() {
     283      ParticleCreatorParameter.ValidValues.Clear();
    282284      if (Problem != null) {
    283285        IParticleCreator oldParticleCreator = ParticleCreator;
    284286        IParticleCreator defaultParticleCreator = Problem.Operators.OfType<IParticleCreator>().FirstOrDefault();
    285         ParticleCreatorParameter.ValidValues.Clear();
    286         foreach (IParticleCreator Creator in Problem.Operators.OfType<IParticleCreator>().OrderBy(x => x.Name)) {
    287           ParticleCreatorParameter.ValidValues.Add(Creator);
     287        foreach (var creator in Problem.Operators.OfType<IParticleCreator>().OrderBy(x => x.Name)) {
     288          ParticleCreatorParameter.ValidValues.Add(creator);
    288289        }
    289290        if (oldParticleCreator != null) {
    290           IParticleCreator creator = ParticleCreatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleCreator.GetType());
     291          var creator = ParticleCreatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleCreator.GetType());
    291292          if (creator != null) ParticleCreator = creator;
    292293          else oldParticleCreator = null;
     
    328329        updater.IndexParameter.ActualName = "Iterations";
    329330        updater.ValueParameter.ActualName = "CurrentInertia";
    330         updater.StartValueParameter.Value = new DoubleValue(1);
    331         updater.EndValueParameter.Value = new DoubleValue(1E-10);
     331        updater.StartValueParameter.ActualName = InertiaParameter.Name;
     332        updater.EndValueParameter.Value = new DoubleValue(0.70);
    332333      }
    333334    }
     
    346347
    347348    private void UpdateTopologyInitializer() {
    348       ITopologyInitializer oldTopologyInitializer = TopologyInitializer;
     349      var oldTopologyInitializer = TopologyInitializer;
    349350      TopologyInitializerParameter.ValidValues.Clear();
    350351      foreach (ITopologyInitializer topologyInitializer in ApplicationManager.Manager.GetInstances<ITopologyInitializer>().OrderBy(x => x.Name)) {
    351352        TopologyInitializerParameter.ValidValues.Add(topologyInitializer);
    352353      }
     354
    353355      if (oldTopologyInitializer != null && TopologyInitializerParameter.ValidValues.Any(x => x.GetType() == oldTopologyInitializer.GetType()))
    354356        TopologyInitializer = TopologyInitializerParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldTopologyInitializer.GetType());
     
    357359
    358360    private void ParameterizeTopologyUpdaters() {
    359       foreach (var updater in TopologyUpdaterParameter.ValidValues) {
    360         var multiPsoUpdater = updater as MultiPSOTopologyUpdater;
    361         if (multiPsoUpdater != null) {
    362           multiPsoUpdater.CurrentIterationParameter.ActualName = "Iterations";
    363         }
    364       }
    365     }
    366 
    367     private void UpdateTopologyParameters() {
    368       ITopologyUpdater oldTopologyUpdater = TopologyUpdater;
    369       IParticleUpdater oldParticleUpdater = ParticleUpdater;
    370       ClearTopologyParameters();
    371       if (Problem != null) {
    372         IParticleUpdater defaultParticleUpdater = null;
    373         if (TopologyInitializer != null) {
    374           foreach (ITopologyUpdater topologyUpdater in ApplicationManager.Manager.GetInstances<ITopologyUpdater>())
    375             TopologyUpdaterParameter.ValidValues.Add(topologyUpdater);
    376           defaultParticleUpdater = Problem.Operators.OfType<ILocalParticleUpdater>().FirstOrDefault();
    377           foreach (IParticleUpdater particleUpdater in Problem.Operators.OfType<ILocalParticleUpdater>().OrderBy(x => x.Name))
    378             ParticleUpdaterParameter.ValidValues.Add(particleUpdater);
    379         } else {
    380           defaultParticleUpdater = Problem.Operators.OfType<IGlobalParticleUpdater>().FirstOrDefault();
    381           foreach (IParticleUpdater particleUpdater in Problem.Operators.OfType<IGlobalParticleUpdater>().OrderBy(x => x.Name))
    382             ParticleUpdaterParameter.ValidValues.Add(particleUpdater);
    383         }
    384         if (oldTopologyUpdater != null) {
    385           ITopologyUpdater newTopologyUpdater = TopologyUpdaterParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleUpdater.GetType());
    386           if (newTopologyUpdater != null) TopologyUpdater = newTopologyUpdater;
    387         }
     361      foreach (var updater in TopologyUpdaterParameter.ValidValues.OfType<MultiPSOTopologyUpdater>()) {
     362        updater.CurrentIterationParameter.ActualName = "Iterations";
     363      }
     364    }
     365
     366    private void UpdateParticleUpdaterParameter() {
     367      var oldParticleUpdater = ParticleUpdater;
     368      ParticleUpdaterParameter.ValidValues.Clear();
     369      if (Problem != null) {
     370        var defaultParticleUpdater = Problem.Operators.OfType<IParticleUpdater>().FirstOrDefault();
     371
     372        foreach (var particleUpdater in Problem.Operators.OfType<IParticleUpdater>().OrderBy(x => x.Name))
     373          ParticleUpdaterParameter.ValidValues.Add(particleUpdater);
     374
    388375        if (oldParticleUpdater != null) {
    389           IParticleUpdater newParticleUpdater = ParticleUpdaterParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleUpdater.GetType());
     376          var newParticleUpdater = ParticleUpdaterParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldParticleUpdater.GetType());
    390377          if (newParticleUpdater != null) ParticleUpdater = newParticleUpdater;
    391378          else oldParticleUpdater = null;
     
    393380        if (oldParticleUpdater == null && defaultParticleUpdater != null)
    394381          ParticleUpdater = defaultParticleUpdater;
    395 
    396         ParameterizeTopologyUpdaters();
    397       }
    398     }
    399 
    400     private void ClearTopologyParameters() {
     382      }
     383    }
     384
     385    private void UpdateTopologyParameters() {
     386      ITopologyUpdater oldTopologyUpdater = TopologyUpdater;
    401387      TopologyUpdaterParameter.ValidValues.Clear();
    402       ParticleUpdaterParameter.ValidValues.Clear();
     388      if (Problem != null) {
     389        if (TopologyInitializerParameter.Value != null) {
     390          foreach (ITopologyUpdater topologyUpdater in ApplicationManager.Manager.GetInstances<ITopologyUpdater>())
     391            TopologyUpdaterParameter.ValidValues.Add(topologyUpdater);
     392
     393          if (oldTopologyUpdater != null) {
     394            ITopologyUpdater newTopologyUpdater = TopologyUpdaterParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldTopologyUpdater.GetType());
     395            if (newTopologyUpdater != null) TopologyUpdater = newTopologyUpdater;
     396          }
     397          ParameterizeTopologyUpdaters();
     398        }
     399      }
    403400    }
    404401
  • stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimizationMainLoop.cs

    r14186 r15277  
    122122      Placeholder evaluatorPlaceholder = new Placeholder();
    123123      Placeholder analyzerPlaceholder = new Placeholder();
     124      Placeholder analyzer2Placeholder = new Placeholder();
    124125      UniformSubScopesProcessor uniformSubScopeProcessor = new UniformSubScopesProcessor();
    125126      Placeholder particleUpdaterPlaceholder = new Placeholder();
     
    192193      conditionalBranch.ConditionParameter.ActualName = "ContinueIteration";
    193194      conditionalBranch.TrueBranch = analyzerPlaceholder;
     195      conditionalBranch.FalseBranch = analyzer2Placeholder;
     196
     197      analyzer2Placeholder.Name = "(Analyzer)";
     198      analyzer2Placeholder.OperatorParameter.ActualName = AnalyzerParameter.Name;
    194199      #endregion
    195200    }
  • stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RandomTopologyInitializer.cs

    r14186 r15277  
    2525using HeuristicLab.Core;
    2626using HeuristicLab.Data;
     27using HeuristicLab.Optimization;
    2728using HeuristicLab.Parameters;
    2829using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2930
    3031namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    31   [Item("Random Topology Initializer", "Randomly connectes every particle with k other particles.")]
     32  [Item("Random Distinct Topology Initializer", "Each particle is informed by exactly k+1 distinct other particles (including itself).")]
    3233  [StorableClass]
    33   public sealed class RandomTopologyInitializer : TopologyInitializer {
     34  public sealed class RandomTopologyInitializer : TopologyInitializer, IStochasticOperator {
    3435    #region Parameters
    3536    public ILookupParameter<IRandom> RandomParameter {
     
    4041    }
    4142    #endregion
    42 
    43     #region Parameter Values
    44     private IRandom Random {
    45       get { return RandomParameter.ActualValue; }
    46     }
    47     private int NrOfConnections {
    48       get { return NrOfConnectionsParameter.ActualValue.Value; }
    49     }
    50     #endregion
    51 
     43   
    5244    #region Construction & Cloning
    5345    [StorableConstructor]
     
    6557
    6658    public override IOperation Apply() {
    67       ItemArray<IntArray> neighbors = new ItemArray<IntArray>(SwarmSize);
    68       for (int i = 0; i < SwarmSize; i++) {
    69         var numbers = Enumerable.Range(0, SwarmSize).ToList();
     59      var random = RandomParameter.ActualValue;
     60      var swarmSize = SwarmSizeParameter.ActualValue.Value;
     61      var nrOfConnections = NrOfConnectionsParameter.ActualValue.Value;
     62
     63      ItemArray<IntArray> neighbors = new ItemArray<IntArray>(swarmSize);
     64      for (int i = 0; i < swarmSize; i++) {
     65        var numbers = Enumerable.Range(0, swarmSize).ToList();
    7066        numbers.RemoveAt(i);
    71         var selectedNumbers = new List<int>(NrOfConnections);
    72         for (int j = 0; j < NrOfConnections && numbers.Count > 0; j++) {
    73           int index = Random.Next(numbers.Count);
     67        var selectedNumbers = new List<int>(nrOfConnections + 1);
     68        selectedNumbers.Add(i);
     69        for (int j = 0; j < nrOfConnections && numbers.Count > 0; j++) {
     70          int index = random.Next(numbers.Count);
    7471          selectedNumbers.Add(numbers[index]);
    7572          numbers.RemoveAt(index);
     
    7774        neighbors[i] = new IntArray(selectedNumbers.ToArray());
    7875      }
    79       Neighbors = neighbors;
     76      NeighborsParameter.ActualValue = neighbors;
    8077      return base.Apply();
    8178    }
  • stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RingTopologyInitializer.cs

    r14186 r15277  
    2626
    2727namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    28   [Item("Ring Topology Initializer", "Connected every particle with its preceeding and its following particle.")]
     28  [Item("Ring Topology Initializer", "Each particle is informed by its preceeding and its succeeding particle wrapping around at the beginning and the end of the swarm (in addition each particle also informs itself).")]
    2929  [StorableClass]
    3030  public sealed class RingTopologyInitializer : TopologyInitializer {
     
    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, (i + 1) % swarmSize });
    4850      }
    49       Neighbors = neighbors;
     51      NeighborsParameter.ActualValue = neighbors;
    5052      return base.Apply();
    5153    }
  • stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/SPSORandomTopologyInitializer.cs

    r15181 r15277  
    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);
  • stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/TopologyInitializer.cs

    r14186 r15277  
    4040      get { return (IScopeTreeLookupParameter<IntArray>)Parameters["Neighbors"]; }
    4141    }
    42 
    4342    public ILookupParameter<IntValue> SwarmSizeParameter {
    4443      get { return (ILookupParameter<IntValue>)Parameters["SwarmSize"]; }
    45     }
    46 
    47     #endregion
    48 
    49     #region Parameter Values
    50     protected ItemArray<IntArray> Neighbors {
    51       get { return NeighborsParameter.ActualValue; }
    52       set { NeighborsParameter.ActualValue = value; }
    53     }
    54     protected int SwarmSize {
    55       get { return SwarmSizeParameter.ActualValue.Value; }
    5644    }
    5745    #endregion
  • stable/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/VonNeumannTopologyInitializer.cs

    r14186 r15277  
    2626
    2727namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    28   [Item("Von Neumann Topology Initializer", "Every particle is connected with the two following and the two previous particles wrapping around at the beginning and the end of the population.")]
     28  [Item("Von Neumann Topology Initializer", "Every particle is informed by the two following and the two previous particles wrapping around at the beginning and the end of the swarm (in addition each particle also informs itself).")]
    2929  [StorableClass]
    3030  public sealed class VonNeumannTopologyInitializer : TopologyInitializer {
     
    4444
    4545    public override IOperation Apply() {
    46       ItemArray<IntArray> neighbors = new ItemArray<IntArray>(SwarmSize);
    47       for (int i = 0; i < SwarmSize; i++) {
     46      var swarmSize = SwarmSizeParameter.ActualValue.Value;
     47
     48      ItemArray<IntArray> neighbors = new ItemArray<IntArray>(swarmSize);
     49      for (int i = 0; i < swarmSize; i++) {
    4850        neighbors[i] = new IntArray(new[] {
    49           (SwarmSize + i-2) % SwarmSize,
    50           (SwarmSize + i-1) % SwarmSize,
    51           (i+1) % SwarmSize,
    52           (i+2) % SwarmSize
     51          (swarmSize + i-2) % swarmSize,
     52          (swarmSize + i-1) % swarmSize,
     53          i,
     54          (i+1) % swarmSize,
     55          (i+2) % swarmSize
    5356        });
    5457      }
    55       Neighbors = neighbors;
     58      NeighborsParameter.ActualValue = neighbors;
    5659      return base.Apply();
    5760    }
  • stable/HeuristicLab.Encodings.RealVectorEncoding

  • stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/HeuristicLab.Encodings.RealVectorEncoding-3.3.csproj

    r15217 r15277  
    116116    <Compile Include="Creators\NormalDistributedRealVectorCreator.cs" />
    117117    <Compile Include="Interfaces\IRealVectorMultiNeighborhoodShakingOperator.cs" />
     118    <Compile Include="ParticleOperators\RealVectorNeighborhoodParticleUpdater.cs" />
    118119    <Compile Include="ParticleOperators\RealVectorParticleCreator.cs" />
     120    <Compile Include="ParticleOperators\RealVectorParticleUpdater.cs" />
     121    <Compile Include="ParticleOperators\RealVectorSwarmUpdater.cs" />
     122    <Compile Include="ParticleOperators\RealVectorTotallyConnectedParticleUpdater.cs" />
     123    <Compile Include="ParticleOperators\SPSO2007VelocityInitializer.cs" />
     124    <Compile Include="ParticleOperators\SPSOVelocityInitializer.cs" />
     125    <Compile Include="ParticleOperators\SPSO2011ParticleUpdater.cs" />
     126    <Compile Include="ParticleOperators\SPSO2007ParticleUpdater.cs" />
     127    <Compile Include="ParticleOperators\SPSOParticleCreator.cs" />
    119128    <Compile Include="Crossovers\BlendAlphaBetaCrossover.cs" />
    120129    <Compile Include="Interfaces\IRealVectorManipulator.cs" />
     
    128137    <Compile Include="Interfaces\IRealVectorSwarmUpdater.cs" />
    129138    <Compile Include="Manipulators\SelfAdaptiveNormalAllPositionsManipulator.cs" />
    130     <Compile Include="ParticleOperators\RealVectorNeighborhoodParticleUpdater.cs" />
    131     <Compile Include="ParticleOperators\RealVectorParticleUpdater.cs" />
    132     <Compile Include="ParticleOperators\RealVectorSwarmUpdater.cs" />
    133     <Compile Include="ParticleOperators\RealVectorTotallyConnectedParticleUpdater.cs" />
     139    <Compile Include="ParticleOperators\SPSOParticleUpdater.cs" />
     140    <Compile Include="ParticleOperators\SPSO2011VelocityInitializer.cs" />
     141    <Compile Include="ParticleOperators\SPSOSwarmUpdater.cs" />
    134142    <Compile Include="Plugin.cs" />
    135143    <Compile Include="RealVectorCreator.cs" />
  • stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorParticleCreator.cs

    r14186 r15277  
    2626namespace HeuristicLab.Encodings.RealVectorEncoding {
    2727  public interface IRealVectorParticleCreator : IParticleCreator, IRealVectorOperator {
    28     ILookupParameter<IntValue> ProblemSizeParameter { get; }
    2928    ILookupParameter<RealVector> RealVectorParameter { get; }
    3029    ILookupParameter<RealVector> PersonalBestParameter { get; }
  • stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorParticleUpdater.cs

    r14186 r15277  
    2727  public interface IRealVectorParticleUpdater : IParticleUpdater, IRealVectorOperator {
    2828    ILookupParameter<RealVector> VelocityParameter { get; }
    29     ILookupParameter<DoubleMatrix> CurrentVelocityBoundsParameter { get; }
     29    ILookupParameter<DoubleValue> CurrentMaxVelocityParameter { get; }
    3030    ILookupParameter<RealVector> RealVectorParameter { get; }
    3131    ILookupParameter<DoubleMatrix> BoundsParameter { get; }
  • stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorNeighborhoodParticleUpdater.cs

    r14186 r15277  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    24 using HeuristicLab.Optimization;
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26using HeuristicLab.PluginInfrastructure;
    2627
    2728namespace HeuristicLab.Encodings.RealVectorEncoding {
    2829  [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.")]
    2930  [StorableClass]
    30   public sealed class RealVectorNeighborhoodParticleUpdater : RealVectorParticleUpdater, ILocalParticleUpdater {
     31  [NonDiscoverableType]
     32  [Obsolete("Use SPSO2011ParticleUpdater")]
     33  internal sealed class RealVectorNeighborhoodParticleUpdater : RealVectorParticleUpdater {
    3134
    3235    #region Construction & Cloning
  • stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorParticleCreator.cs

    r14186 r15277  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
    2526using HeuristicLab.Operators;
     27using HeuristicLab.Optimization;
    2628using HeuristicLab.Parameters;
    2729using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     30using HeuristicLab.PluginInfrastructure;
    2831
    2932namespace HeuristicLab.Encodings.RealVectorEncoding {
    3033  [Item("RealVectorParticleCreator", "Creates a particle with position, zero velocity vector and personal best.")]
    3134  [StorableClass]
    32   public class RealVectorParticleCreator : AlgorithmOperator, IRealVectorParticleCreator {
     35  [NonDiscoverableType]
     36  [Obsolete("Use SPSOParticleCreator")]
     37  internal class RealVectorParticleCreator : AlgorithmOperator, IRealVectorParticleCreator {
    3338
    3439    #region Parameters
     
    4752    public ILookupParameter<RealVector> VelocityParameter {
    4853      get { return (ILookupParameter<RealVector>)Parameters["Velocity"]; }
     54    }
     55    public ILookupParameter<ISolutionCreator> SolutionCreatorParameter {
     56      get { return (ILookupParameter<ISolutionCreator>)Parameters["SolutionCreator"]; }
    4957    }
    5058    #endregion
     
    7078      Parameters.Add(new LookupParameter<RealVector>("PersonalBest", "Particle's personal best solution."));
    7179      Parameters.Add(new LookupParameter<RealVector>("Velocity", "Particle's current velocity."));
     80      Parameters.Add(new LookupParameter<ISolutionCreator>("SolutionCreator", "The operator that creates the initial position."));
    7281
    7382      UniformRandomRealVectorCreator realVectorCreater = new UniformRandomRealVectorCreator();
     
    94103      return base.Apply();
    95104    }
    96 
    97 
     105   
     106    [StorableHook(HookType.AfterDeserialization)]
     107    private void AfterDeserialization() {
     108      if (!Parameters.ContainsKey("SolutionCreator"))
     109        Parameters.Add(new LookupParameter<ISolutionCreator>("SolutionCreator", "The operator that creates the initial position."));
     110    }
    98111  }
    99112}
  • stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorParticleUpdater.cs

    r14186 r15277  
    2727using HeuristicLab.Parameters;
    2828using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using HeuristicLab.PluginInfrastructure;
    2930
    3031namespace HeuristicLab.Encodings.RealVectorEncoding {
     
    3233  [Item("RealVectorParticleUpdater", "Updates a certain particle taking the current position and velocity into account, as well as the best point and the best point in a local neighborhood.")]
    3334  [StorableClass]
    34   public abstract class RealVectorParticleUpdater : SingleSuccessorOperator, IRealVectorParticleUpdater {
     35  [NonDiscoverableType]
     36  [Obsolete("Use SPSO2011ParticleUpdater")]
     37  internal abstract class RealVectorParticleUpdater : SingleSuccessorOperator, IRealVectorParticleUpdater {
    3538
    3639    public override bool CanChangeName {
     
    6265    public ILookupParameter<DoubleMatrix> CurrentVelocityBoundsParameter {
    6366      get { return (ILookupParameter<DoubleMatrix>)Parameters["CurrentVelocityBounds"]; }
     67    }
     68    public ILookupParameter<DoubleValue> CurrentMaxVelocityParameter {
     69      get { return (ILookupParameter<DoubleValue>)Parameters["CurrentMaxVelocity"]; }
    6470    }
    6571    public ILookupParameter<DoubleValue> InertiaParameter {
     
    126132      Parameters.Add(new LookupParameter<DoubleMatrix>("Bounds", "The lower and upper bounds for each dimension of the position vector for the current problem."));
    127133      Parameters.Add(new LookupParameter<DoubleMatrix>("CurrentVelocityBounds", "Upper and lower bounds for the particle's velocity vector."));
     134      Parameters.Add(new LookupParameter<DoubleValue>("CurrentMaxVelocity", "Maximum for the particle's velocity vector."));
    128135      Parameters.Add(new LookupParameter<DoubleValue>("CurrentInertia", "The weight for the particle's velocity vector."));
    129136      Parameters.Add(new LookupParameter<DoubleValue>("PersonalBestAttraction", "The weight for the particle's personal best position."));
     
    131138    }
    132139    #endregion
     140   
     141    [StorableHook(HookType.AfterDeserialization)]
     142    private void AfterDeserialization() {
     143      if (!Parameters.ContainsKey("CurrentMaxVelocity"))
     144        Parameters.Add(new LookupParameter<DoubleValue>("CurrentMaxVelocity", "Maximum for the particle's velocity vector."));
     145    }
    133146
    134147    protected void MoveParticle(RealVector velocity, RealVector position) {
  • stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorSwarmUpdater.cs

    r14186 r15277  
    3535  [Item("RealVectorSwarmUpdater", "Updates personal best point and quality as well as global best point and quality.")]
    3636  [StorableClass]
    37   public sealed class RealVectorSwarmUpdater : SingleSuccessorOperator, IRealVectorSwarmUpdater, ISingleObjectiveOperator {
     37  [NonDiscoverableType]
     38  [Obsolete("Use SPSOSwarmUpdater")]
     39  internal sealed class RealVectorSwarmUpdater : SingleSuccessorOperator, IRealVectorSwarmUpdater, ISingleObjectiveOperator {
    3840
    3941    [Storable]
  • stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorTotallyConnectedParticleUpdater.cs

    r14186 r15277  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    24 using HeuristicLab.Optimization;
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26using HeuristicLab.PluginInfrastructure;
    2627
    2728namespace HeuristicLab.Encodings.RealVectorEncoding {
    2829  [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")]
    2930  [StorableClass]
    30   public sealed class RealVectorTotallyConnectedParticleUpdater : RealVectorParticleUpdater, IGlobalParticleUpdater {
     31  [NonDiscoverableType]
     32  [Obsolete("Use SPSO2011ParticleUpdater")]
     33  internal sealed class RealVectorTotallyConnectedParticleUpdater : RealVectorParticleUpdater {
    3134
    3235    #region Construction & Cloning
  • stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/SPSO2007ParticleUpdater.cs

    r15096 r15277  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Data;
     26using HeuristicLab.Parameters;
    2627using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2728
     
    2930  [Item("SPSO 2007 Particle Updater", "Updates the particle's position according to the formulae described in SPSO 2007.")]
    3031  [StorableClass]
    31   public sealed class SPSO2007ParticleUpdater : RealVectorParticleUpdater {
     32  public sealed class SPSO2007ParticleUpdater : SPSOParticleUpdater {
    3233
    3334    #region Construction & Cloning
     
    4142    #endregion
    4243   
    43     public static void UpdateVelocity(IRandom random, RealVector velocity, double maxVelocity, RealVector position, double inertia, RealVector personalBest, double personalBestAttraction, RealVector neighborBest, double neighborBestAttraction) {
     44    public static void UpdateVelocity(IRandom random, RealVector velocity, RealVector position, RealVector personalBest, RealVector neighborBest, double inertia = 0.721, double personalBestAttraction = 1.193, double neighborBestAttraction = 1.193, double maxVelocity = double.MaxValue) {
    4445      for (int i = 0; i < velocity.Length; i++) {
    45         double r_p = random.NextDouble() * 1.193;
    46         double r_g = random.NextDouble() * 1.193;
     46        double r_p = random.NextDouble();
     47        double r_g = random.NextDouble();
    4748        velocity[i] =
    4849          velocity[i] * inertia +
     
    6970        if (position[i] < min) {
    7071          position[i] = min;
    71           velocity[i] = 0;
     72          velocity[i] = 0; // SPSO 2007
    7273        }
    7374        if (position[i] > max) {
    7475          position[i] = max;
    75           velocity[i] = 0;
     76          velocity[i] = 0; // SPSO 2007
    7677        }
    7778      }
     
    9091      var neighborBest = NeighborBestParameter.ActualValue;
    9192      var neighborBestAttraction = NeighborBestAttractionParameter.ActualValue.Value;
    92      
    93       UpdateVelocity(random, velocity, maxVelocity, position, inertia, personalBest, personalBestAttraction, neighborBest, neighborBestAttraction);
     93
     94      UpdateVelocity(random, velocity, position, personalBest, neighborBest, inertia, personalBestAttraction, neighborBestAttraction, maxVelocity);
    9495      UpdatePosition(bounds, velocity, position);
    9596
  • stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/SPSO2011ParticleUpdater.cs

    r15096 r15277  
    2525using HeuristicLab.Data;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Random;
    2728
    2829namespace HeuristicLab.Encodings.RealVectorEncoding {
    2930  [Item("SPSO 2011 Particle Updater", "Updates the particle's position according to the formulae described in SPSO 2011.")]
    3031  [StorableClass]
    31   public sealed class SPSO2011ParticleUpdater : RealVectorParticleUpdater {
    32 
     32  public sealed class SPSO2011ParticleUpdater : SPSOParticleUpdater {
    3333    #region Construction & Cloning
    3434    [StorableConstructor]
     
    4141    #endregion
    4242   
    43     public static void UpdateVelocity(IRandom random, RealVector velocity, double maxVelocity, RealVector position, double inertia, RealVector personalBest, double personalBestAttraction, RealVector neighborBest, double neighborBestAttraction) {
     43    public static void UpdateVelocity(IRandom random, RealVector velocity, RealVector position, RealVector personalBest, RealVector neighborBest, double inertia = 0.721, double personalBestAttraction = 1.193, double neighborBestAttraction = 1.193, double maxVelocity = double.MaxValue) {
    4444      var gravity = new double[velocity.Length];
    45       var direct = new RealVector(velocity.Length);
     45      var direction = new RealVector(velocity.Length);
    4646      var radius = 0.0;
    4747
     48      var nd = new NormalDistributedRandom(random, 0, 1);
     49
    4850      for (int i = 0; i < velocity.Length; i++) {
    49         var g_id = 1.193 * ((personalBest[i] + neighborBest[i] - 2 * position[i]) / 3.0);
     51        var g_id = (personalBestAttraction * personalBest[i]
     52          + neighborBestAttraction * neighborBest[i]
     53          - position[i] * (neighborBestAttraction + personalBestAttraction)) / 3.0;
     54        // center of the hyper-sphere
    5055        gravity[i] = g_id + position[i];
    51         direct[i] = (random.NextDouble() - 0.5) * 2;
     56        // a random direction vector uniform over the surface of hyper-sphere, see http://mathworld.wolfram.com/HyperspherePointPicking.html
     57        direction[i] = nd.NextDouble();
    5258        radius += g_id * g_id;
    5359      }
    5460
     61      // randomly choose a radius within the hyper-sphere
    5562      radius = random.NextDouble() * Math.Sqrt(radius);
    5663
    57       var unitscale = Math.Sqrt(direct.DotProduct(direct));
     64      // unitscale is used to rescale the random direction vector to unit length, resp. length of the radius
     65      var unitscale = Math.Sqrt(direction.DotProduct(direction));
    5866      if (unitscale > 0) {
    5967        for (var i = 0; i < velocity.Length; i++) {
    60           velocity[i] = velocity[i] * inertia + gravity[i] + direct[i] * radius / unitscale - position[i];
     68          var sampledPos = gravity[i] + direction[i] * radius / unitscale;
     69          velocity[i] = velocity[i] * inertia + sampledPos - position[i];
    6170        }
    6271      }
     
    101110      var neighborBest = NeighborBestParameter.ActualValue;
    102111      var neighborBestAttraction = NeighborBestAttractionParameter.ActualValue.Value;
    103      
    104       UpdateVelocity(random, velocity, maxVelocity, position, inertia, personalBest, personalBestAttraction, neighborBest, neighborBestAttraction);
     112
     113      UpdateVelocity(random, velocity, position, personalBest, neighborBest, inertia, personalBestAttraction, neighborBestAttraction, maxVelocity);
    105114      UpdatePosition(bounds, velocity, position);
    106115
  • stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/SPSOParticleUpdater.cs

    r15102 r15277  
    7171      get { return (ILookupParameter<DoubleValue>)Parameters["NeighborBestAttraction"]; }
    7272    }
    73 
    74     public IValueLookupParameter<DoubleValue> MaxBeyondBestParameter {
    75       get { return (IValueLookupParameter<DoubleValue>)Parameters["MaxBeyondBest"]; }
    76     }
    7773    #endregion
    7874
     
    9389      Parameters.Add(new LookupParameter<DoubleValue>("PersonalBestAttraction", "The weight for the particle's personal best position."));
    9490      Parameters.Add(new LookupParameter<DoubleValue>("NeighborBestAttraction", "The weight for the global best position."));
    95       Parameters.Add(new ValueLookupParameter<DoubleValue>("MaxBeyondBest", "A factor of how much the velocity update may maximally aim beyond the personal and neighbor best.", new DoubleValue(1.193)));
    9691    }
    9792    #endregion
  • stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/SPSOSwarmUpdater.cs

    r15102 r15277  
    3434
    3535namespace HeuristicLab.Encodings.RealVectorEncoding {
    36   [Item("Swarm Updater (SPSO)", "Updates personal best point and quality as well as global best point and quality.")]
     36  [Item("Swarm Updater (SPSO)", "Updates personal best point and quality as well as neighbor best point and quality.")]
    3737  [StorableClass]
    3838  public sealed class SPSOSwarmUpdater : SingleSuccessorOperator, IRealVectorSwarmUpdater, ISingleObjectiveOperator {
     
    126126      Parameters.Add(new ScopeTreeLookupParameter<IntArray>("Neighbors", "The list of neighbors for each particle."));
    127127      Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
    128       Parameters.Add(new ValueLookupParameter<DoubleValue>("MaxVelocity", "Speed limit for each particle.", new DoubleValue(1000000)));
     128      Parameters.Add(new ValueLookupParameter<DoubleValue>("MaxVelocity", "The maximum velocity for each particle and initial velocity if scaling is used.", new DoubleValue(double.MaxValue)));
    129129      Parameters.Add(new LookupParameter<DoubleValue>("CurrentMaxVelocity", "Current value of the speed limit."));
    130130      Parameters.Add(new LookupParameter<ResultCollection>("Results", "Results"));
     
    132132      #region Max Velocity Updating
    133133      Parameters.Add(new OptionalConstrainedValueParameter<IDiscreteDoubleValueModifier>("MaxVelocityScalingOperator", "Modifies the value"));
    134       Parameters.Add(new ValueLookupParameter<DoubleValue>("FinalMaxVelocity", "The value of maximum velocity if PSO has reached maximum iterations.", new DoubleValue(1E-10)));
     134      Parameters.Add(new ValueLookupParameter<DoubleValue>("FinalMaxVelocity", "The value of maximum velocity if scaling is used and PSO has reached maximum iterations.", new DoubleValue(1E-10)));
    135135      Parameters.Add(new LookupParameter<IntValue>("MaxVelocityIndex", "The current index.", "Iterations"));
    136136      Parameters.Add(new ValueLookupParameter<IntValue>("MaxVelocityStartIndex", "The start index at which to start modifying 'Value'.", new IntValue(0)));
     
    195195        var neighborBest = new ItemArray<RealVector>(neighbors.Length);
    196196        var neighborBestQuality = new ItemArray<DoubleValue>(neighbors.Length);
     197        double overallBest = double.NaN;
     198        RealVector overallBestVector = null;
    197199        for (int n = 0; n < neighbors.Length; n++) {
    198           var pairs = particles.Where(x => x.Item1 == n || neighbors[n].Contains(x.Item1));
    199           var bestNeighbor = (maximization ? pairs.MaxItems(p => p.Item3)
    200                                            : pairs.MinItems(p => p.Item3)).First();
     200          var neighborhood = particles.Where(x => neighbors[n].Contains(x.Item1));
     201          var bestNeighbor = (maximization ? neighborhood.MaxItems(p => p.Item3)
     202                                           : neighborhood.MinItems(p => p.Item3)).First();
    201203          neighborBest[n] = bestNeighbor.Item2;
    202204          neighborBestQuality[n] = new DoubleValue(bestNeighbor.Item3);
     205          if (double.IsNaN(overallBest) || maximization && bestNeighbor.Item3 > overallBest
     206            || !maximization && bestNeighbor.Item3 < overallBest) {
     207            overallBest = bestNeighbor.Item3;
     208            overallBestVector = bestNeighbor.Item2;
     209          }
    203210        }
    204211        NeighborBestParameter.ActualValue = neighborBest;
    205212        NeighborBestQualityParameter.ActualValue = neighborBestQuality;
     213        SwarmBestQualityParameter.ActualValue = new DoubleValue(overallBest);
     214        BestRealVectorParameter.ActualValue = overallBestVector;
    206215      } else {
    207216        // Neighbor best = Global best
    208217        var best = maximization ? particles.MaxItems(x => x.Item3).First() : particles.MinItems(x => x.Item3).First();
    209         NeighborBestParameter.ActualValue = new ItemArray<RealVector>(particles.Select(x => best.Item2));
    210         NeighborBestQualityParameter.ActualValue = new ItemArray<DoubleValue>(particles.Select(x => new DoubleValue(best.Item3)));
     218        NeighborBestParameter.ActualValue = new ItemArray<RealVector>(Enumerable.Repeat(best.Item2, particles.Count));
     219        NeighborBestQualityParameter.ActualValue = new ItemArray<DoubleValue>(Enumerable.Repeat(new DoubleValue(best.Item3), particles.Count));
     220        SwarmBestQualityParameter.ActualValue = new DoubleValue(best.Item3);
     221        BestRealVectorParameter.ActualValue = best.Item2;
    211222      }
    212223    }
     
    224235          !maximization && p.Item3 < personalBestQuality[p.Item1].Value) {
    225236          personalBestQuality[p.Item1].Value = p.Item3;
    226           personalBest[p.Item1] = (RealVector)p.Item2.Clone();
     237          personalBest[p.Item1] = new RealVector(p.Item2);
    227238        }
    228239      }
  • stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVector.cs

    r14186 r15277  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    4445        array[i] = elements[i];
    4546    }
     47    public RealVector(RealVector other) : this(other.array) { }
    4648
    4749    public override IDeepCloneable Clone(Cloner cloner) {
     
    7779    }
    7880
     81    public double DotProduct(RealVector other) {
     82      if (other.Length != Length) throw new ArgumentException("Vectors are of unequal length.");
     83      var dotProd = 0.0;
     84      for (var i = 0; i < Length; i++)
     85        dotProd += this[i] * other[i];
     86      return dotProd;
     87    }
    7988  }
    8089}
  • stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorEncoding.cs

    r14186 r15277  
    280280        particleCreator.RealVectorParameter.ActualName = Name;
    281281        particleCreator.BoundsParameter.ActualName = BoundsParameter.Name;
    282         particleCreator.ProblemSizeParameter.ActualName = LengthParameter.Name;
    283282      }
    284283    }
  • stable/HeuristicLab.Optimization

  • stable/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj

    r15109 r15277  
    191191    <Compile Include="Interfaces\IDiscreteDoubleMatrixModifier.cs" />
    192192    <Compile Include="Algorithms\HeuristicOptimizationEngineAlgorithm.cs" />
    193     <Compile Include="Interfaces\IGlobalParticleUpdater.cs" />
    194193    <Compile Include="Interfaces\ILocalImprovementOperator.cs" />
    195     <Compile Include="Interfaces\ILocalParticleUpdater.cs" />
    196194    <Compile Include="Algorithms\HeuristicOptimizationAlgorithm.cs" />
    197195    <Compile Include="Interfaces\IMultiNeighborhoodShakingOperator.cs" />
  • stable/HeuristicLab.Optimization/3.3/Interfaces/IParticleCreator.cs

    r14186 r15277  
    2727  /// </summary>
    2828  public interface IParticleCreator : ISolutionCreator {
     29    ILookupParameter<ISolutionCreator> SolutionCreatorParameter { get; }
    2930  }
    3031}
  • stable/HeuristicLab.Optimizer

  • stable/HeuristicLab.Optimizer/3.3/HeuristicLab.Optimizer-3.3.csproj

    r15257 r15277  
    129129    <EmbeddedResource Include="Documents\SGP_SymbReg.hl" />
    130130    <EmbeddedResource Include="Documents\VNS_TSP.hl" />
    131     <EmbeddedResource Include="Documents\PSO_Schwefel.hl" />
    132131    <EmbeddedResource Include="Documents\SS_VRP.hl" />
    133132    <EmbeddedResource Include="Documents\RAPGA_JSSP.hl" />
     
    153152    <EmbeddedResource Include="Documents\SGP_Robocode.hl" />
    154153    <EmbeddedResource Include="Documents\OSGP_SymReg.hl" />
     154    <EmbeddedResource Include="Documents\PSO_Rastrigin.hl" />
    155155    <None Include="Plugin.cs.frame" />
    156156    <Compile Include="ChangeNestingLevelDialog.cs">
  • stable/HeuristicLab.Optimizer/3.3/StartPage.cs

    r15257 r15277  
    134134    private void FillGroupLookup() {
    135135      var standardProblems = new List<string> { "ALPSGA_TSP", "ES_Griewank", "OSES_Griewank", "GA_Grouping", "GA_TSP", "GA_VRP", "GE_ArtificialAnt",
    136                 "IslandGA_TSP", "LS_Knapsack", "PSO_Schwefel", "RAPGA_JSSP",
     136                "IslandGA_TSP", "LS_Knapsack", "PSO_Rastrigin", "RAPGA_JSSP",
    137137                "SA_Rastrigin", "SGP_SantaFe", "GP_Multiplexer", "SGP_Robocode", "SS_VRP", "TS_TSP", "TS_VRP", "VNS_OP", "VNS_TSP", "GA_BPP"
    138138        };
  • stable/HeuristicLab.Problems.TestFunctions

  • stable/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs

    r15217 r15277  
    359359        op.BoundsParameter.ActualName = BoundsParameter.Name;
    360360        op.BoundsParameter.Hidden = true;
    361         op.ProblemSizeParameter.ActualName = ProblemSizeParameter.Name;
    362         op.ProblemSizeParameter.Hidden = true;
    363361      }
    364362      foreach (var op in Operators.OfType<IRealVectorParticleUpdater>()) {
  • stable/HeuristicLab.Tests

  • stable/HeuristicLab.Tests/HeuristicLab-3.3/Samples/PsoRastriginSampleTest.cs

    r15224 r15277  
    3131namespace HeuristicLab.Tests {
    3232  [TestClass]
    33   public class PsoSchwefelSampleTest {
     33  public class PsoRastriginSampleTest {
    3434    private const string SampleFileName = "PSO_Rastrigin";
    3535
     
    5151      if (Environment.Is64BitProcess) {
    5252        Assert.AreEqual(0, SamplesUtils.GetDoubleResult(pso, "BestQuality"));
    53         Assert.AreEqual(3.9649516110677525, SamplesUtils.GetDoubleResult(pso, "CurrentAverageQuality"));
    54         Assert.AreEqual(25.566430359483757, SamplesUtils.GetDoubleResult(pso, "CurrentWorstQuality"));
     53        Assert.AreEqual(3.9649516110677525, SamplesUtils.GetDoubleResult(pso, "CurrentAverageQuality"), 1e-08);
     54        Assert.AreEqual(25.566430359483757, SamplesUtils.GetDoubleResult(pso, "CurrentWorstQuality"), 1e-08);
    5555        Assert.AreEqual(200, SamplesUtils.GetIntResult(pso, "Iterations"));
    5656      } else {
    5757        Assert.AreEqual(0, SamplesUtils.GetDoubleResult(pso, "BestQuality"));
    58         Assert.AreEqual(3.3957460831564048, SamplesUtils.GetDoubleResult(pso, "CurrentAverageQuality"));
    59         Assert.AreEqual(34.412788077766145, SamplesUtils.GetDoubleResult(pso, "CurrentWorstQuality"));
     58        Assert.AreEqual(3.3957460831564048, SamplesUtils.GetDoubleResult(pso, "CurrentAverageQuality"), 1e-08);
     59        Assert.AreEqual(34.412788077766145, SamplesUtils.GetDoubleResult(pso, "CurrentWorstQuality"), 1e-08);
    6060        Assert.AreEqual(200, SamplesUtils.GetIntResult(pso, "Iterations"));
    6161      }
  • stable/HeuristicLab.Tests/HeuristicLab.Tests.csproj

    r15257 r15277  
    475475    <Compile Include="HeuristicLab-3.3\Samples\GPMultiplexerSampleTest.cs" />
    476476    <Compile Include="HeuristicLab-3.3\Samples\LocalSearchKnapsackSampleTest.cs" />
    477     <Compile Include="HeuristicLab-3.3\Samples\PsoSchwefelSampleTest.cs" />
     477    <Compile Include="HeuristicLab-3.3\Samples\PsoRastriginSampleTest.cs" />
    478478    <Compile Include="HeuristicLab-3.3\Samples\RAPGASchedulingSampleTest.cs" />
    479479    <Compile Include="HeuristicLab-3.3\Samples\SamplesUtils.cs" />
Note: See TracChangeset for help on using the changeset viewer.