I am writing to request support with my model. I am trying to simulate a small system for a public call center, where multiple phone rooms are available, and people arrive to make calls. When a person arrives at the center, they are assigned a phone room. If all rooms are occupied, they wait in a queue. If the queue is full, the person is rejected. However, in my model, I first need to determine the appropriate number of phone rooms, waiting spaces, and supply capacity within an effective budget. In my model these variables are presented as: Appel_office_num, w_appel, and Soleil_cap. Then I can solve for the profit maximization.
I attempted to model this using a queuing process, but when running the simulation, I encountered errors such as:
“Variable in upper bound of range set”
“Variables in subscripts are not yet allowed…”
I was unable to resolve these issues and would appreciate any guidance on fixing them. Additionally, I would like to know if these types of problems require a specific solver.
I have attached my scripts for your reference. Thank you in advance for your support
When AMPL generates a problem instance for the solver, it needs to know what every set’s members are, and what every [subscript] expression’s value is. Thus, since the values of variables are determined by the solver, set expressions and subscript expressions cannot depend on the values of variables. For example, in your situation:
0..(Appel_office_num-1) is rejected with “variable in upper bound of range set” — because this set expression depends on the value of a variable.
fact[Appel_office_num] is rejected with “Variables in subscripts are not yet allowed” — because the subscript Appel_office_num is a variable.
A common approach for avoiding these kinds of expressions is to define some parameters and variables like this:
param Appel_office_max integer > 0;
var Appel_office_used {1..Appel_office_max} binary;
You should set Appel_office_max to the largest number of phone rooms that are available or that could possibly be used in a solution. Then in the model, define Appel_office_used[i] to be 1 if and only if phone room i is used. To avoid a lot of equivalent solutions, it is usually a good idea to add constraints Appel_office_used[i+1] <= Appel_office_used[i] so that only lower-numbered rooms are used.
Of course, you will need to re-think you model to use variables like this. But your model needs revision anyway; a solver such as Gurobi will have trouble with an expression like (Appel_office_num*Rho_appel[t])^i — where i can be as great as 60 — and with values of param fact that range as high as fact[60] \approx 10^{81}. In general, it is better to express a model using binary variables and logical expressions, rather than using complicated mathematical expressions.