package com.aps.macroplanner.data;

/**
 * 单元周期 (UnitPeriod) — 对应 Quintiq 中的 UnitPeriod
 * 表示某个单元在某个周期的产能可用情况
 */
public class UnitPeriod {
    private final String unitId;
    private final Period period;
    private final double minCapacity;    // 最小产能
    private final double maxCapacity;    // 最大可用产能
    private final boolean hasMinCapacity; // 是否有最小产能约束

    public UnitPeriod(String unitId, Period period, double minCapacity, double maxCapacity, boolean hasMinCapacity) {
        this.unitId = unitId;
        this.period = period;
        this.minCapacity = minCapacity;
        this.maxCapacity = maxCapacity;
        this.hasMinCapacity = hasMinCapacity;
    }

    public String getUnitId() { return unitId; }
    public Period getPeriod() { return period; }
    public double getMinCapacity() { return minCapacity; }
    public double getMaxCapacity() { return maxCapacity; }
    public boolean hasMinCapacity() { return hasMinCapacity; }

    public String getKey() {
        return unitId + "_" + period.getIndex();
    }

    @Override
    public String toString() {
        return "UnitPeriod[" + unitId + ", " + period + "]";
    }
}