Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/09/17 10:37:45 (7 years ago)
Author:
jschiess
Message:

#1836 SA reheating strategies:
+ Finalized strategies
+ Added temperature initializer mechanism

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/jschiess/HeuristicLab.Algorithms.SimulatedAnnealing/3.4/AcceptanceRatioReheatingOperator.cs

    r15001 r15315  
    1616namespace HeuristicLab.Algorithms.SimulatedAnnealing
    1717{
    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.")]
    1919    [StorableClass]
    2020    public class AcceptanceRatioReheatingOperator : SingleSuccessorOperator, IReheatingOperator
     
    3838        private const string AcceptanceMemoryName = "AcceptanceMemory";
    3939        private const string AverageAcceptanceRatioName = "AverageAcceptanceRatio";
     40        private const string ReheatWindowSizeName = "ReheatWindowSize";
    4041
    4142
     
    105106        {
    106107            get { return (ILookupParameter<DoubleValue>)Parameters[AverageAcceptanceRatioName]; }
     108        }
     109        public IValueParameter<IntValue> ReheatWindowSizeParameter
     110        {
     111            get { return (IValueParameter<IntValue>)Parameters[ReheatWindowSizeName]; }
    107112        }
    108113
     
    128133            Parameters.Add(new ValueParameter<IntValue>(MemorySizeName, "The maximum size of the acceptance memory.", new IntValue(100)));
    129134            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)));
    130136            #endregion
    131137
     
    204210                    StartTemperatureParameter.ActualValue.Value = TemperatureParameter.ActualValue.Value;
    205211                    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));
    206214                }
    207215
Note: See TracChangeset for help on using the changeset viewer.