
Thank you for that, but I have a follow up sir Mikhail:
[image: guys.png]
I'm now trying to code (font color blue) the *let lamda i=di and lamda
n+i=-di *from the photo above*, *but I'm having trouble with it. Can you
help me with this?
Here's the code:
param n >= 0;
param b >= 0;
set B := {1..b};
set P := {1..n};
set D := {n+1..2*n};
set N := {0..2*n};
set ARC := {i in 0..n,j in n+1..2*n:i<>j};
param distance{ARC} >= 0;
param tt{ARC} >= 0;
param supply {P} >= 0;
param demand {D} >= 0;
*let P = supply{P} and D = demand{D}; *
var x{ARC,B} binary;
minimize fuelcost: sum{i in 0..n,j in n+1..2*n:i<>j} sum{k in B} x[i,j,k] *
(distance[i,j] * 0.5) * (tt[i,j] * 0.8);
Thank you!
On Fri, Feb 19, 2021 at 6:45 AM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:Thank you for that sir Mikhail!
But I have a follow-up:
[image: guys.png]
I'm now trying to code (font color blue) the *let lamda i=di and lamda
n+i=-di *from the photo above*, *but I'm having trouble with it. Can you
help me with this?
Here's the code:
param n >= 0;
param b >= 0;
set B := {1..b};
set P := {1..n};
set D := {n+1..2*n};
set N := {0..2*n};
set ARC := {i in 0..n,j in n+1..2*n:i<>j};
param distance{ARC} >= 0;
param tt{ARC} >= 0;
param supply {P} >= 0;
param demand {D} >= 0;
*let P = supply{P} and D = demand{D}; *
var x{ARC,B} binary;
minimize fuelcost: sum{i in 0..n,j in n+1..2*n:i<>j} sum{k in B} x[i,j,k] *
(distance[i,j] * 0.5) * (tt[i,j] * 0.8);
Thank you!
On Fri, Feb 19, 2021 at 5:58 AM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:In your model, param distance is defined as *param distance {i in 0..n ...}*
this means that data must be specified for every *i* in (0,1,2,3,4).
However, in the data, you only give data for *i = 0,3,4*. *{j in n + 1..2 *
n: i <> j}* to my mind is also described incorrectly because for *i = 0*
the expression *{j in n + 1..2 * n: i <> j}* gives the value* j = 1..0*;
and for *i = 4, j = 5..8*. The *distance* and *tt* data for values j> 4 is
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/f490d632-3b9f-41fa-97a5-f9767a2a63e2n%40googlegroups.com.