Changeset 7215 for branches/HeuristicLab.Hive.Azure/HeuristicLab.Problems.QuadraticAssignment.Algorithms/3.3/RobustTabooSearch.cs
- Timestamp:
- 12/20/11 13:54:57 (12 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.Problems.QuadraticAssignment.Algorithms/3.3/RobustTabooSearch.cs
r6953 r7215 51 51 52 52 #region Parameter Properties 53 public FixedValueParameter<MultiAnalyzer> AnalyzerParameter {54 get { return ( FixedValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; }53 public IValueParameter<MultiAnalyzer> AnalyzerParameter { 54 get { return (IValueParameter<MultiAnalyzer>)Parameters["Analyzer"]; } 55 55 } 56 56 public FixedValueParameter<IntValue> SeedParameter { … … 77 77 public FixedValueParameter<BoolValue> UseNewTabuTenureAdaptionSchemeParameter { 78 78 get { return (FixedValueParameter<BoolValue>)Parameters["UseNewTabuTenureAdaptionScheme"]; } 79 } 80 public FixedValueParameter<BoolValue> TerminateOnOptimalSolutionParameter { 81 get { return (FixedValueParameter<BoolValue>)Parameters["TerminateOnOptimalSolution"]; } 79 82 } 80 83 #endregion … … 112 115 get { return UseNewTabuTenureAdaptionSchemeParameter.Value.Value; } 113 116 set { UseNewTabuTenureAdaptionSchemeParameter.Value.Value = value; } 117 } 118 public bool TerminateOnOptimalSolution { 119 get { return TerminateOnOptimalSolutionParameter.Value.Value; } 120 set { TerminateOnOptimalSolutionParameter.Value.Value = value; } 114 121 } 115 122 #endregion … … 132 139 } 133 140 public RobustTabooSearch() { 134 Parameters.Add(new FixedValueParameter<MultiAnalyzer>("Analyzer", "The analyzers that are applied after each iteration.", new MultiAnalyzer()));141 Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The analyzers that are applied after each iteration.", new MultiAnalyzer())); 135 142 Parameters.Add(new FixedValueParameter<IntValue>("Seed", "The seed value of the random number generator.", new IntValue(0))); 136 143 Parameters.Add(new FixedValueParameter<BoolValue>("SetSeedRandomly", "True whether the seed should be set randomly for each run, false if it should be fixed.", new BoolValue(true))); … … 140 147 Parameters.Add(new FixedValueParameter<BoolValue>("UseAlternativeAspiration", "True if the alternative aspiration condition should be used that takes moves that have not been made for some time above others.", new BoolValue(false))); 141 148 Parameters.Add(new FixedValueParameter<IntValue>("AlternativeAspirationTenure", "The time t that a move will be remembered for the alternative aspiration condition.", new IntValue(int.MaxValue))); 142 Parameters.Add(new FixedValueParameter<BoolValue>("TerminateOnOptimalSolution", "True when the algorithm should stop if it reached a quality equal or smaller to the BestKnownQuality.", new BoolValue( true)));149 Parameters.Add(new FixedValueParameter<BoolValue>("TerminateOnOptimalSolution", "True when the algorithm should stop if it reached a quality equal or smaller to the BestKnownQuality.", new BoolValue(false))); 143 150 Parameters.Add(new FixedValueParameter<BoolValue>("UseNewTabuTenureAdaptionScheme", @"In an updated version of his implementation, Eric Taillard introduced a different way to change the tabu tenure. 144 151 Instead of setting it uniformly between min and max, it will be set between 0 and max according to a right-skewed distribution. 145 152 Set this option to false if you want to optimize using the earlier 1991 version, and set to true if you want to optimize using the newer version. 146 153 Please note that the MinimumTabuTenure parameter has no effect in the new version.", new BoolValue(true))); 154 155 TerminateOnOptimalSolutionParameter.Hidden = true; 147 156 148 157 qualityAnalyzer = new BestAverageWorstQualityAnalyzer(); … … 298 307 [StorableHook(HookType.AfterDeserialization)] 299 308 private void AfterDeserialization() { 309 // BackwardsCompatibility3.3 310 #region Backwards compatible code, remove with 3.4 311 if (Parameters["Analyzer"] is FixedValueParameter<MultiAnalyzer>) { 312 MultiAnalyzer analyzer = AnalyzerParameter.Value; 313 Parameters.Remove("Analyzer"); 314 Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The analyzers that are applied after each iteration.", analyzer)); 315 } 316 #endregion 300 317 RegisterEventHandlers(); 301 318 } … … 365 382 if (Problem != null) { 366 383 foreach (IAnalyzer analyzer in ((IProblem)Problem).Operators.OfType<IAnalyzer>()) { 367 AnalyzerParameter.Value.Operators.Add(analyzer );384 AnalyzerParameter.Value.Operators.Add(analyzer, analyzer.EnabledByDefault); 368 385 if (!(analyzer is BestQAPSolutionAnalyzer)) 369 386 AnalyzerParameter.Value.Operators.SetItemCheckedState(analyzer, false); 370 387 } 371 388 } 372 AnalyzerParameter.Value.Operators.Add(qualityAnalyzer );389 AnalyzerParameter.Value.Operators.Add(qualityAnalyzer, qualityAnalyzer.EnabledByDefault); 373 390 } 374 391
Note: See TracChangeset
for help on using the changeset viewer.