Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SecondaryStructureWeights.cc
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/scoring/ScoringManager.hh
11 /// @brief Scoring manager class header
12 /// @author Andrew Leaver-Fay (leaverfa@email.unc.edu)
13 
15 
16 // numeric headers
17 #include <numeric/random/random.hh>
18 
19 #include <utility/vector1.hh>
20 
21 
22 // utility headers
23 
24 // ObjexxFCL headers
25 
26 // C++ headers
27 
28 namespace core {
29 namespace scoring {
30 
31 static numeric::random::RandomGenerator ss_weights_RG(82645);
32 
34 
35 /// @brief initialize to default values, also load proper data bins from external files
36 void
38 {
39  // weights
41 
42  // additional settings
43  set_ss_lowstrand( 0 );
44  set_ss_cutoff( 6 );
45  // set_ss_lowstrand( 1 );
46  // set_ss_cutoff( 11 );
47 
49  set_seq_sep_scale( 20.0 );
54 }
55 
56 
57 /// @details if not randomizing weights, all weights set to 1.0
58 void
60  bool const & randomize_weights
61 )
62 {
63  if ( randomize_weights ) {
64  // Choose whether to weight up parallel or antiparallel
65  Real randomnumber = ss_weights_RG.uniform();
66  Real randomweight = 10.0 * ss_weights_RG.uniform(); // Pretty drastic reweighting...
67  if ( randomnumber < 0.5 ){
68  set_parallel_weight( randomweight );
69  set_antiparallel_weight( 1.0/randomweight );
70  } else {
71  set_parallel_weight( 1.0/randomweight );
72  set_antiparallel_weight( randomweight );
73  }
74  } else { // default weights
75  set_parallel_weight( 1.0 );
77  }
78 }
79 
80 
81 }
82 }