Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FragmentScoringMethod.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/scores/FragmentScoringMethod.hh
11 /// @brief a base class for fragment scoring
12 /// @author Dominik Gront (dgront@chem.uw.edu.pl)
13 
14 #ifndef INCLUDED_protocols_frag_picker_scores_FragmentScoringMethod_hh
15 #define INCLUDED_protocols_frag_picker_scores_FragmentScoringMethod_hh
16 
17 // type headers
18 #include <core/types.hh>
19 #include <utility/pointer/ReferenceCount.hh>
20 
21 // package headers
26 
27 #include <string>
28 
29 namespace protocols {
30 namespace frag_picker {
31 namespace scores {
32 
33 using namespace core;
34 
35 /// @brief a fragment candidate score
37 public:
38 
39  FragmentScoringMethod(Size priority, Real lowest_acceptable_value,
40  bool use_lowest, std::string name) {
41  priority_ = priority;
42  name_ = name;
43  lowest_acceptable_value_ = lowest_acceptable_value;
44  use_lowest_ = use_lowest;
45  }
46 
47  virtual bool score(FragmentCandidateOP, FragmentScoreMapOP) =0;
48 
49  /// @brief Returns a name of this scoring method
51  return name_;
52  }
53 
54  /// @brief Returns an integer index assigned to this scoring method by a scoring manager
55  inline Size get_id() {
56  return id_;
57  }
58 
59  /// @brief Sets a new integer index for this scoring method.
60  /// @detailed the method should be called only by a scoring manager
61  inline void set_id(Size id) {
62  id_ = id;
63  }
64 
65  /// @brief Returns a priority of this scoring method.
66  /// @detailed The higher the priority, the earlier a given scoring method is evaluated
67  inline Size get_priority() {
68  return priority_;
69  }
70 
71  /// @brief Returns the lowest acceptable score value for this scoring method.
72  /// @detailed Fragments that are below the threshold will be discarded
74  return lowest_acceptable_value_;
75  }
76 
77  /// @brief Returns the boolean choice on using the above lowest acceptable score value.
78  /// @detailed False means there is no lowest acceptable score
79  inline bool get_use_lowest() {
80  return use_lowest_;
81  }
82 
83  /// @brief Sets a new value of the lowest acceptable score
84  /// @detailed Fragments that are below the threshold will be discarded
85  inline void set_min_allowed_score(Real lowest_acceptable_value) {
86  lowest_acceptable_value_ = lowest_acceptable_value;
87  }
88 
89 protected:
95 };
96 
97 /// @brief a fragment candidate
99 public:
101  name_(name) {
102  }
103 
104  virtual FragmentScoringMethodOP make(Size, Real, bool, FragmentPickerOP,
105  std::string) =0;
106 
108  return name_;
109  }
110 
111 private:
113 };
114 
115 } // scores
116 } // frag_picker
117 } // protocols
118 
119 
120 #endif /* INCLUDED_protocols_frag_picker_scores_FragmentScoringMethod_HH */