Solved

set declaration

  • 11 March 2020
  • 5 replies
  • 88 views

Badge

Hi all, tried to declare a new set with index d. Aimms complained that index d was already used BUT it is not used anywhere in aimms. I just can’t find any sets with index d. Tried also index s; same complaint from aimms. I opened another similar project and I was able to create sets with indices d and a. Not sure what’s happening. Any suggestions would be appreciated 

 

thanks

 

nick

 

icon

Best answer by Gertjan 12 March 2020, 22:31

View original

5 replies

Userlevel 5
Badge +2

Hi, @Nick .

If you press “Ctrl + F”, search for “d”, the button “Declaration...” becomes enabled?

If so, just click on it and you’ll find which identifier it is referencing:

Hope it helps.

Badge

Hi, thanks very much. it worked - i had a variable labelled as “d” so wasnt aware that i cannot declare an index with the the letter “d” as well. it seems that names of variables (or parameters) and indexation of sets are related

Userlevel 5
Badge +2

Hi, @Nick . Great! Yes, they are.

Userlevel 6
Badge +6

Hi @Nick,

to give some extra context: all identifiers in AIMMS need to have a unique names; this holds for a parameter, a variable, a constraint, a database table etc. An index is also considered an identifier and needs a unique name so it can be referenced as such.

We recommend using clear Variable names such as Transport, InventoryLevel etc. Sets have names as Depots, Customers etc with respective indices d of Depots and c of Customers. Then the variables will become Transport(d,c) and InventoryLevel(d), a parameter could be Demand(c) and a constraint DeliverDemand(d):  sum(d, Transport(d,c)>=Demand(c).

 

PS: You might like this blog post and how-to:

https://techblog.aimms.com/2016/09/23/set-subset-index-and-element-parameter-in-aimms/

https://how-to.aimms.com/Articles/184/184-use-multiple-indices-for-set.html

Badge

Hello @Gertjan , this is very helpful, thank you.

 

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator