Free cookie consent management tool by TermsFeed Policy Generator

source: branches/1836_jschiess/HeuristicLab.Algorithms.SimulatedAnnealing/3.4/NoReheatingOperator.cs @ 16433

Last change on this file since 16433 was 15333, checked in by jschiess, 7 years ago

#1836 SA reheating strategies
+ added an adaptive temperature control strategy
+ some refactorings

File size: 2.0 KB
Line 
1using HeuristicLab.Operators;
2using System;
3using System.Collections.Generic;
4using System.Linq;
5using System.Text;
6using System.Threading.Tasks;
7using HeuristicLab.Common;
8using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
9using HeuristicLab.Core;
10using HeuristicLab.Data;
11using HeuristicLab.Parameters;
12using HeuristicLab.Optimization;
13using HeuristicLab.PluginInfrastructure;
14using HeuristicLab.Analysis;
15
16namespace HeuristicLab.Algorithms.SimulatedAnnealing
17{
18    [Item("-", "No reheats are performed.")]
19    [StorableClass]
20    public class NoReheatingOperator : SingleSuccessorOperator, IReheatingOperator
21    {
22        #region Strings
23        private const string AnnealingOperatorName = "AnnealingOperator";
24
25        #endregion
26        #region Parameters     
27        public ILookupParameter<IOperator> AnnealingOperatorParameter
28        {
29            get { return (ILookupParameter<IOperator>)Parameters[AnnealingOperatorName]; }
30        }
31
32        #endregion
33
34        public NoReheatingOperator() : base()
35        {
36            #region Create parameters
37            Parameters.Add(new LookupParameter<IOperator>(AnnealingOperatorName, "The operator that cools the temperature."));
38            #endregion
39
40            Parameterize();
41        }
42
43        [StorableConstructor]
44        protected NoReheatingOperator(bool deserializing) : base(deserializing) { }
45        protected NoReheatingOperator(NoReheatingOperator original, Cloner cloner) : base(original, cloner) { }
46
47
48        public override IDeepCloneable Clone(Cloner cloner)
49        {
50            return new NoReheatingOperator(this, cloner);
51        }
52
53        public void Parameterize()
54        {
55        }
56
57        public override IOperation Apply()
58        {
59            return new OperationCollection {
60                    ExecutionContext.CreateOperation(AnnealingOperatorParameter.ActualValue),
61                    base.Apply()
62                };
63        }
64    }
65}
Note: See TracBrowser for help on using the repository browser.