Duplicating a model

309 views
Skip to first unread message

Mo

unread,
May 11, 2012, 4:03:46 AM5/11/12
to ai...@googlegroups.com
Hi,
 
I am looking at saving my existing model with a different name - similar to "save as" in MS word.
 
Following this I tried to use "save as" but it saves as .amb or .aim file. However I want to save a .prj file so I can continue to work on the newly saved model.
 
Is there any solution to this?  (If the existing model is too long then it could take a long time to type the entire model again nad save it as a new model)
 
Any help is appreciated
Mo

Guido Diepen

unread,
May 11, 2012, 4:15:31 AM5/11/12
to ai...@googlegroups.com
Hi Mo,

there is no thing as a 'Save-as' function of the complete project in AIMMS. The best way is to copy the contents of the complete directory containing the project to another project. If you want to actually rename the version, you can then follow the instructions in the Knowledge Base article  http://www.aimms.com/aimms/knowledgebase/kb000026.html  to rename all the different files of the AIMMS project.

Guido Diepen
AIMMS Specialist

Marcel Roelofs

unread,
May 12, 2012, 7:11:32 AM5/12/12
to ai...@googlegroups.com
Well, the thing about the MS world is that a Word or Excel document usually consists of a single file, hence "save as" is easily implemented and understood --- copy the file to the requested new name.

The average AIMMS project usually consists of multiple files, a project file, one or more library projects, multiple .amb or .aim files and/or other files that contain data relevant to your project, which *you* think are an integral part of the project.What do you expect to actually happen when you do "save as"? Saving the project file under a different name seems a pretty useless option, as it will keep the same model files, and I guess you want to also be able to change the model files independently of the original project (btw. this is what Visual Studio does :). If you want to rename model files as well: are there ones you consider to be shared, or should all be renamed, but then to what? 

Given this unclarity what "save as" actually entails, the most simple option seems to be to leave it up to you to copy the directory and all the files that you think are part of the project.

Cheers,
Marcel


On Friday, May 11, 2012 10:03:46 AM UTC+2, Mo wrote:

Mo

unread,
May 15, 2012, 10:33:49 AM5/15/12
to ai...@googlegroups.com
HI Guido, Marcel,
 
Thanks for your reply. I am trying to copy the directory and all the files. However I didn't succeed.
 
The reason to create another copy of my existing model is to have a basic version of the model which is the existing model and create another version of the existing model in which I intend to add additional constraints.
 
For some reason I could not copy the directory and all the files. Is there any step by step method to achieve this? Would much appreciate an elaborate method to perform this task.
 
Thanks,
Mo

Guido Diepen

unread,
May 15, 2012, 10:57:50 AM5/15/12
to ai...@googlegroups.com
Hi Mo,

very curious to know what is going wrong then while copying the complete folder. What exactly are you doing? The only step you need to perform is to use the Windows Explorer to go to the parent directory of the directory that contains your .prj file. After that, you just copy this directory as a whole to a new directory (e.g. Ctrl-c, Ctrl-v). I would not recommend doing the copying from within AIMMS itself, but just use the functionality provided by Windows for this.

If your goal is to make one basic version of your model and some other versions containing additional constraints, you can also put all of the additional constraints in your one project and use the Constraints and Variables attributes of the Mathematical Program identifier to instruct AIMMS which variables and constraints to consider when generating the actual model. 

Some basic information about this can be found on the AIMMS blog in the article http://blog.aimms.com/2012/02/selecting-variables-and-constraints-for-a-math-program/. Please note that this article only describes the basics. I am still working on some follow up articles that show different ways of (automatically) constructing the sets for the Variables and Constraints.

Guido Diepen
AIMMS Specialist

Mo

unread,
May 16, 2012, 12:03:31 AM5/16/12
to ai...@googlegroups.com
Hi guido,
 
Thanks for your reply.
 
I was finally able to figure out how to copy the files and paste it into another directory and rename all the files in the new directory (the way you had mentioned). This way I have two copies of the same project but with different names :)
 
I don't intend to include all additional contraints into a single project and choose from aomg them while executing. I would like to have it clean and prefer to have multiple versions. However, I will keep your suggestion in mind and use it when required.
 
Really appreciate your help and thanks again,
Mo

u112...@tuks.co.za

unread,
May 23, 2013, 3:30:08 AM5/23/13
to ai...@googlegroups.com
Following this discussion. I would like to know how to copy the data file from the old to the newly copied aimms file?
Dit

u112...@tuks.co.za

unread,
May 23, 2013, 4:02:27 AM5/23/13
to ai...@googlegroups.com
or how to make the data available to the copied file?


On Friday, May 11, 2012 10:03:46 AM UTC+2, Mo wrote:

Guido Diepen

unread,
May 23, 2013, 5:51:18 AM5/23/13
to ai...@googlegroups.com
Hi Dit,

if you rename the project file to another name, e.g.
OriginalNameOfProject.prj
to
NewNameOfProject.prj 

you should also just be able to copy the file OriginalNameOfProject.dat to NewNameOfProject.dat and after opening the NewNameOfProject.prj, it should automatically see the cases in the dat file again.

Note that you can also open another dat file via Menu > File > Open > Data File...

Guido Diepen
AIMMS Specialist

u112...@tuks.co.za

unread,
May 23, 2013, 9:21:31 AM5/23/13
to ai...@googlegroups.com
Thank you. I have actually used File>Export>aimmspack which actually copies everything once.

Dit.

This message and attachments are subject to a disclaimer. Please refer to http://www.it.up.ac.za/documentation/governance/disclaimer/ for full details.
Reply all
Reply to author
Forward
0 new messages