I am new to ampl. I need your help to review this constraint. I am going to explain a part of the problem :
n i : set of demand site
n j : set of candidate site
n k : set of type station (large, medium, small)
var
var X {i in DemandSites, j in Sites} binary; #location that would be build
var Xjk {j in Sites, k in Types} binary; #type of the station would be build
I would like to optimize location model to minimize cost.
minimize Total_Cost:
sum {i in DemandSites, j in Sites, k in Types} F[k} * Xjk[j,k];
subject to Constraint_coverage {i in DemandSites} :
sum {j in Sites} d[i,j] * X [i,j] >= demand[i];
Your constraint named Constraint_coverage looks good. Of course, your model needs to also include AMPL statements to define the sets and parameters that are used in the constraint; for example:
set Sites;
set DemandSites;
param d {DemandSites,Sites};
param demand {DemandSites};
I do have some concerns with your objective function Total_Cost:
minimize Total_Cost:
sum {i in DemandSites, j in Sites, k in Types} F[k} * Xjk[j,k];
Of course, F[k} should be F[k]. More seriously, you are summing over iinDemandSites, but there is no i in F[k]*Xjk[j,k]. This could mean that something is missing from the objective expression.