The optimizer uses a set of Mover objects to propose steps. Currently each Mover is called at each Monte Carlo iteration. This may change in the future. The movers propose some modification, which is then accepted or rejected based on the Metropolis criteria. Optionally, a number of local optimization steps are taken before the MonteCarlo step is accepted or rejected.
Public Member Functions | |
virtual std::string | get_type_name () const |
virtual ::IMP::VersionInfo | get_version_info () const |
MonteCarlo (Model *m=NULL) | |
virtual Float | optimize (unsigned int max_steps) |
void | set_move_probability (Float p) |
Set the probability of each move being made. | |
void | set_return_best (bool tf) |
Local optimization | |
The MonteCarlo optimizer can run a local optimizer following each Monte-Carlo move and before it decides whether or not to accept the step. Steps taken by the local optimizer do not count towards the total number of steps passed to the Optimizer::optimize() call. The local optimizer must not have OptimizerState objects which change the set of optimized particles/attributes. This is not checked. | |
Optimizer * | get_local_optimizer () const |
int | get_local_steps () const |
void | set_local_optimizer (Optimizer *cg) |
void | set_local_steps (unsigned int n) |
Statistics | |
unsigned int | get_number_of_forward_steps () const |
Return how many times the optimizer has succeeded in taking a step. | |
unsigned int | get_number_of_upward_steps () const |
Return how many times the optimizer has stepped to higher energy. | |
Score threshold | |
Optimization will stop if the score falls below the threshold. | |
Float | get_score_threshold () const |
void | set_score_threshold (Float t) |
Temperature | |
The temperature has to be on the same scale as the differences in energy between good and bad states (and so the default is likely to not be a good choice). | |
Float | get_temperature () const |
void | set_temperature (Float t) |
Movers | |
The following methods are used to manipulate the list of Movers. Each mover is called at each optimization step, giving it a chance to change the current configuration. | |
unsigned int | add_mover (Mover *obj) |
void | add_movers (const Movers &obj) |
void | clear_movers () |
bool | get_has_movers () const |
return true if there are any objects in the container | |
Mover * | get_mover (unsigned int i) const |
unsigned int | get_number_of_movers () const |
MoverConstIterator | movers_begin () const |
MoverIterator | movers_begin () |
MoverConstIterator | movers_end () const |
MoverIterator | movers_end () |
void | remove_mover (Mover *d) |
Remove any occurences of d from the container. | |
void | remove_movers (const Movers &d) |
Remove any occurences of each item in d. | |
template<class F > | |
void | remove_movers_if (const F &f) |
Remove any occurrences for which f is true. | |
void | reserve_movers (unsigned int sz) |
void | set_movers (const Movers &ps) |
Friends | |
template<class T > | |
void | IMP::internal::unref (T *) |
unsigned int IMP::core::MonteCarlo::add_mover | ( | Mover * | obj | ) |
void IMP::core::MonteCarlo::add_movers | ( | const Movers & | obj | ) |
Add several objects to the container. They are not necessarily added at the end.
Mover* IMP::core::MonteCarlo::get_mover | ( | unsigned int | i | ) | const |
Get the object refered to by the index
IndexException | in Python if the index is out of range |
void IMP::core::MonteCarlo::set_move_probability | ( | Float | p | ) |
Set the probability of each move being made.
Make this low if the space is rough and there are many particles. The movers should make each individual move with this probability. That is, a NormalMover with 100 particles will move each particle with probability p.
void IMP::core::MonteCarlo::set_movers | ( | const Movers & | ps | ) |
Set the contents of the container to ps removing all its current contents.
void IMP::core::MonteCarlo::set_return_best | ( | bool | tf | ) |
By default the Monte Carlo optimizer simply returns the energy of and leaves the Model in the state after the last accepted move. This is not necessarily the lowest energy state visited. If you wish to always return the lowest energy state, set this to true.