} } } nhost.addNode(nnode);
  public Experiment copy(Organizer organizer, Object context) {    String uniqueName = organizer.generateExperimentName(getExperimentName());    Experiment experimentCopy = null;    if (inDatabase)       experimentCopy = new Experiment(uniqueName, expID, trialID);    else      experimentCopy = new Experiment(uniqueName);    for (int i = 0; i < getComponentCount(); i++) {      ModifiableConfigurableComponent sc = getComponent(i);      ModifiableConfigurableComponent copiedSC = organizer.copyComponent(sc, context);      experimentCopy.addComponent(copiedSC);    }    HostComponent[] hosts = getHosts();    for (int i = 0; i < hosts.length; i++) {      HostComponent nhost = experimentCopy.addHost(hosts[i].getFullName().toString());      nhost.setServerPort(hosts[i].getServerPort());      nhost.setMonitoringPort(hosts[i].getMonitoringPort());      NodeComponent[] onodes = hosts[i].getNodes();      for (int j = 0; j < onodes.length; j++) {	NodeComponent nnode = experimentCopy.addNode(onodes[j].getFullName().toString());	AgentComponent[] oagents = onodes[j].getAgents();        // compare short names only, as full names may be different	for (int x=0; x < oagents.length; x++) {          AgentComponent[] nagents = experimentCopy.getAgents();          for (int y=0; y < nagents.length; y++ ) {            if (nagents[y].getShortName().equals(oagents[x].getShortName())) {              nnode.addAgent(nagents[y]);            }           }	}	      	nhost.addNode(nnode);      }    }    // copy the results directory; results from the copied experiment    // will be stored in this directory under the copied experiment name    experimentCopy.setResultDirectory(getResultDirectory());        return experimentCopy;  }