Best answer by GertjanView original
Objective Function Problem:
Hi, the "objective function" of my program is read as a variable in AIMMS. All the parameters in the objective function already have a data read from excel. My problem is, AIMMS keeps on saying "the scope of index i has not been specified" when I try to specify the index, the program won't run because it will say that the objective function should be a free scalar variable. What should I do?
Already have an account? Login
Please use your business or academic e-mail address to register
Login to the community
No account yet? Create an account
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Taking a quickly glance at your model, the basic answer is that you can't have a free index (i,j) within your objective function, i.e., you need to use a function to iterate over these indexes if you specify them.
But, in order to give you a complete answer I would need to understand the relation between your variable x(v,k) and the parameter tt(i,j).
I noticed that you are using min(P) but none of your parameters nor variables depend on it.
Maybe other community member could help you better.
BTW (if I may): Looking at some of your identifiers and specifically constraints, you might want to give them some more self-explanatory names (you did that for Sets). This will make the model easier to read and debug (e.g. saying Constraint_12 is infeasible is less intuitive than calling it RespectDemand). Same for objective, is this a Cost, Revenue or so? Also, when you come back later, you are able to read the model-tree and understand what the model does. Just as an illustration: