Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RationalMonteCarlo.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file protocols/simple_moves/rational_mc/RationalMonteCarlo.hh
11 /// @author Christopher Miles (cmiles@uw.edu)
12 
13 #ifndef INCLUDED_protocols_simple_moves_rational_mc_RationalMonteCarlo_HH
14 #define INCLUDED_protocols_simple_moves_rational_mc_RationalMonteCarlo_HH
15 
16 // Unit header
18 
19 // C/C++ headers
20 #include <string>
21 
22 // External headers
23 #include <boost/function.hpp>
24 #include <boost/unordered/unordered_map.hpp>
25 
26 // Project headers
27 #include <core/types.hh>
28 #include <core/pose/Pose.fwd.hh>
30 
31 // Package headers
33 #include <protocols/moves/Mover.hh>
34 
35 namespace protocols {
36 namespace simple_moves {
37 namespace rational_mc {
38 
39 /// @brief Trigger API definition
40 typedef boost::function<void(const core::pose::Pose&)> RationalMonteCarloTrigger;
41 typedef boost::unordered_map<core::Size, RationalMonteCarloTrigger> Triggers;
42 
43 /// @class Trial-based Monte Carlo minization primitive. Do not modify this
44 /// class; almost anything you could possibly want to add is a bad idea.
48 
49  public:
51  ScoreFunctionOP score,
54  bool recover_low);
55 
56  /// @brief Applies the underlying mover to <pose> the specified number of times
57  void apply(Pose& pose);
58 
59  /// @brief Returns this mover's name
60  std::string get_name() const;
61 
62  // -- Accessors -- //
63  bool recover_low() const;
64  moves::MoverOP mover() const;
65  core::Size num_trials() const;
66  core::Real temperature() const;
68 
69  /// @brief Updates the last accepted and lowest scoring pose members of the
70  /// MonteCarlo member variable to the score of the specified pose
71  void reset(const core::pose::Pose& pose);
72  const core::pose::Pose& lowest_score_pose() const;
73  const core::pose::Pose& last_accepted_pose() const;
74 
75  // -- Mutators -- //
77  void set_recover_low(bool recover_low);
80 
81  void enable_autotemp(core::Real quench);
82  void disable_autotemp();
83 
84  /// @brief Updates the score function. Before calling this method, make sure
85  /// that apply() has been called at least once on a non-empty pose.
87 
88  // -- Triggers -- //
89 
90  /// @brief Registers the specified trigger with this instance. Returns a unique
91  /// identifier for referring to this trigger in subsequent operations.
93 
94  /// @brief Unregisters the trigger with the given unique identifier
95  void remove_trigger(core::Size trigger_id);
96 
97  protected:
98  /// @brief Executes all triggers attached to this instance. The order of trigger
99  /// execution is undefined. Do not assume, depend, or in any way rely upon a
100  /// partiular ordering.
101  void fire_all_triggers(const Pose& pose);
102 
103  private:
104  /// @brief Underlying mover
106 
107  /// @brief Determines whether applications of the base mover should be accepted
108  /// by applying the Metropolis criterion to the pose
110 
111  /// @brief Number of times to execute the underlying mover in calls to apply()
113 
114  /// @brief Determines whether the low scoring pose should be recovered at the
115  /// conclusion of the apply() method
117 
118  /// @brief Collection of function callbacks
120 
121  /// @brief Next trigger id to be assigned
123 };
124 
125 } // namespace rational_mc
126 } // namespace simple_moves
127 } // namespace protocols
128 
129 #endif // protocols_simple_moves_rational_mc_RationalMonteCarlo_HH_