Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SimAnnealerBase.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 core/pack/annealer/SimAnnealerBase.hh
11 /// @brief Packer's simulated annealing base class implementation
12 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com)
13 
14 
15 #ifndef INCLUDED_core_pack_annealer_SimAnnealerBase_HH
16 #define INCLUDED_core_pack_annealer_SimAnnealerBase_HH
17 
18 // Unit Headers
20 
21 // Package Headers
22 // AUTO-REMOVED #include <core/pack/interaction_graph/InteractionGraphBase.fwd.hh>
23 // AUTO-REMOVED #include <core/pack/rotamer_set/RotamerSets.hh>
24 #include <core/types.hh>
25 
26 // Utility Headers
27 #include <utility/pointer/ReferenceCount.hh>
28 
29 // ObjexxFCL Headers
30 // AUTO-REMOVED #include <ObjexxFCL/FArray1D.hh>
31 
32 // STL Headers
33 // AUTO-REMOVED #include <vector>
34 
36 #include <ObjexxFCL/FArray1.fwd.hh>
37 #include <ObjexxFCL/FArray1D.fwd.hh>
38 
39 
40 namespace core {
41 namespace pack {
42 namespace annealer {
43 
44 //extern bool annealing_starts_at_low_temperature;
45 
47 {
48 public:
50 
51 public:
52 
54  int num_rots_to_pack,
55  ObjexxFCL::FArray1D_int & bestrotamer_at_seqpos,
57  bool start_with_current, // start simulation with current rotamers
58  ObjexxFCL::FArray1_int & current_rot_index,
59  bool calc_rot_freq,
60  ObjexxFCL::FArray1D< core::PackerEnergy > & rot_freq
61  );
62 
63  virtual ~SimAnnealerBase();
64 
65  virtual void run() = 0;
66 
67  bool pass_metropolis( core::PackerEnergy delta_energy) const;
68  bool pass_metropolis( core::PackerEnergy previous_energy, core::PackerEnergy delta_energy ) const;
69 
70  void setup_iterations();
71  void setup_iterations( const int & num_of_state_changes );
72  int get_outeriterations() const;
73  int get_inneriterations() const;
74  void setup_temperature( const int & nn );
75  void setup_temperature( const ObjexxFCL::FArray1D< core::PackerEnergy >& loopenergy,int nn );
76  void set_temperature( core::PackerEnergy new_temperature );
78  void set_to_quench();
79  void set_not_to_quench();
80  bool quench() const;
81  bool get_start_with_current() const;
82  bool get_calc_rot_freq() const;
83  void set_disallow_quench( bool const & setting );
84 
87 
88  inline void scale_outeriterations( core::PackerEnergy const so )
89  {
90  outeriterations_scaling_ = so; return;
91  }
92 
93  inline void scale_inneriterations( core::PackerEnergy const si )
94  {
95  inneriterations_scaling_ = si; return;
96  }
97 
98 protected:
99 
102  static const int maxouteriterations = 500;
104 
106  void num_rots_to_pack( Size setting );
107 
108  ObjexxFCL::FArray1D_int& bestrotamer_at_seqpos();
109  ObjexxFCL::FArray1D_int const & bestrotamer_at_seqpos() const;
111  bool start_with_current() const;
112  ObjexxFCL::FArray1_int & current_rot_index();
113  ObjexxFCL::FArray1_int const & current_rot_index() const;
114  bool & calc_rot_freq();
115  bool calc_rot_freq() const;
116  ObjexxFCL::FArray1D< core::PackerEnergy >& rot_freq();
117  ObjexxFCL::FArray1D< core::PackerEnergy > const & rot_freq() const;
118 
121 
122  void clear(); // resets counts modified by get_temperature
123 
124 private:
125 
127  ObjexxFCL::FArray1D_int& bestrotamer_at_seqpos_;
130  ObjexxFCL::FArray1_int & current_rot_index_; //assert current_rot_index.size() == pose.total_residue()
132  ObjexxFCL::FArray1D< core::PackerEnergy >& rot_freq_;
133 
134 
137  bool quench_;
138  core::PackerEnergy hightemp_; // initialized at instantiation
139  core::PackerEnergy lowtemp_; // initialized at instantiation
141  int jump_;
142 
145 
148 
149  SimAnnealerBase(const SimAnnealerBase& rhs);
150 };
151 
152 } //namespace annealer
153 } //namespace pack
154 } //namespace core
155 
156 #endif