[AMPL 15311] Maximum Covering Location Problem with set problem: there's a set conditioned with distance and radio coverage.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[AMPL 15311] Maximum Covering Location Problem with set problem: there's a set conditioned with distance and radio coverage.

Alberto G
Hello,

I've got these sets:
set I:= 1..5;
set J:= 1..2;   
set H:= 1..4;

and the parameters:
param d{I,J};
param r{H};

where I stands for the block i, J stands for all possible locations of a certain server and H stands for the different coverage levels. In the parameters: d{I,J} is the distance from block i to server j, and r{H} is the coverage radio in function of the coverage level. This parameter is determined as:

param r:=
1 250
2 320
3 515
4 680;

and d{I,J}:
param d: 1 2 3 4 5:=
1 86 190 291 480 520
2 389 420 485 530 610;  

Therefore, there's also a set that can be defined as:
set Ni {i in I} := {j in J : r[h-1] <= d[i,j] <= r[h]};

Which represents a neighborhood. The problem is that it's quite easy if you have just a radio coberture discrete i.e. just one value. But in this case it is varying among the set H.

There are two binary variables:
var X {J} binary;
var Y {I,H} binary;

Everything else is fine, that's why I think it might be too much to add the constraints.
So, my problem is that when I compute AMPL, I get this error:

h is not defined
context:  set Ni {i in I} := {j in J :  >>> r[h- <<< 1] <= d[i,j] <= r[h]};

Things I've tried:
1) Replaced r[h-1] for another parameter called r0, which starts at r=0 when h=1 and then r=250 when h=2 and so on.
2) I put the set under the definition of parameters.

Any ideas would be much appreciated. 
Thanks in advance,

Alberto.


--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

[AMPL 15312] Re: Maximum Covering Location Problem with set problem: there's a set conditioned with distance and radio coverage.

Alberto G
I'm sorry, reading again I found out I confuse "coberture". It should be coverage.

...Which represents a neighborhood. The problem is that it's quite easy if you have just a radio coberture discrete i.e. just one value. But in this case it is varying among the set H.

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [AMPL 15316] Re: Maximum Covering Location Problem with set problem: there's a set conditioned with distance and radio coverage.

ptiwari
There is no definition of 'h' in your statement. You should define 'h' before using it. 

set Ni {i in I} := {j in J : r[h-1] <= d[i,j] <= r[h]};

One potential way is

set Ni{i in I, h in H} := 

Thanks,
Paras

On Wed, Dec 6, 2017 at 10:46 AM, Alberto G <[hidden email]> wrote:
I'm sorry, reading again I found out I confuse "coberture". It should be coverage.

...Which represents a neighborhood. The problem is that it's quite easy if you have just a radio coberture discrete i.e. just one value. But in this case it is varying among the set H.

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.