IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
IMP::core::MonteCarloWithBasinHopping Class Reference

This variant of Monte Carlo uses basis hopping. More...

#include <IMP/core/MonteCarlo.h>

Inheritance diagram for IMP::core::MonteCarloWithBasinHopping:

Detailed Description

This variant of Monte Carlo uses basis hopping.

Basin hopping is where, after a move, a local optimizer is used to relax the model before the energy computation. However, the pre-relaxation state of the model is used as the starting point for the next step. The idea is that models are accepted or rejected based on the score of the nearest local minima, but they can still climb the barriers in between as the model is not reset to the minima after each step.

Definition at line 270 of file MonteCarlo.h.

Public Member Functions

 MonteCarloWithBasinHopping (Optimizer *opt, unsigned int ns)
virtual std::string get_type_name () const override
virtual ::IMP::VersionInfo get_version_info () const override
 Get information about the module and version of the object.
Public Member Functions inherited from IMP::core::MonteCarloWithLocalOptimization
 MonteCarloWithLocalOptimization (Optimizer *opt, unsigned int steps)
Optimizer * get_local_optimizer () const
unsigned int get_number_of_steps () const
Public Member Functions inherited from IMP::core::MonteCarlo
 MonteCarlo (Model *m)
double get_best_accepted_energy () const
 If return best is on, returns the best energy found so far.
double get_last_accepted_energy () const
 Return the energy of the last accepted state.
double get_maximum_difference () const
bool get_return_best () const
double get_score_threshold () const
 Get the score threshold.
void set_best_accepted_energy (double energy)
void set_last_accepted_energy (double energy)
void set_maximum_difference (double d)
void set_return_best (bool tf)
void set_score_moved (bool mv)
 If set true (default false), only rescore moved particles.
void set_score_threshold (double s)
 Set the score threshold.
void remove_mover (MonteCarloMover *d)
void remove_movers (const MonteCarloMovers &d)
void set_movers (const MonteCarloMovers &ps)
void set_movers_order (const MonteCarloMovers &objs)
unsigned int add_mover (MonteCarloMover *obj)
void add_movers (const MonteCarloMovers &objs)
void clear_movers ()
unsigned int get_number_of_movers () const
bool get_has_movers ()
MonteCarloMover * get_mover (unsigned int i) const
MonteCarloMovers get_movers () const
void erase_mover (unsigned int i)
void reserve_movers (unsigned int sz)
void set_kt (Float t)
Float get_kt () const
unsigned int get_number_of_downward_steps () const
 Return how many times the optimizer has stepped to lower score.
unsigned int get_number_of_upward_steps () const
 Return how many times the optimizer has stepped to higher score.
unsigned int get_number_of_proposed_steps () const
 Get number of proposed moves.
unsigned int get_number_of_accepted_steps () const
 Get number of accepted moves.
void set_number_of_downward_steps (unsigned int nsteps)
void set_number_of_upward_steps (unsigned int nsteps)
void set_number_of_rejected_steps (unsigned int nsteps)
void reset_statistics ()
Public Member Functions inherited from IMP::Optimizer
 Optimizer (Model *m, std::string name="Optimizer %1%")
double get_last_score () const
 Return the score found in the last evaluate.
ScoringFunction * get_scoring_function () const
 Return the scoring function that is being used.
bool get_stop_on_good_score () const
double optimize (unsigned int max_steps)
 Optimize the model for up to max_steps iterations.
virtual void set_scoring_function (ScoringFunctionAdaptor sf)
 Set the scoring function to use.
void set_stop_on_good_score (bool tf)
void remove_optimizer_state (OptimizerState *d)
void remove_optimizer_states (const OptimizerStates &d)
void set_optimizer_states (const OptimizerStates &ps)
void set_optimizer_states_order (const OptimizerStates &objs)
unsigned int add_optimizer_state (OptimizerState *obj)
void add_optimizer_states (const OptimizerStates &objs)
void clear_optimizer_states ()
unsigned int get_number_of_optimizer_states () const
bool get_has_optimizer_states ()
OptimizerState * get_optimizer_state (unsigned int i) const
OptimizerStates get_optimizer_states () const
void erase_optimizer_state (unsigned int i)
void reserve_optimizer_states (unsigned int sz)
Public Member Functions inherited from IMP::ModelObject
 ModelObject (Model *m, std::string name)
