IMP  2.2.1
The Integrative Modeling Platform
kernel/Sampler.h
Go to the documentation of this file.
1 /**
2  * \file IMP/kernel/Sampler.h \brief Base class for all samplers.
3  *
4  * Copyright 2007-2014 IMP Inventors. All rights reserved.
5  *
6  */
7 
8 #ifndef IMPKERNEL_SAMPLER_H
9 #define IMPKERNEL_SAMPLER_H
10 
11 #include <IMP/kernel/kernel_config.h>
12 #include "Model.h"
13 #include <IMP/base/Pointer.h>
14 #include <IMP/base/Object.h>
15 #include "ConfigurationSet.h"
18 
19 IMPKERNEL_BEGIN_NAMESPACE
20 
21 //! Base class for all samplers.
22 /** A sampler takes a Model and searches for good configurations,
23  given the optimizeable parameters and the scoring function in
24  the Model and extra information that can be provided. Typically,
25  the current configuration of the model is ignore.
26 
27  Typically a sampler works by using one or more Optimizer
28  types to search for configurations which minimize the scoring
29  function.
30 */
31 class IMPKERNELEXPORT Sampler : public IMP::base::Object {
34 
35  public:
36  Sampler(kernel::Model *m, std::string name = "Sampler %1%");
37  ConfigurationSet *create_sample() const;
38 
39  ScoringFunction *get_scoring_function() const { return sf_; }
40  void set_scoring_function(ScoringFunctionAdaptor sf);
41 
42  Model *get_model() const { return model_; }
43 
44  protected:
45  virtual ConfigurationSet *do_sample() const = 0;
46 
47  // for the vtable
49  //! Subclasses should override this method
50 };
51 
53 
54 IMPKERNEL_END_NAMESPACE
55 
56 #endif /* IMPKERNEL_SAMPLER_H */
A class to store a set of configurations of a model.
A nullptr-initialized pointer to an IMP Object.
A smart pointer to a ref-counted Object that is a class memeber.
Definition: base/Pointer.h:147
Store a set of configurations of the model.
Control display of deprecation information.
Various general useful macros for IMP.
#define IMP_REF_COUNTED_NONTRIVIAL_DESTRUCTOR(Name)
Storage of a model, its restraints, constraints and particles.
Common base class for heavy weight IMP objects.
Definition: base/Object.h:106
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
IMP::kernel::Sampler Sampler
Base class for all samplers.
A shared base class to help in debugging and things.
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:72