Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/04/11 21:34:45 (13 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/SwarmUpdater.cs

    r5410 r5435  
    2929
    3030namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    31 
    3231  [Item("Swarm Updater", "Updates personal best point and quality as well as global best point and quality.")]
    3332  [StorableClass]
    34   public class SwarmUpdater : SingleSuccessorOperator {
     33  public sealed class SwarmUpdater : SingleSuccessorOperator {
     34    public override bool CanChangeName {
     35      get { return false; }
     36    }
    3537
    3638    #region Parameter properties
     
    5961
    6062    #region Parameter values
    61     public double Quality {
     63    private double Quality {
    6264      get { return QualityParameter.ActualValue.Value; }
    6365    }
    64     public double PersonalBestQuality {
     66    private double PersonalBestQuality {
    6567      get { return PersonalBestQualityParameter.ActualValue.Value; }
    6668      set { PersonalBestQualityParameter.ActualValue = new DoubleValue(value); }
    6769    }
    68     public double BestQuality {
     70    private double BestQuality {
    6971      get { return BestQualityParameter.ActualValue.Value; }
    7072      set { BestQualityParameter.ActualValue = new DoubleValue(value); }
    7173    }
    72     public RealVector Point {
     74    private RealVector Point {
    7375      get { return PointParameter.ActualValue; }
    7476    }
    75     public RealVector PersonalBestPoint {
     77    private RealVector PersonalBestPoint {
    7678      get { return PersonalBestPointParameter.ActualValue; }
    7779      set { PersonalBestPointParameter.ActualValue = value; }
    7880    }
    79     public RealVector BestPoint {
     81    private RealVector BestPoint {
    8082      get { return BestPointParameter.ActualValue; }
    8183      set { BestPointParameter.ActualValue = value; }
    8284    }
    83     public bool Maximization {
     85    private bool Maximization {
    8486      get { return MaximizationParameter.ActualValue.Value; }
    8587    }
     
    8991
    9092    [StorableConstructor]
    91     protected SwarmUpdater(bool deserializing) : base(deserializing) { }
    92     protected SwarmUpdater(SwarmUpdater original, Cloner cloner)
    93       : base(original, cloner) {
    94     }
    95 
     93    private SwarmUpdater(bool deserializing) : base(deserializing) { }
     94    private SwarmUpdater(SwarmUpdater original, Cloner cloner) : base(original, cloner) { }
    9695    public SwarmUpdater()
    9796      : base() {
     
    112111
    113112    public override IOperation Apply() {
    114 
    115113      if (Maximization && Quality > PersonalBestQuality ||
    116114         !Maximization && Quality < PersonalBestQuality) {
     
    125123      return base.Apply();
    126124    }
    127 
    128     public override bool CanChangeName {
    129       get { return false; }
    130     }
    131125  }
    132126}
Note: See TracChangeset for help on using the changeset viewer.