Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SimulatedTempering.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/canonical_sampling/MetropolisHastingsMover.hh
11 /// @brief
12 /// @author Oliver Lange ( oliver.lange@tum.de )
13 
14 #ifndef INCLUDED_protocols_canonical_sampling_SimulatedTempering_hh
15 #define INCLUDED_protocols_canonical_sampling_SimulatedTempering_hh
16 
17 // Unit Headers
20 
21 #include <protocols/moves/Mover.hh>
22 
23 // Project Headers
25 #include <core/pose/Pose.fwd.hh>
26 #include <numeric/random/WeightedSampler.hh>
27 #include <protocols/jd2/Job.fwd.hh>
28 
29 // Utility Headers
30 #include <core/types.hh>
31 #include <utility/vector1.hh>
32 
33 namespace protocols {
34 namespace canonical_sampling {
35 
36 ///@details
39 public:
40 
42 
44 
45  virtual
46  void apply( core::pose::Pose& ) {};
47 
48  virtual
50  get_name() const;
51 
53  clone() const;
54 
55  virtual
57  fresh_instance() const;
58 
59  virtual
60  void
62  utility::tag::TagPtr const tag,
64  protocols::filters::Filters_map const & filters,
65  protocols::moves::Movers_map const & movers,
66  core::pose::Pose const & pose
67  );
68 
69  /// @brief execute the temperatur move ( called by observer_after_metropolis )
70  /// returns the current temperatur in kT.
73 
74  /// @brief callback executed before any Monte Carlo trials
75  virtual void
77  core::pose::Pose & pose,
78  protocols::canonical_sampling::MetropolisHastingsMover const & metropolis_hastings_mover,
79  core::Size cycle //non-zero if trajectory is restarted
80  );
81 
82  /// @brief callback executed after all Monte Carlo trials
83  virtual
84  void
86  core::pose::Pose & pose,
87  protocols::canonical_sampling::MetropolisHastingsMover const & metropolis_hastings_mover
88  );
89 
90  void
91  finalize_simulation( std::string const& output_name );
92 
93 protected:
94  void set_defaults();
95 
96  /// @brief Assigns user specified values to primitive members using command line options
97  virtual
98  void init_from_options();
99 
100  /// @brief update weights based on current counts
101  void reweight();
102 
103  /// @brief reset the raw counts per state (not the weighted ones) to 0
104  void reset_raw_counter();
105 
106  /// @brief initialize temperatures and weights from file, return false if IO error occurrs
107  virtual
109 
110  virtual
111  void write_to_file( std::string const& file_in, std::string const& output_name, utility::vector1< core::Real > const& wcounts );
112 
113 /// ------------------ register cmdline options ---------------------------
114 
115 private:
116  static bool options_registered_;
117 
118 public:
119  static void register_options();
120 
121 /// ---------------- member variables --------------------------
122 
123 private:
124 
125  /// --- configurables ----
126  // add to score -- can help to get effective weights closer to 1
128 
129  // how likely is a self-transition in temperature moves
130  core::Real self_transition_; //not in options currently --- probably useless
131 
132  // allows jumps to any temperature in single step
134 
135  // reweight after X steps -- 0 for now reweighting
137 
138  /// ---- state -----
143 
144 
145 }; //end SimulatedTempering
146 
147 } //namespace canonical_sampling
148 } //namespace protocols
149 
150 #endif //INCLUDED_protocols_canonical_sampling_SimulatedTempering_HH