Skip to main content
Solved

How to exclude "na" values in Min-/Max-Operators?

  • May 27, 2020
  • 6 replies
  • 243 views

Hello together,

I have declared a parameter as an Min-Operator, which have to indicate the minimal objective function value for each k across all j. 

Background: In each k at least one j is infeasible (objective function value = “na”) as certain restrictions are violated. As a result, the problem occurs that the Min-Operator outputs "na" as the minimum value for each k.

The Min-Operator’s definition is as follows: 

     Index domain: k

          min(j,Parameter(j,k))

Does anybody now how to exclude “na” in the Min-Operator’s definition? Thank you in advance!

Best regards

David

Best answer by Marcel Hunting

Hi @David Kik In the index domain of that constraint you can use

(j,k) | (Parameter(j,k) <> inf) and (Parameter(j,k) <> na)

such that the constraint will not be generated if Parameter(j,k) equals 'inf' or 'na'.

6 replies

Marcel Hunting
AIMMSian
Forum|alt.badge.img+4
  • AIMMSian
  • 258 replies
  • May 28, 2020

Hi @David Kik, you can use

min(j | Parameter(j,k) <> na,Parameter(j,k))

to exclude 'na’. Note that this will evaluate to 'inf’ if all Parameter(j,k) are equal to 'na’.


  • Author
  • Explorer
  • 3 replies
  • May 28, 2020

Hi @Marcel Hunting. Your suggestion works so far. Thanks a lot!

However, as you have already noted, the problem occurs that for a given k, all parameters (j,k) are equal to 'na' which results in 'inf' for this k. Consequently, this leads to a incorrect result. 

How can I exclude in my constraint (see below) that the resulting 'inf' is excluded and only positive values are considered for parameter (j,k)?

Constraint:

Auxiliary Variable >= Parameter(j,k) * Decision Variable (j,k)

 

Best,

David


  • Author
  • Explorer
  • 3 replies
  • May 28, 2020

Hi @David Kik, you can use

 min(j | Parameter(j,k) <> na,Parameter(j,k))

to exclude 'na’. Note that this will evaluate to 'inf’ if all Parameter(j,k) are equal to 'na’.

 

Hi @Marcel Hunting. Your suggestion works so far. Thanks a lot!

However, as you have already noted, the problem occurs that for a given k, all parameters (j,k) are equal to 'na' which results in 'inf' for this k. Consequently, this leads to a incorrect result. 

How can I exclude in my constraint (see below) that the resulting 'inf' is excluded and only positive values are considered for parameter (j,k)?

Constraint:

Auxiliary Variable >= Parameter(j,k) * Decision Variable (j,k)

 

Best,

David


Marcel Hunting
AIMMSian
Forum|alt.badge.img+4
  • AIMMSian
  • 258 replies
  • Answer
  • June 4, 2020

Hi @David Kik In the index domain of that constraint you can use

(j,k) | (Parameter(j,k) <> inf) and (Parameter(j,k) <> na)

such that the constraint will not be generated if Parameter(j,k) equals 'inf' or 'na'.


Andrew
  • Former AIMMSian
  • 50 replies
  • June 22, 2020

Hi @David Kik 

 

Has Marcel’s suggestions helped you with your question?

 

Best


  • Author
  • Explorer
  • 3 replies
  • June 26, 2020

@Marcel Hunting Thank you!

 

@Andrew yes, a lot!

 

Best

David



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

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