package com.aps.macroplanner.output.dto;

import java.util.ArrayList;
import java.util.List;

/**
 * 优化结果顶层容器 — 对应 Quintiq 中一次完整的优化运行输出。
 *
 * <p>包含以下子结构:</p>
 * <ul>
 *   <li>metadata — 运行时间戳、求解器、版本</li>
 *   <li>periodTasks — 生产任务结果 (← PTQty)</li>
 *   <li>salesDemands — 销售需求满足结果 (← SalesDemandQty)</li>
 *   <li>pispips — 库存点库存结果 (← InvQty, DemandSlack 等)</li>
 *   <li>kpis — KPI 汇总结果</li>
 *   <li>statistics — 求解器运行统计</li>
 * </ul>
 */
public class OptimizationResult {

    // ==================== 元数据 ====================

    private String timestamp;
    private String solver;
    private String version;

    // ==================== 业务结果 ====================

    private final List<PeriodTaskResult> periodTasks = new ArrayList<>();
    private final List<SalesDemandResult> salesDemands = new ArrayList<>();
    private final List<PispipResult> pispips = new ArrayList<>();

    // ==================== 产品生产网络 ====================

    private ProductNetworkResult productNetwork;

    // ==================== Unit产能使用 ====================

    private List<UnitCapacityResult> unitCapacities;

    // ==================== 需求满足汇总 ====================

    private List<DemandSummaryResult> demandSummary;

    // ==================== KPI 和统计 ====================

    private KpiResult kpis;
    private SolverStatistics statistics;

    // ==================== Getters / Setters ====================

    public String getTimestamp() { return timestamp; }
    public void setTimestamp(String v) { this.timestamp = v; }

    public String getSolver() { return solver; }
    public void setSolver(String v) { this.solver = v; }

    public String getVersion() { return version; }
    public void setVersion(String v) { this.version = v; }

    public List<PeriodTaskResult> getPeriodTasks() { return periodTasks; }
    public List<SalesDemandResult> getSalesDemands() { return salesDemands; }
    public List<PispipResult> getPispips() { return pispips; }

    public ProductNetworkResult getProductNetwork() { return productNetwork; }
    public void setProductNetwork(ProductNetworkResult v) { this.productNetwork = v; }

    public List<UnitCapacityResult> getUnitCapacities() { return unitCapacities; }
    public void setUnitCapacities(List<UnitCapacityResult> v) { this.unitCapacities = v; }

    public List<DemandSummaryResult> getDemandSummary() { return demandSummary; }
    public void setDemandSummary(List<DemandSummaryResult> v) { this.demandSummary = v; }

    public KpiResult getKpis() { return kpis; }
    public void setKpis(KpiResult v) { this.kpis = v; }

    public SolverStatistics getStatistics() { return statistics; }
    public void setStatistics(SolverStatistics v) { this.statistics = v; }
}