throw new EngineException
(context, this, I18N.errorsJ().get("org.nlogo.prim.$common.onlyObserverCanAskAllPatches"));
}
}
} else if (target instanceof Agent) {
Agent agent = (Agent) target;
if (agent.id == -1) {
throw new EngineException(context, this,
I18N.errorsJ().getN("org.nlogo.$common.thatAgentIsDead", agent.classDisplayName()));
}
agentset = new ArrayAgentSet(agent.getAgentClass(), 1, false, world);
agentset.add(agent);
} else {
throw new ArgumentTypeException(context, this, 0, Syntax.AgentsetType() | Syntax.AgentType(), target);
}
context.runExclusiveJob(agentset, next);