我正在写一个LpProblem,我需要创建一个约束,其中一些变量的和是100的倍数……100,200,300...
我正在尝试使用mod()、round()和int()来执行下面的表达式,但都不起作用,因为它们不支持LpAffineExpression。
probl += lpSum([如果h2 == b,则varSKU中h的varsh为b]) % 100 == 0
probl += lpSum([ varSKU中h的varsh if h2 == b]) / 100 == int(lpSum([varsh for h in varSKU if h2 == b]) )/100
probl += lpSum([varsh for h if varSKU if h2 == b]) / 100 == round(lpSum([varsh for h if h2 == b]) / 100)
你能给我一些关于写这个约束的想法吗?
谢谢!
https://stackoverflow.com/questions/47929215
复制相似问题