Skip to main content
Solved

Problem in giving a min. value to my index

  • Apr 22, 2022 6:39 PM UTC
  • 3 replies
  • 228 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

View original

3 replies

gdiepen
AIMMS Champ
Forum|alt.badge.img+7
  • AIMMS Champ
  • Apr 26, 2022 10:58 AM UTC

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
  • Answer
  • Apr 27, 2022 12:25 AM UTC

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
  • Jun 6, 2022 6:23 PM UTC

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