Skip to main content

Dear colleagues, I would like to ask for your assistance in order to declare specific parts in the definition field. I have three doubts:

1) How to implement a sum in definition in AIMMS in which one of the variables does not start from the first item?

Example: i=14j=16(Cprod.Pi,j+Cest.Ei,j)+j=26(Caum.∆Pi,j++Cred.∆Pi,j-)

 

2) How to implement an expression in definition in AIMMS that considers operations with two subsequent items (in different times)?

Example:  Ei,j=Pi,j+Ei,j-1-PDi,j

 

3) How to implement a value assignment for a specific indexed item in definition in AIMMS?

Example: P1,6=1500

 

Thanks for you assistance.

Hi Nelson,

1. I'm not sure what your example entails, so I present one of my own.

Assume you are building capacity by doing investments in various areas.  In an area, there can be an investment at multiple times.

Investment parameter: Inv(a,t) invest capacity in area a at beginning of period t.
Then the capacity cap(a,t) = sum( tp | tp <= t, Inv(a,tp) ). So the capacity at the period t is the cumulative capacity bought since the start up to the period at hand.

As you can see, the notation is a | to limit the values the index can take on, and to use a second index (with range the same set). You can use any expression between | and , so also something like t > first(time_set).
 

2. The notation AIMMS uses is a direct transcription of the algebraic notation you are using, so, your constraint definition (which is typical for modeling inventory):

E(i,j) = P(i,j) + E(i,j-1) -PD(i,j)

 

3. For assignments used in the body of a procedure, you can refer to the elements directly by using two single quotes.  As per your example:

P('1’,'6’) := 1500

If you want P to be a defined parameter, you may use something like:

definition: if i='1’ and j = '6’ then 1500 else …. endif 
 

or if all elements of P have a defined fixed value, then something like:

definition: data {
    (1,6) : 1500,
    (1,7) : 1600, 

    ….
}

Hope this helps,

Chris.


Reply


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

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