或工具:在累积约束中建立时间相关能力

发布于 2025-02-02 18:17:25 字数 925 浏览 2 评论 0 原文

在车间调度问题中,我一直试图编码以下约束,以捕获存在一些资源稀缺约束的事实,这些约束是依赖时间的(例如:根据一天或班次的可用工人数量)

for all t:
  sum(workers_required[i]
    if (start(intervals[i]) <= t < end(intervals[i])) and
    (intervals[i] is present)) <= workers_available[t]

为了捕获这一约束,我想到了两种方法:

  1. 利用内置的添加量,

我没有发现好&amp;利用此功能达到时间相关容量的简单方法。

  • 我是否应该为每次移动定义更多的间隔VAR:间隔[任务,偏移],然后添加2个约束? (增加了太多复杂性)
    1. 对于每个班次: model.AddCumulative(shift_intervals,workers_required,workers_available)
    2. 对于每个任务 - 连续间隔约束:说明单个任务,我想最大程度地减少间隔数量(即间歇性持续过渡的数量),并将它们与另一个连续
    3. 连续

,1+2似乎相当复杂。.是否没有其他方法可以在每个任务中创建1个间隔并在不同的时间域上限制此间隔? 例如,一种告诉模型的方法,即增加算法的约束仅在特定时域中有效?

  1. 通过时间分解来构建自己的累积约束:它有效,但模型复杂性&amp;运行时增加因子10。基于hakan工作的方法:

如果可能的话,我宁愿选择简化的选项1。

Within the job shop scheduling problem, I have been trying to encode the following constraint to capture the fact that there are some resource scarcity constraints, which are time dependent (for instance: the number of workers available, based on the day or the shift)

for all t:
  sum(workers_required[i]
    if (start(intervals[i]) <= t < end(intervals[i])) and
    (intervals[i] is present)) <= workers_available[t]

To capture this constraint, I have thought of 2 methods:

  1. Leverage the built-in AddCumulative

I haven't found a good & simple way to leverage this function for time-dependent capacity.

  • Should I create more interval vars defined for each shift: interval[task, shift], then add 2 constraints ? (adds too much complexity)
    1. For each shift: model.AddCumulative(shift_intervals, workers_required, workers_available)
    2. For each task - Continuous interval constraints: Saying that for a single task, I want to minimise the number of intervals (i.e the number of interval presence transitions), and have them continuous one with another

However, 1+2 seems rather complex.. Is there no other way to create only 1 interval per task and to constrain this interval over different time domains ?
For instance, a way to tell the model that the AddCumulative constraint is only valid over a specific time domain?

  1. Build my own cumulative constraint through time decomposition: It works but the model complexity & run-time increase by a factor 10. Approach based on Hakan work: http://www.hakank.org/or_tools/cp_sat_utils.py

If possible, I would rather go for a simplified option 1.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ゞ花落谁相伴 2025-02-09 18:17:25

只需固定的间隔,固定的要求就可以在可用容量和最大容量之间填充。

Just fixed intervals with fixed demands to fill in between the the available capacity and the max capacity.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文