Pallas Solver  0.1
C++ Global Optimization Algorithms
cooling_schedule.h
Go to the documentation of this file.
1 
11 // Pallas Solver
12 // Copyright 2015. All rights reserved.
13 //
14 // Redistribution and use in source and binary forms, with or without
15 // modification, are permitted provided that the following conditions are met:
16 //
17 // * Redistributions of source code must retain the above copyright notice,
18 // this list of conditions and the following disclaimer.
19 // * Redistributions in binary form must reproduce the above copyright notice,
20 // this list of conditions and the following disclaimer in the documentation
21 // and/or other materials provided with the distribution.
22 //
23 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 // POSSIBILITY OF SUCH DAMAGE.
34 //
35 // Author: ryan.latture@gmail.com (Ryan Latture)
36 
37 #ifndef PALLAS_COOLING_SCHEDULE_H
38 #define PALLAS_COOLING_SCHEDULE_H
39 
40 #include "pallas/types.h"
41 #include "pallas/internal/state.h"
42 #include "pallas/step_function.h"
43 
44 
45 namespace pallas {
46 
51  public:
55  struct Options {
60  Options() {
61  type = BOLTZMANN;
62  initial_temperature = -1.0;
63  final_temperature = 1.0e-12;
64  boltzmann_constant = 1.0;
65  fast_quench_param = 1.0;
66  fast_m_param = 1.0;
67  fast_n_param = 1.0;
68  }
69 
70  CoolingScheduleType type;
75  double fast_m_param;
76  double fast_n_param;
78  };
79 
87  static CoolingSchedule* Create(const Options& options);
88 
92  virtual ~CoolingSchedule() {};
93 
98  virtual void update_temperature() = 0;
99 
103  double get_temperature() const;
107  double get_initial_temperature() const;
108 
114  void set_temperature(double T);
115 
126  void calc_start_temperature(const GradientProblem& problem,
127  internal::State& state,
128  StepFunction* step_function);
129 
130 
131  protected:
132  double temperature;
133  double initial_temperature;
136  };
137 
149  class FastCooling : public CoolingSchedule {
150  public:
155  FastCooling(const CoolingSchedule::Options& options);
156 
160  void update_temperature();
161 
162  private:
163  double fast_m_param;
164  double fast_n_param;
165  double fast_c_param;
166  double fast_quench_param;
167  };
168 
180  public:
181  CauchyCooling(const CoolingSchedule::Options& options);
182 
186  void update_temperature();
187  };
188 
200  public:
205 
209  void update_temperature();
210  };
211 
212 } // namespace pallas
213 
214 #endif // PALLAS_COOLING_SCHEDULE_H
void set_temperature(double T)
Sets the current temperature.
Definition: cooling_schedule.cc:60
Interface to produce randomized candidate solutions.
Definition: step_function.h:41
Cauchy cooling schedule.
Definition: cooling_schedule.h:179
double fast_n_param
Definition: cooling_schedule.h:76
double fast_m_param
Definition: cooling_schedule.h:75
Fast cooling schedule updates.
Definition: cooling_schedule.h:149
Determines the rate of cooling within pallas::SimulatedAnnealing.
Definition: cooling_schedule.h:50
void calc_start_temperature(const GradientProblem &problem, internal::State &state, StepFunction *step_function)
Estimates an appropriate starting temperature.
Definition: cooling_schedule.cc:64
Definition: basinhopping.h:51
double final_temperature
Definition: cooling_schedule.h:72
double boltzmann_constant
Definition: cooling_schedule.h:73
virtual void update_temperature()=0
Interface to update the temperature member variable.
Boltzmann cooling schedule.
Definition: cooling_schedule.h:199
virtual ~CoolingSchedule()
Default destructor.
Definition: cooling_schedule.h:92
Definition: state.h:34
double initial_temperature
Definition: cooling_schedule.h:71
double get_initial_temperature() const
Returns the initial temperature to start the minimization at.
Definition: cooling_schedule.cc:56
static CoolingSchedule * Create(const Options &options)
Creates a pointer to a cooling schedule.
Definition: cooling_schedule.cc:34
double get_temperature() const
Returns the current temperature stored withing the cooling schedule.
Definition: cooling_schedule.cc:52
double temperature
Definition: cooling_schedule.h:132
CoolingScheduleType type
Definition: cooling_schedule.h:70
double boltzmann_constant
Definition: cooling_schedule.h:134
double fast_quench_param
Definition: cooling_schedule.h:74
Options()
Default constructor.
Definition: cooling_schedule.h:60
Definition: cooling_schedule.h:55