Pallas Solver  0.1
C++ Global Optimization Algorithms
Public Member Functions | List of all members
pallas::internal::Metropolis Class Reference

Implements a probabilistic acceptance criterion for candidate solutions. More...

#include <metropolis.h>

Public Member Functions

 Metropolis (double T)
 
 ~Metropolis ()
 
bool accept_reject (double cost_new, double cost_old)
 Returns a bool whether to accept the candidate solution. More...
 
bool operator() (double cost_new, double cost_old)
 Calls the accept_reject function Accepts the candidate solution based on the function: /code double w = std::min(1.0, exp(-1.0*(cost_new - cost_old)*beta)); double r = (*random_num)(); return w >= r; /endcode. More...
 

Detailed Description

Implements a probabilistic acceptance criterion for candidate solutions.

Constructor & Destructor Documentation

pallas::internal::Metropolis::Metropolis ( double  T)
inline

Constructor

Parameters
Tdouble. "Temperature" –higher temperatures will result in higher cost functions being accepted with higher probability.
pallas::internal::Metropolis::~Metropolis ( )
inline

Default destructor

Member Function Documentation

bool pallas::internal::Metropolis::accept_reject ( double  cost_new,
double  cost_old 
)
inline

Returns a bool whether to accept the candidate solution.

Accepts the candidate solution based on the function: /code double w = std::min(1.0, exp(-1.0*(cost_new - cost_old)*beta)); double r = (*random_num)(); return w >= r; /endcode

Parameters
cost_newdouble. cost of the candidate solution.
cost_oldcost of the current solution.
Returns
Bool whether the candidate solution was accepted.

Here is the caller graph for this function:

bool pallas::internal::Metropolis::operator() ( double  cost_new,
double  cost_old 
)
inline

Calls the accept_reject function Accepts the candidate solution based on the function: /code double w = std::min(1.0, exp(-1.0*(cost_new - cost_old)*beta)); double r = (*random_num)(); return w >= r; /endcode.

Parameters
cost_newdouble. cost of the candidate solution.
cost_oldcost of the current solution.
Returns
Bool whether the candidate solution was accepted.

Here is the call graph for this function:


The documentation for this class was generated from the following file: