19 #include <numeric/random/random.hh>
20 #include <utility/exit.hh>
22 static numeric::random::RandomGenerator
RG(8401368);
23 static basic::Tracer
TR(
"protocols.hybridization.WeightedFragmentSmoothTrialMover" );
26 namespace hybridization {
48 for (
Size i_frag_set = 1; i_frag_set<=
frag_libs_.size(); ++i_frag_set) {
50 for (
Size i_frame = 1; i_frame <=
frag_libs_[i_frag_set]->nr_frames(); ++i_frame) {
52 std::advance(frame_it, i_frame-1);
53 core::Size seqpos_start = (*frame_it)->start();
57 bool cross_anchor =
false;
58 for (
Size i_anchor = 1; i_anchor <=
anchor_reses_.size() && !cross_anchor; ++i_anchor) {
61 if (cross_anchor)
continue;
63 for (
Size seqpos = seqpos_start; seqpos <= seqpos_end; ++seqpos) {
64 if (seqpos < 1 || seqpos > residue_weights.size()) {
65 utility_exit_with_message(
"FATAL. Fragment library size doesn't match with the size of protein.");
67 frame_weights[i_frame] += residue_weights[seqpos];
78 bool success (
false );
80 while ( !success && ( nfail < 100 ) ) {
88 std::advance(frame_it, insert_pos-1);
94 goodfrag.reserve( 200 );
101 cost_->score( **frame_it, pose, scores );
103 for (
core::Size j = 1; j <= nr_frags; ++j ) {
110 if ( s < cost_->cutoff() ) {
111 goodfrag.push_back( j );
117 if ( goodfrag.size()< 1 ) {
118 if ( costmin > 12. ) {
124 frag_num = goodfrag[
static_cast< int >(
RG.uniform() * goodfrag.size() )+1 ];
126 frame_it->apply( frag_num, pose );
130 TR.Error <<
"couldn't find a fragment to insert!!" << std::endl;
136 return "WeightedFragmentSmoothTrialMover";