IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
excluded_volume.py
1## \example core/excluded_volume.py
2# Setup an excluded volume restraint between a bunch of particles with radius.
3#
4
5import IMP.container
6import sys
7
8IMP.setup_from_argv(sys.argv, "excluded volume")
9
10# Make 100 particles randomly distributed in a cubic box
11m = IMP.Model()
14 IMP.algebra.Vector3D(10,10,10))
15for i in range(100):
16 p = m.add_particle("p")
17 lsc.add(p)
20
21# this container lists all pairs that are close at the time of evaluation
25# use the lower bound on the inter-sphere distance to push the spheres apart
27
28# alternatively, one could just do
30
31# get the current score
33print(sf.evaluate(False))
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
Return all close unordered pairs of particles taken from the SingletonContainer.
Applies a PairScore to each Pair in a list.
Prevent a set of particles and rigid bodies from inter-penetrating.
Lower bound harmonic function (non-zero when feature < mean).
Create a scoring function on a list of restraints.
A score on the distance between the surfaces of two spheres.
static XYZR setup_particle(Model *m, ParticleIndex pi)
Definition XYZR.h:48
VectorD< 3 > Vector3D
Definition VectorD.h:407
VectorD< D > get_random_vector_in(const BoundingBoxD< D > &bb)
Generate a random vector in a box with uniform density.
Various classes to hold sets of particles.
void setup_from_argv(int argc, char **argv, std::string description)
Parse the command line flags and return the positional arguments.