Skip to main content
Solved

Problem in giving a min. value to my index

  • April 22, 2022
  • 3 replies
  • 97 views

Forum|alt.badge.img

Hello everyone, 

 

In the problem that I have to solve, I have got two sets: j (=1, …, 5) and k (=1, …, 9). I also have a parameter: parameter(j,k) and I want that j begins from 2 (and not from 1) for this parameter. How do I put it in AIMMS?

 

Moreover, in my objective function I want to minimize the sum of my costs but for j >= 2. My current formula looks like this: sum[j, 200*W(j)]     with W(j) a variable

How do I specify that I want j to be larger or equal than 2?

 

Thank you

Best answer by mohansx

To add to gdiepen’s answer, when declare your parameter(j, k) as below

Index domain: (j, k) | ord(j) >= 2

You can have many conditions after | using the keywords and, or

3 replies

gdiepen
AIMMS Champ
Forum|alt.badge.img+7
  • AIMMS Champ
  • 155 replies
  • April 26, 2022

The AIMMS functionailty you are looking for is domain conditions, which you can use with the | (or such that) operator.

 

For example, your sum can be done like:

sum[ j | ord(j) >= 2, 200*W(j) ]

which you can read as:

sum 200*W(j) for all j for which holds that the ordinal position of j in its set is greater or equal than 2 (i.e. everything except the first element)


mohansx
Forum|alt.badge.img+5
  • Former AIMMSian
  • 223 replies
  • Answer
  • April 27, 2022

To add to gdiepen’s answer, when declare your parameter(j, k) as below

Index domain: (j, k) | ord(j) >= 2

You can have many conditions after | using the keywords and, or


jadaxu
Forum|alt.badge.img
  • Explorer
  • 7 replies
  • June 6, 2022

Hi @sachasbl,

Just wanted to check back - did you find the help you needed in this thread, or maybe you found another solution you could share with us? It might help others to know, and thank you so much! 🙂



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

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