Originally posted by: ikucukkoc
Hello
I have defined required data, decision variables, and objective function. However, I have a problem to code the constraint attached to this post.
DemandProportions= {<1 "A" 0.16667> <1 "B" 0.66667> <1 "C" 0.16667> <2 "D" 0.66667> <2 "E" 0.33333>} //initialized externally
{int} ProdCycles = {1, 2, 3, 4, 5, 6};
{int} Queues = {1, 2, 3, 4};
int TotalPhi = 6;
tuple linemodel{
int h;
string j;
}
{linemodel} LineModels = {<h, j> | <h, j, i> in LineModelTasks}; //LineModelTasks has defined in the code
tuple propdemand{
key string j;
float d;
};
{propdemand} PropDemands= {<j, d>|<h, j, d> in DemandProportions};
propdemand PropDemandsArray[i in 1..card(PropDemands)] = item(PropDemands, i-1);
forall( <h, j> in LineModels )
ct314:
sum( phi in ProdCycles, h in Lines, q in Queues )
T[ phi, <h, j>, q ] == TotalPhi * PropDemandsArray[<j,i>];
My question is: I defined "<h, j> in LineModels" for forall section but I also need to sum all "h in Lines". Is that a proper representation for the attached constraint? Or should I delete "h in Lines"?
The next question is the program does not accept "PropDemandsArray[<j,i>". How should I modify it?
Many thanks in advance.
Best Regards
#DecisionOptimization#OPLusingCPLEXOptimizer