// Path: CutletLib/src/main/java/com/cutlet/lib/optimizer/OptimizationResult.java
// @ToString
// public class OptimizationResult implements Serializable {
// 
//     private final List<Layout> layouts = new ArrayList<>();
//     private double runtime;
// 
//     public void createNewLayout(@NonNull PanelInstance p) {
//         addLayout(new Layout(p.getSheet(), layouts.size()));
//     }
// 
//     private void addLayout(Layout l) {
//         layouts.add(l);
//     }
// 
//     public OptimizationResultStats getStats() {
//         int numberOfCuts = 0;
//         int numberOfLayouts = layouts.size();
//         double totalCutLength = 0;
//         double sheetArea = 0;
//         double usedArea = 0;
//         double boundingBoxArea = 0;
//         for (Layout layout : layouts) {
//             CutTreeStats substats = layout.getCutTree().getStats();
//             numberOfCuts += substats.getNumberOfCuts();
//             totalCutLength += substats.getTotalCutLength();
//             sheetArea += substats.getSheetArea();
//             usedArea += substats.getUsedArea();
//             boundingBoxArea += substats.getBoundingBoxArea();
//         }
//         OptimizationResultStats stats = new OptimizationResultStats(numberOfLayouts,
//                 numberOfCuts,
//                 totalCutLength,
//                 sheetArea,
//                 usedArea,
//                 boundingBoxArea);
//         return stats;
//     }
// 
//     public List<Layout> getLayouts() {
//         return layouts;
//     }
// 
//     public double getRuntime() {
//         return runtime;
//     }
// 
//     public void setRuntime(double runtime) {
//         this.runtime = runtime;
//     }
// 
// }


import com.cutlet.lib.optimizer.OptimizationResult;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.google.common.base.Optional;
import static com.google.common.base.Preconditions.checkArgument;
import lombok.NonNull;

/*
 * Copyright (C) 2017 rudolf.muehlbauer@gmail.com
 */
package com.cutlet.lib.model;


// we use guava's Optional here, because it is serializable, jdks is not
// http://stackoverflow.com/a/39637752/1689451


/**
 *
 * @author rmuehlba
 */
public class Project implements Serializable {

    private List<Panel> panels = new ArrayList<>();
    private double bladeWidth = 3;
    private Optional<OptimizationResult> optimizationResult;

    public List<Panel> getPanels() {
        return panels;
    }

    public void setPanels(@NonNull final List<Panel> inputs) {
        this.panels = inputs;
    }

    public double getBladeWidth() {
        return bladeWidth;
    }


// Path: CutletLib/src/main/java/com/cutlet/lib/optimizer/OptimizationResult.java
// @ToString
// public class OptimizationResult implements Serializable {
// 
//     private final List<Layout> layouts = new ArrayList<>();
//     private double runtime;
// 
//     public void createNewLayout(@NonNull PanelInstance p) {
//         addLayout(new Layout(p.getSheet(), layouts.size()));
//     }
// 
//     private void addLayout(Layout l) {
//         layouts.add(l);
//     }
// 
//     public OptimizationResultStats getStats() {
//         int numberOfCuts = 0;
//         int numberOfLayouts = layouts.size();
//         double totalCutLength = 0;
//         double sheetArea = 0;
//         double usedArea = 0;
//         double boundingBoxArea = 0;
//         for (Layout layout : layouts) {
//             CutTreeStats substats = layout.getCutTree().getStats();
//             numberOfCuts += substats.getNumberOfCuts();
//             totalCutLength += substats.getTotalCutLength();
//             sheetArea += substats.getSheetArea();
//             usedArea += substats.getUsedArea();
//             boundingBoxArea += substats.getBoundingBoxArea();
//         }
//         OptimizationResultStats stats = new OptimizationResultStats(numberOfLayouts,
//                 numberOfCuts,
//                 totalCutLength,
//                 sheetArea,
//                 usedArea,
//                 boundingBoxArea);
//         return stats;
//     }
// 
//     public List<Layout> getLayouts() {
//         return layouts;
//     }
// 
//     public double getRuntime() {
//         return runtime;
//     }
// 
//     public void setRuntime(double runtime) {
//         this.runtime = runtime;
//     }
// 
// }


// Path: CutletLib/src/main/java/com/cutlet/lib/model/Project.java
import com.cutlet.lib.optimizer.OptimizationResult;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.google.common.base.Optional;
import static com.google.common.base.Preconditions.checkArgument;
import lombok.NonNull;

/*
 * Copyright (C) 2017 rudolf.muehlbauer@gmail.com
 */
package com.cutlet.lib.model;


// we use guava's Optional here, because it is serializable, jdks is not
// http://stackoverflow.com/a/39637752/1689451


/**
 *
 * @author rmuehlba
 */
public class Project implements Serializable {

    private List<Panel> panels = new ArrayList<>();
    private double bladeWidth = 3;
    private Optional<OptimizationResult> optimizationResult;

    public List<Panel> getPanels() {
        return panels;
    }

    public void setPanels(@NonNull final List<Panel> inputs) {
        this.panels = inputs;
    }

    public double getBladeWidth() {
        return bladeWidth;
    }


    public void setBladeWidth(final double bladeWidth) {
