}
// Instantiate the agent.
AbstractAgent agent = null;
for (Class<?> agentClass : agentClassList) {
AgentopiaAgentMarker marker = (AgentopiaAgentMarker) agentClass.getAnnotation(AgentopiaAgentMarker.class);
if (agentId.equals(marker.name())) {
try {
agent = (AbstractAgent) agentClass.newInstance();
}
catch (Exception exc) {
Logger.getLogger().warn(exc, "Unable to instantiate agent: " + agentId);