for (int i = 0; i < societies.size(); i++) { ((SocietyComponent)societies.get(i)).setRunning(false); }
if (society != null) society.setRunning(false);
  public void experimentStopped() {    if (listeners != null) {      for (int i = 0; i < listeners.size(); i++) {	ExperimentListener listener = (ExperimentListener)listeners.get(i);	listener.experimentTerminated();      }    }    // Tell the Societies in the experiment they are no longer running?    for (int i = 0; i < societies.size(); i++) {      ((SocietyComponent)societies.get(i)).setRunning(false);    }  }