/**
  * prepares the setup process for the second cycle
  *
  * @param product
  * @param processSetUp
  */
 private void prepareSetUpProcessForSecondCycle(Product product, ProductionProcess processSetUp) {
   // for second cycle
   double cycleTime = product.getQ() / product.getD();
   processSetUp.setStartCycle2(
       new SimpleDoubleProperty(processSetUp.getStartCycle1().doubleValue() + cycleTime));
   processSetUp.setEndCycle2(
       new SimpleDoubleProperty(processSetUp.getEndCycle1().doubleValue() + cycleTime));
   processes.add(processSetUp);
 }
  /**
   * sets the production process for the specific product in the process plan
   *
   * @param product
   */
  private void setProductionProcess(Product product) {
    ProductionProcess processProduction = new ProductionProcess();
    processProduction.setK(null);
    processProduction.setProcess(new SimpleStringProperty("Produktion"));
    ProductionProcess processSetUp = processes.get(processes.size() - 1);
    processProduction.setStartCycle1(processSetUp.getEndCycle1());
    double endProduction = processProduction.getStartCycle1().doubleValue() + product.getT();
    processProduction.setEndCycle1(new SimpleDoubleProperty(endProduction));

    prepareProductionProcessForSecondCycle(product, processProduction);
  }
 /**
  * sets the setup process for the specific product in the process plan
  *
  * @param product
  */
 private void setProcessSetUp(Product product) {
   ProductionProcess processSetUp = new ProductionProcess();
   processSetUp.setK(product.getKProperty());
   processSetUp.setProcess(new SimpleStringProperty("Rüsten"));
   if (processes.size() == 0) {
     processSetUp.setStartCycle1(new SimpleDoubleProperty(0.0));
   } else {
     ProductionProcess predecessor = processes.get(processes.size() - 1);
     double startTime = predecessor.getEndCycle1().doubleValue();
     processSetUp.setStartCycle1(new SimpleDoubleProperty(startTime));
   }
   double endTime = processSetUp.getStartCycle1().doubleValue() + product.getTau();
   processSetUp.setEndCycle1(new SimpleDoubleProperty(endTime));
   prepareSetUpProcessForSecondCycle(product, processSetUp);
 }
 /**
  * adds the total duration (cycle time) to the process plan
  *
  * @return the generated process plan with cycle time
  */
 public List<ProductionProcess> addTotalDurationForTableView() {
   List<ProductionProcess> processesTable = new ArrayList<ProductionProcess>(processes);
   ProductionProcess totalDuration = new ProductionProcess();
   totalDuration.setK(null);
   totalDuration.setProcess(new SimpleStringProperty("Gesamtdauer"));
   ProductionProcess lastProcess = processes.get(processes.size() - 1);
   totalDuration.setEndCycle1(lastProcess.getEndCycle1());
   processesTable.add(totalDuration);
   return processesTable;
 }