Originally posted by: StudentLucas
I've simplified my problem:
there are a 2d-array with article/price information and a 3d array with article/day/demand information
The exercise is to get the best sales (combination of price and demand). But it doesnt work (there is "no solution"). If I change "==" to "<=" it works but with a wrong solution, the same is if I would use "=>".
Hier is my code, could please somebody check it? Thanks in advance!
{string} Fuel = {"Gasolin", "Diesel"};
{string} Day = {"Monday", "Saturday"};
// Index for price/demand category
// 1: regular price, 2: discount price for members
{int} I = {1, 2};
int price[Fuel][I] = [
[11, 8],
[14, 10]
];
int demand[Fuel][Day][I] = [
[[100, 118],[221, 284]],
[[122, 132],[319, 405]]
];
dvar int+ sales[Fuel][Day];
maximize sum(f in Fuel, d in Day) sales[f][d];
subject to{
forall(f in Fuel, d in Day, i in I){
sales[f][d] == price[f][i] * demand[f][d][i];
}
}
#CPLEXOptimizers#DecisionOptimization