Changeset 11576 for branches/OptimizationNetworks/HeuristicLab.Problems.ParameterOptimization/3.3/BestSolutionsAnalyzer.cs
- Timestamp:
- 11/25/14 03:26:00 (10 years ago)
- Location:
- branches/OptimizationNetworks
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks
- Property svn:mergeinfo changed
-
branches/OptimizationNetworks/HeuristicLab.Problems.ParameterOptimization/3.3/BestSolutionsAnalyzer.cs
r10594 r11576 121 121 var bestSolutions = (ItemSet<DoubleArray>)results[BestSolutionsResultName].Value; 122 122 //clear best solutions if new found quality is better than the existing one 123 if (max && bestQuality > previousBestQuality 124 || !max && bestQuality < previousBestQuality) 123 if (max && bestQuality > previousBestQuality || !max && bestQuality < previousBestQuality) 125 124 bestSolutions.Clear(); 126 125 … … 134 133 } 135 134 } 136 PreviousBestQualityParameter.ActualValue = (DoubleValue)BestQualityParameter.ActualValue.Clone();137 135 136 //update best quality 137 if (max && bestQuality >= BestQualityParameter.ActualValue.Value 138 || !max && bestQuality <= BestQualityParameter.ActualValue.Value) { 139 BestQualityParameter.ActualValue.Value = bestQuality; 140 } 138 141 //update best known quality 139 142 if (bestKnownQuality == null || max && bestQuality > bestKnownQuality.Value … … 141 144 BestKnownQualityParameter.ActualValue = new DoubleValue(bestQuality); 142 145 } 146 PreviousBestQualityParameter.ActualValue = (DoubleValue)BestQualityParameter.ActualValue.Clone(); 143 147 144 148 return base.Apply(); … … 156 160 public int GetHashCode(DoubleArray obj) { 157 161 if (obj == null) return 0; 158 return obj.Aggregate(23, (current, item) => current ^ (int)item);162 return (int)obj.Aggregate(23L, (current, item) => current ^ System.BitConverter.DoubleToInt64Bits(item)); 159 163 } 160 164 }
Note: See TracChangeset
for help on using the changeset viewer.