recreate these restraints whenever they remove a particle, so I suggestI agree, although we should put some thought in to it. We currently have more or less one sort of container (implemented using the IMP_CONTAINER macro), plus a couple of slightly odd ones. The IMP_CONTAINER containers use Indexes to identify thingsthat the NonbondedListScoreState class provides a remove_particles() method to remove particles. (This can also be useful for removingstill-active particles from a nonbonded list, if desired.) For symmetry,perhaps the set_particles() method should also be renamed to add_particles(). But this can all be done later.
It is probably worth creating another type IMP_DYNAMIC_CONTAINER which uses ints to identify things in the container and which supports deleting. This way we have a clear distinction. I can make this change since I wrote IMP_CONTAINER.