int nSocieties = experiment.getSocietyComponentCount(); for (int i = 0; i < nSocieties; i++) experiment.getSocietyComponent(i).setRunning(isRunning);
experiment.getSocietyComponent().setRunning(isRunning);
  private void updateExperimentControls(Experiment experiment,					boolean isRunning) {    if (!isRunning) {      experiment.experimentStopped();      csmart.setRunningExperiment(null);    } else      csmart.setRunningExperiment(experiment);    // update societies    int nSocieties = experiment.getSocietyComponentCount();    for (int i = 0; i < nSocieties; i++)      experiment.getSocietyComponent(i).setRunning(isRunning);    // if not running, enable the run button, and don't select it    // if running, disable the run button and select it    runButton.setEnabled(!isRunning && haveMoreTrials());    runButton.setSelected(isRunning);    // if running, enable the stop button and don't select it    // if not running, disable the stop button and don't select it    stopButton.setEnabled(isRunning);    stopButton.setSelected(false);    abortButton.setEnabled(isRunning);    abortButton.setSelected(false);    // if not running, don't allow the user to restart individual nodes    JInternalFrame[] frames = desktop.getAllFrames();    for (int i = 0; i < frames.length; i++) {      String s = frames[i].getTitle();      if (!s.equals("Configuration") && !s.equals("Trial Values"))         ((ConsoleInternalFrame)frames[i]).enableRestart(false);    }  }