#-- File: simple_connectivity_on_molecules.py --# import IMP import IMP.core import IMP.helper m = IMP.Model() IMP.core.create_xyzr_particles(m, 4, 1.0) ps = m.get_particles() mhs = IMP.atom.Hierarchies() for p in ps: mh = IMP.atom.Hierarchy.setup_particle(p) mhs.append(mh) sc = IMP.helper.create_simple_connectivity_on_molecules(mhs) r = sc.get_restraint() h = sc.get_harmonic_upper_bound() sdps = sc.get_sphere_distance_pair_score() sc.set_mean(10.0) sc.set_stddev(3.5) sc.set_k(0.1) m.add_restraint(r) r.show() m.evaluate(False)