Changeset 5316
- Timestamp:
- 01/17/11 21:58:00 (14 years ago)
- 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 31 31 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 32 32 33 [Item("Best Point Initializer", "Determines the best quality and point of the current particle population.")] 33 34 [StorableClass] 34 35 public class BestPointInitializer : SingleSuccessorOperator { -
branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/EmptyTopologyInitializer.cs
r5209 r5316 25 25 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 26 26 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.")] 27 28 [StorableClass] 28 29 public class EmptyTopologyInitializer : TopologyInitializer { -
branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/IDiscreteDoubleMatrixModifier.cs
r5311 r5316 9 9 10 10 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 11 11 12 public interface IDiscreteDoubleMatrixModifier : IItem { 12 13 ILookupParameter<DoubleMatrix> ValueParameter { get; } -
branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/IParticleUpdater.cs
r5209 r5316 28 28 29 29 public interface IParticleUpdater : IItem { 30 30 31 LookupParameter<RealVector> VelocityParameter { get; } 31 32 LookupParameter<DoubleMatrix> VelocityBoundsParameter { get; } -
branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/IdentityTopologyUpdater.cs
r5209 r5316 25 25 using HeuristicLab.Parameters; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Core; 27 28 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 28 29 30 [Item("Identity Topology Updater", "Does not change the topology.")] 29 31 [StorableClass] 30 32 public class IdentityTopologyUpdater : SingleSuccessorOperator, ITopologyUpdater { -
branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/NeighborUpdater.cs
r5209 r5316 31 31 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 32 32 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] 33 35 public class NeighborUpdater : SingleSuccessorOperator { 34 36 -
branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/NeighborhoodParticleUpdater.cs
r5209 r5316 27 27 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 28 28 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")] 29 30 [StorableClass] 30 31 public class NeighborhoodParticleUpdater : ParticleUpdater { -
branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimization.cs
r5312 r5316 40 40 [Creatable("Algorithms")] 41 41 [StorableClass] 42 public class ParticleSwarmOptimization : EngineAlgorithm {42 public class ParticleSwarmOptimization : EngineAlgorithm, IStorableContent { 43 43 44 44 #region Problem Properties … … 110 110 111 111 #region Properties 112 113 public string Filename { get; set; } 114 112 115 [Storable] 113 116 private BestAverageWorstQualityAnalyzer qualityAnalyzer; … … 288 291 this.OmegaParameter.ActualValue = new DoubleValue(OmegaUpdaterParameter.Value.StartValueParameter.Value.Value); 289 292 } 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; 292 295 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; 300 298 } 301 299 } … … 387 385 388 386 #endregion 387 389 388 } 390 389 } -
branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RandomTopologyInitializer.cs
r5209 r5316 30 30 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 31 31 32 [Item("Random Topology Initializer", "Randomly connectes every particle with k other particles.")] 33 [StorableClass] 32 34 public class RandomTopologyInitializer : TopologyInitializer { 33 35 -
branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RingTopologyInitializer.cs
r5209 r5316 26 26 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 27 27 28 [Item("Ring Topology Initializer", "Connected every particle with its preceeding and its following particle.")] 29 [StorableClass] 28 30 public class RingTopologyInitializer : TopologyInitializer { 29 31 -
branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/SwarmUpdater.cs
r5034 r5316 30 30 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 31 31 32 [Item("Swarm Updater", "Updates personal best point and quality as well as global best point and quality.")] 32 33 [StorableClass] 33 34 public class SwarmUpdater : SingleSuccessorOperator { -
branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/TotallyConnectedParticleUpdater.cs
r5209 r5316 27 27 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 28 28 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")] 29 30 [StorableClass] 30 31 public class TotallyConnectedParticleUpdater : ParticleUpdater { -
branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/VelocityBoundsModifier.cs
r5311 r5316 13 13 14 14 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 15 16 [StorableClass] 15 17 public class VelocityBoundsModifier : SingleSuccessorOperator, IDiscreteDoubleMatrixModifier { 18 19 #region Parameters 16 20 public ILookupParameter<DoubleMatrix> ValueParameter { 17 21 get { return (ILookupParameter<DoubleMatrix>)Parameters["Matrix"]; } 18 22 } 19 20 23 public IValueLookupParameter<DoubleValue> ScaleParameter { 21 24 get { return (IValueLookupParameter<DoubleValue>)Parameters["Scale"]; } 22 25 } 23 24 26 public ConstrainedValueParameter<IDiscreteDoubleValueModifier> ScalingOperatorParameter { 25 27 get { return (ConstrainedValueParameter<IDiscreteDoubleValueModifier>)Parameters["ScalingOperator"]; } 26 28 } 27 28 29 public IValueLookupParameter<DoubleValue> StartValueParameter { 29 30 get { return (IValueLookupParameter<DoubleValue>)Parameters["StartValue"]; } 30 31 } 31 32 32 public IValueLookupParameter<DoubleValue> EndValueParameter { 33 33 get { return (IValueLookupParameter<DoubleValue>)Parameters["EndValue"]; } 34 34 } 35 36 35 public ILookupParameter<IntValue> IndexParameter { 37 36 get { return (ILookupParameter<IntValue>)Parameters["Index"]; } 38 37 } 39 40 38 public IValueLookupParameter<IntValue> StartIndexParameter { 41 39 get { return (IValueLookupParameter<IntValue>)Parameters["StartIndex"]; } 42 40 } 43 44 41 public IValueLookupParameter<IntValue> EndIndexParameter { 45 42 get { return (IValueLookupParameter<IntValue>)Parameters["EndIndex"]; } 46 43 } 44 #endregion 47 45 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() { 49 54 Parameters.Add(new LookupParameter<DoubleMatrix>("Matrix", "The double matrix to modify.")); 50 55 Parameters.Add(new ValueLookupParameter<DoubleValue>("Scale", "Scale parameter.")); … … 56 61 Parameters.Add(new ValueLookupParameter<IntValue>("EndIndex", "The end index by which 'Value' should have reached 'EndValue'.")); 57 62 Initialize(); 63 } 64 public override IDeepCloneable Clone(Cloner cloner) { 65 return new VelocityBoundsModifier(this, cloner); 58 66 } 59 67 … … 70 78 StartIndexParameter.ActualNameChanged += new EventHandler(StartIndexParameter_ActualNameChanged); 71 79 } 80 #endregion 72 81 73 82 #region Events … … 109 118 #endregion 110 119 111 112 #region Cloning113 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 #endregion122 123 [StorableConstructor]124 protected VelocityBoundsModifier(bool deserializing) : base(deserializing) { }125 126 120 public override IOperation Apply() { 127 121 OperationCollection next = new OperationCollection(); -
branches/PSO/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/VonNeumannTopologyInitializer.cs
r5209 r5316 26 26 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 27 27 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] 28 30 public class VonNeumannTopologyInitializer : TopologyInitializer { 29 31
Note: See TracChangeset
for help on using the changeset viewer.