I have a function in my code that builds a model and solve it and return the result. I have to call this function repeatedly. Although my code works properly I get the following warning after calling the function which makes my code super sluggish as it goes forward.
Warning: A variable or constraint named va is already attached to this model. If creating variables programmatically, use the anonymous variable syntax x = @variable(m, [1:N], ...).
Can you please let me know how I can get rid of the model after it is solved to prevent this issue. Any help would be appreciated.
It is not clear how to define variables as is suggested by the warnings. variables in the model are kept and new variables would be added to the model as the code goes forward. There should be a way to get rid of the older variables in the model. Please let me know if you have any information about removing variables in a model. Thanks in advance!