Dear AMPL Community,
I am trying to develop a piecewise linear purchasing model, and I am facing two difficulties that I have been unable to solve up until now.
Iwant the below objective function to be interpreted by AMPL as follows:
if the sum {g in G, t in T, u in CC,p in P} x[g,t,u,p] >= parameter CC_threshold1, cost parameter r2_cogs[u,g] will be activated for all volume between parameters CC_threshold1 and CC_threshold2. For volume up until CC_threshold1, cost parameter r1_cogs[u,g] will apply.
minimize total_cost:
(sum {g in G, t in T, u in CC, p in P} ((<<CC_threshold1, CC_threshold2; r1_cogs[u,g], r2_cogs[u,g], r3_cogs[u,g]>> x[g,t,u,p]) + (x[g,t,u,p]*shipping[u,p]))* (1 + dues[u,p])) ;
I am basing the construction of my piecewise linear objective function on Figure 17-2: Piecewise-linear model with three slopes (transpl1.mod) of the AMPL user guide.
In the example given by AMPL, the "limit" or "threshold" parameters are given for all origin and distance combinations. This is different from my model in that I have a "total" limit where the idea is that if I reach a total threshold figure of CC_threshold1, a discount to my cost parameter will be applicable.
A second objective that I am trying to accomplish is to activate a "total" discount scheme.
What I mean by this is that I want AMPL to interpret the below as follows:
if the sum {g in G, t in T, u in AC,p in P} y[g,t,u,p] >= parameter CC_threshold 2, cost parameter r3_cogs[u,g] will be applicable to all volume in y[g,t,u,p]. How can I accomplish this?
(sum {g in G, t in T, u in AC, p in P} ((<<AC_threshold1, AC_threshold2; r1_cogs[u,g], r2_cogs[u,g], r3_cogs[u,g]>> y[g,t,u,p]) + (y[g,t,u,p]*shipping[u,p]))* (1 + dues[u,p]))
All the best from Chris