Rosetta 3.5
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
protocols
canonical_sampling
TemperatureController.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 protocols/canonical_sampling/TemperatureControllerMover.cc
11
/// @brief TemperatureController methods implemented
12
/// @author
13
14
15
// Unit Headers
16
#include <
protocols/canonical_sampling/TemperatureController.hh
>
17
18
19
// protocols headers
20
#include <
protocols/moves/DataMap.hh
>
21
#include <
protocols/moves/MonteCarlo.hh
>
22
#include <
protocols/moves/Mover.hh
>
23
#include <
protocols/moves/MoverFactory.hh
>
24
#include <
protocols/canonical_sampling/ThermodynamicObserver.hh
>
25
#include <
protocols/canonical_sampling/MetropolisHastingsMover.hh
>
26
27
#include <
protocols/rosetta_scripts/util.hh
>
28
29
//#include <protocols/jd2/JobDistributor.hh>
30
#include <
protocols/jd2/util.hh
>
31
#include <
protocols/jd2/Job.hh
>
32
33
// core headers
34
#include <basic/options/option_macros.hh>
35
#include <basic/options/keys/in.OptionKeys.gen.hh>
36
#include <basic/options/keys/packing.OptionKeys.gen.hh>
37
38
#include <basic/Tracer.hh>
39
40
#include <
core/pack/task/TaskFactory.hh
>
41
#include <
core/pack/task/operation/TaskOperations.hh
>
42
43
#include <
core/scoring/ScoreFunction.hh
>
44
#include <
core/types.hh
>
45
46
// numeric headers
47
#include <numeric/random/random.hh>
48
49
// utility headers
50
#include <utility/file/file_sys_util.hh>
51
#include <utility/pointer/owning_ptr.hh>
52
#include <utility/tag/Tag.hh>
53
#include <utility/io/ozstream.hh>
54
#include <utility/io/izstream.hh>
55
56
// C++ Headers
57
#include <cmath>
58
59
static
basic::Tracer
tr
(
"protocols.canonical_sampling.TemperatureController"
);
60
61
namespace
protocols {
62
namespace
canonical_sampling {
63
using namespace
core;
64
65
66
std::string
67
interpolation_type_enum_to_string
(
InterpolationType
interp_enum ) {
68
69
return
interp_enum ==
linear
?
"linear"
:
"exponential"
;
70
}
71
72
InterpolationType
73
interpolation_type_string_to_enum
(
std::string
const
& interp_string ) {
74
75
if
(interp_string ==
"linear"
) {
76
return
linear
;
77
}
else
if
(interp_string !=
"exponential"
) {
78
utility_exit_with_message(
"invalid temp_interpolation value, expecting linear or exponential"
);
79
}
80
return
exponential
;
81
}
82
83
TemperatureController::TemperatureController
() :
84
protocols::canonical_sampling::
ThermodynamicObserver
()
85
{}
86
87
TemperatureController::TemperatureController
(
TemperatureController
const
& other ) :
88
//utility::pointer::ReferenceCount(),
89
protocols::canonical_sampling::
ThermodynamicObserver
(other)
90
{}
91
92
///@brief make a move in temperature space depending on the current score
93
void
94
TemperatureController::observe_after_metropolis
(
protocols::canonical_sampling::MetropolisHastingsMover
const
& ) {
95
Real
const
score(
monte_carlo_
->last_accepted_score() );
96
temperature_move
( score );
97
}
98
99
protocols::moves::MonteCarloCOP
100
TemperatureController::monte_carlo
()
const
{
101
return
monte_carlo_
;
102
}
103
104
void
105
TemperatureController::set_monte_carlo
(
106
protocols::moves::MonteCarloOP
monte_carlo
107
)
108
{
109
monte_carlo_
=
monte_carlo
;
110
}
111
112
protocols::moves::MonteCarloOP
113
TemperatureController::monte_carlo
() {
114
return
monte_carlo_
;
115
}
116
117
/// @brief execute the temperatur move ( called by observer_after_metropolis )
118
/// returns the current temperatur in kT.
119
core::Real
120
TemperatureController::temperature_move
(
core::pose::Pose
&,
core::Real
score) {
121
return
temperature_move
( score );
122
}
123
124
std::string
125
TemperatureController::get_name
()
const
126
{
127
return
"TemperatureController"
;
128
}
129
130
131
void
132
TemperatureController::initialize_simulation
(
133
core::pose::Pose
&,
134
protocols::canonical_sampling::MetropolisHastingsMover
const
&,
135
core::Size
level,
136
core::Real
,
137
core::Size
138
) {
139
if
( level != 1 ) {
140
utility_exit_with_message(
"TemperatureController - Baseclass doesn't know about different temp-levels"
);
141
};
142
}
143
144
145
}
//moves
146
}
//protocols
147
Generated on Sat Jun 1 2013 11:44:48 for Rosetta 3.5 by
1.8.4