} catch (org.nlogo.api.AgentException ex) {
throw new EngineException(context, this, ex.getMessage());
}
} else if (agentOrSet instanceof AgentSet) {
AgentSet sourceSet = (AgentSet) agentOrSet;
LogoListBuilder result = new LogoListBuilder();
try {
for (AgentSet.Iterator iter = sourceSet.shufflerator(context.job.random);
iter.hasNext();) {
result.add(iter.next().getPatchVariable(vn));
}
} catch (org.nlogo.api.AgentException ex) {
throw new EngineException(context, this, ex.getMessage());
}
return result.toLogoList();
} else {
throw new org.nlogo.nvm.ArgumentTypeException
(context, this, 0,
Syntax.TurtleType() | Syntax.PatchType()
| Syntax.TurtlesetType() | Syntax.PatchsetType(),