41 #include <basic/options/option_macros.hh>
42 #include <basic/options/keys/in.OptionKeys.gen.hh>
43 #include <basic/options/keys/packing.OptionKeys.gen.hh>
51 #include <basic/Tracer.hh>
55 #include <numeric/random/random.hh>
58 #include <utility/file/file_sys_util.hh>
59 #include <utility/pointer/owning_ptr.hh>
60 #include <utility/tag/Tag.hh>
68 static basic::Tracer
tr(
"protocols.canonical_sampling.SidechainSidechainMetropolisHastingsMover" );
69 static numeric::random::RandomGenerator
RG(61257547);
72 namespace canonical_sampling {
75 using namespace scoring;
89 return "SidechainMetropolisHastings";
104 stride_( other.stride_ )
112 if (
tr.Trace.visible() ) {
114 <<
" deltaE= " << delta_energy
115 <<
" boltzman=" << boltz_factor
116 <<
" lpd= " << last_proposal_density_ratio << std::endl;
119 if ( probability < 1 &&
RG.uniform() >= probability ) {
134 ig->set_scorefunction( sfxn );
137 Real current_energy = sfxn(pose);
165 runtime_assert( ig );
167 ig->initialize( pose );
168 Real last_accepted_prop_density( 1.0 );
169 Real last_accepted_dE( 0.0 );
172 runtime_assert( move );
174 Size resid = move->suggest_residue_number( pose );
176 new_state = move->make_move( new_state );
179 Real delta_energy = ig->consider_substitution( resid, new_state );
180 if (
pass_metropolis( delta_energy, move->last_proposal_density_ratio() ) ) {
181 ig->commit_change( resid );
182 current_energy -= delta_energy;
183 current[ resid ] = new_state;
185 last_accepted_prop_density = move->last_proposal_density_ratio();
186 last_accepted_dE = delta_energy;
188 ig->reject_change( resid );
192 tempering()->temperature_move( current_energy );
193 move->observe_after_metropolis( *
this );
197 for(
Size res_i = 1; res_i <= current.size(); res_i++ ){
201 if ( std::abs( score-current_energy ) > 1 ) {
202 tr.Warning <<
"Energy mismatch!!! score=" << score <<
" ig->energy " << current_energy << std::endl;
206 job->add_string_real_pair(
"prop_density", move->last_proposal_density_ratio() );
207 job->add_string_real_pair(
"prop_density_accept", last_accepted_prop_density );
208 job->add_string_real_pair(
"move_dE", delta_energy );
209 job->add_string_real_pair(
"move_dE_accept", last_accepted_dE );
210 job->add_string_string_pair(
"move_type", move->type() );
215 if (
observers()[ i ]->requires_pose() && !model_count )
continue;
216 observers()[i]->observe_after_metropolis(*
this);
234 return "SidechainMetropolisHastingsMover";