Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MoverStatistics.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
11 /// @brief Keeps track of the acceptance_rate of a Mover
12 /// @author Monica Berrondo August 16 2007
13 
14 
15 #ifndef INCLUDED_protocols_moves_MoverStatistics_hh
16 #define INCLUDED_protocols_moves_MoverStatistics_hh
17 
18 
19 // Package headers
20 #include <core/types.hh>
21 
22 //#include <basic/basic.hh>
23 
25 
26 // ObjexxFCL Headers
27 // AUTO-REMOVED #include <ObjexxFCL/format.hh>
28 
29 // C++ Headers
30 // AUTO-REMOVED #include <string>
31 // AUTO-REMOVED #include <sstream>
32 #include <vector>
33 
34 // Utility Headers
35 #include <utility/pointer/ReferenceCount.hh>
36 
37 namespace protocols {
38 namespace moves {
39 
40 
41 ///////////////////////////////////////////////////////////////////////////////
42 // @brief MoverStatistics keeps track of the acceptance_rate for a mover
43 //
44 
46 
47 public:
48  ///@brief Automatically generated virtual destructor for class deriving directly from ReferenceCount
49  virtual ~MoverStatistics();
50 
51  // default constructor
53  accepted_(0),
54  rejected_(0),
57 
58  {}
59 
60  void accepted( bool result ) const
61  {
62  if ( result ) accepted_++;
63  else rejected_++;
64  }
65 
66  void add_score( core::Real score_in ) { score_.push_back(score_in); }
67 
68  void clear_score() { score_.clear(); }
69 
70  void print ( MonteCarloOP mc, std::string const type );
71 
73 
74  int num_accepted() const { return accepted_; }
75 
76  void clear()
77  {
78  accepted_ = 0;
79  rejected_ = 0;
80  thermal_accepts_ = 0;
82 
83  }
84 
85 private:
86  mutable int accepted_; ///< number of accepted moves
87  mutable int rejected_; ///< number of rejected moves
88  std::vector < core::Real > score_;
91 }; // MoverStatistics class
92 } // moves
93 } // rosetta
94 
95 
96 #endif