Hi, may i know how to tackle this problem? When working with multiple AIMMS modules in one project, is it possible to organize them within a single AIMMS file by creating separate folders for each project and its corresponding data? I have tried this approach (as shown in the screenshots), but when I run them individually, I am unable to obtain the expected results. Can you help me check if I'm doing this correctly?
Page 1 / 1
Hi @Anne ,
If you don’t set up a Write file into your Modules, AIMMS will write them all under MainProject/ProjectName.ams. For example:
The Modules without a source file:
My MainProject/ProjectName.ams:
If you set up a source file, then AIMMS will write in separate .ams files.
However, if I understood correctly, you want to have many datasets and run them independently in the same model? If so, you can save .data file per dataset you have. Load and run them independently. You will be able to even load all of these cases and compare the results.
If it is not it, and you just want to run different models inside the same AIMMS application with different identifiers, you can:
Set up your mathematical program to use only a subset of all Constraints and Variables.
Or/and use CaseFileSave to save parts of your identifiers, for example:
Define a procedure pr_saveCase with an input parameter for the case name:
Procedure pr_saveCase { Arguments: (sp_in_caseName); Body: { ! Save the case in the folder "data". if not DirectoryExists("data") then DirectoryCreate("data"); endif; CaseFileSave("data\\" + sp_in_caseName + ".data", AllIdentifiers); } StringParameter sp_in_caseName { Property: Input; } }
Call the procedure with a specific case name, e.g., pr_saveCase("Scenario1").
CaseFileSave function saves the data of all model identifiers (specified by AllIdentifiers) to the .data file in the "data" folder.
Custom subsets of identifiers can also be saved by replacing AllIdentifiers with a properly defined set of identifiers.
Best regards,
Sign up
Already have an account? Login Please use your business or academic e-mail address to register