[AMPL 24989] location problem

Good afternoon,

I need your help to solve the following error please. I am going to explain a part of the problem :

  • i : set of demand site

  • j : set of candidate site

  • k : set of type station (large, medium, small)

I would like to optimize location model to minimize construction and operation costs.

Screenshot 2024-02-25 133539.png

error processing objective Total_Cost:
no value for CCT[1]

Thank you

In your question, you say that you are seeing this error message — which refers to the AMPL objective function Total_Cost:

error processing objective Total_Cost:
        no value for CCT[1]

The most common reason for this error is that you have defined a parameter CCT in your model (using a param statement), but you have not provided any data values for the parameter.

To get more help, reply with copies of your files attached. (Use the
image icon to attach files.) With that information, it may be possible to give more advice on writing the objective and the CCT_k = constraint.

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:


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