IMP logo
IMP Reference Guide  2.17.0
The Integrative Modeling Platform
MoveStatisticsScoreState.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/MoveStatisticsScoreState.h
3  * \brief Write geometry to a file during optimization
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPCORE_MOVE_STATISTICS_SCORE_STATE_H
9 #define IMPCORE_MOVE_STATISTICS_SCORE_STATE_H
10 
11 #include <IMP/core/core_config.h>
12 #include <IMP/ScoreState.h>
13 #include <IMP/internal/utility.h>
14 #include <IMP/algebra/Vector3D.h>
15 #include <IMP/io.h>
16 
17 IMPCORE_BEGIN_NAMESPACE
18 
19 //! Keep track of statistics about how particles move.
20 /** Keep track of average and maximum moves for a set
21  of particles during optimization.
22  */
23 class IMPCOREEXPORT MoveStatisticsScoreState : public ScoreState {
24  Particles ps_;
25  algebra::Vector3Ds last_;
26  double max_move_;
27  std::string max_mover_;
28  double max_average_;
29  double total_move_;
30  double total_movers_;
31  bool init_;
32 
33  public:
35  void show_statistics(std::ostream& out = std::cout) const;
36  void reset();
37  virtual void do_before_evaluate() override;
38  virtual void do_after_evaluate(DerivativeAccumulator* da) override;
39  virtual ModelObjectsTemp do_get_inputs() const override;
40  virtual ModelObjectsTemp do_get_outputs() const override;
42 };
43 
44 IMPCORE_END_NAMESPACE
45 
46 #endif /* IMPCORE_MOVE_STATISTICS_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
Write/read the state of the particles to/from a buffer in memory.
virtual void do_after_evaluate(DerivativeAccumulator *accpt)=0
Do any necessary updates after the model score is calculated.
ScoreStates maintain invariants in the Model.
Definition: ScoreState.h:54
Keep track of statistics about how particles move.
Shared score state.
virtual ModelObjectsTemp do_get_outputs() const =0
Simple 3D vector class.
virtual ModelObjectsTemp do_get_inputs() const =0
Class for adding derivatives from restraints to the model.