Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TemperingBase.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_TemperingBase_hh
15 #define INCLUDED_protocols_canonical_sampling_TemperingBase_hh
16 
17 // Unit Headers
19 #include <protocols/moves/Mover.hh>
20 
21 // Project Headers
24 #include <core/pose/Pose.fwd.hh>
25 #include <numeric/random/WeightedSampler.hh>
26 #include <protocols/jd2/Job.hh>
27 
28 // Utility Headers
29 #include <core/types.hh>
30 #include <utility/vector1.hh>
31 
32 namespace protocols {
33 namespace canonical_sampling {
34 
35 ///@details
38 public:
39 
40  TemperingBase();
41 
42  TemperingBase( TemperingBase const& );
43 
44  virtual
45  void apply( core::pose::Pose& ) {};
46 
47  virtual
49  get_name() const;
50 
51  virtual
52  void
54  utility::tag::TagPtr const tag,
56  protocols::filters::Filters_map const & filters,
57  protocols::moves::Movers_map const & movers,
58  core::pose::Pose const & pose
59  );
60 
61  /// @brief callback executed before any Monte Carlo trials
62  virtual void
64  core::pose::Pose & pose,
65  protocols::canonical_sampling::MetropolisHastingsMover const & metropolis_hastings_mover,
66  core::Size cycle //non-zero if trajectory is restarted
67  );
68 
69  virtual
70  void
72  core::pose::Pose & pose,
73  protocols::canonical_sampling::MetropolisHastingsMover const & metropolis_hastings_mover,
74  core::Size level,
76  core::Size cycle
77  );
78 
79  /// @brief callback executed after all Monte Carlo trials
80  virtual
81  void
83  core::pose::Pose & pose,
84  protocols::canonical_sampling::MetropolisHastingsMover const & metropolis_hastings_mover
85  );
86 
87  /// @brief return current_temperature (in monte-carlo object)
88  core::Real temperature() const;
89 
90  ///@brief return temperature of a certain level
91  core::Real temperature( core::Size level ) const;
92 
94  return current_temp_;
95  }
96 
97  /// @brief callback executed after all Monte Carlo trials
98  core::Size n_temp_levels() const;
99 
100 protected:
101  void set_defaults();
102 
103  /// @brief Assigns user specified values to primitive members using command line options
104  virtual
105  void init_from_options();
106 
107  /// @brief initialize temperatures and weights from file, return false if IO error occurrs
108  virtual
110 
111  virtual
112  void write_to_file( std::string const& file_in, std::string const& output_name, utility::vector1< core::Real > const& wcounts );
113 
114  bool check_temp_consistency();
115 
117  return ++temp_trial_count_ % temperature_stride_ == 0;
118  }
119 
120 protected:
121 
123  return current_temp_;
124  }
125 
126  //back to uninitialized state
127  void clear();
128 
130 
131  void set_current_temp( core::Size new_temp );
132 
133  bool stats_line_output() const {
134  return stats_line_output_;
135  }
136  bool stats_silent_output() const {
137  return stats_silent_output_;
138  }
139  std::string const& stats_file() const {
140  return stats_file_;
141  }
142 
143  void generate_temp_range( core::Real temp_low, core::Real temp_high, core::Size n_levels, InterpolationType interpolation = linear );
144 
145 /// ------------------ register cmdline options ---------------------------
146 private:
147  static bool options_registered_;
148 
149 public:
150  static void register_options();
151 
152 /// ---------------- member variables --------------------------
153 private:
154  ///--- configurables... -----
155  //temperature levels
157 
158  //attempt frequency for temperature moves
160 
161  //if false look for current temperature in monte_carlo_ at each move (default true)
163 
164  //how should statistics output be written -- common options read by child-classes
168 
169  //job object to report on temperatures
171 
172  //if not initialized when simulations starts call init_from_options()
174 
175  //current temperature level
177 
178  //counting calls to temp_moves (-->temperature_stride_)
180 }; //end TemperingBase
181 
182 } //namespace canonical_sampling
183 } //namespace protocols
184 
185 #endif //INCLUDED_protocols_canonical_sampling_TemperingBase_HH