Aimms Command Line Tool - run

488 views
Skip to first unread message

Mayank Patel

unread,
Jul 6, 2012, 6:55:29 AM7/6/12
to ai...@googlegroups.com
Hi,

I am wanting to run my model (with user interface) in Linux. I understand that graphics is not supported, however, how can I load a saved case?

I thought of writing a procedure where use either CaseLoadCurrent or CaseSelect, but couldn't find a way to type in the name of the case i want to load using " " for example!

Any thoughts?

Thanks

Mayank

Guido Diepen

unread,
Jul 6, 2012, 7:36:10 AM7/6/12
to ai...@googlegroups.com
Hi Mayank,

The run statement of the AimmsCmd tool does not support running procedures that have arguments. This means that if you want to have a procedure that loads a given case via the AimmsCmd, you must do so by introducing a new string parameter CaseToLoad, which you assign a value with the let statement. After that, you have to execute a procedure that will load the case denoted by the value of the string parameter CaseToLoad.

For this procedure, you can use CaseLoadCurrent in combination with the CaseFind statements. You can find a small example about the inverse (i.e. saving a case) with code in the blog article:  http://blog.aimms.com/2012/06/save-a-case-from-aimms-procedure/ 

Guido Diepen
AIMMS Specialist

Mayank Patel

unread,
Jul 6, 2012, 11:09:55 AM7/6/12
to ai...@googlegroups.com
Thanks Guido,

Works well now, except for one thing. When loading the selected case, a dialog opens asking "Data of case "..." has changed, save changes?"
Is there away to turn off dialog messages?

Thanks

Mayank

Luis Pinto

unread,
Jul 6, 2012, 11:12:43 AM7/6/12
to ai...@googlegroups.com
Hey,

Just use the CaseSetChangedStatus(0) before loading.
This will tell aimms that there has been no changes and it shouldn't try and save.

Cheers,

Luis Pinto

www.unisoma.com.br


--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To view this discussion on the web visit https://groups.google.com/d/msg/aimms/-/coD208jb3_sJ.

To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/aimms?hl=en.

Sergio Bruno

unread,
Jul 6, 2012, 12:36:37 PM7/6/12
to ai...@googlegroups.com
There is a command line option --as-server that avoids those dialog problems

Mayank Patel

unread,
Jul 11, 2012, 6:31:37 AM7/11/12
to ai...@googlegroups.com
Hi,

Thanks for all the responses!

The CaseSetChangedStatus(0) command still raises the "do you want to save changes..." dialog box.

And when executing the run using the "--a -server" command in Linux, i.e. ("AimmsCmd --as-server /path_to/<proj_name>" and then "runMainExecution") it just hangs (for a run that take seconds in Windows)...i assume due to the "do you want to save changes..." dialog box!

I also tried "AimmsCmd.sh --run-only MainExecution /path_to/<proj_name>" but that returned me to the prompt, and there was no updates to the .dat file for new case saves.

Any thoughts, suggestions?

Thanks

Mayank
To unsubscribe from this group, send email to aimms+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/aimms?hl=en.

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+unsubscribe@googlegroups.com.
To unsubscribe from this group, send email to aimms+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/aimms?hl=en.

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+unsubscribe@googlegroups.com.
To unsubscribe from this group, send email to aimms+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/aimms?hl=en.

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+unsubscribe@googlegroups.com.
To unsubscribe from this group, send email to aimms+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/aimms?hl=en.

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+unsubscribe@googlegroups.com.
To unsubscribe from this group, send email to aimms+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/aimms?hl=en.

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+unsubscribe@googlegroups.com.
To unsubscribe from this group, send email to aimms+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/aimms?hl=en.

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+unsubscribe@googlegroups.com.
To unsubscribe from this group, send email to aimms+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/aimms?hl=en.

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+unsubscribe@googlegroups.com.

Guido Diepen

unread,
Jul 12, 2012, 5:44:20 AM7/12/12
to ai...@googlegroups.com
Hi,

the dialog message you get, is it stating that the case has changed, or that datasets have changed?

Also, you might want to set the contents of the MainTermination procedure to 
return 1 ; 

By doing so, you will not get any message anymore in case of unsaved data when you are closing the project.

Guido Diepen
AIMMS Specialist

Mayank Patel

unread,
Jul 12, 2012, 7:48:04 AM7/12/12
to ai...@googlegroups.com
Hi,

I get the message that the data has changed. Does this make a difference?

Thanks for the MainTermination suggestion, unfortunately I had already set this.

Thanks

Mayank

Guido Diepen

unread,
Jul 12, 2012, 7:59:05 AM7/12/12
to ai...@googlegroups.com
Hi Mayank,

the reason for asking is that there are two things in AIMMS, you have datasets and you have cases. If you are using datasets, it could be that the dataset is also containing unsaved data and this would show up as a separate dialog. If you are not using datasets, you don't have to worry about this information ;)

Can you please post the code of the procedure that is actually doing the load of the case? Also, which specific version of AIMMS are you using?

Guido Diepen
AIMMS Specialist

Mayank Patel

unread,
Jul 16, 2012, 12:02:06 PM7/16/12
to ai...@googlegroups.com
Hi Guido,

Sorry for the late reply.

Here is the code of the procedure "LoadSelectedCase"

ClearData ;
CaseSetChangedStatus(0,1) ;

CaseStudyName := "Test_run" ;

CaseFind(CaseStudyName,SelectedCase) ;

CaseLoadCurrent(SelectedCase,0,0) ;

Which is called in the "MainExecution" by

LoadSelectedCase ;

I am using AIMMS v3.11

Any ideas?

Thanks

Mayank

Mayank Patel

unread,
Aug 8, 2012, 11:24:02 AM8/8/12
to ai...@googlegroups.com
Hi Guido,

Any further thoughts to my last post?

Thanks

Mayank

Peter Nieuwesteeg

unread,
Aug 9, 2012, 1:46:43 AM8/9/12
to ai...@googlegroups.com
Hi,

You need to changed the order of the statements, such that the CaseSetChangedStatus will be right before the CaseLoadCurrent:

ClearData ;


CaseStudyName := "Test_run" ;


CaseFind(CaseStudyName,SelectedCase) ;


CaseSetChangedStatus(0,1) ;


CaseLoadCurrent(SelectedCase,0,0) ;


The reason is that you changed the data, after you set that changed status.

Peter
  
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/aimms?hl=en.

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/aimms?hl=en.

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/aimms?hl=en.

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/aimms?hl=en.

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/aimms?hl=en.

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/aimms?hl=en.

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/aimms?hl=en.

--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To post to this group, send email to ai...@googlegroups.com.
To unsubscribe from this group, send email to aimms+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages