Rosetta 3.4
Public Types | Public Member Functions
protocols::moves::MonteCarlo Class Reference

This object is responsible for all of the major functions needed in a Monte Carlo simulation. Its main purpose is to apply the Metropolis Criterion on a pose, based on a ScoreFunction, temperature, and the previously accepted pose. It stores the lowest-energy pose ecountered, the last-accepted pose in the simulation, and various other statistics. More...

#include <MonteCarlo.hh>

Inheritance diagram for protocols::moves::MonteCarlo:
Inheritance graph
[legend]
Collaboration diagram for protocols::moves::MonteCarlo:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
core::scoring::ScoreFunction 
ScoreFunction
typedef
core::scoring::ScoreFunctionOP 
ScoreFunctionOP
typedef
core::scoring::ScoreFunctionCOP 
ScoreFunctionCOP
typedef core::pose::Pose Pose
typedef core::pose::PoseOP PoseOP
typedef core::pose::PoseCOP PoseCOP
typedef core::Real Real

Public Member Functions

 MonteCarlo (MonteCarlo const &)
 Copy constructor.
 MonteCarlo (Pose const &init_pose, ScoreFunction const &scorefxn, Real const temperature)
 Constructs a useable MonteCarlo object.
 MonteCarlo (ScoreFunction const &scorefxn, Real const temperature)
 Constructor without Pose -- call reset(pose) before first use.
 ~MonteCarlo ()
 Empty destructor in C++ file to reduce number of necessary includes.
void reset_scorefxn (Pose const &init_pose, ScoreFunction const &scorefxn)
 Resets the ScoreFunction.
void set_temperature (Real const temp)
 Sets the temperature value used in the Metropolis Criterion to <temp>
Real temperature () const
 Returns the temperature value used in the Metropolis Criterion.
void set_autotemp (bool const setting, core::Real const quench_temp)
 Sets autotemp to quench_temp example(s): See also: MonteCarlo MonteCarlo.autotemp MonteCarlo.show_state.
virtual bool boltzmann (Pose &pose, std::string const &move_type="unk", core::Real const proposal_density_ratio=1, core::Real const inner_score_temperature_delta=0)
 Applies the Metropolis Criterion on pose based on the ScoreFunction, temperature, and the last accepted pose. This method evaluates the change in score, compares the trial pose to the last accepted pose, and updates the pose structure and simulation statistics appropriately.
virtual bool boltzmann (core::Real score_delta, std::string const &move_type="unk", core::Real const proposal_density_ratio=1)
 Applies the Metropolis Criterion on the inputted pose based on the supplied score delta.
void reset (Pose const &pose)
 Sets lowest score pose and last accepted pose to the score of <pose>
void reset_last_accepted (Pose const &pose)
 Sets the last accepted pose to the score of <pose>
Pose const & last_accepted_pose () const
 Returns the last accepted pose.
Pose const & lowest_score_pose () const
 Returns the lowest score pose encountered.
void set_last_accepted_pose (Pose const &pose)
 Sets the last accepted pose to the score of <pose>
void set_lowest_score_pose (Pose const &pose)
 Sets the lowest score pose to the score of <pose>
template<typename ConformationObserver >
void attach_observer_to_last_accepted_conformation (ConformationObserver &obs)
 attach observer to last accepted conformation
template<typename ConformationObserver >
void attach_observer_to_lowest_score_conformation (ConformationObserver &obs)
 attach observer to lowest score conformation
template<typename PoseObserver >
void attach_observer_to_last_accepted_pose (PoseObserver &obs)
 attach observer to last accepted pose
template<typename PoseObserver >
void attach_observer_to_lowest_score_pose (PoseObserver &obs)
 attach observer to lowest score pose
void recover_low (Pose &pose)
 Sets the input <pose> and last accepted pose to the lowest score pose.
void score_function (ScoreFunction const &scorefxn)
 Sets the ScoreFunction to <scorefxn> , re-scores last accepted pose and lowest score pose.
ScoreFunction const & score_function () const
 Returns the MonteCarlo ScoreFunction.
void show_scores () const
 Displays the last accepted score and the lowest score.
void reset_counters ()
 Resets the mover counters.
void show_state () const
 Displays the entire MonteCarlo state temperature, scores, annealing settings, move statistics, move counters (show_counters)
