Public Member Functions | |
BasicAnneal (const char *params="") | |
virtual | ~BasicAnneal () |
void | std_init (const char *params="") |
virtual ostream & | show_config (ostream &out) |
virtual void | accept_curr_moves () |
virtual void | reject_curr_moves () |
virtual void | wiggle () |
virtual bool | stop () |
virtual float | energy () |
virtual void | best_found () |
virtual void | update_minmax_step () |
virtual ostream & | logline (ostream &out) |
virtual void | log () |
virtual void | do_anneal () |
Public Attributes | |
float | min_step |
float | max_step |
int | min_move |
int | max_move |
int | energy_precision |
float | Temp |
float | Cooling |
float | best_energy |
float | curr_energy |
float | candidate_energy |
float | log_optimum |
vector< BasicMove * > | curr_moves |
vector< BasicMove * > | possible_moves |
int | success |
int | trys |
int | log_counter |
int | log_freq |
int | last_best_log |
string | best_filename |
Basic annealing class. Derive other annealing classes from this base class.
BasicAnneal::BasicAnneal | ( | const char * | params = "" |
) | [inline] |
Constructor.
params - T - Temperature C - Cooling factor logfreq - Log frequency log_optimum energy_precision - how many digits precision best_filename
log_optimum is an "external" optimum Energy value. The logging system prints then the difference between this value and the current Emin.
References std_init().
virtual BasicAnneal::~BasicAnneal | ( | ) | [inline, virtual] |
Virtual destructor.
void BasicAnneal::std_init | ( | const char * | params = "" |
) | [inline] |
Parse params string and initialize defaults.
Reimplemented in TrefoilTorusAnneal.
Referenced by BasicAnneal(), BoxAnneal::BoxAnneal(), FittingAnneal::FittingAnneal(), SampleAnneal::SampleAnneal(), and TrefoilTorusAnneal::std_init().
virtual ostream& BasicAnneal::show_config | ( | ostream & | out | ) | [inline, virtual] |
Show the configuration parameters.
Reimplemented in FittingAnneal.
Referenced by do_anneal(), and FittingAnneal::show_config().
virtual void BasicAnneal::accept_curr_moves | ( | ) | [inline, virtual] |
virtual void BasicAnneal::reject_curr_moves | ( | ) | [inline, virtual] |
virtual void BasicAnneal::wiggle | ( | ) | [inline, virtual] |
Make random moves and store them in curr_moves.
Reimplemented in BoxAnneal.
Referenced by do_anneal().
virtual bool BasicAnneal::stop | ( | ) | [inline, virtual] |
Returns true when annealing considers to have converged.
Reimplemented in BoxAnneal, FittingAnneal, SampleAnneal, and TrefoilTorusAnneal.
Referenced by do_anneal().
virtual float BasicAnneal::energy | ( | ) | [inline, virtual] |
The energy we want to optimize.
Reimplemented in BoxAnneal, FittingAnneal, SampleAnneal, and TrefoilTorusAnneal.
Referenced by do_anneal().
virtual void BasicAnneal::best_found | ( | ) | [inline, virtual] |
This gets called each time anneal finds a new best energy.
Reimplemented in BoxAnneal, FittingAnneal, SampleAnneal, and TrefoilTorusAnneal.
Referenced by TrefoilTorusAnneal::best_found(), SampleAnneal::best_found(), FittingAnneal::best_found(), BoxAnneal::best_found(), and do_anneal().
virtual void BasicAnneal::update_minmax_step | ( | ) | [inline, virtual] |
Adjust the min_step and max_step values as well as the min_move and max_move index to the corresponding move.
Referenced by FittingAnneal::best_found(), and logline().
virtual ostream& BasicAnneal::logline | ( | ostream & | out | ) | [inline, virtual] |
Write annealing information (temp, energy, minimal energy, success rate, min/max stepsize, and last best count) to ostream out.
References update_minmax_step().
Referenced by log(), and FittingAnneal::log().
virtual void BasicAnneal::log | ( | ) | [inline, virtual] |
Perfomr a logging action (uses logline) but can be reimplemented in derived classes.
Reimplemented in FittingAnneal.
References logline().
Referenced by do_anneal().
virtual void BasicAnneal::do_anneal | ( | ) | [inline, virtual] |
Start the actual annealing!
References accept_curr_moves(), best_found(), energy(), log(), reject_curr_moves(), show_config(), stop(), and wiggle().