25 #include <basic/Tracer.hh>
27 #include <numeric/random/random.hh>
31 #include <utility/vector1.hh>
33 #if defined(WIN32) || defined(__CYGWIN__)
37 static basic::Tracer
TR(
"protocols.ligand_docking.RigidSearchMover", basic::t_debug);
38 static numeric::random::RandomGenerator
mc_RG(32900);
41 namespace ligand_docking {
47 num_trials_(num_trials),
56 Mover::type(
"RigidSearch" );
63 jump_id_( that.jump_id_ ),
64 num_trials_( that.num_trials_ ),
65 scorefxn_( that.scorefxn_ ),
66 temperature_( that.temperature_ ),
67 rotate_deg_( that.rotate_deg_ ),
68 translate_Ang_( that.translate_Ang_ ),
69 rotate_rsd_( that.rotate_rsd_ ),
70 rotate_atom_( that.rotate_atom_ ),
71 recover_low_( that.recover_low_ )
83 clock_t start_time = clock();
88 Jump last_accepted_jump( best_jump_so_far );
90 Real last_accepted_score( best_score_so_far );
91 int num_accepts(0), num_improves(0);
92 int const report_interval = std::min( 50,
num_trials_ / 5 );
93 TR <<
"Starting score " << best_score_so_far << std::endl;
95 if( i % report_interval == 0 ) {
96 TR <<
"Cycle " << i <<
", " << num_accepts <<
" accepts, " << num_improves <<
" improves, score = " << (*scorefxn_)( pose ) << std::endl;
101 Vector dummy_up, rot_center;
107 curr_jump.set_rb_center( 1 , downstream_stub, rot_center );
111 Real const curr_score = (*scorefxn_)( pose );
112 Real const deltaE = last_accepted_score - curr_score;
116 if(
mc_RG.uniform() >= std::exp(boltz) ) {
124 last_accepted_score = curr_score;
125 if( last_accepted_score < best_score_so_far ) {
127 best_jump_so_far = last_accepted_jump;
128 best_score_so_far = last_accepted_score;
133 TR <<
"Best score " << best_score_so_far <<
", end score " << (*scorefxn_)( pose ) << std::endl;
134 clock_t end_time = clock();
135 TR <<
"Speed: " <<
num_trials_ / (double(end_time - start_time) / CLOCKS_PER_SEC) <<
" cycles per second" << std::endl;
140 return "RigidSearchMover";