10 #ifndef IMPMULTI_STATE_ENSEMBLE_GENERATOR_H
11 #define IMPMULTI_STATE_ENSEMBLE_GENERATOR_H
16 IMPMULTISTATE_BEGIN_NAMESPACE
19 typedef std::vector<MultiStateModel> Ensemble;
21 class IMPMULTISTATEEXPORT EnsembleGenerator {
23 EnsembleGenerator(
unsigned int population_size,
25 std::vector<MultiStateModelScore*>& scorers,
26 float min_weight_threshold);
28 void generate(
unsigned int multi_state_model_size);
34 void add_one_state(
const Ensemble& init_ensemble,
35 Ensemble& new_ensemble);
37 void rescore(Ensemble& ensemble,
38 Ensemble& rescored_ensemble,
39 std::vector<std::vector<IMP::saxs::WeightedFitParameters> >& rfps)
const;
41 void output(Ensemble& ensemble,
42 const std::vector<std::vector<IMP::saxs::WeightedFitParameters> >& fps)
const;
44 double get_score(
const MultiStateModel& e)
const {
46 for(
unsigned int i=0; i<scorers_.size(); i++) {
47 ret += scorers_[i]->get_score(e);
52 void get_state_probabilities(
const Ensemble& ensemble,
53 std::vector<double>& state_prob)
const;
55 void get_weights_average_and_std(
const Ensemble& ensemble,
56 const std::vector<IMP::saxs::WeightedFitParameters>& fps,
57 std::vector<double>& weights_average,
58 std::vector<double>& weights_variance)
const;
63 std::vector<MultiStateModelScore*> scorers_;
64 std::vector<Ensemble > ensembles_;
65 float min_weight_threshold_;
68 IMPMULTISTATE_END_NAMESPACE
base class for MultiStateModel