Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/04/11 21:34:45 (14 years ago)
Author:
abeham
Message:

#852

  • Made public properties that redirect to ActualValue.Value private or protected
  • Sealed all of the specific operators
  • Removed files that are present in the repository, but are not included in the project
  • Removed .sln file (is this still needed?)
  • Added license headers to some files
  • Unified the pattern for writing the constructors similar to other files in the trunk
  • Corrected assembly and plugin version from 3.3.0.x to 3.3.2.x
  • Fixed the wiring in the VelocityBoundsModifier
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RingTopologyInitializer.cs

    r5316 r5435  
    2424using HeuristicLab.Encodings.IntegerVectorEncoding;
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26
    2627namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    27 
    2828  [Item("Ring Topology Initializer", "Connected every particle with its preceeding and its following particle.")]
    2929  [StorableClass]
    30   public class RingTopologyInitializer : TopologyInitializer {
     30  public sealed class RingTopologyInitializer : TopologyInitializer {
     31    #region Construction & Cloning
    3132
    32     #region Construction & Cloning
    33     public RingTopologyInitializer() { }
    3433    [StorableConstructor]
    35     protected RingTopologyInitializer(bool deserializing) : base(deserializing) { }
    36     protected RingTopologyInitializer(RingTopologyInitializer original, Cloner cloner)
    37       : base(original, cloner) {
    38     }
     34    private RingTopologyInitializer(bool deserializing) : base(deserializing) { }
     35    private RingTopologyInitializer(RingTopologyInitializer original, Cloner cloner) : base(original, cloner) { }
     36    public RingTopologyInitializer() : base() { }
     37
    3938    public override IDeepCloneable Clone(Cloner cloner) {
    4039      return new RingTopologyInitializer(this, cloner);
    4140    }
     41
    4242    #endregion
    4343
    4444    public override IOperation Apply() {
    4545      ItemArray<IntegerVector> neighbors = new ItemArray<IntegerVector>(SwarmSize);
    46       for (int i = 0; i<SwarmSize; i++) {
    47         neighbors[i] = new IntegerVector(new[] { (SwarmSize + i-1) % SwarmSize, (i+1) % SwarmSize });
     46      for (int i = 0; i < SwarmSize; i++) {
     47        neighbors[i] = new IntegerVector(new[] { (SwarmSize + i - 1) % SwarmSize, (i + 1) % SwarmSize });
    4848      }
    4949      Neighbors = neighbors;
    5050      return base.Apply();
    5151    }
    52 
    5352  }
    5453}
Note: See TracChangeset for help on using the changeset viewer.