IMP logo
IMP Reference Guide  2.20.0
The Integrative Modeling Platform
DependencyScoreState.h
Go to the documentation of this file.
1 /**
2  * \file IMP/domino/DependencyScoreState.h
3  * \brief Add a dependency to the dependency graph.
4  *
5  * Copyright 2007-2022 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/container_base.h>
15 
16 IMPDOMINO_BEGIN_NAMESPACE
17 
18 //! Add a dependency to the dependency graph
19 /** This score state doesn't do anything other than add edges to the
20  dependency graph. This can be useful when involved filters are used
21  as they are not included in the dependency graph. This may go away
22  and be replaced by adding dependencies to the SubsetFilterTable.
23  */
24 class IMPDOMINOEXPORT DependencyScoreState : public ScoreState {
25  ParticlesTemp inputp_, outputp_;
26  ContainersTemp inputc_, outputc_;
27 
28  public:
30  void set_input_particles(const ParticlesTemp &pt) {
31  IMP_USAGE_CHECK(!get_model(),
32  "Must set dependencies before adding to model.");
33  inputp_ = pt;
34  }
35  void set_output_particles(const ParticlesTemp &pt) {
36  IMP_USAGE_CHECK(!get_model(),
37  "Must set dependencies before adding to model.");
38  outputp_ = pt;
39  }
40  void set_input_containers(const ContainersTemp &pt) {
41  IMP_USAGE_CHECK(!get_model(),
42  "Must set dependencies before adding to model.");
43  inputc_ = pt;
44  }
45  void set_output_containers(const ContainersTemp &pt) {
46  IMP_USAGE_CHECK(!get_model(),
47  "Must set dependencies before adding to model.");
48  outputc_ = pt;
49  }
50 
51  protected:
52  virtual void do_before_evaluate() override;
53  virtual void do_after_evaluate(DerivativeAccumulator *da) override;
54  virtual ModelObjectsTemp do_get_inputs() const override;
55  virtual ModelObjectsTemp do_get_outputs() const override;
57  ;
58 };
59 
60 IMPDOMINO_END_NAMESPACE
61 
62 #endif /* IMPDOMINO_DEPENDENCY_SCORE_STATE_H */
virtual void do_before_evaluate()=0
Update the state given the current state of the model.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
virtual void do_after_evaluate(DerivativeAccumulator *accpt)=0
Do any necessary updates after the model score is calculated.
Add a dependency to the dependency graph.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
ScoreStates maintain invariants in the Model.
Definition: ScoreState.h:56
Shared score state.
Abstract base class for containers of particles.
virtual ModelObjectsTemp do_get_outputs() const =0
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Definition: check_macros.h:168
virtual ModelObjectsTemp do_get_inputs() const =0
Class for adding derivatives from restraints to the model.