Sunday, December 19, 2004

Random Acts




We're working to come up with an approach to enable Croquet-based simulations involving ‘random’ events to be replicated on multiple machines. This is an interesting problem for us because of the fact that replication of computation would also replicate generation of the random numbers to be used in a simulation. This would usually be undesireable. For example, if we create a virtual coin toss simulation in Croquet that is intended to produce a random outcome (the outcome of either "heads" or "tails"), we would have to ensure that what might come up as “heads” on my instance is also “heads” on all other clients in the TeaParty. The problem is that if all of us are replicating the calculation of a random outcome, there would be nothing to ensure that what appears as “heads” on my machine would not be “tails” on yours. Solving this problem has deep implications on making the somewhat non-deterministic ODE (Open Dynamics Engine) integration with Croquet both deterministic and collaborative. Setting aside the obvious philosophical treatise that the act of structuring a form of deterministic randomness in cyberspace might warrant, we're presently considering two practical approaches to this issue.



One approach is to generate results on a master machine (the initiator of the event) and then replicating the random number computation (actually a pseudo-random number computation) on all other machines in the TeaParty (one machine simply tells all the other machines in the TeaParty that a new final result has been produced). In this way, when the triggering event or gesture happens on a particular machine, then that machine consults its own random number generator to produce a result. When the same event or gesture occurs on another machine, the random number generator on that machine is consulted to produce the result. For moderately complex simulations, there will be little guarantee of uniformity across ones that are moderately shared.



Another approach would be to get all participants to behave as if they are using the same random number generator. This would involve creating one random number generator that produces a well-distributed sequence of random values, regardless of which machine originates the request for any one of these values and the resulting sequence would be shared by all members of the TeaParty. In so doing, each request for the next random number would be shared as a TeaParty-wide event by all participating machines and no machine would be permitted to request an additional random number on its own that is not seen by all the other machines. This does not necessarily mean that there would be one generator for all purposes in all simulations running in the TeaParty. There could be one shared generator per ball in a billiards simulation, or one shared generator per billiard table in a simulation, or even one per TSpace. The point being that each of these shared generators is individually a single conceptual generator that is shared by all machines participating in the TeaParty.

No comments:

Post a Comment