Originally posted by: ZJay
Thanks AlexFleischer, Sorry for the late reply, I'm not allowed to post the entire model for some reasons. While I still stuck on this problem. I doubt it's because the function item() could only use index to access the elements in the tuple sets, at least in my model. I tried change <c.bid> to 0 in the expression( item(feasiblePackages[c], <c.bid>) ), and it works. For sure I won't get the correct solution, while at least it runs.
Following is the tuples and objective function, I hope it would help for other kind people to look into this problem.
tuple FeasiblePackage
{
key ServiceBoundle serviceBoundle;
int initialprice;
int bc;
int price;
int isBid;
}
tuple Customer
{
key string cid;
ServiceBoundle bid;
int isAssigned;
int isInFinalState;
}
tuple ServiceBoundle
{
sorted {string} serviceIds;
}
{Service} services = ...;
{Service} serviceUnion;
{Customer} customers=...;
{FeasiblePackage} feasiblePackages[customers]=...;
dvar boolean X[c in customers];
minimize sum (c in customers: (card(c.bid.serviceIds) > 0))(X[c] * item(feasiblePackages[c], <c.bid>).price);
#DecisionOptimization#OPLusingCPLEXOptimizer