AgentSet agents = (AgentSet) obj;
int count = agents.count();
if (count == 0) {
return org.nlogo.api.Nobody$.MODULE$;
} else {
return agents.randomOne(count, context.job.random.nextInt(count));
}
} else {
throw new ArgumentTypeException
(context, this, 0, Syntax.ListType() | Syntax.AgentsetType(), obj);
}