public void update(double deltaTime) {

    totalTime += deltaTime;
    if (isDone) {
      return;
    }
    // Update all the objects in the factor that need updating each tick
    for (FactoryObject object : mFWorkers) object.update(deltaTime);

    if (mTaskBoard.isDone()) {
      isDone = true;
      Timestamp timestamp = new Timestamp(System.currentTimeMillis());
      String outFileName = "reports/" + timestamp;
      outFileName = outFileName.replaceAll("[-:.]", "_");
      File file = null;
      FileWriter fw = null;
      try {
        file = new File(outFileName);
        file.createNewFile();
        fw = new FileWriter(outFileName, true);
        for (FactoryObject object : mFObjects) {
          if (object instanceof FactoryReporter) {
            ((FactoryReporter) object).report(fw);
          }
        }
      } catch (IOException e) {
        System.out.println("Error occured during file write: " + outFileName);
        if (file != null) file.delete();
      } finally {
        if (fw != null) {
          try {
            fw.close();
          } catch (IOException e) {
            System.out.println("Error: failed to close FileWriter");
          }
        }

        DecimalFormat threePlaces = new DecimalFormat(".###");
        JOptionPane.showMessageDialog(
            null,
            "Total time: " + threePlaces.format(totalTime) + "s",
            "Simulation Over!",
            JOptionPane.INFORMATION_MESSAGE);
      }
    }
  }