Exitaimms

33 views
Skip to first unread message

Mauro Rozenberg

unread,
Jan 11, 2011, 3:15:01 PM1/11/11
to AIMMS - The Modeling System
Hi, I’m using the command line to execute Aimms with a component
license with the --as-server parameter. At the end of Mainexecution I
have placed the command exitaimms but it doesn’t seem to work.
When executed with the developer license a Save Case confirmation
windows appears. Is this stoping the exitaimms statement? How can I
change this?

Thanks,
Mauro.

Marcel Roelofs

unread,
Jan 13, 2011, 2:22:01 PM1/13/11
to AIMMS - The Modeling System
The problem is with the default MainTermation procedure added to the
model, as explained in the AIMMS help file:

MainTermination is one of the three standard procedures in the model
tree. This procedure is called prior to closing the project. Default
the procedure contains this AIMMS code:

if ( CaseSaveAll( confirm:2 ) = 1 ) then
return 1;
else
return 0;
endif ;

In this case, AIMMS will ask you to save your data whenever you want
to exit your project and a change has been made to the data since the
last time you saved it. If no data needs to be saved, or if the data
has been saved properly then the procedure returns 1, indicating that
AIMMS is allowed to close the project. If the user has canceled the
dialog, then the procedure returns 0, and AIMMS will not close the
project.

You can alter the contents of this procedure, but you should make sure
that you return the proper value. If you return 0 (or omit any return
statement), then AIMMS will not close the current project. To
indicate that AIMMS should close the project you must return a nonzero
value. For example, if you want to close the project without any
check on unsaved data, then this procedure should have the body:

return 1;

Note
• If you remove the procedure MainTermination from your model, then
when closing the project, AIMMS will perform default checks on unsaved
data (similar to the default contents of the procedure
MainTermination, described above). Thus, if you want to influence the
way in which AIMMS checks for unsaved data when closing the project,
you should not delete the procedure MainTermination, but alter its
contents.

Cheers,
Marcel Roelofs
Reply all
Reply to author
Forward
0 new messages