Export GAMS file into AIMMS

531 views
Skip to first unread message

Sesha

unread,
Jan 20, 2011, 6:58:40 PM1/20/11
to AIMMS - The Modeling System
Hey all
I want to know how the whole export thing of .gms file into AIMMS
works out.
I also want to confirm whether the academic license of AIMMS is
unrestricted [ no limits on variables/constraints/solvers etc] ? I
dont have full license of GAMS so am trying to import/recode .gms file
into AIMMS and run it on AIMMS.
Can anybody give me some pointers on interoperability between GAMS/
AIMMS?

Thanks,
Sesha

ck

unread,
Jan 22, 2011, 8:41:18 AM1/22/11
to AIMMS - The Modeling System
Hi Sesha,

AIMMS has a filter to import GAMS models.
The following dialog will lead you through the process of
converting a GAMS model to an AIMMS model.

a. Create a new AIMMS project in the folder of the main
GAMS model.
b. Via the AIMMS menu:
File - Open model...
c. The Open model file dialog has a model type selection
that reads "Binary model file (*.amb)"
Switch this to "Text model files (*.aim)"
d. With this type of model both .gms and .aim files are
shown in the dialog.
e. Select your GAMS model.
f. You will need to enter the filename of the
converted model. This must be a .aim file.

Remarks:
- Syntax errors may occur, especially on the more recent
additions to GAMS.
- The filter is part of the AIMMS compiler, so AIMMS shows
as action "compiling".

With respect to your licensing question: The academic license
has no restrictions on the number of constraints / variables.

Hope this helps,

Chris Kuip
AIMMS Software developer

Abubakar Sani Hassan

unread,
Sep 10, 2015, 7:58:18 AM9/10/15
to AIMMS - The Modeling System
Hi Chris

I tried this procedure with my gams model but when I change it to (*.aim)" , I only see the aimms projected I created, without the my gams model .gms. When I change to all files, and select the gams model, I get the error: "The selected file is not recognized as a valid model file".

kind Regards
Abubakar

Marcel Hunting

unread,
Sep 10, 2015, 8:44:31 AM9/10/15
to AIMMS - The Modeling System
Hi,

The procedure described by Chris only works in AIMMS 3. Unfortunately, AIMMS 4 cannot read or convert GAMS model so you would need to install AIMMS 3 to convert the model yourself. But, if you attach your GAMS model here then we can convert it for you.

Best regards,

Marcel Hunting
AIMMS Optimization Specialist

Abubakar Sani Hassan

unread,
Sep 10, 2015, 4:50:00 PM9/10/15
to AIMMS - The Modeling System
Many thanks Marcel, I have converted it with aimms 3, now going through the syntax errors as Chris rightly pointed out.

Diederik Kuipers

unread,
Mar 11, 2016, 4:16:48 AM3/11/16
to AIMMS - The Modeling System
Hi Marcel,

Unfortunately I'm running AIMMS 4, could you please convert these two files? 

Kind regards,

Diederik
EMMA.gms
EMMA_call.gms

bill b

unread,
May 3, 2016, 4:44:40 PM5/3/16
to AIMMS - The Modeling System
Hi Marcel

I have access to AIMMS3.7 but it does not seem to recognize the gams files either.  Am I doing something wrong or is 3.7 too new?

Thanks,

Bill

bill b

unread,
May 3, 2016, 5:16:31 PM5/3/16
to AIMMS - The Modeling System
Sorry you can discard the bit about it not working

I think the initial problem was a skipped a step.

It now reads in fine except for the last statement where it really doesn't like the periods

MODEL contracts

/eqn2a.pi_spot, eqn2b.pi_contract, eqn4a.q, eqn4b.q_spot, eqn4c.q_contract, eqn4d.alpha, eqn4e.beta

eqn6a.s, eqn6b.s_spot, eqn6c.s_contract,eqn6d.gamma/;



Any thoughts?

Marcel Hunting

