Advertisement

Flocking & Formations

Started by February 09, 2004 04:36 PM
19 comments, last by Crazy Chicken 21 years ago
quote:
Original post by InnocuousFox
Adding this sort of fuzziness NOW will also make your reactions to outside influences much more dynamic down the road.


Dave, I would have thought you''d be more careful with your terminology. Adding noise to a computation to make it stochastic isn''t fuzziness , it''s uncertainty due to stochastic forcing. In this situation, the stochastic forcing you supplied is the distribution of outcome values given the input value (and your ''width'' parameter).

One word of warning with regards to Dave''s suggestion. Adding Gaussian (Normally distributed) noise to this dynamic process in an additive manner results in each fish being described by a stochastic DE known as an Ito Stochastic Differential Equation. Such equations model diffusion processes. This means that you can expect your flock as a whole to display a diffusion... in other words, cohesion will be lost unless your rules for staying close are tuned to overcome the diffusion inherent in the velocity and heading. That''s not to suggest that Dave''s idea is a bad one, simply that you need to be aware of the consequences and account for them.

Personally, I''d adjust Dave''s idea to reflect the use of actual probabilities. Generate a probability distribution over the sorts of deviations you''d like (as Dave has done, you might use the numbers from -100 to +100... scale them appropriately to the variable you are considering). Assign a probability to each, either by discretising a Normal distribution, or using some other probability distribution. (Here''s the important bit). Compute the cumulative probability distribution over the deviations, which maps deviations onto the scale [0,1]. Store this in a table indexed by the discrete cumulative probability values. Then, whenever you want a deviation, simply generate a uniformly distributed random number in the range [0,1], find the closest cumulative probability and use this as a lookup into the cumulative distribution to obtain the appropriate deviation.

Nice and simple and it gives you quantitative results about the likelihood of certain events occuring within your flock.

Cheers,

Timkin

This topic is closed to new replies.

Advertisement