Optimization, Operations Research, Python, Programming, Data Science.
cstr_unique_start(model, m, j): return sum(model.x[m, j, t] for t in model.T) == 1 def cstr_unique_machine(model, m, t): total = 0 start = model.T.first() for j in model.J: duration = model.p[m, j] t0 = max(start, t - duration + 1) for t1 in range(t0, t + 1): total = total + model.x[m, j, t1]