unread,
May 3, 2016, 6:24:44 PM5/3/16
to AIMMS - The Modeling System
Hi,

The GAMS to AIMMS converter was not perfect. It could not handle complementarity couples like in this model. To convert this you have to modify the GAMS model and later on make changes in the AIMMS model manually.

First you have to remove the complementarity couples by replacing

/eqn2a.pi_spot, eqn2b.pi_contract, eqn4a.q, eqn4b.q_spot, eqn4c.q_contract, eqn4d.alpha, eqn4e.beta

eqn6a.s, eqn6b.s_spot, eqn6c.s_contract,eqn6d.gamma/;


by

/eqn2a, eqn2b, eqn4a, eqn4b, eqn4c, eqn4d, eqn4e

eqn6a, eqn6b, eqn6c,eqn6d/;


Now AIMMS should be able to convert the model. In the AIMMS project, for each complementarity variable that was removed in the previous step (e.g. pi_spot, pi_constract) you have to change it from Variable into a Complementarity Variable. Finally, in the Complement attribute field of the variables you have to fill in the name of the corresponding complementarity constraint. So for pi_spot you should fill in eqn2a, for pi_constract you should fill in eqn2b. etc. Note: you should only fill in the name of the constraint and not add indices.

Best regards,

Marcel

bill b

unread,
May 4, 2016, 3:43:31 AM5/4/16
to ai...@googlegroups.com
Thank you!

--
You received this message because you are subscribed to a topic in the Google Groups "AIMMS - The Modeling System" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/aimms/L6yBTSm55-w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to aimms+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ramiro Saltos Atiencia

unread,
Sep 30, 2016, 7:10:58 AM9/30/16
to AIMMS - The Modeling System
Hi dear Marcel. I am new AIMMS user and I am evaluating it. Could you help to convert the attached gams model to aims model, please?

Regards
Ramiro
ModeloForestal.gms

Marcel Hunting

unread,
Sep 30, 2016, 10:13:09 AM9/30/16
to AIMMS - The Modeling System
Hi Ramiro,

To convert this file we would also need all the .txt files that are included, e.g., ParIN.txt, ParVol.txt, etc.

Best regards,

Marcel

Ramiro Saltos Atiencia

unread,
Oct 2, 2016, 4:46:16 AM10/2/16
to AIMMS - The Modeling System
Hi, I have attached all txt files. Some parameters are initialized inside gams since I do not have the text file.
projdir.rar

Marcel Hunting

unread,
Oct 5, 2016, 5:04:12 AM10/5/16
to AIMMS - The Modeling System
Hi,

I am afraid that I have not been able to convert your GAMS model. The converter in AIMMS 3 (which was removed in AIMMS 4) was not perfect and could not convert all GAMS models. Often it is possible to make some changes by hand to "help" the converter but in your case that did not work.

Best regards,

Marcel

Vitali Avagyan

unread,
May 24, 2017, 8:31:06 AM5/24/17
to AIMMS - The Modeling System
Dear Marcel,

Can you convert my GAMS model into AIMMS please? I tried to download the AIMMS 3 and follow the instructions but all was in vein.

Now I am using AIMMS 4.34

Thank you.

Kind Regards,
Vitali

Marcel Hunting

unread,
May 24, 2017, 9:00:12 AM5/24/17
to AIMMS - The Modeling System
Hi,

Sure, I will try to convert it if you attach the GAMS model file.

Best regards,

Marcel

Vitali Avagyan

unread,
May 24, 2017, 10:34:43 AM5/24/17
to ai...@googlegroups.com
Thanks, Marcel.

Here it is. Thanks in advance.

Kind Regards,
Vitali

Kind Regards,
Vitali

--
You received this message because you are subscribed to a topic in the Google Groups "AIMMS - The Modeling System" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/aimms/L6yBTSm55-w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to aimms+unsubscribe@googlegroups.com.
convert.gms

Marcel Hunting

unread,
May 25, 2017, 12:14:00 PM5/25/17
to AIMMS - The Modeling System
Hi,

