How do you declare precedence in your model? You need to declare the parameter before reading the data to make it more efficiently.
If you are using the API, you could simply declare the parameter (in the model, with “param precedence;”) and pass the data for your matrix in some data structure your programming language provides (pandas, numpy array, lists…), instead of using the “data” format.
When I run your script I get different errors from your model:
ampl: include ALB1.run
ALB1.mod, line 13 (offset 169):
cannot enforce strict bound
context: var Tc >>> >0; <<<
ALB1.mod, line 15 (offset 183):
Tc is already defined
context: minimize >>> Tc;
You should enforce >= 0 for Tc instead of > 0 (you could adjust an epsilon > 0 and make Tc >= eps).
You have to give a name for your objective and constraints in ampl:
minimize f: Tc;
, would be a valid objective. There are more errors (some forgotten colon in the model). After solving them, I could just run the model. There is no problem with "precedence" in your current example.
Please, feel free to ask something if it is not clear, but try to provide accurate and consistent examples, then it is much easier for others to help you!
You can also take a look at some examples in this Colab repository, they might be helpful to write models.