Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
util.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file
11 /// @brief
12 /// @author
13 
14 
18 
19 #include <basic/options/option.hh>
20 #include <basic/options/keys/mc.OptionKeys.gen.hh>
21 
22 #include <utility/basic_sys_util.hh>
23 #include <utility/io/izstream.hh>
26 
27 #include <utility/vector1.hh>
28 
29 
30 
31 namespace protocols {
32 namespace canonical_sampling {
33 namespace mc_convergence_checks {
34 
35 using namespace core;
36 using namespace basic::options;
38 
39  if ( option[ OptionKeys::mc::known_structures ].user() ) {
40  /* this block is to take care of a
41  particular problem with the archive... the file can be gone for short-whiles (during IO of Archive-process ) */
42  Size trial( 100 );
43  utility::io::izstream testin;
44  do {
45  utility::sys_sleep( 1 );
46  testin.open( option[ OptionKeys::mc::known_structures ]() );
47  } while ( !testin.good() && trial-- > 0 );
48  // if ( trial == 0 ) throw EXCN_BadInput( "can't open "+option[ OptionKeys::mc::known_structures ]() );
49  /* okay file is now good, or will never be... */
50  Pool_RMSD_OP pool_ptr = new Pool_RMSD(
51  option[ OptionKeys::mc::known_structures ]()
52  );
53 
54  if ( option[ OptionKeys::mc::excluded_residues_from_rmsd ].user() ) {
55  pool_ptr->set_excluded_residues( option[ OptionKeys::mc::excluded_residues_from_rmsd ]() );
56  }
57 
58  mc.push_back( new Pool_ConvergenceCheck( pool_ptr, option[ OptionKeys::mc::max_rmsd_against_known_structures ]() ));
59  protocols::jd2::JobDistributor::get_instance()->job_outputter()->add_evaluation( new Pool_Evaluator( pool_ptr ) );
60 
61  }
62 
63  /* other convergence checker */
64  if ( option[ basic::options::OptionKeys::mc::heat_convergence_check ].user() ) {
65  mc.push_back( new Heat_ConvergenceCheck() );
66  mc.set_heat_after_cycles( option[ basic::options::OptionKeys::mc::heat_convergence_check ] );
67  }
68 
69  /* add more checkers here ... */
70 }
71 
72 }
73 }
74 }