void show_counters () const
 Displays the number of trials performed, fraction of trial moves accepted, and the average energy drop per accepted trial by mover types applied (unknown movers or perturbations are listed as "unktrials")
Size total_trials () const
 Returns the total number of trials since the last reset.
Real last_accepted_score () const
 Returns the score value of the last accepted pose.
Real lowest_score () const
 Returns the score value of the lowest score pose encountered.
MCA mc_accepted () const
 Returns mc_accepted, informative of the last move applied.
void clear_poses ()
 Removes last accepted pose and lowest score pose.
void set_update_boinc (bool setting)
 no brief for now
Real total_score_of_last_considered_pose () const
core::Size last_accept () const
 Returns the number of trials since last acceptance.
core::Size heat_after_cycles () const
 no brief for now
void set_heat_after_cycles (core::Size setting)
 no brief for now
void push_back (moves::MonteCarloExceptionConvergeOP)
 no brief for now
Size check_frequency () const

Detailed Description

This object is responsible for all of the major functions needed in a Monte Carlo simulation. Its main purpose is to apply the Metropolis Criterion on a pose, based on a ScoreFunction, temperature, and the previously accepted pose. It stores the lowest-energy pose ecountered, the last-accepted pose in the simulation, and various other statistics.

Output Methods: MonteCarlo.show_counters() MonteCarlo.show_scores() MonteCarlo.show_state() Common Methods: MonteCarlo.last_accepted_score MonteCarlo.last_accepted_pose MonteCarlo.lowest_score MonteCarlo.lowest_score_pose MonteCarlo.score_function MonteCarlo.set_temperature MonteCarlo.temperature


Member Typedef Documentation


Constructor & Destructor Documentation

protocols::moves::MonteCarlo::MonteCarlo ( MonteCarlo const &  src)

Copy constructor.

The copy constructor does not copy the OPs, but rather creates new objects using the copy constructors or the clone() methods of the objects being pointed at. This is important, since otherwise, a copy of a Monte Carlo object could corrupt the state held in the original MonteCarlo object.

protocols::moves::MonteCarlo::MonteCarlo ( Pose const &  init_pose,
ScoreFunction const &  scorefxn,
Real const  temperature 
)

Constructs a useable MonteCarlo object.

mc = MonteCarlo( init_pose , scorefxn , temp )

Pose init_pose /manipulated during the simulation ScoreFunction scorefxn /evaluates pose scores Real (float) temp /used in the Metropolis Criterion

References core::scoring::ScoreFunction::clone(), and reset().

protocols::moves::MonteCarlo::MonteCarlo ( ScoreFunction const &  scorefxn,
Real const  temperature 
)

Constructor without Pose -- call reset(pose) before first use.

References core::scoring::ScoreFunction::clone().

protocols::moves::MonteCarlo::~MonteCarlo ( )

Empty destructor in C++ file to reduce number of necessary includes.


Member Function Documentation

template<typename ConformationObserver >
void protocols::moves::MonteCarlo::attach_observer_to_last_accepted_conformation ( ConformationObserver &  obs)

attach observer to last accepted conformation

Template Parameters:
ConformationObserverany class implementing void attach_to( Conformation & )
template<typename PoseObserver >
void protocols::moves::MonteCarlo::attach_observer_to_last_accepted_pose ( PoseObserver &  obs)

attach observer to last accepted pose

Template Parameters:
PoseObserverany class implementing void attach_to( Pose & )

Referenced by protocols::viewer::add_monte_carlo_silent_viewer().

template<typename ConformationObserver >
void protocols::moves::MonteCarlo::attach_observer_to_lowest_score_conformation ( ConformationObserver &  obs)

attach observer to lowest score conformation

Template Parameters:
ConformationObserverany class implementing void attach_to( Conformation & )
template<typename PoseObserver >
void protocols::moves::MonteCarlo::attach_observer_to_lowest_score_pose ( PoseObserver &  obs)

attach observer to lowest score pose

Template Parameters:
PoseObserverany class implementing void attach_to( Pose & )

Referenced by protocols::viewer::add_monte_carlo_silent_viewer().

