在车间调度问题中,我一直试图编码以下约束,以捕获存在一些资源稀缺约束的事实,这些约束是依赖时间的(例如:根据一天或班次的可用工人数量)
for all t:
sum(workers_required[i]
if (start(intervals[i]) <= t < end(intervals[i])) and
(intervals[i] is present)) <= workers_available[t]
为了捕获这一约束,我想到了两种方法:
- 利用内置的添加量,
我没有发现好&amp;利用此功能达到时间相关容量的简单方法。
- 我是否应该为每次移动定义更多的间隔VAR:间隔[任务,偏移],然后添加2个约束? (增加了太多复杂性)
- 对于每个班次:
model.AddCumulative(shift_intervals,workers_required,workers_available)
- 对于每个任务 - 连续间隔约束:说明单个任务,我想最大程度地减少间隔数量(即间歇性持续过渡的数量),并将它们与另一个连续
连续
,1+2似乎相当复杂。.是否没有其他方法可以在每个任务中创建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:
- 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)
- For each shift:
model.AddCumulative(shift_intervals, workers_required, workers_available)
- 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?
- 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.
发布评论
评论(1)
只需固定的间隔,固定的要求就可以在可用容量和最大容量之间填充。
Just fixed intervals with fixed demands to fill in between the the available capacity and the max capacity.