Here you can find the source of randomActorId(int max)
public static final int randomActorId(int max)
//package com.java2s; //License from project: Apache License public class Main { public static final int randomActorId(int max) { int min = 0; return randomNumber(min, max); }//from w w w . j a va2s . c o m public static final int randomNumber(int min, int max) { int num = min + (int) (Math.random() * ((max - min) + 1)); return num; } }