Ejemplo n.º 1
0
  /**
   * Some settings (e.g. simulation width and height) pertain to the global simulation and are
   * incorrect for the local simulation. Thus, we need to correct them, so that they correspond to
   * the local simulation.
   */
  private void createLocalSettings() {
    IntBox mypart = partitions[workerID];

    double cellWidth = globalSettings.getCellWidth();
    double cellHeight = globalSettings.getCellHeight();

    localSettings = ClassCopier.copy(globalSettings);

    localSettings.setGridCellsX(mypart.xsize());
    localSettings.setGridCellsY(mypart.ysize());
    localSettings.setSimulationWidth(cellWidth * mypart.xsize());
    localSettings.setSimulationHeight(cellHeight * mypart.ysize());
  }