documentation and example for GranulateRandom