Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EnergyEval.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/fragment/picking_old/vall/eval/EnergyEval.hh
11 /// @brief scores a fragment by inserting its backbone angles into a Pose
12 /// and evaluating its energy using a given ScoreFunction
13 /// @author Yih-En Andrew Ban (yab@u.washington.edu)
14 
15 #ifndef INCLUDED_core_fragment_picking_old_vall_eval_EnergyEval_hh
16 #define INCLUDED_core_fragment_picking_old_vall_eval_EnergyEval_hh
17 
18 
19 // unit headers
21 
22 // type headers
23 #include <core/types.hh>
24 
25 // package headers
28 
29 // project headers
30 #include <core/pose/Pose.hh>
32 
33 
34 // C++ headers
35 #include <iostream>
36 #include <string>
37 
38 #include <utility/vector1.hh>
39 
40 
41 
42 namespace core {
43 namespace fragment {
44 namespace picking_old {
45 namespace vall {
46 namespace eval {
47 
48 
49 /// @brief scores a fragment by inserting its backbone angles into a Pose and
50 /// evaluating its energy using a given ScoreFunction
51 /// @remarks Useful for e.g. evaluating a chainbreak score, constraint score, etc.
52 /// @warning Class currently assumes insertion of backbone angles into protein
53 /// residues.
54 class EnergyEval : public VallFragmentEval {
55 
56 
57 private: // typedefs
58 
59 
61 
62 
63 public: // typedefs
64 
65 
67 
70 
72  typedef core::Real Real;
73 
74 
75 public: // concept typedefs
76 
77 
78  /// @brief typedef for ExtentEvaluator concept
80 
81 
82  /// @brief typedef for ExtentEvaluator concept
84 
85 
86 public: // concept translation typedefs
87 
88 
90 
91 
92 public: // construct/destruct
93 
94 
95  /// @brief default constructor
96  EnergyEval();
97 
98 
99  /// @brief constructor
100  /// @param[in] pose insert backbone angles using a copy of this Pose
101  /// @param[in] insert_position insert backbone angles starting from this
102  /// position in the Pose
103  /// @param[in] score_function evaluate the Pose using a copy of this
104  /// ScoreFunction
105  /// @param[in] randomize flags that indicates whether a small amount
106  /// of noise between [0, 0.000001) will be added to the energy
107  EnergyEval(
108  Pose const & pose,
109  Size const insert_position,
111  bool const randomize = false
112  );
113 
114 
115  /// @brief default copy constructor
116  EnergyEval( EnergyEval const & rval );
117 
118 
119  /// @brief default destructor
120  virtual
121  ~EnergyEval();
122 
123 
124 public: // copy assignment
125 
126 
127  /// @brief copy assignment
128  EnergyEval & operator =( EnergyEval const & rval );
129 
130 
131 public: // virtual constructors
132 
133 
134  /// @brief clone this object
135  virtual
136  VallFragmentEvalOP clone() const;
137 
138 
139 public: // virtual evaluation methods
140 
141 
142  /// @brief for a fragment extent, evaluate and store results in a VallFragmentScore
143  /// @return true, so score is always stored during VallLibrarian::catalog()
144  virtual
145  bool eval_impl(
146  Extent const & extent,
147  VallFragmentScore & fs
148  );
149 
150 
151 public: // accessor
152 
153 
154  /// @brief the Pose to evaluate
155  inline
156  Pose const & pose() const {
157  return pose_;
158  }
159 
160 
161  /// @brief insert angles into the Pose starting from this position
162  inline
164  return insert_position_;
165  }
166 
167 
168  /// @brief the ScoreFunction used to evaluate the pose
169  inline
170  ScoreFunction const & score_function() const {
171  return score_function_;
172  }
173 
174 
175  /// @brief adding random noise between [0, 0.000001) to the energy?
176  inline
177  bool randomize() const {
178  return randomize_;
179  }
180 
181 
182 public: // mutators
183 
184 
185  /// @brief the Pose to evaluate
186  inline
187  void pose( Pose const & p ) {
188  pose_ = p;
189  }
190 
191 
192  /// @brief insert angles into the Pose starting from this position
193  inline
194  void insert_position( Size const position ) {
195  insert_position_ = position;
196  }
197 
198 
199  /// @brief the ScoreFunction used to evaluate the pose
200  inline
201  void score_function( ScoreFunction const & fx ) {
202  score_function_ = fx;
203  }
204 
205 
206  /// @brief set flag to add random noise between [0, 0.000001) to the energy
207  inline
208  void randomize( bool const flag ) {
209  randomize_ = flag;
210  }
211 
212 
213 public: // additional hooks
214 
215 
216  /// @brief operation to be perform before catalog() starts
217  virtual
218  void pre_catalog_op( VallLibrary const & );
219 
220 
221 private: // data
222 
223 
224  /// @brief insert backbone angles into this Pose
226 
227 
228  /// @brief insert backbone angles into pose starting from this position
230 
231 
232  /// @brief evaluate the Pose using this ScoreFunction
234 
235 
236  /// @brief flag to add random noise between [0, 0.000001) into the energy
238 
239 
240 };
241 
242 
243 } // namespace eval
244 } // namespace vall
245 } // namespace picking_old
246 } // namespace fragment
247 } // namespace core
248 
249 
250 #endif /* INCLUDED_core_fragment_picking_old_vall_eval_EnergyEval_HH */