/**
   * Initializes this class with all {@link Parameters} as generated by the given {@link
   * ISimulationParametersInitializer}s.<br>
   * This method will adopt parameters if there are any already.<br>
   * If you don't want that, call {@link
   * SimulationParameters#init(ISimulationParametersInitializer...)} or destroy existing Parameters
   * first.<br>
   * Be aware that if this method is called several times (after first calling the destroy method),
   * the old {@link Parameters} are gone. All registered {@link IParameterChangeListener}s are then
   * informed that the {@link Parameters} are new ones.
   *
   * @param parameterInitializers the concrete {@link ISimulationParametersInitializer}s that
   *     initialize the {@link SimulationParametersProvider}
   */
  public static void initOrAdopt(ISimulationParametersInitializer... parameterInitializers) {

    // either create a new parameters object or use the old one instead
    Parameters parameters = null;
    if (SimulationParameters.myParamProvider != null) {
      parameters = SimulationParameters.myParamProvider.getParameters();
      SimulationParameters.LOG.info("Adopted existing simulation parameters.");
    } else {
      parameters = new Parameters();
    }

    // merge all parameters as returned by the given simulation parameter initializers into one
    // object
    for (ISimulationParametersInitializer parameterInitializer : parameterInitializers) {
      parameters.addAllParameters(parameterInitializer.initializeSimulationParameters());
    }

    // initialize the simulation parameters provider
    SimulationParameters.myParamProvider = new SimulationParametersProvider(parameters);
    SimulationParameters.myParamProvider.getParameters();

    // refresh parameters of all available parameter listeners
    synchronized (SimulationParameters.parameterChangeListeners) {
      for (IParameterChangeListener parameterChangeListener :
          SimulationParameters.parameterChangeListeners) {
        SimulationParameters.LOG.debug(
            "Refreshing parameter listener '"
                + parameterChangeListener.getClass().getSimpleName()
                + "'.");
        parameterChangeListener.refreshParameters();
      }
    }
  }
 /**
  * Adds a new {@link IParameterChangeListener} to the set of {@link IParameterChangeListener}s
  * that are informed if the {@link Parameters}s have changed.
  *
  * @param parameterChangeListener the {@link IParameterChangeListener} to add
  */
 public static void addParameterChangeListener(IParameterChangeListener parameterChangeListener) {
   SimulationParameters.LOG.debug(
       "Adding parameter listener '" + parameterChangeListener.getClass().getSimpleName() + "'.");
   SimulationParameters.parameterChangeListeners.add(parameterChangeListener);
 }