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/SimulatedAnnealingMainLoop.cs

    r15001 r15315  
    4949        private const string CoolingName = "Cooling";
    5050        private const string InitialTemperatureName = "InitialTemperature";
    51         private const string InitialAcceptanceRateName = "InitialAcceptanceRate";
    5251        private const string StartTemperatureName = "StartTemperature";
    5352        private const string EndTemperatureName = "EndTemperature";
     
    6564        private const string LastQualityName = "LastQuality";
    6665        private const string UphillMovesMemoryName = "UphillMovesMemory";
     66        private const string TemperatureBeforeReheatName = "TemperatureBeforeReheat";
     67        private const string CurrentRandomWalkStepName = "CurrentRandomWalkStep";
     68        private const string QualitiesBeforeReheatingName = "QualitiesBeforeReheating";
     69        private const string LastAcceptedQualityName = "LastAcceptedQuality";
     70        private const string TemperatureInitializerName = "TemperatureInitializer";
     71        private const string TemperatureInitializedName = "TemperatureInitialized";
     72
    6773        #endregion
    6874
     
    9197        {
    9298            get { return (ILookupParameter<DoubleValue>)Parameters[InitialTemperatureName]; }
    93         }
    94         public ILookupParameter<DoubleValue> InitialAcceptanceRateParameter
    95         {
    96             get { return (ILookupParameter<DoubleValue>)Parameters[InitialAcceptanceRateName]; }
    9799        }
    98100        public ILookupParameter<DoubleValue> MoveQualityParameter
     
    200202            Parameters.Add(new ValueLookupParameter<IOperator>(AnnealingOperatorName, "The operator that cools the temperature."));
    201203            Parameters.Add(new ValueLookupParameter<IOperator>(ReheatingOperatorName, "The operator that reheats the temperature if necessary."));
     204            Parameters.Add(new ValueLookupParameter<IOperator>(TemperatureInitializerName, "The operator that initialized the temperature."));
    202205
    203206            Parameters.Add(new ValueLookupParameter<IOperator>(AnalyzerName, "The operator used to analyze each generation."));
     
    206209
    207210            Parameters.Add(new LookupParameter<DoubleValue>(InitialTemperatureName, "The initial temperature."));
    208             Parameters.Add(new LookupParameter<DoubleValue>(InitialAcceptanceRateName, "The initial acceptance rate of average-sized hills used to calculate the initial temperature."));
    209211            Parameters.Add(new LookupParameter<IntValue>(TemperatureStartIndexName, "The index where the annealing or heating was last changed."));
    210212            Parameters.Add(new LookupParameter<BoolValue>(CoolingName, "True when the temperature should be cooled, false otherwise."));
    211213            Parameters.Add(new LookupParameter<DoubleValue>(StartTemperatureName, "The temperature from which cooling or reheating should occur."));
    212214            Parameters.Add(new LookupParameter<DoubleValue>(EndTemperatureName, "The temperature to which should be cooled or heated."));
     215
    213216
    214217            #endregion
     
    237240
    238241            variableCreator.Name = "Initialize Memory";
     242            variableCreator.CollectedValues.Add(new ValueParameter<BoolValue>(TemperatureInitializedName, new BoolValue(false)));
    239243            variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>(AverageAcceptanceRatioName, new DoubleValue(0d)));
    240244            variableCreator.CollectedValues.Add(new ValueParameter<IntValue>(ConsecutiveRejectedSolutionsCountName, new IntValue(0)));
     
    242246            variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>(LastQualityName, new DoubleValue(-1)));
    243247            variableCreator.CollectedValues.Add(new ValueParameter<ItemList<DoubleValue>>(UphillMovesMemoryName, new ItemList<DoubleValue>()));
     248            variableCreator.CollectedValues.Add(new ValueParameter<IntValue>(CurrentRandomWalkStepName, new IntValue(0)));
     249            variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>(TemperatureBeforeReheatName, new DoubleValue(0)));
     250            variableCreator.CollectedValues.Add(new ValueParameter<ItemList<DoubleValue>>(QualitiesBeforeReheatingName, new ItemList<DoubleValue>()));
     251            variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>(LastAcceptedQualityName, new DoubleValue(-1)));
    244252
    245253            analyzer1.Name = "Analyzer";
     
    267275
    268276           
    269 
    270277            subScopesRemover.RemoveAllSubScopes = true;
    271278
Note: See TracChangeset for help on using the changeset viewer.