bool protocols::moves::MonteCarlo::boltzmann ( core::Real  score_delta,
std::string const &  move_type = "unk",
core::Real const  proposal_density_ratio = 1 
) [virtual]
bool protocols::moves::MonteCarlo::boltzmann ( Pose pose,
std::string const &  move_type = "unk",
core::Real const  proposal_density_ratio = 1,
core::Real const  inner_score_temperature_delta = 0 
) [virtual]

Applies the Metropolis Criterion on pose based on the ScoreFunction, temperature, and the last accepted pose. This method evaluates the change in score, compares the trial pose to the last accepted pose, and updates the pose structure and simulation statistics appropriately.

example(s): mc.boltzmann( pose ) See also: MonteCarlo MonteCarlo.last_accepted_score MonteCarlo.lowest_score

References core::scoring::Energies::clear(), protocols::moves::TrialCounter::count_accepted(), protocols::moves::TrialCounter::count_energy_drop(), protocols::moves::TrialCounter::count_trial(), protocols::comparative_modeling::features::E, core::pose::Pose::energies(), last_accepted_score(), lowest_score(), mc_RG(), protocols::moves::MCA_accepted_score_beat_last, protocols::moves::MCA_accepted_score_beat_low, protocols::moves::MCA_accepted_thermally, protocols::moves::MCA_rejected, core::scoring::EMapVector::show_if_nonzero_weight(), core::scoring::Energies::total_energies(), protocols::moves::TR(), and protocols::moves::TrialCounter::trial().

Referenced by protocols::protein_interface_design::movers::LoopRemodel::apply(), protocols::protein_interface_design::movers::BackrubDDMover::apply(), protocols::loops::loop_mover::refine::LoopMover_Refine_Backrub::apply(), protocols::loops::loop_mover::refine::LoopMover_Refine_KIC::apply(), protocols::enzdes::BackboneSampler::apply(), protocols::moves::ReplicaExchangeMC::boltzmann(), protocols::forge::remodel::RemodelLoopMover::boost_closure_stage(), protocols::enzdes::EnzdesFlexBBProtocol::generate_alc_ensemble_for_region(), protocols::enzdes::EnzdesFlexBBProtocol::generate_backrub_ensemble_for_region(), protocols::forge::remodel::RemodelLoopMover::independent_stage(), protocols::loops::loop_mover::perturb::LoopMover_Perturb_KIC::model_loop(), protocols::loops::loop_mover::perturb::LoopMover_Perturb_CCD::model_loop(), protocols::abinitio::ConstraintFragmentSampler::set_max_seq_sep(), and protocols::forge::remodel::RemodelLoopMover::simultaneous_stage().

Size protocols::moves::MonteCarlo::check_frequency ( ) const [inline]
void protocols::moves::MonteCarlo::clear_poses ( )
core::Size protocols::moves::MonteCarlo::heat_after_cycles ( ) const [inline]

no brief for now

core::Size protocols::moves::MonteCarlo::last_accept ( ) const [inline]

Returns the number of trials since last acceptance.

example(s): mc.last_accept() See also: MonteCarlo MonteCarlo.show_counters MonteCarlo.last_accepted_pose MonteCarlo.last_accepted_score

Pose const& protocols::moves::MonteCarlo::last_accepted_pose ( ) const [inline]
Real protocols::moves::MonteCarlo::last_accepted_score ( ) const
Real protocols::moves::MonteCarlo::lowest_score ( ) const

Returns the score value of the lowest score pose encountered.

example(s): mc.lowest_score() See also: MonteCarlo MonteCarlo.lowest_score_pose MonteCarlo.show_counters MonteCarlo.show_scores MonteCarlo.show_state

Referenced by boltzmann(), protocols::moves::operator<<(), score_function(), show_scores(), and show_state().

Pose const& protocols::moves::MonteCarlo::lowest_score_pose ( ) const [inline]
MCA protocols::moves::MonteCarlo::mc_accepted ( ) const

Returns mc_accepted, informative of the last move applied.

Note: Returns true for an accept, false otherwise 3 = accepted:score beat low score and last_accepted score 2 = accepted:score beat last_accepted score 1 = thermally accepted: score worse than last_accepted score 0 = not accepted example(s): mc.mc_accepted() See also: MonteCarlo MonteCarlo.show_state

void protocols::moves::MonteCarlo::push_back ( moves::MonteCarloExceptionConvergeOP  check)
void protocols::moves::MonteCarlo::recover_low ( Pose pose)
void protocols::moves::MonteCarlo::reset ( Pose const &  pose)