bool get_has_dependencies () const
 Return whether this object has dependencies computed.
bool get_has_required_score_states () const
 Return whether score states are computed.
ModelObjectsTemp get_inputs () const
ModelObjectsTemps get_interactions () const
 Get the interacting sets induced by this ModelObject.
Model * get_model () const
ModelObjectsTemp get_outputs () const
const ScoreStatesTemp & get_required_score_states () const
 Get the score states that are ancestors of this in the dependency graph.
void set_has_dependencies (bool tf)
 Either invalidate the dependencies or ensure they are correct.
void set_has_required_score_states (bool tf)
 Compute the required score states.
Public Member Functions inherited from IMP::Object
CheckLevel get_check_level () const
 get_derived_object (self)
 Return this object cast to the most derived subclass.
LogLevel get_log_level () const
void set_check_level (CheckLevel l)
void set_log_level (LogLevel l)
 Set the logging level used in this object.
const std::string & get_name () const
 Get the (not necessarily unique) name of this object.
void set_name (std::string name)
void set_was_used (bool tf) const
void show (std::ostream &out=std::cout) const
virtual void clear_caches ()

Protected Member Functions

virtual void do_step () override
 a class that inherits from this should override this method
Protected Member Functions inherited from IMP::core::MonteCarlo
bool do_accept_or_reject_move (double score, const MonteCarloMoverResult &moved)
bool do_accept_or_reject_move (double score, double last, const MonteCarloMoverResult &moved)
virtual double do_evaluate (const ParticleIndexes &moved, bool force_full_score) const
 Get the current energy.
MonteCarloMoverResult do_move ()
virtual Float do_optimize (unsigned int max_steps) override
 override this function to do actual optimization
ParticleIndexes get_movable_particles () const
Protected Member Functions inherited from IMP::Optimizer
virtual ModelObjectsTemp do_get_inputs () const override
virtual ModelObjectsTemp do_get_outputs () const override
 don't return anything here to avoid pointless dependencies
ModelObjectsTemp get_optimizer_state_inputs () const
void update_states () const
 Update optimizer states, should be called at each successful step.
Protected Member Functions inherited from IMP::ModelObject
virtual ModelObjectsTemps do_get_interactions () const
virtual void handle_set_has_required_score_states (bool)
Protected Member Functions inherited from IMP::Object
 Object (std::string name)
 Construct an object with the given name.
virtual void do_destroy ()

Additional Inherited Members

list movers
 A Python list of Movers.
list optimizer_states
 A Python list of OptimizerStates.
Protected Attributes inherited from IMP::core::MonteCarlo
ParticleIndexes reset_pis_

Constructor & Destructor Documentation

◆ ~MonteCarloWithBasinHopping()

virtual IMP::core::MonteCarloWithBasinHopping::~MonteCarloWithBasinHopping ( )
virtual

Definition at line 277 of file MonteCarlo.h.

Member Function Documentation

◆ do_step()

virtual void IMP::core::MonteCarloWithBasinHopping::do_step ( )
overrideprotectedvirtual

a class that inherits from this should override this method

Reimplemented from IMP::core::MonteCarloWithLocalOptimization.

◆ get_type_name()

virtual std::string IMP::core::MonteCarloWithBasinHopping::get_type_name ( ) const
overridevirtual

Reimplemented from IMP::core::MonteCarloWithLocalOptimization.

Definition at line 277 of file MonteCarlo.h.

◆ get_version_info()

virtual ::IMP::VersionInfo IMP::core::MonteCarloWithBasinHopping::get_version_info ( ) const
overridevirtual

Get information about the module and version of the object.

Reimplemented from IMP::core::MonteCarloWithLocalOptimization.

Definition at line 277 of file MonteCarlo.h.


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