18 #include <ObjexxFCL/format.hh>
19 #include <ObjexxFCL/string.functions.hh>
22 #include <basic/Tracer.hh>
23 static basic::Tracer
tr(
"protocols.moves.TrialCounter");
29 using namespace ObjexxFCL::fmt;
35 trial_counter_.clear();
36 accept_counter_.clear();
37 energy_drop_counter_.clear();
44 for ( std::map< std::string, int >::const_iterator
45 it=trial_counter_.begin(); it != trial_counter_.end(); ++it ) {
46 ntrials += it->second;
57 if ( line_header.size() ) {
58 line_header=line_header+
" ";
60 for ( std::map< std::string, int >::const_iterator
61 it=trial_counter_.begin(); it != trial_counter_.end(); ++it ) {
63 int const ntrials( it->second );
64 if ( accept_counter_.count( tag )) {
65 int const accepts( accept_counter_.find( tag )->second );
66 core::Real const energy_drop( energy_drop_counter_.find( tag )->second );
67 os << line_header <<
A( 16, tag ) <<
68 " trials= " << I( 6, ntrials ) <<
"; " <<
69 " accepts= " << F( 6, 4,
core::Real( accepts )/ntrials ) <<
"; " <<
70 " energy_drop/trial= " << F( 9, 5,
core::Real( energy_drop ) / ntrials );
71 if ( endline ) os << std::endl;
73 os <<
A( 16, tag ) <<
" trials= " << I( 6, ntrials ) <<
" NO ACCEPTS.";
74 if ( endline ) os << std::endl;
80 return trial_counter_[ tag ];
84 return accept_counter_[ tag ];
88 return energy_drop_counter_[ tag ];
92 ++trial_counter_[ tag ];
96 ++accept_counter_[ tag ];
100 energy_drop_counter_[ tag ] += delta;