IMP  2.0.1
The Integrative Modeling Platform
DependencyScoreState.h
Go to the documentation of this file.
1 /**
2  * \file IMP/domino/DependencyScoreState.h
3  * \brief A beyesian infererence-based sampler.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPDOMINO_DEPENDENCY_SCORE_STATE_H
10 #define IMPDOMINO_DEPENDENCY_SCORE_STATE_H
11 
12 #include <IMP/domino/domino_config.h>
13 #include <IMP/ScoreState.h>
14 #include <IMP/score_state_macros.h>
15 
16 IMPDOMINO_BEGIN_NAMESPACE
17 
18 
19 
20 //! Add a dependency to the dependency graph
21 /** This score state doesn't do anything other than add edges to the
22  dependency graph. This can be useful when involved filters are used
23  as they are not included in the dependency graph. This may go away
24  and be replaced by adding dependencies to the SubsetFilterTable.
25  */
26 class IMPDOMINOEXPORT DependencyScoreState : public ScoreState
27 {
28  ParticlesTemp inputp_, outputp_;
29  ContainersTemp inputc_, outputc_;
30 public:
32  void set_input_particles(const ParticlesTemp &pt) {
33  IMP_USAGE_CHECK(!get_is_part_of_model(),
34  "Must set dependencies before adding to model.");
35  inputp_=pt;
36  }
37  void set_output_particles(const ParticlesTemp &pt) {
38  IMP_USAGE_CHECK(!get_is_part_of_model(),
39  "Must set dependencies before adding to model.");
40  outputp_=pt;
41  }
42  void set_input_containers(const ContainersTemp &pt) {
43  IMP_USAGE_CHECK(!get_is_part_of_model(),
44  "Must set dependencies before adding to model.");
45  inputc_=pt;
46  }
47  void set_output_containers(const ContainersTemp &pt) {
48  IMP_USAGE_CHECK(!get_is_part_of_model(),
49  "Must set dependencies before adding to model.");
50  outputc_=pt;
51  }
52  protected:
53  virtual void do_before_evaluate() IMP_OVERRIDE;
54  virtual void do_after_evaluate(DerivativeAccumulator *da)
55  IMP_OVERRIDE;
56  virtual ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
57  virtual ModelObjectsTemp do_get_outputs() const IMP_OVERRIDE;
59 };
60 
61 
62 IMPDOMINO_END_NAMESPACE
63 
64 #endif /* IMPDOMINO_DEPENDENCY_SCORE_STATE_H */