22 #include <basic/Tracer.hh>
23 #include <ObjexxFCL/format.hh>
26 #include <utility/pointer/ReferenceCount.hh>
30 #include <utility/exit.hh>
31 #include <utility/vector1.hh>
34 namespace multistate_design {
36 static basic::Tracer
TR(
"protocols.multistate_design.PartitionAggregateFunction");
42 compare_all_to_ground_state_( false )
48 bool const compare_to_ground_state
52 anchor_offset_(anchor_offset),
53 compare_all_to_ground_state_( compare_to_ground_state )
73 using namespace ObjexxFCL::fmt;
76 runtime_assert(single_state_fitnesses.size() == single_states.size());
88 for (
core::Size i = 1; i <= single_state_fitnesses.size(); ++i) {
91 TR(basic::t_trace) <<
"State fitness " << F(8,2,single_state_fitnesses[i]);
92 TR(basic::t_trace) <<
"State ground-state offset " << F(8,2,ground_state_offset);
93 core::Real const exp_term( std::exp( ( single_state_fitnesses[i] - ground_state_offset - normalize ) * inv_temp ) );
94 TR(basic::t_trace) <<
" exp. term " << F(6,2,exp_term);
96 if ( single_states[i]->is_positive_state() ) {
97 TR(basic::t_trace) <<
" (POSITIVE STATE)";
110 core::Real const anchor_term( std::exp( ( single_states[i]->best_score() - ground_state_offset +
anchor_offset_ - normalize ) * inv_temp ) );
111 TR(basic::t_trace) <<
" anchor exp. term " << F(6,2,anchor_term);
112 denom += anchor_term;
114 TR(basic::t_trace) << std::endl;
116 TR(basic::t_trace) <<
"numer " << F(5,2,numer) <<
" / denom " << F(5,2,denom) << std::endl;
119 TR(basic::t_debug) <<
"Boltzmann prob. for target state(s) vs. competitor(s): "
120 << ObjexxFCL::fmt::F(5,2,prob_target) << std::endl;
122 return -1.*prob_target;