资源预留
原能力
检查高峰执行资源、应急余量和跨阶段占用,把冲突交给负责人确认。(细化版 p.6–7)
首选项目
OR-Tools(Apache-2.0)。 OR-Tools
匹配范围
约束求解检查时段容量和资源冲突。
源码
OR-Tools · def add_cumulative(
ortools/sat/python/cp_model.py · 1476–1489 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
def add_cumulative(
self,
intervals: Iterable[IntervalVar],
demands: Iterable[LinearExprT],
capacity: LinearExprT,
) -> Constraint:
"""Adds Cumulative(intervals, demands, capacity).
This constraint enforces that:
for all t:
sum(demands[i]
if (start(intervals[i]) <= t < end(intervals[i])) and
(intervals[i] is present)) <= capacity
- # Copyright 2010-2025 Google LLC
实现与验收要点
预算权源、预留有效期、人员承诺和临时优先级。