if (agents[k].getShortName().equals("NCA")) {
if (agents[k].getShortName().equals(agent)) {
  private String getOPlanAgentURL() {    HostComponent[] hosts = experiment.getHostComponents();    for (int i = 0; i < hosts.length; i++) {      NodeComponent[] nodes = hosts[i].getNodes();      for (int j = 0; j < nodes.length; j++) {        AgentComponent[] agents = nodes[j].getAgents();        for (int k = 0; k < agents.length; k++) {          if (agents[k].getShortName().equals("NCA")) {            int port = CSMARTUL.agentPort;            Properties arguments = nodes[j].getArguments();            if (arguments != null) {              String s = arguments.getProperty(CSMARTUL.AGENT_PORT);              if (s != null) {                try {                  port = Integer.parseInt(s);                } catch (Exception e) {                  if (log.isErrorEnabled())                    log.error("Exception parsing " + CSMARTUL.AGENT_PORT                               + " : ", e);                }              }            }            return "http://" + hosts[i].getShortName() + ":" + port + "/$NCA";          }        }      }    }    return null;  }