14 #ifndef INCLUDED_protocols_frag_picker_BoundedCollector_hh
15 #define INCLUDED_protocols_frag_picker_BoundedCollector_hh
34 #include <ObjexxFCL/format.hh>
38 #include <utility/vector1.hh>
41 namespace std { }
using namespace std;
47 namespace frag_picker {
54 template<
class StrictWeakOrdering >
55 class BoundedCollector:
public CandidatesCollector {
65 Size max_frags_per_pos,
66 StrictWeakOrdering fragment_comparator,
68 Size buffer_factor = 5
73 for(
Size i=1;i<=n_score_terms;i++)
74 worst_s->set_score_component(99999.9999,i);
76 for (
Size i = 1; i <= query_size; i++) {
79 fragment_comparator, max_frags_per_pos,max_frags_per_pos*buffer_factor);
80 queue.set_worst(
std::pair<FragmentCandidateOP,
81 scores::FragmentScoreMapOP>(worst_f,worst_s) );
82 storage_.push_back(queue);
89 return storage_[new_canditate.first->get_first_index_in_query()].push(
96 return storage_[seq_pos].size();
104 for(
Size i=1;i<=storage_.size();++i)
105 response += storage_[i].
size();
113 return storage_.size();
121 utility_exit_with_message(
"Cant' cast candidates' collector to BoundedCollector.");
124 for(
Size l=1;l<=content.size();l++) storage_.at(pos).push( content[l] );
129 return storage_.at(position_in_query).expose_data();
134 for (
Size i_pos = 1; i_pos <= storage_.size(); ++i_pos)
135 storage_[i_pos].clear();
140 using namespace ObjexxFCL::fmt;
142 <<
"\n pos count best worst | pos count best worst | pos count best worst |\n";
144 for (
Size i_pos = 1; i_pos <= storage_.size(); ++i_pos) {
146 if (storage_[i_pos].
size() <= 1) {
147 out << I(4, i_pos) <<
" 0 |";
149 out << I(4, i_pos) <<
" " << I(6, storage_[i_pos].
size())
151 out << F(8, 2, scoring->total_score(
152 storage_[i_pos].peek_front().second)) <<
" ";
153 out << F(8, 2, scoring->total_score(
154 storage_[i_pos].peek_back().second)) <<
" |";