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/VonNeumannTopologyInitializer.cs

    r5316 r5435  
    2424using HeuristicLab.Encodings.IntegerVectorEncoding;
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26
    2627namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    27 
    2828  [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.")]
    2929  [StorableClass]
    30   public class VonNeumannTopologyInitializer : TopologyInitializer {
     30  public sealed class VonNeumannTopologyInitializer : TopologyInitializer {
    3131
    3232    #region Construction & Cloning
    33     public VonNeumannTopologyInitializer() { }
     33
    3434    [StorableConstructor]
    35     protected VonNeumannTopologyInitializer(bool deserializing) : base(deserializing) { }
    36     protected VonNeumannTopologyInitializer(VonNeumannTopologyInitializer original, Cloner cloner)
    37       : base(original, cloner) {
    38     }
     35    private VonNeumannTopologyInitializer(bool deserializing) : base(deserializing) { }
     36    private VonNeumannTopologyInitializer(VonNeumannTopologyInitializer original, Cloner cloner) : base(original, cloner) { }
     37    public VonNeumannTopologyInitializer() : base() { }
     38
    3939    public override IDeepCloneable Clone(Cloner cloner) {
    4040      return new VonNeumannTopologyInitializer(this, cloner);
    4141    }
     42
    4243    #endregion
    4344
    4445    public override IOperation Apply() {
    4546      ItemArray<IntegerVector> neighbors = new ItemArray<IntegerVector>(SwarmSize);
    46       for (int i = 0; i<SwarmSize; i++) {
     47      for (int i = 0; i < SwarmSize; i++) {
    4748        neighbors[i] = new IntegerVector(new[] {
    4849          (SwarmSize + i-2) % SwarmSize,
     
    5556      return base.Apply();
    5657    }
    57 
    5858  }
    5959}
Note: See TracChangeset for help on using the changeset viewer.