[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[IMP-dev] Annoyance with current restraint design



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?