8 #ifndef IMPKERNEL_OPTIMIZER_H
9 #define IMPKERNEL_OPTIMIZER_H
11 #include <IMP/kernel_config.h>
24 IMPKERNEL_BEGIN_NAMESPACE
49 bool stop_on_good_score_;
56 void set_is_optimizing_states(
bool tf)
const;
60 return get_optimizer_state_inputs();
81 double optimize(
unsigned int max_steps);
86 bool get_stop_on_good_score()
const {
return stop_on_good_score_; }
88 double get_last_score()
const {
return scoring_function_->get_last_score(); }
94 if (scoring_function_) {
95 return scoring_function_;
98 "Use Optimizer::set_scoring_function() to set one.",
112 set_optimizer_state_optimizer(obj,
this);
114 { Optimizer::set_optimizer_state_optimizer(obj,
nullptr); });
118 virtual void set_scoring_function(ScoringFunctionAdaptor sf);
125 virtual double do_optimize(
unsigned int ns) = 0;
129 void update_states()
const;
134 IMPKERNEL_END_NAMESPACE
Storage of a model, its restraints, constraints and particles.
A smart pointer to a reference counted object.
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Class for storing model, its restraints, constraints, and particles.
Base class for objects in a Model that depend on other objects.
Base class for all optimizers.
virtual ModelObjectsTemp do_get_outputs() const override
don't return anything here to avoid pointless dependencies
A class for storing lists of IMP items.
For backwards compatibility.
Base class for objects in a Model that depend on other objects.
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
#define IMP_THROW(message, exception_name)
Throw an exception with a message.
A nullptr-initialized pointer to an IMP Object.
Represents a scoring function on the model.
A shared base class to help in debugging and things.
Shared optimizer state that is invoked upon commitment of new coordinates.
#define IMP_REF_COUNTED_NONTRIVIAL_DESTRUCTOR(Name)
virtual ModelObjectsTemp do_get_inputs() const override
void set_stop_on_good_score(bool tf)
double get_last_score() const
Return the score found in the last evaluate.
An exception for an invalid value being passed to IMP.
ScoringFunction * get_scoring_function() const
Return the scoring function that is being used.