IMP  2.3.0
The Integrative Modeling Platform
IMP::kernel::ConfigurationSet Class Reference

A class to store a set of configurations of a model. More...

#include <IMP/kernel/ConfigurationSet.h>

+ Inheritance diagram for IMP::kernel::ConfigurationSet:

Detailed Description

A class to store a set of configurations of a model.

The class maintains a set of structures found by a Sampler protocol and allows them to be queried and loaded and saved.

1 ## \example kernel/basic_optimization.py
2 # This illustrates a basic main loop for optimization and searching for the best
3 # scoring conformation.
4 #
5 
6 import IMP.example
7 import IMP.statistics
8 
9 (m, c) = IMP.example.create_model_and_particles()
12 m.add_restraint(r)
13 # we don't want to see lots of log messages about restraint evaluation
14 m.set_log_level(IMP.WARNING)
15 
16 # the container (c) stores a list of particles, which are alse XYZR particles
17 # we can construct a list of all the decorated particles
18 xyzrs = c.get_particles()
19 
21 s.set_number_of_attempts(10)
22 # but we do want something to watch
23 s.set_log_level(IMP.base.TERSE)
24 s.set_number_of_monte_carlo_steps(10)
25 # find some configurations which move the particles far apart
26 configs = s.create_sample()
27 for i in range(0, configs.get_number_of_configurations()):
28  configs.load_configuration(i)
29  # print out the sphere containing the point set
30  # - Why? - Why not?
31  sphere = IMP.core.get_enclosing_sphere(xyzrs)
32  print sphere
33 
34 # cluster the solutions based on their coordinates
36 
37 # of course, this doesn't return anything of interest since the points are
38 # randomly distributed, but, again, why not?
39 clustering = IMP.statistics.create_lloyds_kmeans(e, 3, 1000)
40 for i in range(0, clustering.get_number_of_clusters()):
41  # load the configuration for a central point
42  configs.load_configuration(clustering.get_cluster_representative(i))
43  sphere = IMP.core.get_enclosing_sphere(xyzrs)
44  print sphere

Definition at line 28 of file kernel/ConfigurationSet.h.

Public Member Functions

 ConfigurationSet (kernel::Model *m, std::string name="ConfigurationSet %1%")
 
Modelget_model () const
 
unsigned int get_number_of_configurations () const
 
virtual std::string get_type_name () const
 
virtual ::IMP::base::VersionInfo get_version_info () const
 Get information about the module and version of the object. More...
 
void load_configuration (int i) const
 Load the ith configuration into the Model. More...
 
void remove_configuration (unsigned int i)
 
void save_configuration ()
 Save the current configuration of the Model. More...
 
- Public Member Functions inherited from IMP::base::Object
virtual void clear_caches ()
 
CheckLevel get_check_level () const
 
LogLevel get_log_level () const
 
void set_check_level (CheckLevel l)
 
void set_log_level (LogLevel l)
 Set the logging level used in this object. More...
 
void set_was_used (bool tf) const
 
void show (std::ostream &out=std::cout) const
 
const std::string & get_name () const
 
void set_name (std::string name)
 

Additional Inherited Members

- Protected Member Functions inherited from IMP::base::Object
 Object (std::string name)
 Construct an object with the given name. More...
 
virtual void do_destroy ()
 

Member Function Documentation

virtual ::IMP::base::VersionInfo IMP::kernel::ConfigurationSet::get_version_info ( ) const
virtual

Get information about the module and version of the object.

Reimplemented from IMP::base::Object.

Definition at line 43 of file kernel/ConfigurationSet.h.

void IMP::kernel::ConfigurationSet::load_configuration ( int  i) const

Load the ith configuration into the Model.

Passing -1 returns it to the base configuration.

void IMP::kernel::ConfigurationSet::save_configuration ( )

Save the current configuration of the Model.


The documentation for this class was generated from the following file: