Skip to main content
Solved

exists function with corresponding indices

  • April 16, 2025
  • 1 reply
  • 28 views

Forum|alt.badge.img+1

 Hi,

Say I have the parameters shown below.

I am using the “exists” function to check whether there is a “1” for each category during the time range from 1:00 to 5:00.

While “exists” returns a logical value indicating whether a “1” is found, it does not return the index. Along with using the exists function, how can I also find the indexes corresponding to the “1”s in my parameters?

Thank you!

 

Best answer by luispinto

Hello!
I guess it depends a bit on how you want to use those indexes.

In one scenario, let's say your original parameter is p_resourceAvailable(i_category,i_time) and you want to use the indexes to restrict another parameter, for example, p_resourceLimit(i_category,i_time), you can simply use p_resourceAvailable in the index domain of p_resourceLimit, somthing like this:

 

Set s_time {
Index: i_time;
}


Set s_category {
Index: i_category;
}


Parameter p_resourceAvailable {
IndexDomain: (i_category,i_time);
}


Parameter p_resourceLimit {
IndexDomain: (i_category,i_time) | p_resourceAvailable(i_category, i_time);
}

 

So, limiting which combination of indexes will be used in an index domain, sum, a for loop, etc. can be done by using the original parameter.

Is this what you are seeking?

If not, can you share more about what you intended to use the index for?

1 reply

luispinto
AIMMSian
Forum|alt.badge.img+6
  • Customer Success Manager
  • 65 replies
  • Answer
  • April 16, 2025

Hello!
I guess it depends a bit on how you want to use those indexes.

In one scenario, let's say your original parameter is p_resourceAvailable(i_category,i_time) and you want to use the indexes to restrict another parameter, for example, p_resourceLimit(i_category,i_time), you can simply use p_resourceAvailable in the index domain of p_resourceLimit, somthing like this:

 

Set s_time {
Index: i_time;
}


Set s_category {
Index: i_category;
}


Parameter p_resourceAvailable {
IndexDomain: (i_category,i_time);
}


Parameter p_resourceLimit {
IndexDomain: (i_category,i_time) | p_resourceAvailable(i_category, i_time);
}

 

So, limiting which combination of indexes will be used in an index domain, sum, a for loop, etc. can be done by using the original parameter.

Is this what you are seeking?

If not, can you share more about what you intended to use the index for?



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

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