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

Re: [IMP-dev] active particles and their restraints



Daniel Russel wrote:
So does anyone thin that getting rid of the Is_active check entirely in Restraint/Model and replacing it will asserts in particle is a bad idea?
Yes, I agree - if people really want to delete particles, they will have 
to make sure their restraints are deleted also. But we certainly need to 
allow users to delete particles - without that applications such as 
grand canonical MC are impossible. The is_active stuff was Bret's 
proposal for this.
I also propose that we change the member from 'is_active' to 
'is_deleted'. This will make it more obvious than the particle has 
really been deleted and cannot be used any more. ('inactive' is too easy 
to interpret as 'do not optimize'.)
Unless anybody else really wants to do it, I will write the code and a 
bunch of unit tests for this today.
Finally, we have a class of restraints which commonly act on "all 
atoms". For example, any kind of nonbonded restraint is often set up 
this way. I think it would be rather annoying for users to have to 
recreate these restraints whenever they remove a particle, so I suggest 
that the NonbondedListScoreState class provides a remove_particles() 
method to remove particles. (This can also be useful for removing 
still-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.
	Ben
--
ben@salilab.org                      http://salilab.org/~ben/
"It is a capital mistake to theorize before one has data."
	- Sir Arthur Conan Doyle