metricRelate.setItem(data.getName());
metricRelate.setItemId(data.getName());
  private ComponentData addMetricsComponentData(ComponentData data) {    ComponentData picd = null;    // Find the Experiment.    // From it, get a count of the Agents in the Society & set the numAgents    if (numAgents == 0 && data.getOwner() instanceof Experiment) {      Experiment exp = (Experiment)data.getOwner();      List ags = exp.getAgentsList();      if (ags != null)	numAgents = ags.size();      else	numAgents = 0;    }    // recurse down from the top, finding all of the AgentComponents    // save the name of the first I find    if (data.getType().equals(ComponentData.AGENT)) {      numAgs2++;      if (metricRelate == null) {	metricRelate = new RelationshipData();	metricRelate.setRole(MetricControl_Role);	metricRelate.setItem(data.getName()); // name	metricRelate.setType(data.getName().substring(data.getName().lastIndexOf(".") + 1));	metricRelate.setSupported(data.getName()); // name	// and to the first, add the MetricsInitializerPlugin	picd = addInitPICD(data);      }      // for each Agent, add the MetricsPlugin & the relationship      addCollectorCD(data);      addRelationship((AgentComponentData) data);    } else if (data.childCount() > 0) {      // for each child, call this same method.      ComponentData[] children = data.getChildren();      for (int i = 0; i < children.length; i++) {	ComponentData xpicd = addMetricsComponentData(children[i]);        if (xpicd != null) picd = xpicd;      }    }    return picd;  }