Subject: [IMP-dev] Annoyance with current restraint design
From: Daniel Russel <>
Date: Sun, 16 Dec 2007 14:14:56 -0800
I have some restraints which I want to have be semi-dynamic, meaning,
I want to be able to reset the list of particles which they act on.
This doesn't work so cleanly with restraints taking lists of
ParticleIndexes as then you need one version of set_particles to be
called from the constructor (where the Restraint::model_ is not set)
and another version to be called by outsiders after the model pointer
has been set (or pass the model pointer to both and ignore the stored
pointer).
This seems like a reason for writing restraints which take Particles
rather than ParticleIndexes. It may also be worth dropping the
Restraint::model_ pointer entirely and just using the pointer stored
in particles. So
DistanceRestraint::DistanceRestraint(Particle*, Particle*, ScoreFunc*)
ExclusionVolumeRestraint(Particles, ScoreFuncParams)
Any thoughts?