mercredi 16 décembre 2015

Generate random numbers separated by some distance

I need to generate random numbers which are separated by some distance('r') from an interval.These numbers would represent the center of a circle, I want these circles to be at random locations and they should not overlap which is why the condition. One approach I thought of is to divide the range into set of intervals of length 'r'(radius of circle),from that set, get a set of alternative intervals(S), choose randomly from this set S and then choose a number randomly in each of these intervals. Could you suggest an approach which would give better randomness?




Aucun commentaire:

Enregistrer un commentaire