求解一个模型,不知道目标函数这么写有什么问题,请大家帮忙看一下吧,谢谢啦!
int NbItems = ...;range Items = 1..NbItems;
int NbResources = ...; range Resources = 1..NbResources;
int Use[Resources][Items] = ...;
int MaxValue = max(r in Resources)Capacity[r];
dvar int Take[Items]in 0..MaxValue;
maxmize sum(i in Items) Value[i] * Take[i];
subject to{
forall(r in Resources)
ct:
sum(i in Items)
Use[r][i]*Take[i]<=Capacity[r];
}