00001
00002
00003
00004
00005
00006
00007
00008 #ifndef IMPDOMINO_JNODE_H
00009 #define IMPDOMINO_JNODE_H
00010
00011 #include "domino_config.h"
00012 #include "DiscreteSampler.h"
00013 #include "CombState.h"
00014 #include <IMP/base_types.h>
00015 #include "RestraintEvaluatorI.h"
00016 #include <vector>
00017 #include <sstream>
00018 #include <algorithm>
00019
00020 IMPDOMINO_BEGIN_NAMESPACE
00021
00022
00023
00024
00025
00026 class IMPDOMINOEXPORT JNode
00027 {
00028 public:
00029
00030
00031
00032
00033 JNode(const Particles &p, int node_ind);
00034 ~JNode() {
00035
00036 }
00037 void set_restraint_evaluator(RestraintEvaluatorI *rstr_eval) {
00038 rstr_eval_=rstr_eval;
00039 }
00040
00041
00042
00043 void init_sampling(DiscreteSampler &ds);
00044
00045
00046
00047
00048
00049 void get_intersection(const JNode &other, Particles &in) const;
00050 void get_intersection2(const JNode &other, Particles in) const {}
00051
00052
00053
00054
00055
00056 bool is_part(const Particles &p) const;
00057
00058
00059
00060
00061
00062 void populate_states_of_particles(Particles *particles,
00063 Combinations *states);
00064
00065
00066
00067
00068
00069
00070 void realize(Restraint *r, Particles *ps, Float weight);
00071
00072
00073
00074
00075
00076
00077 std::vector<CombState *> * find_minimum(bool move_to_state = false,
00078 unsigned int num_of_solutions=1);
00079
00080 CombState* get_state(unsigned int index, bool move_to_state = false);
00081
00082 void show(std::ostream& out = std::cout) const;
00083 void show_sampling_space(std::ostream& out = std::cout) const;
00084 unsigned int get_node_index() const {
00085 return node_ind_;
00086 }
00087 const Particles *get_particles() const {
00088 return &particles_;
00089 }
00090
00091
00092
00093
00094
00095
00096
00097 std::vector<CombState *> min_marginalize(const CombState &s,
00098 bool move_to_state = false);
00099
00100
00101
00102
00103
00104
00105 void update_potentials(
00106 const std::map<std::string, float> &old_score_separators,
00107 const std::map<std::string, float> &new_score_separators,
00108 const Particles &intersection_particles);
00109 const DiscreteSampler* get_sampler() {
00110 return ds_;
00111 }
00112
00113 void move2state(CombState *cs);
00114 void clear();
00115
00116
00117 Float get_score(const CombState &comb);
00118
00119 protected:
00120
00121 Particles particles_;
00122 unsigned int node_ind_;
00123 Combinations comb_states_;
00124 std::vector<std::string> comb_states_keys_;
00125 DiscreteSampler *ds_;
00126 RestraintEvaluatorI *rstr_eval_;
00127 };
00128
00129
00130 IMPDOMINO_END_NAMESPACE
00131
00132 #endif