6 Nov
2007
6 Nov
'07
6:42 p.m.
> And I'm not sure where you'd store the weight, > if not in the restraint. Why not just in the Restraint base class? > The Restraint never actually uses its weight. It is a property of how the thing calling the restraint combines the weights, not of the restraint itself. And so should go with the thing calling the restraint. Plus, this way we can reuse a restraint with different weights in different places if we should so desire. > My alternative to stacks: restraints which contain other restraints > would use a copy-like constructor to make a cloned > DerivativeAccumulator, multiplied by their own weight, and then pass > that to their child restraints' evaluate methods. > I like it.