Sets lowest score pose and last accepted pose to the score of <pose>

Note:
(does not reset counters)

example(s): mc.reset(pose) See also: MonteCarlo MonteCarlo.last_accepted_pose MonteCarlo.last_accepted_score MonteCarlo.lowest_score MonteCarlo.lowest_scored_pose

Referenced by protocols::protein_interface_design::movers::BackrubDDMover::apply(), protocols::loops::loop_mover::refine::LoopMover_Refine_Backrub::apply(), protocols::loops::loop_closure::ccd::LoopClosure::apply(), protocols::forge::remodel::RemodelLoopMover::apply(), protocols::enzdes::BackboneSampler::apply(), protocols::abinitio::FragmentSampler::apply(), protocols::abinitio::FoldConstraints::apply(), protocols::abinitio::ConstraintFragmentSampler::apply(), protocols::forge::remodel::RemodelLoopMover::boost_closure_stage(), protocols::abinitio::MembraneAbinitio::do_stage1_cycles(), protocols::abinitio::FragmentSampler::do_stage1_cycles(), protocols::abinitio::ClassicAbinitio::do_stage1_cycles(), protocols::abinitio::ClassicAbinitio::do_stage5_cycles(), protocols::enzdes::EnzdesFlexBBProtocol::generate_alc_ensemble_for_region(), protocols::enzdes::EnzdesFlexBBProtocol::generate_backrub_ensemble_for_region(), protocols::forge::remodel::RemodelLoopMover::independent_stage(), protocols::abinitio::FoldConstraints::min_trial(), MonteCarlo(), reset_scorefxn(), protocols::abinitio::KinematicAbinitio::set_max_seq_sep(), protocols::abinitio::FoldConstraints::set_max_seq_sep(), protocols::abinitio::ConstraintFragmentSampler::set_max_seq_sep(), and protocols::forge::remodel::RemodelLoopMover::simultaneous_stage().

void protocols::moves::MonteCarlo::reset_counters ( )
void protocols::moves::MonteCarlo::reset_last_accepted ( Pose const &  pose)

Sets the last accepted pose to the score of <pose>

Note:
(does not reset counters)

example(s): mc.reset_last_accepted( pose ) See also: MonteCarlo MonteCarlo.reset

Referenced by protocols::canonical_sampling::SidechainMetropolisHastingsMover::apply().

void protocols::moves::MonteCarlo::reset_scorefxn ( Pose const &  init_pose,
ScoreFunction const &  scorefxn 
)

Resets the ScoreFunction.

References core::scoring::ScoreFunction::clone(), and reset().

void protocols::moves::MonteCarlo::score_function ( ScoreFunction const &  scorefxn)

Sets the ScoreFunction to <scorefxn> , re-scores last accepted pose and lowest score pose.

set the scorefxn, re-scores last-accepted and lowest-score pose

example(s): mc.score_function( scorefxn ) See also: MonteCarlo MonteCarlo.boltzmann MonteCarlo.set_temperature MonteCarlo.temperature ScoreFunction create_score_function

References core::scoring::Energies::clear(), core::scoring::ScoreFunction::clone(), protocols::comparative_modeling::features::E, core::pose::Pose::energies(), last_accepted_score(), lowest_score(), core::scoring::EMapVector::show_if_nonzero_weight(), core::scoring::Energies::total_energies(), and protocols::moves::TR().

Referenced by protocols::loops::loop_mover::refine::LoopMover_Refine_Backrub::apply(), protocols::loops::loop_mover::refine::LoopMover_Refine_KIC::apply(), protocols::forge::remodel::RemodelLoopMover::apply(), protocols::forge::remodel::RemodelLoopMover::boost_closure_stage(), protocols::abinitio::MembraneAbinitio::current_scorefxn(), protocols::abinitio::FragmentSampler::current_scorefxn(), protocols::abinitio::ClassicAbinitio::current_scorefxn(), protocols::forge::remodel::RemodelLoopMover::independent_stage(), protocols::abinitio::MembraneAbinitio::output_debug_structure(), protocols::abinitio::ClassicAbinitio::output_debug_structure(), protocols::abinitio::MembraneAbinitio::set_current_weight(), protocols::abinitio::FragmentSampler::set_current_weight(), protocols::abinitio::ClassicAbinitio::set_current_weight(), and protocols::forge::remodel::RemodelLoopMover::simultaneous_stage().