AIMMS does not support gdx and therefore I had to remove that part from the GAMS files. So, I am afraid you still have to implement the Excel part. Also, AIMMS cannot convert, e.g.,

  $set demandScale

so I replaced it by a scalar; I guess that should be ok. See the attached AIMMS project.

Best regards,

Marcel


On Wednesday, May 24, 2017 at 4:34:43 PM UTC+2, Vitali Avagyan wrote:
Thanks, Marcel.

Here it is. Thanks in advance.

Kind Regards,
Vitali

Kind Regards,
Vitali
ProfitStore.zip

Vitali Avagyan

unread,
May 26, 2017, 5:16:30 AM5/26/17
to ai...@googlegroups.com
Marvellous! Thanks a lot, Marcel.

Kind Regards,
Vitali

Kind Regards,
Vitali

David Bernal

unread,
May 30, 2018, 7:31:38 AM5/30/18
to AIMMS - The Modeling System
Hi, is there a chance of translating into AIMMS the GAMS file attached? I have requested an academic license but with AIMMS 4.53 I haven't been able to import this GAMS file.
Thanks in advance for this.
Best regards,
David

Kind Regards,
Vitali


Kind Regards,
Vitali

To unsubscribe from this group and all its topics, send an email to aimms+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "AIMMS - The Modeling System" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/aimms/L6yBTSm55-w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to aimms+un...@googlegroups.com.
Untitled_1.gms

Marcel Hunting

unread,
May 30, 2018, 7:44:47 AM5/30/18
to AIMMS - The Modeling System
Hi David,

You cannot use AIMMS 4 to convert a GAMS file into an AIMMS project. You can convert it using AIMMS 3 (with some hassle). Attached you can find the AIMMS 4 project of your GAMS model.

Best regards,

Marcel
elec.zip

David Bernal

unread,
Jun 1, 2018, 3:46:58 AM6/1/18
to ai...@googlegroups.com
Thank you! Looking forward to playing with the model there.
It seems that running the 4 "scenarios" that I have in the code is not as trivial as changing the parameter value and rerunning the optimization though.

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aimms+unsubscribe@googlegroups.com.

Marcel Hunting

unread,
Jun 1, 2018, 4:49:53 AM6/1/18
to AIMMS - The Modeling System
Not sure what you mean by that but if you have any new issue, please create a new topic.

Marcel


On Friday, June 1, 2018 at 9:46:58 AM UTC+2, David Bernal wrote:
Thank you! Looking forward to playing with the model there.
It seems that running the 4 "scenarios" that I have in the code is not as trivial as changing the parameter value and rerunning the optimization though.

David Bernal

unread,
Jun 12, 2018, 1:16:21 PM6/12/18
to AIMMS - The Modeling System
Hey Marcel,
Thank you so much for your help and suggestions. Is there any plan to reintroduce the GAMS reader in the next AIMMS releases? I am in the process of translating some old GAMS models to AIMMS and doing it by "hand" would take some unnecessary time.
What is the procedure to do it? Which version of AIMMS 3 should we use to import it? Once it is imported, is it immediately compatible with new AIMMS versions?
Thank you for your time.
David

Marcel Hunting

unread,
Jun 14, 2018, 7:31:19 AM6/14/18
to AIMMS - The Modeling System
Hi David,

We have no plans for reintroducing a GAMS reader in the (near) future.

To convert GAMS models to AIMMS you need an AIMMS 3 version, preferably the last one which is version 3.14. The GAMS converter was not perfect so sometimes you get errors and you have to (temporary) modify the GAMS file before AIMMS can convert it. You will then get an AIMMS project in AIMMS 3 format. Then you need one of the first AIMMS 4 versions (<= 4.9) to convert the AIMMS 3 format into AIMMS 4 format. Support for AIMMS 3 project was removed in AIMMS 4.10.

Best regards,

Marcel
Reply all
Reply to author
Forward
0 new messages