21 #include <ObjexxFCL/Fmath.hh>
24 #include <numeric/random/random.hh>
25 #include <numeric/random/random_permutation.hh>
28 #include <utility/exit.hh>
33 #include <utility/vector0.hh>
34 #include <utility/vector1.hh>
35 #include <ObjexxFCL/FArray1.hh>
38 using namespace ObjexxFCL;
39 static numeric::random::RandomGenerator
RG(62456);
45 RotamerAssigningAnnealer::RotamerAssigningAnnealer(
46 int num_rots_to_pack_in,
47 FArray1D_int & bestrotamer_at_seqpos,
49 bool start_with_current,
51 FArray1_int & current_rot_index,
53 FArray1D< core::PackerEnergy > & rot_freq
57 bestrotamer_at_seqpos,
64 rotamer_sets_( rotamer_sets ),
65 rot_to_pack_( num_rots_to_pack_in ),
66 current_to_pick_( 1 ),
67 n_assigned_at_start_( 0 ),
68 assign_state_to_all_nodes_immediately_( false )
70 for (
unsigned int ii(1); ii <=
rot_to_pack_.size(); ++ii) {
79 int num_rots_to_pack_in,
80 FArray1D_int & bestrotamer_at_seqpos,
82 bool start_with_current,
84 FArray1_int & current_rot_index,
86 FArray1D< core::PackerEnergy > & rot_freq
90 bestrotamer_at_seqpos,
97 rotamer_sets_( rotamer_sets ),
98 current_to_pick_( 1 ),
99 n_assigned_at_start_( 0 ),
100 assign_state_to_all_nodes_immediately_( false )
127 int const nmoltres = rotamer_sets->nmoltenres();
131 ++npickable_rots_for_node[ rotamer_sets->moltenres_for_rotamer(
rot_to_pack_[ ii ] ) ];
133 for (
int ii = 1; ii <= nmoltres; ++ii ) {
137 if ( npickable_rots_for_node[ ii ] == 0 ) {
138 std::cerr <<
"ERROR: No pickable rotamers for molten residue " << ii <<
" ( seqpos= " <<
139 rotamer_sets->moltenres_2_resid( ii ) <<
" ) found in rots_to_pack_." << std::endl;
140 std::cerr <<
"ERROR: Each molten residue must have at least one pickable rotamer." << std::endl;
141 std::cerr <<
"Provided rotamers: (rotid, moltenresid, moltenres_rotid ) " << std::endl;
143 std::cerr <<
"( " << jj <<
", "
144 << rotamer_sets->moltenres_for_rotamer(
rot_to_pack_[ ii ] ) <<
", "
145 << rotamer_sets->rotid_on_moltenresidue(
rot_to_pack_[ ii ] ) <<
") ";
146 if ( jj % 4 == 3 ) std::cerr <<
"\n";
148 std::cerr <<
"\n Exiting." << std::endl;
188 std::cout <<
"RotamerAssigningAnnealer: recovering current rotamers for start." << std::endl;
193 std::cout <<
"RotamerAssigningAnnealer: unable to recover current rotamer for moltenres: " <<
current_to_pick_ << std::endl;