Changeset 15315 for branches/jschiess/HeuristicLab.Algorithms.SimulatedAnnealing/3.4/AcceptanceRatioReheatingOperator.cs
- Timestamp:
- 08/09/17 10:37:45 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/jschiess/HeuristicLab.Algorithms.SimulatedAnnealing/3.4/AcceptanceRatioReheatingOperator.cs
r15001 r15315 16 16 namespace HeuristicLab.Algorithms.SimulatedAnnealing 17 17 { 18 [Item("AcceptanceRatioReheatingOperator", "Reheats the temperature if the acceptance is below a threshold .")]18 [Item("AcceptanceRatioReheatingOperator", "Reheats the temperature if the acceptance is below a threshold until it is above another one.")] 19 19 [StorableClass] 20 20 public class AcceptanceRatioReheatingOperator : SingleSuccessorOperator, IReheatingOperator … … 38 38 private const string AcceptanceMemoryName = "AcceptanceMemory"; 39 39 private const string AverageAcceptanceRatioName = "AverageAcceptanceRatio"; 40 private const string ReheatWindowSizeName = "ReheatWindowSize"; 40 41 41 42 … … 105 106 { 106 107 get { return (ILookupParameter<DoubleValue>)Parameters[AverageAcceptanceRatioName]; } 108 } 109 public IValueParameter<IntValue> ReheatWindowSizeParameter 110 { 111 get { return (IValueParameter<IntValue>)Parameters[ReheatWindowSizeName]; } 107 112 } 108 113 … … 128 133 Parameters.Add(new ValueParameter<IntValue>(MemorySizeName, "The maximum size of the acceptance memory.", new IntValue(100))); 129 134 Parameters.Add(new LookupParameter<DoubleValue>(AverageAcceptanceRatioName, "Average acceptance over full acceptance memory.")); 135 Parameters.Add(new ValueParameter<IntValue>(ReheatWindowSizeName, "The amount of iterations each reheat needs to heat the current temperature to upper temperature.", new IntValue(10000))); 130 136 #endregion 131 137 … … 204 210 StartTemperatureParameter.ActualValue.Value = TemperatureParameter.ActualValue.Value; 205 211 EndTemperatureParameter.ActualValue.Value = UpperTemperatureParameter.ActualValue.Value; 212 ReheatingOperatorParameter.Value.EndIndexParameter.Value = new IntValue( 213 Math.Min(MaximumIterationsParameter.ActualValue.Value, IterationsParameter.ActualValue.Value + ReheatWindowSizeParameter.Value.Value)); 206 214 } 207 215
Note: See TracChangeset
for help on using the changeset viewer.