core::scoring::ScoreFunction const & protocols::moves::MonteCarlo::score_function ( ) const

Returns the MonteCarlo ScoreFunction.

example(s): mc.score_function() mc.score_function()( pose ) See also: MonteCarlo MonteCarlo.boltzmann MonteCarlo.set_temperature MonteCarlo.temperature ScoreFunction create_score_function

void protocols::moves::MonteCarlo::set_autotemp ( bool const  setting,
core::Real const  quench_temp 
)

Sets autotemp to quench_temp example(s): See also: MonteCarlo MonteCarlo.autotemp MonteCarlo.show_state.

Referenced by protocols::protein_interface_design::movers::LoopRemodel::apply().

void protocols::moves::MonteCarlo::set_heat_after_cycles ( core::Size  setting) [inline]
void protocols::moves::MonteCarlo::set_last_accepted_pose ( Pose const &  pose)

Sets the last accepted pose to the score of <pose>

Note:
(for recovering from a checkpoint)

example(s): mc.set_last_accepted_pose( pose ) See also: MonteCarlo MonteCarlo.last_accept MonteCarlo.last_accepted_pose MonteCarlo.last_accepted_score

Referenced by protocols::checkpoint::CheckPointer::recover_checkpoint().

void protocols::moves::MonteCarlo::set_lowest_score_pose ( Pose const &  pose)

Sets the lowest score pose to the score of <pose>

Note:
(for recovering from a checkpoint)

example(s): mc.set_lowest_score_pose(_pose_) See also: MonteCarlo MonteCarlo.lowest_score MonteCarlo.lowest_score_pose

Referenced by protocols::checkpoint::CheckPointer::recover_checkpoint().

void protocols::moves::MonteCarlo::set_temperature ( Real const  temp)
void protocols::moves::MonteCarlo::set_update_boinc ( bool  setting) [inline]

no brief for now

void protocols::moves::MonteCarlo::show_counters ( ) const
void protocols::moves::MonteCarlo::show_scores ( ) const
void protocols::moves::MonteCarlo::show_state ( ) const

Displays the entire MonteCarlo state temperature, scores, annealing settings, move statistics, move counters (show_counters)

example(s): mc.show_state() Output as: protocols.moves.MonteCarlo: MC: t l1 l2 las lws la au qu mca t= temperature l1= (*score_function_)(*last_accepted_pose_) l2= (*score_function_)(*lowest_score_pose_) las= last accepted score lws= lowest score la= last_accept_ au= autotemp_ qu= quench_temp_ mca= mc_accepted_ See also: MonteCarlo MonteCarlo.show_counters MonteCarlo.show_scores MonteCarlo.last_accepted_score MonteCarlo.lowest_score MonteCarlo.temperature

References last_accepted_score(), lowest_score(), show_counters(), and protocols::moves::TR().

Referenced by protocols::forge::remodel::RemodelLoopMover::boost_closure_stage(), protocols::forge::remodel::RemodelLoopMover::independent_stage(), and protocols::forge::remodel::RemodelLoopMover::simultaneous_stage().

Real protocols::moves::MonteCarlo::temperature ( ) const [inline]

Returns the temperature value used in the Metropolis Criterion.

example(s): mc.temperature() See also: MonteCarlo MonteCarlo.set_temperature MonteCarlo.show_state

Referenced by protocols::protein_interface_design::movers::LoopRemodel::apply(), and protocols::moves::operator<<().

Real protocols::moves::MonteCarlo::total_score_of_last_considered_pose ( ) const [inline]
core::Size protocols::moves::MonteCarlo::total_trials ( ) const

Returns the total number of trials since the last reset.

return number of trials since last reset

Note:
: MonteCarlo.boltzmann(pose) updates the number of trials example(s): mc.total_trials() See also: MonteCarlo MonteCarlo.last_accept MonteCarlo.show_counters MonteCarlo.show_state

References protocols::moves::TrialCounter::total_trials().

Referenced by protocols::abinitio::MembraneAbinitio::apply(), protocols::abinitio::ClassicAbinitio::apply(), and protocols::moves::operator<<().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines