Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VarianceStatisticsArchive.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 // This file is part of the Rosetta software suite and is made available under license.
5 // The Rosetta software is developed by the contributing members of the Rosetta Commons consortium.
6 // (C) 199x-2009 Rosetta Commons participating institutions and developers.
7 // For more information, see http://www.rosettacommons.org/.
8 
9 /// @file IterativeAbrelax
10 /// @brief iterative protocol starting with abinitio and getting progressively more concerned with full-atom relaxed structures
11 /// @detailed
12 /// @author Oliver Lange
13 
14 // Unit Headers
16 
17 // Package Headers
19 
20 // Utility Headers
21 #include <basic/Tracer.hh>
22 #include <basic/MemTracer.hh>
23 #include <numeric/random/random.hh>
24 
25 
26 static basic::Tracer tr("protocols.iterative.VarianceStatistics");
27 using basic::mem_tr;
28 
29 static numeric::random::RandomGenerator RG(410142); // <- Magic number, do not change
30 
31 using core::Real;
32 
33 
34 namespace protocols {
35 namespace jd2 {
36 namespace archive {
37 
38 
40  : insertion_prob_( 0.1 )
41 {
42  set_name( name );
43 }
44 
45 
47  if ( decoys().size() < nstruct() ) {
48  tr.Debug << "added " << evaluated_decoy->decoy_tag() << " to " << name() << std::endl;
49  decoys().insert( decoys().begin(), evaluated_decoy );
51  return true;
52  }
53 
54  if ( RG.uniform() < insertion_prob_ ) { //keep or not ?
55  //replace with random element
56  Size rg_pos( static_cast< int >( RG.uniform() * decoys().size() ) );
57  runtime_assert( rg_pos < decoys().size() );
58  SilentStructs::iterator it=decoys().begin();
59  while ( rg_pos-- > 0 ) {
60  ++it;
61  }
62  runtime_assert( it != decoys().end() );
63  *it=evaluated_decoy;
65  return true;
66  }
67 
68  return false;
69 }
70 
71 }
72 } //abinitio
73 } //protocols