Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 OPL 中编写一个最小函数。
forall(p in P) sum(n in N)Q6[n][p]==Min (Max_Rema*Dem[p],sum(m in M)Q4[m][n]) ;
我希望 Q6 应该等于 and 的最小值Max_Rema*Dem[p],sum(m in M)Q4[m][n]其中Max_RemaandDem[p]是参数。这个怎么写?
Max_Rema*Dem[p]
sum(m in M)Q4[m][n]
Max_Rema
Dem[p]
minl有帮助:
minl
range P=1..3; range N=1..4; int Dem[p in 1..3]=p; int Max_Rema=3; dvar int Q4[N][P]; dvar int Q6[N][P]; subject to { forall(p in P) sum(n in N)Q6[n][p]==minl (Max_Rema*Dem[p],sum(m in N)Q4[m][p]) ; }