[Biojava-dev] Query about DP example - Dice.java

David Huen smh1008@cus.cam.ac.uk
Wed, 2 Oct 2002 15:02:01 +0100


Hi,
I note that the example shows manipulation of the transition probabilities 
by:-
      dist = casino.getWeights(casino.magicalState());
      dist.setWeight(fairS, 0.8);
      dist.setWeight(loadedS, 0.2);

This appears to suggest that getWeights() must return the actual 
Distribution object it uses: a copy of it is unacceptable if this is to 
work.  If this is to be the expected behaviour with all future 
implementations of this class, we should explicitly state it in the 
javadocs.

Otherwise, perhaps the above snippet should be appended with
      casino.setWeights(casino.magicalState(), dist);

Would this make sense?

Regards,
David Huen