Originally posted by: Ujfaaz
Hi,
I'm trying to build my first Supply Chain Model with OPL using CPLEX. It should be an easy model with a company, which has a Headquarter and produced everything there. After period 2, the company can offshore or outsource the production to another site. The main-part of the model is working, but I have difficulties to model the transported quantity for each activity from site1 to site2.
These are the different parts (variable, expression and constraint) which concern the transportation:
dvar int+ transquan[Sites][Sites][Act][Time]; //transported quantity of act. from site x to site y
dexpr float TransCost =
sum(j1 in Sites, j2 in Sites, a in Act, t in Time) transquan[j1][j2][a][t] * TC[j1][j2][a];
subject to{
//Transport Constraints------------------------------------
forall(j in Sites, a in Act, t in Time, s in Supplier)
transquan[j][j][a][t] == prodquantity[j][a][t] + purchquantity[s][a][t];
}
The result now is that when an activity is in site one the variable is "transquan["site1"]["site1"][a][t]. So it's always from the site produced to the same site. Also when the next activity is at the other site. Which adaption do you recommend so that the model recognize when the semi-finished product has to be transported from site 1 to site 2?
The full code inclusive my data file is attached.
Thank you in advance. If you have any further question, please ask.
#DecisionOptimization#OPLusingCPLEXOptimizer