Station Type

6 views
Skip to first unread message

Eriska Prasetiowati

unread,
Mar 22, 2024, 6:24:35 PMMar 22
to AMPL Modeling Language
Hello, can you help me to fix my problem. I am going to explain a part of the problem:
variable
var X {i in DemandSites, j in Sites} binary; #candidate_location
var Xjk {j in Sites, k in Types} binary; #station type
var F {k in Types} >= 0; #auxiliary variable of total cost

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];constraint
subject to Constraint_coverage {i in DemandSites} :
    sum {j in Sites} d[i,j] * X [i,j] >= demand[i]; #d[i,j]_distance

subject to Constraint3 {j in Sites, k in Types}:
    Xjk[j,k] * F[k] <= Cmax;

subject to One_Type_Per_Location {i in DemandSites, j in Sites}:
    sum{k in Types} Xjk[j,k] = 1;

subject to dem {i in DemandSites}:
    sum {j in Sites} X[i,j] = 1;
My problem is the result of Xjk or the selected station type is type number 1. Why this problem happens. I expected there are different types in different location. Please help me solve this problem.Thanks

AMPL Google Group

unread,
Mar 23, 2024, 4:45:55 PMMar 23
to AMPL Modeling Language
Your question has been moved to our new user forum at discuss.ampl.com, and a response has been posted. To see the response, use this link:

https://discuss.ampl.com/t/ampl-25006-station-type/1010/2

To reply, click the red "Reply" button that follows the response. (Do not send an email reply to this message.)


--
Robert Fourer

We're switching to a new, enhanced user forum.
Join it now at discuss.ampl.com.
{#HS:2548312228-123208#}
--
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/93cb33ca-f7e6-4965-b8fb-ab91dbe67987n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages