Changeset 6046 for branches/histogram/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs
- Timestamp:
- 04/23/11 10:00:31 (13 years ago)
- Location:
- branches/histogram
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/histogram
- Property svn:ignore
-
old new 10 10 protoc.exe 11 11 HeuristicLab 3.3.5.1.ReSharper.user 12 *.psess 13 *.vsp
-
- Property svn:mergeinfo changed
/trunk/sources merged: 6026,6029-6031,6035-6037,6042-6045
- Property svn:ignore
-
branches/histogram/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs
r5753 r6046 46 46 get { return (LookupParameter<DoubleValue>)Parameters["Quality"]; } 47 47 } 48 public LookupParameter<DoubleValue> Best QualityParameter {48 public LookupParameter<DoubleValue> BestLocalQualityParameter { 49 49 get { return (LookupParameter<DoubleValue>)Parameters["BestLocalQuality"]; } 50 50 } … … 56 56 } 57 57 public LookupParameter<IntValue> IterationsParameter { 58 get { return (LookupParameter<IntValue>)Parameters[" LocalIterations"]; }58 get { return (LookupParameter<IntValue>)Parameters["Iterations"]; } 59 59 } 60 60 public ValueLookupParameter<IntValue> MaximumIterationsParameter { … … 85 85 public LocalSearchMainLoop() 86 86 : base() { 87 87 Initialize(); 88 88 } 89 89 private LocalSearchMainLoop(LocalSearchMainLoop original, Cloner cloner) … … 100 100 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution.")); 101 101 Parameters.Add(new LookupParameter<DoubleValue>("BestLocalQuality", "The value which represents the best quality found so far.")); 102 Parameters.Add(new ValueLookupParameter<DoubleValue>("BestKnownQuality", "The best known quality value found so far."));102 Parameters.Add(new ValueLookupParameter<DoubleValue>("BestKnownQuality", "The problem's best known quality value found so far.")); 103 103 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The value which represents the quality of a move.")); 104 Parameters.Add(new LookupParameter<IntValue>(" LocalIterations", "The number of generations."));104 Parameters.Add(new LookupParameter<IntValue>("Iterations", "The number of iterations performed.")); 105 105 Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed.")); 106 106 Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored.")); … … 140 140 141 141 bestQualityInitializer.Name = "Initialize BestQuality"; 142 bestQualityInitializer.LeftSideParameter.ActualName = Best QualityParameter.Name;142 bestQualityInitializer.LeftSideParameter.ActualName = BestLocalQualityParameter.Name; 143 143 bestQualityInitializer.RightSideParameter.ActualName = QualityParameter.Name; 144 144 … … 148 148 resultsCollector1.CopyValue = new BoolValue(false); 149 149 resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>(IterationsParameter.Name)); 150 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>(Best QualityParameter.Name, null, BestQualityParameter.Name));150 resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>(BestLocalQualityParameter.Name, null, BestLocalQualityParameter.Name)); 151 151 resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name; 152 152 … … 177 177 178 178 bestQualityUpdater.Name = "Update BestQuality"; 179 bestQualityUpdater.LeftSideParameter.ActualName = Best QualityParameter.Name;179 bestQualityUpdater.LeftSideParameter.ActualName = BestLocalQualityParameter.Name; 180 180 bestQualityUpdater.RightSideParameter.ActualName = QualityParameter.Name; 181 181 182 182 resultsCollector2.CopyValue = new BoolValue(false); 183 resultsCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>(Best QualityParameter.Name, null, BestQualityParameter.Name));183 resultsCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>(BestLocalQualityParameter.Name, null, BestLocalQualityParameter.Name)); 184 184 resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name; 185 185 … … 204 204 205 205 #region Create operator graph 206 OperatorGraph.InitialOperator = subScopesProcessor0; 206 OperatorGraph.InitialOperator = subScopesProcessor0; // don't change this without adapting the constructor of LocalSearchImprovementOperator 207 207 subScopesProcessor0.Operators.Add(bestQualityInitializer); 208 208 subScopesProcessor0.Successor = resultsCollector1; … … 243 243 return base.Apply(); 244 244 } 245 246 [StorableHook(HookType.AfterDeserialization)] 247 private void AfterDeserialization() { 248 // BackwardsCompatibility3.3 249 #region Backwards compatible code, remove with 3.4 250 if (!Parameters.ContainsKey("BestLocalQuality")) 251 Parameters.Add(new LookupParameter<DoubleValue>("BestLocalQuality", "The value which represents the best quality found so far.")); 252 if (!Parameters.ContainsKey("Iterations")) 253 Parameters.Add(new LookupParameter<IntValue>("Iterations", "The number of iterations performed.")); 254 #endregion 255 } 245 256 } 246 257 }
Note: See TracChangeset
for help on using the changeset viewer.