Public Member Functions | |
SampleAnneal (const char *params="") | |
bool | stop () |
void | best_found () |
float | energy () |
Public Attributes | |
int | no_of_nodes |
int | N |
vector< float > | nodes |
vector< float > | best_nodes |
An example annealing class that inherits BasicAnneal. For N points $fx_i$f in 2D, we want to minimize the energy , where dist is the euclidean distance between two points.
SampleAnneal::SampleAnneal | ( | const char * | params = "" |
) | [inline] |
params - like BasicAnneal. Addionally N - Number of points
References BasicAnneal::std_init().
bool SampleAnneal::stop | ( | ) | [inline, virtual] |
Stop criterion.
Reimplemented from BasicAnneal.
void SampleAnneal::best_found | ( | ) | [inline, virtual] |
This is called when a smaller Energy is found. Writes current coordinates to file best_filename.
Reimplemented from BasicAnneal.
References BasicAnneal::best_found().
float SampleAnneal::energy | ( | ) | [inline, virtual] |
The energy for this problem. We want the euclidean distance (dist) between N points to be 2! Which means that the energy is .
Reimplemented from BasicAnneal.