node.addAgent(addAgent);
if(node.getShortName().equalsIgnoreCase(addAgent.getShortName())) { if(log.isWarnEnabled()) { log.warn("Agent name same as node, cannot perform addition"); } JOptionPane.showMessageDialog(null, "Cannot Map Agent to Node of Same name, ignoring agent: " + addAgent.getShortName()); } else { node.addAgent(addAgent); }
  public void addNodeChildren(ComponentData[] children, NodeComponent node) {    for(int i=0; i < children.length; i++) {      boolean foundInSociety = false;      boolean foundInNode = false;      ComponentData child = children[i];      AgentComponent[] allAgents = getAgents();      AgentComponent addAgent = null;      if(child.getType().equals(ComponentData.AGENT)) {        for(int k=0; k < allAgents.length; k++) {          if(child.getName().equals(allAgents[k].getShortName())) {            foundInSociety = true;            addAgent = allAgents[k];            break;          }        }        if(foundInSociety) {          AgentComponent[] crntAgents = node.getAgents();          for(int j=0; j < crntAgents.length; j++) {            if(child.getName().equals(crntAgents[j].getShortName())) {              foundInNode = true;              break;            }          }          if(!foundInNode) {            node.addAgent(addAgent);          }        } else {          if(log.isWarnEnabled()) {            log.warn("Agent: " + child.getName() + "not known.  Add aborted");          }        }      } else {        if(log.isWarnEnabled()) {          log.warn("Unknown child of node: " + child.getName());        }      }    }  }