I use following Groovy code to select random elements from a list.
Groovy
Random rnd = new Random() log.info("Random element:" + list[rnd.nextInt(list.size)])
I get previous or next element as a "random" value in most cases.
Aucun commentaire:
Enregistrer un commentaire