Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ConstScore.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/ConstScore.hh
11 /// @brief score that adds a constant (so basically it does nothing!)
12 /// @author Dominik Gront (dgront@chem.uw.edu.pl)
13 
14 #ifndef INCLUDED_protocols_frag_picker_scores_ConstScore_hh
15 #define INCLUDED_protocols_frag_picker_scores_ConstScore_hh
16 
17 // type headers
18 #include <core/types.hh>
19 
20 // package headers
21 // AUTO-REMOVED #include <protocols/frag_picker/FragmentPicker.hh>
24 
27 #include <utility/vector1.hh>
28 
29 
30 namespace protocols {
31 namespace frag_picker {
32 namespace scores {
33 
34 /// @brief ConstScore adds a constant to the total score for each position
35 /// @detailed The total ConstScore for a fragment = n_frag_res * score_const
37 public:
38  /// @brief the value used to score each position
39  /// @detailed You don't have to change the value
40  /// here as you can always rescale the score by a weight provided in a score configuration file
41  static const int CONST_SCORE = 1;
42 
43  ConstScore(Size priority, Real lowest_acceptable_value, bool use_lowest) :
44  FragmentScoringMethod(priority, lowest_acceptable_value, use_lowest,"ConstScore") {
45  }
46 
47  /// @brief Computes the score i.e. returns a constant times the number of residues in a fragment
48  /// @detailed the method returns ALWAYS TRUE which is inconsistent with other methods derived from
49  /// FragmentScoringMethod base class. The other option (i.e. returning false when a score is too high)
50  /// doesn't make any sense in this case.
51  virtual bool score(FragmentCandidateOP f, FragmentScoreMapOP empty_map) {
52 
53  empty_map->set_score_component((Real) f->get_length() * CONST_SCORE, id_);
54  return true;
55  }
56 };
57 
58 /// @brief Maker class that produces a new ConstScore object
60 public:
61 
63  MakeFragmentScoringMethod("ConstScore") {
64  }
65 
66  FragmentScoringMethodOP make(Size priority, Real lowest_acceptable_value,
67  bool use_lowest, FragmentPickerOP, std::string /* params */) {
68  return (FragmentScoringMethodOP) new ConstScore(priority,
69  lowest_acceptable_value, use_lowest);
70  }
71 };
72 
73 } // scores
74 } // frag_picker
75 } // protocols
76 
77 
78 #endif /* INCLUDED_protocols_frag_picker_scores_ConstScore_HH */