Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
QuotaSelector.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/frag_picker/quota/QuotaSelector.hh
11 /// @brief provides a selector that picks best fragments based on their total score
12 /// @author Dominik Gront (dgront@chem.uw.edu.pl)
13 
14 #ifndef INCLUDED_protocols_frag_picker_quota_QuotaSelector_hh
15 #define INCLUDED_protocols_frag_picker_quota_QuotaSelector_hh
16 
20 
22 
23 // package headers
24 // AUTO-REMOVED #include <protocols/frag_picker/CommonFragmentComparators.hh>
27 
28 // utility headers
29 #include <core/types.hh>
30 
31 // C++ headers
32 #include <set>
33 
34 #include <utility/vector1.hh>
35 
36 
37 namespace protocols {
38 namespace frag_picker {
39 namespace quota {
40 
41 /// @brief selects a given number of fragments using a quota scheme
43 public:
44 
45  /// @brief Constructor sets the desired number of fragments.
47 
48  virtual ~QuotaSelector() {
49  }
50 
51  /// @brief Selects desired number of fragments from a given candidates
52  virtual void select_fragments(
53  ScoredCandidatesVector1 const& in,
55  {
57  }
58 
59 protected:
62  inline Size round(Real x) { return Size(x > 0.0 ? x + 0.5 : x - 0.5); }
63 
66  Size recently_taken,
67  std::set<Size> & in_use
68  );
69 
70  void push_the_limits(utility::vector1<Size> & q_limits,Size target_total);
71 
72  void push_the_limits_to_the_winner(utility::vector1<Size> & q_limits,Size target_total);
73 
75 
76  virtual void select_fragments_200(
77  ScoredCandidatesVector1 const& in,
79 
80  virtual void select_fragments_25_200(
81  ScoredCandidatesVector1 const& in,
83 private:
85  std::map<std::string,Size> tag_map_;
86 };
87 
88 } // quota
89 } // frag_picker
90 } // protocols
91 
92 
93 #endif /* INCLUDED_protocols_frag_picker_quota_QuotaSelector_HH */