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
TrialCounterObserver.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/TrialCounterObserver.cc
11
/// @brief protocols::canonical_sampling::TrialCounterObserver methods implemented
12
/// @author
13
14
15
// Unit Headers
16
#include <
protocols/canonical_sampling/TrialCounterObserver.hh
>
17
#include <
protocols/canonical_sampling/TrialCounterObserverCreator.hh
>
18
19
#include <
protocols/canonical_sampling/MetropolisHastingsMover.hh
>
20
// Package Headers
21
22
// Project Headers
23
#include <
core/pose/Pose.hh
>
24
25
26
// Utility Headers
27
#include <basic/Tracer.hh>
28
#include <
core/types.hh
>
29
#include <utility/exit.hh>
30
#include <utility/tag/Tag.hh>
31
32
// C++ Headers
33
34
static
basic::Tracer
tr
(
"protocols.canonical_sampling.TrialCounter"
);
35
36
namespace
protocols {
37
namespace
canonical_sampling {
38
39
40
std::string
41
TrialCounterObserverCreator::keyname
()
const
{
42
return
TrialCounterObserverCreator::mover_name
();
43
}
44
45
protocols::moves::MoverOP
46
TrialCounterObserverCreator::create_mover
()
const
{
47
return
new
TrialCounterObserver
;
48
}
49
50
std::string
51
TrialCounterObserverCreator::mover_name
() {
52
return
"TrialCounterObserver"
;
53
}
54
55
56
///@brief
57
TrialCounterObserver::TrialCounterObserver
(
58
) :
ThermodynamicObserver
()
59
{
60
Mover::type(
"TrialCounterObserver"
);
61
}
62
63
TrialCounterObserver::~TrialCounterObserver
() {}
64
65
std::string
TrialCounterObserver::get_name
()
const
{
66
return
"TrialCounterObserver"
;
67
}
68
69
protocols::moves::MoverOP
70
TrialCounterObserver::clone
()
const
{
71
return
new
TrialCounterObserver
( *
this
);
72
}
73
74
75
76
void
77
TrialCounterObserver::parse_my_tag
(
78
utility::tag::TagPtr
const
tag,
79
protocols::moves::DataMap
&,
80
protocols::filters::Filters_map
const
&,
81
protocols::moves::Movers_map
const
&,
82
core::pose::Pose
const
&
83
) {
//no options ...
84
file_
= tag->getOption<
std::string
>(
"file"
,
"trial.stats"
);
85
}
86
87
88
void
89
TrialCounterObserver::initialize_simulation
(
90
core::pose::Pose
&
/*pose*/
,
91
MetropolisHastingsMover
const
& mhm,
/*metropolis_hastings_mover*/
92
core::Size
//default=0; non-zero if trajectory is restarted
93
)
94
{
95
counters_
.
set_temperature_observer
( mhm.
tempering
() );
96
counters_
.
reset
();
97
}
98
99
/// @brief callback executed after the Metropolis criterion is evaluated
100
void
101
TrialCounterObserver::observe_after_metropolis
(
102
MetropolisHastingsMover
const
& metropolis_hastings_mover
103
) {
104
std::string
const
& move_type( metropolis_hastings_mover.
last_move
().
type
() );
105
counters_
.
count_trial
( move_type );
106
if
( metropolis_hastings_mover.
last_accepted
() ) {
107
counters_
.
count_accepted
( move_type );
108
}
109
}
110
111
void
112
TrialCounterObserver::finalize_simulation
(
113
core::pose::Pose
&
/*pose*/
,
114
MetropolisHastingsMover
const
&mhm
/*metropolis_hastings_mover*/
115
)
116
{
117
counters_
.
show
(
tr
.Info );
118
counters_
.
write_to_file
(
file_
, mhm.
output_name
() );
119
}
120
121
}
//moves
122
}
//protocols
123
Generated on Sat Jun 1 2013 11:44:57 for Rosetta 3.5 by
1.8.4