Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LoopRefineInnerCycle.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
6 // (c) under license. The Rosetta software is developed by the contributing
7 // (c) members of the Rosetta Commons. For more information, see
8 // (c) http://www.rosettacommons.org. Questions about this can be addressed to
9 // (c) University of Washington UW TechTransfer,email:license@u.washington.edu.
10 
11 /// @file protocols/loops/loop_mover/refine/LoopRefineInnerCycle.cc
12 /// @brief Abstract class to define interface for all types of "inner cycle" operations used for loop refinement.
13 /// @detailed
14 ///
15 /// @author Brian D. Weitzner ( brian.weitzner@gmail.com )
16 
17 // Unit headers
19 
20 // Package headers
21 // #include <protocols/loops/loop_mover/LoopMover.hh>
23 #include <protocols/loops/Loops.hh>
24 
25 // Project headers
28 #include <core/pose/Pose.hh>
31 
32 // Basic headers
33 #include <basic/options/keys/loops.OptionKeys.gen.hh>
34 #include <basic/options/option.hh>
35 #include <basic/Tracer.hh>
36 
37 // Utility headers
38 #include <utility/excn/Exceptions.hh>
39 #include <utility/vector1.hh>
40 
41 static basic::Tracer TR("protocols.loops.loop_mover.refine.LoopRefineInnerCycle");
42 using namespace core;
43 
44 namespace protocols {
45 namespace loops {
46 namespace loop_mover {
47 namespace refine {
48 
49 ///////////////////////////////////////////////////////////////////////////////////////////////////////
50 ////////////////////////////////////////////// BOILER PLATE CODE //////////////////////////////////////
51 ///////////////////////////////////////////////////////////////////////////////////////////////////////
52 
53 ///@brief default constructor
54 LoopRefineInnerCycle::LoopRefineInnerCycle() : Mover()
55 {
56  init();
57 }
58 
59 ///@brief copy constructor
61 {
63 }
64 
65 ///@brief assignment operator
67  //abort self-assignment
68  if ( this == &rhs ) return *this;
69  Mover::operator=( rhs );
71  return *this;
72 }
73 
74 //destructor
76 
77 /// @brief Each derived class must specify its name.
79 {
80  return type();
81 }
82 
83 ///@brief This mover retains state such that a fresh version is needed if the input Pose is about to change
85 {
86  return true;
87 }
88 
90 {
91  /// PUT THE LIST OF OPTIONS THAT ARE USED HERE ///
92 
93  /// RECURSIVELY CALL REGISTER OPTIONS ON ALL MOVERS THAT THIS CLASS HAS AN OWNING_PTR TO ///
94 }
95 ///////////////////////////////////////////////////////////////////////////////////////////////////////
96 /////////////////////////////////////// END OF BOILER PLATE CODE //////////////////////////////////////
97 ///////////////////////////////////////////////////////////////////////////////////////////////////////
98 
99 // constructor with arguments
101  LoopMover_Refine_CCDAP loop_mover,
105 ) : Mover()
106 {
107  init( loop_mover, mc, scorefxn, tf );
108 }
109 void LoopRefineInnerCycle::setup_objects( Pose const & /* pose */ )
110 {
111  TR << "Setting up data for " + get_name() + "." << std::endl;
112 
113  /// Perform some sanity checks to ensure the data integrity before moving forward
114  using utility::excn::EXCN_Msg_Exception;
115 
116  if (!scorefxn_) {
117  throw EXCN_Msg_Exception( "No ScoreFunction available in " + get_name() + "." );
118  }
119 
120  if (!tf_) {
121  throw EXCN_Msg_Exception( "No TaskFactory available in " + get_name() + "." );
122  }
123 
124  if (!mc_) {
125  throw EXCN_Msg_Exception( "No MonteCarlo instance available in " + get_name() + "." );
126  }
127 
129  throw EXCN_Msg_Exception( "No parent LoopMover available in " + get_name() + ". This is needed to provide information on the progress of the simulation." );
130  }
131 }
132 
134 {
135  init( NULL, NULL, NULL, NULL );
136 }
137 
139  LoopMover_Refine_CCDAP loop_mover,
143 ) {
145  mc_ = mc;
147  tf_ = tf;
148 
149  type( "LoopRefineInnerCycle" );
150  init_options();
151 }
152 
154  LoopRefineInnerCycle & lhs,
155  LoopRefineInnerCycle const & rhs
156 )
157 {
158  // copy all data members from rhs to lhs
159  lhs.debug_ = rhs.debug_;
161  lhs.mc_ = rhs.mc_;
162  lhs.scorefxn_ = rhs.scorefxn_;
163  lhs.tf_ = rhs.tf_;
164  lhs.movemap_ = rhs.movemap_;
165 }
166 
168 {
169  using namespace basic::options;
170 
171  // Set options here.
172  set_debug( option[ OptionKeys::loops::debug ].user() );
173 }
174 
176 {
177  return debug_;
178 }
179 
181 {
182  debug_ = debug;
183 }
184 
186 {
187  return mc_;
188 }
189 
191 {
192  mc_ = mc;
193 }
194 
196 {
197  return scorefxn_;
198 }
199 
201 {
203 }
204 
206 {
207  return tf_;
208 }
209 
211 {
212  tf_ = tf;
213 }
214 
216 {
217  // Lazily instantiate a movemap
218  if (! movemap_){ movemap_ = new kinematics::MoveMap; }
219  return movemap_;
220 }
221 
223 {
224  movemap_ = movemap;
225 }
226 
228 {
229  Loops::const_iterator it( loop_mover()->loops()->one_random_loop() );
230  Loops one_loop;
231  one_loop.add_loop( it );
232  return one_loop;
233 }
234 
236 {
238 }
239 
241 {
242  loop_mover_that_owns_me_ = new_owner_in_town;
243 }
244 
245 void
246 LoopRefineInnerCycle::show( std::ostream & out )
247 {
248  out << *this;
249 }
250 
251 std::ostream & operator<<(std::ostream& out, LoopRefineInnerCycle const & loop_refine_inner_cycle )
252 {
253  out << loop_refine_inner_cycle.get_name() << " is an abstract class. Only subclasses can be used." << std::endl;
254  return out;
255 }
256 
257 } // namespace refine
258 } // namespace loop_mover
259 } // namespace loops
260 } // namespace protocols