Skip to main content
Solved

Index by number


Forum|alt.badge.img

I would like to index by number for the code provided below, but I get the warning that numeric values can not be used for indexing. Is it possible in AIMMS to do this?

 

Best answer by gdiepen

If you make the set that the index belongs to a subset of Integers, you will not have to use the single quotes around it.

 

If you don’t do that, you will have to refer to the element by enclosing it in single quotes

View original

3 replies

Forum|alt.badge.img
  • Author
  • Explorer
  • 3 replies
  • June 8, 2021

I figured out that the numeric values should be within quotations marks, but I do now have a similar problem. How do I index on the value of Job j that depends on value specified by the parameter ProductSKU(j).

 


gdiepen
AIMMS Champ
Forum|alt.badge.img+7
  • AIMMS Champ
  • 153 replies
  • Answer
  • June 8, 2021

If you make the set that the index belongs to a subset of Integers, you will not have to use the single quotes around it.

 

If you don’t do that, you will have to refer to the element by enclosing it in single quotes


Forum|alt.badge.img
  • Author
  • Explorer
  • 3 replies
  • June 8, 2021

Thank you for your reply @gdiepen, it is now working properly :).