13 #include <utility/string_util.hh>
15 #include <utility/tag/Tag.hh>
18 #include <basic/Tracer.hh>
20 #include <boost/foreach.hpp>
21 #define foreach BOOST_FOREACH
24 #include <utility/vector0.hh>
25 #include <utility/vector1.hh>
27 #include <ObjexxFCL/format.hh>
28 using ObjexxFCL::fmt::F;
32 namespace protein_interface_design{
35 static basic::Tracer
TR(
"protocols.protein_interface_design.filters.BoltzmannFilter" );
40 fitness_threshold_( 0.0 ),
41 triage_threshold_( -9999 ),
139 core::Real positive_sum( 0.0 ), negative_sum( 0.0 );
144 s += F(7,3,filter_val)+
" ";
145 positive_sum += exp( -filter_val /
temperature() );
152 core::Real filter_val = filter->report_sm( pose );
153 s += F(7,3,filter_val)+
" ";
155 negative_sum += exp( -filter_val /
temperature() );
156 negative_counter += 1;
157 TR<<
"Taken filter: "<<filter->get_user_defined_name()<<
" filter val: "<< filter_val<<std::endl;
160 TR << s << -positive_sum/(positive_sum+negative_sum) <<std::endl;
162 TR<<
"Negative counter: "<< negative_counter <<std::endl;
164 if( !negative_counter ){
165 TR<<
"Normalized fitness: 9999 "<<std::endl;
172 TR<<
"Fitness: " << ( -(
core::Real)positive_sum / ( positive_sum + negative_sum )) << std::endl;
173 return( -(
core::Real)positive_sum / ( positive_sum + negative_sum ));
194 TR <<
"BoltzmannFilter"<<std::endl;
195 runtime_assert( tag->hasOption(
"anchors" ) || tag->hasOption(
"negative_filters" ) );
199 norm_neg( tag->getOption<
bool >(
"norm_neg",
false ) );
202 negative_filter_names.clear(); anchors_string.clear();
203 if( tag->hasOption(
"negative_filters" ) )
204 negative_filter_names = utility::string_split( tag->getOption<
std::string >(
"negative_filters" ),
',' );
205 if( tag->hasOption(
"anchors" ) )
206 anchors_string = utility::string_split( tag->getOption<
std::string >(
"anchors"),
',' );
207 foreach(
std::string const positive_filter_name, positive_filter_names )
209 foreach(
std::string const negative_filter_name, negative_filter_names )
211 foreach(
std::string const anchor_str, anchors_string )
216 TR<<
"defined "<<
anchors().size()<<
" anchors"<<std::endl;