Changeset 9086 for trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.4/SimulatedAnnealing.cs
- Timestamp:
- 12/20/12 22:51:59 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.4/SimulatedAnnealing.cs
r9085 r9086 62 62 private const string TemperatureChartName = "Temperature Chart"; 63 63 private const string TemperatureAnalyzerName = "Temperature Analyzer"; 64 private const string ChangeInertiaName = "ChangeInertia"; 64 private const string ThresholdName = "Threshold"; 65 private const string MemorySizeName = "MemorySize"; 65 66 #endregion 66 67 … … 99 100 get { return (OptionalConstrainedValueParameter<IDiscreteDoubleValueModifier>)Parameters[HeatingOperatorName]; } 100 101 } 101 private ValueParameter<IntValue> ChangeInertiaParameter { 102 get { return (ValueParameter<IntValue>) Parameters[ChangeInertiaName]; } 102 private ValueParameter<DoubleRange> ThresholdParameter { 103 get { return (ValueParameter<DoubleRange>) Parameters[ThresholdName]; } 104 } 105 private ValueParameter<IntValue> MemorySizeParameter { 106 get { return (ValueParameter<IntValue>) Parameters[MemorySizeName]; } 103 107 } 104 108 private ValueParameter<IntValue> MaximumIterationsParameter { … … 161 165 set { AnalyzerParameter.Value = value; } 162 166 } 163 public IntValue ChangeInertia { 164 get { return ChangeInertiaParameter.Value; } 165 set { ChangeInertiaParameter.Value = value; } 167 public DoubleRange AcceptanceThreshold { 168 get { return ThresholdParameter.Value; } 169 set { ThresholdParameter.Value = value; } 170 } 171 public IntValue AcceptanceMemorySize { 172 get { return MemorySizeParameter.Value; } 173 set { MemorySizeParameter.Value = value; } 166 174 } 167 175 private RandomCreator RandomCreator { … … 195 203 Parameters.Add(new ValueParameter<DoubleValue>(LowerTemperatureName, "The lower bound for the temperature.", new DoubleValue(1e-6))); 196 204 Parameters.Add(new ValueParameter<MultiAnalyzer>(AnalyzerName, "The operator used to analyze each iteration.", new MultiAnalyzer())); 197 Parameters.Add(new ValueParameter<IntValue>(ChangeInertiaName, "The inertia (= number of iterations) that the process spends before switching between heating and cooling.", new IntValue(10))); 205 Parameters.Add(new ValueParameter<IntValue>(MemorySizeName, "The maximum size of the acceptance memory.", new IntValue(100))); 206 Parameters.Add(new ValueParameter<DoubleRange>(ThresholdName, "The threshold controls the temperature in case a heating operator is specified. If the average ratio of accepted moves goes below the start of the range the temperature is heated. If the the average ratio of accepted moves goes beyond the end of the range the temperature is cooled again.", new DoubleRange(0.05, 0.2))); 198 207 199 208 var randomCreator = new RandomCreator(); … … 247 256 mainLoop.AnalyzerParameter.ActualName = AnalyzerParameter.Name; 248 257 mainLoop.AnnealingOperatorParameter.ActualName = AnnealingOperatorParameter.Name; 249 mainLoop.ChangeInertiaParameter.ActualName = ChangeInertiaParameter.Name; 258 mainLoop.MemorySizeParameter.ActualName = MemorySizeParameter.Name; 259 mainLoop.ThresholdParameter.ActualName = ThresholdParameter.Name; 250 260 mainLoop.CoolingParameter.ActualName = CoolingName; 251 261 mainLoop.EndTemperatureParameter.ActualName = EndTemperatureName;
Note: See TracChangeset
for help on using the changeset viewer.