Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MonteCarloTest.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 src/protocols/simple_moves/MonteCarloTest.cc
11 /// @author Sarel Fleishman (sarelf@uw.edu)
12 
13 
14 // Unit Headers
18 
19 // Package Headers
20 
21 // Project Headers
22 #include <core/pose/Pose.hh>
23 #include <basic/Tracer.hh>
24 // AUTO-REMOVED #include <protocols/filters/Filter.hh>
25 #include <protocols/moves/Mover.hh>
26 
27 // Parser headers
29 #include <utility/tag/Tag.hh>
30 
31 #include <utility/vector0.hh>
32 #include <utility/excn/Exceptions.hh>
33 #include <utility/vector1.hh>
34 
35 
36 // Utility headers
37 
38 //// C++ headers
39 
40 static basic::Tracer TR("protocols.simple_moves.MonteCarloTest");
41 
42 using namespace core;
43 
44 namespace protocols {
45 namespace simple_moves {
46 
48 MonteCarloTestCreator::keyname() const
49 {
50  return MonteCarloTestCreator::mover_name();
51 }
52 
54 MonteCarloTestCreator::create_mover() const {
55  return new MonteCarloTest;
56 }
57 
59 MonteCarloTestCreator::mover_name()
60 {
61  return "MonteCarloTest";
62 }
63 
65 MonteCarloTest::get_name() const {
66  return MonteCarloTestCreator::mover_name();
67 }
68 
69 
70 /// @brief default constructor
71 MonteCarloTest::MonteCarloTest():
72  Mover("MonteCarloTest"),
73  MC_mover_( NULL )
74 {
75 }
76 
77 /// @brief destructor
79 
80 /// @brief clone this object
81 MoverOP
83 {
84  return new MonteCarloTest( *this );
85 }
86 
87 /// @brief create this type of object
88 MoverOP
90 {
91  return new MonteCarloTest();
92 }
93 
96  return( MC_mover_ );
97 }
98 
99 void
101  MC_mover_ = mc;
102 }
103 
104 void
105 MonteCarloTest::parse_my_tag( TagPtr const tag, DataMap &, Filters_map const &, Movers_map const &movers, Pose const & pose ){
106  std::string const mc_name( tag->getOption< std::string >( "MC_name" ) );
107  Movers_map::const_iterator find_mover( movers.find( mc_name ) );
108  if( find_mover == movers.end() )
109  throw utility::excn::EXCN_RosettaScriptsOption( "MC mover not found by MonteCarloTest" );
110 
111  set_MC( dynamic_cast< GenericMonteCarloMover * >( find_mover->second() ) );
112  Pose temp_pose( pose );
113  get_MC()->initialize();
114  get_MC()->reset( temp_pose );
115  TR<<"Setting MonteCarlo container with mover "<<mc_name<<std::endl;
116 }
117 
118 void
120  bool const accept( MC_mover_->boltzmann( pose ) );
121  TR<<"MC mover accept="<<accept<<std::endl;
122 }
123 
124 } // ns simple_moves
125 } // ns protocols