22 #include <basic/Tracer.hh>
29 #include <utility/string_util.hh>
33 #include <utility/exit.hh>
34 #include <utility/fixedsizearray1.hh>
35 #include <utility/pointer/owning_ptr.hh>
46 #include <numeric/geometry/hashing/SixDHasher.hh>
47 #include <numeric/random/random.hh>
57 #include <basic/options/keys/in.OptionKeys.gen.hh>
58 #include <basic/options/keys/out.OptionKeys.gen.hh>
59 #include <basic/options/keys/lh.OptionKeys.gen.hh>
60 #include <basic/options/keys/relax.OptionKeys.gen.hh>
65 #include <utility/vector1.hh>
66 #include <utility/excn/EXCN_Base.hh>
68 #include <basic/options/option.hh>
69 #include <basic/options/keys/lh.OptionKeys.gen.hh>
71 #include <utility/vector1.hh>
78 #if defined(WIN32) || defined(__CYGWIN__)
85 static basic::Tracer
TR(
"LocalHashRelaxProtocol");
86 static numeric::random::RandomGenerator
RG(7590021);
94 std::cout <<
"HERE!" << std::endl;
99 using namespace basic::options;
100 using namespace basic::options::OptionKeys;
101 using namespace core::scoring;
118 if( option[ in::file::native ].user() ){
147 static int casecount = 0;
149 std::vector< core::io::silent::SilentStructOP > lib_structs;
151 TR.Info <<
"Loophash apply function ! " << std::endl;
184 TR.Info <<
"FOUND (" << start_res <<
" to " << stop_res <<
"): "
185 << lib_structs.size() <<
" states in time: "
186 << endtime2 - starttime2 <<
" s " << std::endl;
190 }
while ( lib_structs.size() == 0 );
193 std::random_shuffle( lib_structs.begin(), lib_structs.end());
194 std::vector< core::io::silent::SilentStructOP > select_lib_structs;
195 for(
core::Size k=0;k< std::min(skim_size, lib_structs.size() ) ;k++){
196 select_lib_structs.push_back( lib_structs[k] );
201 for(
core::Size h = 0; h < select_lib_structs.size(); h++){
203 select_lib_structs[h]->fill_pose( rpose );
209 core::Real decoy_score = select_lib_structs[h]->get_energy(
"lh_censcore") + refrms * rms_factor;
211 select_lib_structs[h]->add_energy(
"refrms", refrms, 1.0 );
212 select_lib_structs[h]->add_energy(
"comb_score", decoy_score, 1.0 );
213 TR.Info <<
"refrms: " << refrms <<
" Energy: " << decoy_score << std::endl;
214 if( decoy_score < bestcenscore ){
215 bestcenscore = decoy_score;
219 TR.Info <<
"Best:" <<
" Energy: " << bestcenscore << std::endl;
223 relax->batch_apply( select_lib_structs );
226 TR.Info <<
"Batchrelax time: " << endtime - starttime <<
" for " << select_lib_structs.size() <<
" structures " << std::endl;
231 for(
core::Size h = 0; h < select_lib_structs.size(); h++){
232 TR.Info <<
"DOING: " << h <<
" / " << select_lib_structs.size() << std::endl;
235 select_lib_structs[h]->fill_pose( rpose );
239 TR.Info <<
"score: " << h <<
" " << score << std::endl;
241 select_lib_structs[h]->add_energy(
"lh_score_new", score );
243 if( score < bestscore ){
246 relax_winner = rpose;
252 std::cout <<
"SETTING Relax winner" << std::endl;