- Timestamp:
- 12/20/11 13:54:57 (13 years ago)
- Location:
- branches/HeuristicLab.Hive.Azure
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive.Azure
- Property svn:ignore
-
old new 4 4 *.suo 5 5 *.vsp 6 Doxygen 6 7 Google.ProtocolBuffers-0.9.1.dll 7 8 HeuristicLab 3.3.5.1.ReSharper.user 8 9 HeuristicLab 3.3.6.0.ReSharper.user 9 10 HeuristicLab.4.5.resharper.user 11 HeuristicLab.ExtLibs.6.0.ReSharper.user 10 12 HeuristicLab.resharper.user 11 13 ProtoGen.exe … … 16 18 bin 17 19 protoc.exe 18 HeuristicLab.ExtLibs.6.0.ReSharper.user19 Doxygen
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HeuristicLab.Hive.Azure/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorSwarmUpdater.cs
r5911 r7215 66 66 get { return (ILookupParameter<BoolValue>)Parameters["Maximization"]; } 67 67 } 68 public ILookupParameter<DoubleValue> BestQualityParameter {69 get { return (ILookupParameter<DoubleValue>)Parameters[" BestQuality"]; }68 public ILookupParameter<DoubleValue> SwarmBestQualityParameter { 69 get { return (ILookupParameter<DoubleValue>)Parameters["SwarmBestQuality"]; } 70 70 } 71 71 public ILookupParameter<RealVector> BestRealVectorParameter { … … 112 112 113 113 #region Parameter values 114 private DoubleValue BestQuality {115 get { return BestQualityParameter.ActualValue; }116 set { BestQualityParameter.ActualValue = value; }114 private DoubleValue SwarmBestQuality { 115 get { return SwarmBestQualityParameter.ActualValue; } 116 set { SwarmBestQualityParameter.ActualValue = value; } 117 117 } 118 118 private RealVector BestRealVector { … … 180 180 public RealVectorSwarmUpdater() 181 181 : base() { 182 Parameters.Add(new LookupParameter<DoubleValue>(" BestQuality", "Overallbest quality."));183 Parameters.Add(new LookupParameter<RealVector>("BestRealVector", "Global best particle position "));184 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "Particle 's quality"));185 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("PersonalBestQuality", "Particle 's personal best quality"));186 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("NeighborBestQuality", " Global best particle quality"));187 Parameters.Add(new ScopeTreeLookupParameter<RealVector>("RealVector", "Particle 's position"));188 Parameters.Add(new ScopeTreeLookupParameter<RealVector>("PersonalBest", "Particle 's personal best position"));189 Parameters.Add(new ScopeTreeLookupParameter<RealVector>("NeighborBest", "Neighborhood (or global in case of totally connected neighborhood) best particle position "));182 Parameters.Add(new LookupParameter<DoubleValue>("SwarmBestQuality", "Swarm's best quality.")); 183 Parameters.Add(new LookupParameter<RealVector>("BestRealVector", "Global best particle position.")); 184 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "Particles' qualities.")); 185 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("PersonalBestQuality", "Particles' personal best qualities.")); 186 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("NeighborBestQuality", "Best neighbor particles' qualities.")); 187 Parameters.Add(new ScopeTreeLookupParameter<RealVector>("RealVector", "Particles' positions.")); 188 Parameters.Add(new ScopeTreeLookupParameter<RealVector>("PersonalBest", "Particles' personal best positions.")); 189 Parameters.Add(new ScopeTreeLookupParameter<RealVector>("NeighborBest", "Neighborhood (or global in case of totally connected neighborhood) best particle positions.")); 190 190 Parameters.Add(new ScopeTreeLookupParameter<IntArray>("Neighbors", "The list of neighbors for each particle.")); 191 191 Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false.")); … … 217 217 218 218 [StorableHook(HookType.AfterDeserialization)] 219 private void AfterDeserialization() { 220 if (!Parameters.ContainsKey("SwarmBestQuality")) { 221 ILookupParameter<DoubleValue> oldBestQualityParameter = Parameters["BestQuality"] as ILookupParameter<DoubleValue>; 222 Parameters.Add(new LookupParameter<DoubleValue>("SwarmBestQuality", "Swarm's best quality.")); 223 if (oldBestQualityParameter.ActualName != oldBestQualityParameter.Name) 224 SwarmBestQualityParameter.ActualName = oldBestQualityParameter.ActualName; 225 Parameters.Remove("BestQuality"); 226 } 227 RegisterEvents(); 228 } 229 219 230 private void RegisterEvents() { 220 231 VelocityBoundsStartValueParameter.ValueChanged += new EventHandler(VelocityBoundsStartValueParameter_ValueChanged); … … 273 284 274 285 private void UpdateGlobalBest() { 275 if ( BestQuality == null)276 BestQuality = new DoubleValue();277 BestQuality.Value = Maximization ? Quality.Max(v => v.Value) : Quality.Min(v => v.Value);278 BestRealVector = (RealVector)RealVector[Quality.FindIndex(v => v.Value == BestQuality.Value)].Clone();286 if (SwarmBestQuality == null) 287 SwarmBestQuality = new DoubleValue(); 288 SwarmBestQuality.Value = Maximization ? Quality.Max(v => v.Value) : Quality.Min(v => v.Value); 289 BestRealVector = (RealVector)RealVector[Quality.FindIndex(v => v.Value == SwarmBestQuality.Value)].Clone(); 279 290 } 280 291
Note: See TracChangeset
for help on using the changeset viewer.