Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5316


Ignore:
Timestamp:
01/17/11 21:58:00 (14 years ago)
Author:
epitzer
Message:

added item descriptions, implemented IStorableContent interface, added missing StorableClass attributes, and fixed value updater reset (#852)

Location:
branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/BestPointInitializer.cs

    r5034 r5316  
    3131namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    3232
     33  [Item("Best Point Initializer", "Determines the best quality and point of the current particle population.")]
    3334  [StorableClass]
    3435  public class BestPointInitializer : SingleSuccessorOperator {
  • branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/EmptyTopologyInitializer.cs

    r5209 r5316  
    2525namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    2626
     27  [Item("Empty Topology Initializer", "Does not initialize topology vectors. Best used with the totally connected particle updater that used the global best point instead of the best neighbor point.")]
    2728  [StorableClass]
    2829  public class EmptyTopologyInitializer : TopologyInitializer {
  • branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/IDiscreteDoubleMatrixModifier.cs

    r5311 r5316  
    99
    1010namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
     11
    1112  public interface IDiscreteDoubleMatrixModifier : IItem {
    1213    ILookupParameter<DoubleMatrix> ValueParameter { get; }
  • branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/IParticleUpdater.cs

    r5209 r5316  
    2828
    2929  public interface IParticleUpdater : IItem {
     30
    3031    LookupParameter<RealVector> VelocityParameter { get; }
    3132    LookupParameter<DoubleMatrix> VelocityBoundsParameter { get; }
  • branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/IdentityTopologyUpdater.cs

    r5209 r5316  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Core;
    2728namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    2829
     30  [Item("Identity Topology Updater", "Does not change the topology.")]
    2931  [StorableClass]
    3032  public class IdentityTopologyUpdater : SingleSuccessorOperator, ITopologyUpdater {
  • branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/NeighborUpdater.cs

    r5209 r5316  
    3131namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    3232
     33  [Item("Neighbor Updater", "Determines the best quality and point among the defined list of neigbors for every particle and its individual neighborhood.")]
     34  [StorableClass]
    3335  public class NeighborUpdater : SingleSuccessorOperator {
    3436
  • branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/NeighborhoodParticleUpdater.cs

    r5209 r5316  
    2727namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    2828
     29  [Item("Neighborhood Particle Updater", "Updates the particle's position using (among other things) the best neighbor's position. Point = Point + Velocity*Omega + (PersonalBestPoint-Point)*Phi_P*r_p + (BestNeighborPoint-Point)*Phi_G*r_g")]
    2930  [StorableClass]
    3031  public class NeighborhoodParticleUpdater : ParticleUpdater {
  • branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimization.cs

    r5312 r5316  
    4040  [Creatable("Algorithms")]
    4141  [StorableClass]
    42   public class ParticleSwarmOptimization : EngineAlgorithm {
     42  public class ParticleSwarmOptimization : EngineAlgorithm, IStorableContent {
    4343
    4444    #region Problem Properties
     
    110110
    111111    #region Properties
     112
     113    public string Filename { get; set; }
     114
    112115    [Storable]
    113116    private BestAverageWorstQualityAnalyzer qualityAnalyzer;
     
    288291          this.OmegaParameter.ActualValue = new DoubleValue(OmegaUpdaterParameter.Value.StartValueParameter.Value.Value);
    289292        }
    290         if (VelocityBoundsUpdater != null && VelocityBoundsUpdater.StartValueParameter.Value != null && VelocityBoundsParameter.ActualValue != null) {
    291           DoubleMatrix matrix = VelocityBoundsParameter.ActualValue;
     293        if (VelocityBoundsUpdater != null && VelocityBoundsUpdater.StartValueParameter.Value != null && VelocityBoundsParameter.Value != null) {
     294          DoubleMatrix matrix = VelocityBoundsParameter.Value;
    292295          for (int i = 0; i < matrix.Rows; i++) {
    293             for (int j = 0; j < matrix.Columns; j++) {
    294               if (matrix[i, j] >= 0) {
    295                 matrix[i, j] = VelocityBoundsUpdater.StartValueParameter.Value.Value;
    296               } else {
    297                 matrix[i, j] = (-1) * VelocityBoundsUpdater.StartValueParameter.Value.Value;
    298               }
    299             }
     296            matrix[i, 0] = -VelocityBoundsUpdater.StartValueParameter.Value.Value;
     297            matrix[i, 1] = VelocityBoundsUpdater.StartValueParameter.Value.Value;
    300298          }
    301299        }
     
    387385
    388386    #endregion
     387     
    389388  }
    390389}
  • branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RandomTopologyInitializer.cs

    r5209 r5316  
    3030namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    3131
     32  [Item("Random Topology Initializer", "Randomly connectes every particle with k other particles.")]
     33  [StorableClass]
    3234  public class RandomTopologyInitializer : TopologyInitializer {
    3335
  • branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RingTopologyInitializer.cs

    r5209 r5316  
    2626namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    2727
     28  [Item("Ring Topology Initializer", "Connected every particle with its preceeding and its following particle.")]
     29  [StorableClass]
    2830  public class RingTopologyInitializer : TopologyInitializer {
    2931
  • branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/SwarmUpdater.cs

    r5034 r5316  
    3030namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    3131
     32  [Item("Swarm Updater", "Updates personal best point and quality as well as global best point and quality.")]
    3233  [StorableClass]
    3334  public class SwarmUpdater : SingleSuccessorOperator {
  • branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/TotallyConnectedParticleUpdater.cs

    r5209 r5316  
    2727namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    2828
     29  [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*Omega + (PersonalBestPoint-Point)*Phi_P*r_p + (BestPoint-Point)*Phi_G*r_g")]
    2930  [StorableClass]
    3031  public class TotallyConnectedParticleUpdater : ParticleUpdater {
  • branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/VelocityBoundsModifier.cs

    r5311 r5316  
    1313
    1414namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
     15
     16  [StorableClass]
    1517  public class VelocityBoundsModifier : SingleSuccessorOperator, IDiscreteDoubleMatrixModifier {
     18
     19    #region Parameters
    1620    public ILookupParameter<DoubleMatrix> ValueParameter {
    1721      get { return (ILookupParameter<DoubleMatrix>)Parameters["Matrix"]; }
    1822    }
    19 
    2023    public IValueLookupParameter<DoubleValue> ScaleParameter {
    2124      get { return (IValueLookupParameter<DoubleValue>)Parameters["Scale"]; }
    2225    }
    23 
    2426    public ConstrainedValueParameter<IDiscreteDoubleValueModifier> ScalingOperatorParameter {
    2527      get { return (ConstrainedValueParameter<IDiscreteDoubleValueModifier>)Parameters["ScalingOperator"]; }
    2628    }
    27 
    2829    public IValueLookupParameter<DoubleValue> StartValueParameter {
    2930      get { return (IValueLookupParameter<DoubleValue>)Parameters["StartValue"]; }
    3031    }
    31 
    3232    public IValueLookupParameter<DoubleValue> EndValueParameter {
    3333      get { return (IValueLookupParameter<DoubleValue>)Parameters["EndValue"]; }
    3434    }
    35 
    3635    public ILookupParameter<IntValue> IndexParameter {
    3736      get { return (ILookupParameter<IntValue>)Parameters["Index"]; }
    3837    }
    39 
    4038    public IValueLookupParameter<IntValue> StartIndexParameter {
    4139      get { return (IValueLookupParameter<IntValue>)Parameters["StartIndex"]; }
    4240    }
    43 
    4441    public IValueLookupParameter<IntValue> EndIndexParameter {
    4542      get { return (IValueLookupParameter<IntValue>)Parameters["EndIndex"]; }
    4643    }
     44    #endregion
    4745
    48     public VelocityBoundsModifier() : base() {
     46    #region Construction & Cloning
     47
     48    [StorableConstructor]
     49    protected VelocityBoundsModifier(bool deserializing) : base(deserializing) { }
     50    protected VelocityBoundsModifier(VelocityBoundsModifier original, Cloner cloner) : base(original, cloner) {
     51      Initialize();
     52    }
     53    public VelocityBoundsModifier() {
    4954      Parameters.Add(new LookupParameter<DoubleMatrix>("Matrix", "The double matrix to modify."));
    5055      Parameters.Add(new ValueLookupParameter<DoubleValue>("Scale", "Scale parameter."));
     
    5661      Parameters.Add(new ValueLookupParameter<IntValue>("EndIndex", "The end index by which 'Value' should have reached 'EndValue'."));
    5762      Initialize();
     63    }
     64    public override IDeepCloneable Clone(Cloner cloner) {
     65      return new VelocityBoundsModifier(this, cloner);
    5866    }
    5967
     
    7078      StartIndexParameter.ActualNameChanged += new EventHandler(StartIndexParameter_ActualNameChanged);
    7179    }
     80    #endregion
    7281
    7382    #region Events
     
    109118    #endregion
    110119
    111 
    112     #region Cloning
    113     public override IDeepCloneable Clone(Cloner cloner) {
    114       return new VelocityBoundsModifier(this, cloner);
    115     }
    116 
    117     protected VelocityBoundsModifier(VelocityBoundsModifier original, Cloner cloner)
    118       : base(original, cloner) {
    119         Initialize();
    120     }
    121     #endregion
    122 
    123     [StorableConstructor]
    124     protected VelocityBoundsModifier(bool deserializing) : base(deserializing) { }
    125 
    126120    public override IOperation Apply() {
    127121      OperationCollection next = new OperationCollection();
  • branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/VonNeumannTopologyInitializer.cs

    r5209 r5316  
    2626namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    2727
     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.")]
     29  [StorableClass]
    2830  public class VonNeumannTopologyInitializer : TopologyInitializer {
    2931
Note: See TracChangeset for help on using the changeset viewer.