IMP logo
IMP Reference Guide  2.14.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-2020 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() IMP_OVERRIDE;
38  virtual void do_after_evaluate(DerivativeAccumulator* da) IMP_OVERRIDE;
39  virtual ModelObjectsTemp do_get_inputs() const;
40  virtual ModelObjectsTemp do_get_outputs() const;
42 };
43 
44 IMPCORE_END_NAMESPACE
45 
46 #endif /* IMPCORE_MOVE_STATISTICS_SCORE_STATE_H */
#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.
ScoreStates maintain invariants in the Model.
Definition: ScoreState.h:53
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
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for adding derivatives from restraints to the model.