public ExpConfigWriterNew(List components, NodeComponent[] nodesToWrite, Experiment exp) { this.nodesToWrite = nodesToWrite; this.components = components; theSoc = new GenericComponentData(); theSoc.setType(ComponentData.SOCIETY); theSoc.setName(exp.getExperimentName()); theSoc.setClassName("java.lang.Object"); theSoc.setOwner(exp); theSoc.setParent(null);  addNodes(exp);       for (int i = 0; i < components.size(); i++) { ComponentProperties soc = (ComponentProperties) components.get(i); soc.addComponentData(theSoc); }   for (int i = 0; i < components.size(); i++) { ComponentProperties soc = (ComponentProperties) components.get(i); soc.modifyComponentData(theSoc); }
public ExpConfigWriterNew(ComponentData theSoc) { this.theSoc = theSoc;
  public ExpConfigWriterNew(List components, NodeComponent[] nodesToWrite, Experiment exp) {    this.nodesToWrite = nodesToWrite;    this.components = components;    theSoc = new GenericComponentData();    theSoc.setType(ComponentData.SOCIETY);    theSoc.setName(exp.getExperimentName()); // this should be experiment: trial FIXME    theSoc.setClassName("java.lang.Object"); // leave this out? FIXME    theSoc.setOwner(exp); // the experiment    theSoc.setParent(null);    // For each node, create a GenericComponentData, and add it to the society    addNodes(exp);    // Some components will want access to the complete set of Nodes in the society, etc.    // To get that, they must get back to the root soc object,    // and do a getOwner and go from there. Ugly.        // Now ask each component in turn to add its stuff    for (int i = 0; i < components.size(); i++) {      ComponentProperties soc = (ComponentProperties) components.get(i);      soc.addComponentData(theSoc);    }    // Then give everyone a chance to modify what they've collectively produced    //    for (int i = components.size() - 1; i >= 0; i--) {    for (int i = 0; i < components.size(); i++) {      ComponentProperties soc = (ComponentProperties) components.get(i);      soc.modifyComponentData(theSoc);    }      }