Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RepackTrial.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
20 
21 // Package headers
22 //#include <protocols/loops/loops_main.hh>
25 #include <protocols/loops/Loop.hh>
26 #include <protocols/loops/Loops.hh>
27 
28 // Project headers
34 
35 // Basic headers
36 #include <basic/Tracer.hh>
37 
38 // Utility headers
39 #include <utility/excn/Exceptions.hh>
40 
41 // ObjexxFCL headers
42 #include <ObjexxFCL/format.hh>
43 
44 // C++ headers
45 #include <fstream>
46 
47 static basic::Tracer TR("protocols.loops.loop_mover.refine.RepackTrial");
48 using namespace core;
49 
50 namespace protocols {
51 namespace loops {
52 namespace loop_mover {
53 namespace refine {
54 
55 ///////////////////////////////////////////////////////////////////////////////////////////////////////
56 ////////////////////////////////////////////// BOILER PLATE CODE //////////////////////////////////////
57 ///////////////////////////////////////////////////////////////////////////////////////////////////////
58 
59 ///@brief default constructor
60 RepackTrial::RepackTrial() : LoopRefineInnerCycle()
61 {
62  init();
63 }
64 
65 ///@brief copy constructor
67 {
69 }
70 
71 ///@brief assignment operator
73  //abort self-assignment
74  if ( this == &rhs ) return *this;
77  return *this;
78 }
79 
80 //destructor
82 
83 /// @brief Each derived class must specify its name.
85 {
86  return type();
87 }
88 
89 //@brief clone operator, calls the copy constructor
92 {
93  return new RepackTrial( *this );
94 }
95 
96 ///@brief fresh_instance returns a default-constructed object for JD2
99 {
100  return new RepackTrial();
101 }
102 
103 ///@brief This mover retains state such that a fresh version is needed if the input Pose is about to change
105 {
106  return true;
107 }
108 
110 {
111  /// PUT THE LIST OF OPTIONS THAT ARE USED HERE ///
112 
113  /// RECURSIVELY CALL REGISTER OPTIONS ON ALL MOVERS THAT THIS CLASS HAS AN OWNING_PTR TO ///
114 }
115 ///////////////////////////////////////////////////////////////////////////////////////////////////////
116 /////////////////////////////////////// END OF BOILER PLATE CODE //////////////////////////////////////
117 ///////////////////////////////////////////////////////////////////////////////////////////////////////
118 
119 // constructor with arguments
121  LoopMover_Refine_CCDAP loop_mover,
125 ) : LoopRefineInnerCycle( loop_mover, mc, scorefxn, tf )
126 {
127  init();
128 }
129 
130 void RepackTrial::apply( Pose & pose )
131 {
132  // TR << "Beginning apply function of " + get_name() + "." << std::endl;
133 
134  setup_objects( pose );
135 
136  // show( TR );
137 
138  //main_repack_trial
139  if ( (loop_mover()->current_cycle_number() % loop_mover()->repack_period() ) == 0 ||
140  loop_mover()->current_cycle_number() == loop_mover()->inner_cycles() )
141  {
142  // repack trial
143  pack::task::PackerTaskOP task = task_factory()->create_task_and_apply_taskoperations( pose );
144  task->set_bump_check( true );
145 
146  core::pack::pack_rotamers( pose, *scorefxn(), task );
147  std::string move_type = "repack";
148  mc()->boltzmann( pose, move_type );
149  mc()->show_scores();
150  }
151 }
152 
153 
154 void RepackTrial::setup_objects( Pose const & pose )
155 {
156  // TR << "Setting up data for " + get_name() + "." << std::endl;
157 
159 }
160 
162 {
163  type( "RepackTrial" );
164  init_options();
165 }
166 
168  RepackTrial & /* lhs */,
169  RepackTrial const & /* rhs */
170 )
171 {
172  // copy all data members from rhs to lhs
173 }
174 
176 {
177  /* UNCOMMENT WHEN THERE ARE ACTUALLY OPTIONS TO PROCESS
178  using basic::options::option;
179  using namespace basic::options::OptionKeys;
180  */
181  // Set options here.
182 }
183 
184 void
185 RepackTrial::show( std::ostream & out )
186 {
187  out << *this;
188 }
189 
190 std::ostream & operator<<(std::ostream& out, RepackTrial const & repack_trial )
191 {
192  out << repack_trial.get_name() << " is an awesome class." << std::endl;
193  return out;
194 }
195 
197 
199  return new RepackTrial();
200 }
201 
203  return "RepackTrial";
204 }
205 
206 } // namespace refine
207 } // namespace loop_mover
208 } // namespace loops
209 } // namespace protocols