} 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().getTurtleOrLinkVariable(varName));
}
} 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.LinksetType() | Syntax.LinkType() |
Syntax.TurtlesetType() | Syntax.TurtleType(),