Topics about getting started or leveling up as an AIMMS developer. Datalinks, AIMMS language, building apps...
- 557 Topics
- 1,205 Replies
How-to: Manage sub job completion with pro::messaging::WaitForMessages
Waiting for sub jobs to complete For large jobs, it may make sense to split it into multiple jobs. It may not be convenient, or appropriate, to let the client session organize the communication between the various jobs.This article presents and discusses an example, whereby one control job manages several sub jobs. In addition, results are presented in the client session when all jobs are finished. Read more...
How much data can be plotted in Histogram of AIMMS?
Hi, I’ve been trying to run some Monte Carlo simulations, but apparently if the number of runs is more than 500, the Histogram cannot be made. AIMMS returns some arithmetic error that I don’t understand. How can we increase the number of data that Histogram can make?Thanks,Zulfan
how to store solutions in Monte Carlo simulation
Hi, I was trying to play around with Monte Carlo simulation in AIMMS. I can save the results from MP.Objective for every run. But, how can I save the solution for every run? I tried to use something like below for every run:Variable_Result(run, param1, param2) := Variable(param1,param2);It’s in the procedure “RunMonteCarlo” in the attached file. But, it doesn’t work. Any idea?Thanks,Zulfan
Community Edition Birthday!
Our AIMMS Community License has completed it's first year! 🎉🎊🎈And we are very happy in the reception that this free edition got by our users.Looking back at the original post, I love the proposed intentions for this release. To quote @Gloria Quintanilla :Whether it’s crafting a plan to reduce your personal carbon footprint, creating a schedule for your kids’ school or simply to learn and experiment, AIMMS Community Edition is ideal for those who want to apply modeling to improve decision making. It’s also a great companion for recent graduates who previously used an AIMMS Academic License but want to continue playing with the software at no cost, or showcase their AIMMS skills to prospective employers. So, what did the community edition do for you? Please share with us!And if you still don't have a license, jump right on:https://licensing.cloud.aimms.com/license/community.htm?utm_source=website&utm_medium=footer
PageCopyTableToExcel Procedure - Save Results to Excel
Hello, I want to save the results of various variables into an Excel Workbook. All the results I want to save are on the “Multiple Iteration Dashboard ” Page I created. I read about the function PageCopyTableToExcel that would allow me to save those results (https://documentation.aimms.com/functionreference/user-interface-related-functions/page-functions/pagecopytabletoexcel.html#pagecopytabletoexcel). You can find my projects attached to this question. To do so, I created a Procedure named “ExportExcel” where you can find the following code : if not axll::WorkBookIsOpen(WorkbookFilename : "Book1.xlsx" ) then axll::OpenWorkBook(WorkbookFilename : "Book1.xlsx" );endif; PageCopyTableToExcel(pageName: "Multiple Iteration Dashboard", tag: "FuelEfficiency", includeHeaders: 1, selectionOnly: 0, ExcelWorkbook: "Book1.xlsx", Range: "A1:Z150"); I went into the Fuel Efficiency Table Properties to correctly tag it as “FuelEfficiency”.However, I got t
Merge Requests in GitLab regularly lead to problems
Hello everyone,in contrast to other programming languages, the source code of an AIMMS model usually is in a single file. Our code is hosted at a GitLab instance. Our team notices, that GitLab struggles with the large .ams-file, especially in merge requests. Sometimes the diff is too large to be shown, posting comments (as a reviewer as part of a code review) fails, or loading already posted comments fails. The size of our .ams-file is usually between 1 MB and 5 MB.Has anyone else experienced similar issues? Does anyone know a good alternative to conduct code reviews, which does not involve hosting the code on a different platform?I’m aware that we could use libraries to divide the code in smaller chunks, however, I feel like this is not as easy as in other programming languages and not the way it’s “supposed to be” in AIMMS.Best regardsBenedikt
Substitute for "sumproduct" Function in Excel
Hey Guys,I have a small problem by modeling my MILP.I created a Matrix do define some Binary Variables. Now I want to create a constraint, which contains a multiplication between the Matrix of the Variables an a Matrix with some parameters. The result should be a scalar value comparable to the sumproduct-function in Excel. I want to do a multiplication between the matrices an the result should be a scalar?Hopefully there is a simple function in Aimms to solve my problem.I am thankful for every help!Best regardsSimon
Loop in Main Execution to change a parameter at each iteration
Hello, I want to solve an optimization problem with a minimization of costs. I would like to create a loop that would help me solving the same model but changing only one parameter of my objective function at each iteration. The logic is the following : While (Parameter <= Bound ): Solve Objective_Function(Parameter); Parameter = Parameter + 1; where “Parameter” is the parameter I want to change at each iteration of the loop. where “Bound” is simply a bound to stop my while-loop. where Objective_function is simply the objective function of my problem and depends on the parameter that should change at each iteration. Could you help me? Thank you.
How to get ranges for specific values of variables
Hello, everyone！Now I have a problem about how to set ranges for specific values of a variable. I have a variable “Cmatrix(t,x,conv) ” and “t,x,conv” are some sets. I need that Cmatrix(t,x,conv) ∈ [-1,1] only when conv ≠ 'Heat_pump' . And Cmatrix(t,x,conv) >1 only when conv = 'Heat_pump'. How do I write this in the red box? When I set a constraint to bound the “Cmatrix(t,x,conv) ”, there will be errors as “The solver CONOPT 4.1 cannot handle the ranged constraint Cmatrix_except_HP(1,Elec,CHP_engine) in mathematical program "Cost_minimization"; please define the middle term as a variable and add bounds.” Can some kind person save me? Thank you so so so much! Wish you happy every day.
Demo impressions 4/3/2022
New internal demo and here I am to share! Remember what I share here is not (necessarily) released yet and can change or even be discarded! I just give the scoop.Connecting the dots is a new functionality in the combination chart that can allow you to “connect the dots” quite literally! So if you have a line chart and have missing data (for some x values), you can still connect the data that is present.Example of connecting dotsAutomatic conversation of classic charts to new combination chart! I really appreciate the effort into building this functionality making life so much easier, but still maintaining the original chart so you'll always be safe in using this. I also enjoyed the improvement to table filtering explicitly separating regex functionality from others. This is already released: https://documentation.aimms.com/webui/table-widget.html#regular-expressions
Getting a 'Starting up Aimms failed' error when linking to Python
Hiya! I’m completely new to AIMMS so apologies if this is a really fundamental thing to ask. I’ve been working on a model that I would like to call from within Python using AimmsCmd - for now while I’m just trying to get it to work, my code in Python linking to AIMMS is pretty much identical to the script in the guide to running batch commands:aimmsPath = "C:\\Users\\44750\\AppData\\Local\\AIMMS\\IFA\\Aimms\\184.108.40.206-x64-VS2017\\Bin\\AimmsCmd.exe"command = aimmsPath + " solver.aimms < cmds.txt > log.txt"solve = subprocess.call(command, shell=True)log = open("log.txt","r")print(log.read())log.close()When I execute it however, I get this error:Error: Unable to open AIMMS with "--as-server --ignore-dialogs --hidden "solver.aimms"": Starting up Aimms failed. Program initialization error.Thinking it was probably my model or my code that was flagging up the error, I downloaded the StandAlone example from that same guide and copypasted the Python script - but it returned the exact same
Creating Stochastic model from an existing deterministic NLP problem
Hi. Please, I would like to know if it is possible to create a stochastic model from an existing deterministic Non-linear programming problem using AIMMS. I need great help regarding generating scenarios in a multiperiod Optimization problem containing 3 uncertain parameters.Thank you
Demo impressions 18/02/2022
Last Friday, we had another fantastic demo session.Here are my thoughts and impressions:API Key generations and handling (aka PRO REST API Keys) - this is really cool! As in several API services available, PRO will also have key generation available to interact with the REST server. As always, security comes 1st, so all necessary measures are in place to use this properly and securely. Looking forward to checking all the automation that will be available from this. /
How to use the Data Exchange Library for extracting files and datahow-to
As a follow-up on this first article, a new How-To article is published about the extraction of files and data using the Data Exchange Library (DEX). It shows the difference in using the DEX vs the HTTP library and gives examples on how to read data from both a saved file and from a memory stream.Go to article: How to use the Data Exchange Library for extracting files and dataThe next article in this series will be about using the different data formats. After that, we will go in depth on integrating OAuth using DEX. Let us know if you have suggestions for other follow-up articles!
Employee training problem
Hi, I have been following the Employee Training example. However, I cannot run the code (attached). It is said that the solution does not exist. I don’t know what causes it.Furthermore, how do I check and know if the equations are not feasible ya? I’ve been looking into this Math Inspector, but somehow it’s difficult to understand for me. Thanks,
Cannot get the same results when using newer version of aimms
Dear all, Few years ago, I used Aimms to create the file as attached. At that time, CPLEX 12.17.1 package was used to solve the MILP supply chain model. However, when I use newer packages (12.8,12.9,20.1) to run the same file, it gives me very different results. Especially, the “CO2_Capture_Compression_Cost” variable is 0 although it should be 5.6 billion euros as I got. I tried many ways to find why it happens but it doesn’t work. Does anyone can help me in this problem? Thanks a lot for your read and help. P/s: please run “ReadCO2sourcedata”, “ReadProductssinkdata”, and “ReadStoragesinkdata” to get initial data from “CO2dat” excel file before running the program.
How to find unused identifiershow-to
Find unused identifiers in your AIMMS project Applications that are around for a while clearly have value to the organization. However, some identifiers such as sets, parameters, variables, and procedures in that application may no longer be used, because: They were created for analyzing and testing a particular circumstance. Once the circumstance is handled, the corresponding identifiers can be removed. As the application evolves, some functionality may become obsolete. There are some disadvantages of having obsolete identifiers in the application: It may confuse your successor, as he/she wonders why an obsolete identifier was added. For a defined parameter or set, it may take up a significant amount of memory and thereby also increase the size of cases. Read more...
Demo impressions 04/02/2022
I am back with the insider's view of our internal demo sessions for new developments. Let me share impressions: Some interesting developments in the AIMMS Presolver, namely the dual reductions. This new development (which can seek and eliminate unnecessary variables) can significantly improve memory usage during the solve phase. If that is your case, I would definitely take a look at it here. Webui has continued to evolve our combination chart with some very nice looking charts to add on top of the bar chart: line, scatter, area, spline… Very helpful for analyzing data and customizing for end-users. And, on top of that, some added functionality to coloring, based on indexes and with transparency. To me, it looks great! Finally, some additions to our Pro Account Manager. This should facilitate managing accounts in our Pro environments from a programmatic pov. Was this useful ? Do you like any of the above news? Let me know!
Comparing two generated math programsHow-to
If you have two versions of an AIMMS project in which you solve a math program then it can sometimes happen that you get two different solutions (after running) while you expected that both versions would return the same solution. Assuming that you are using the same solver (and version), and the solver does not hit a time limit, this usually means that the math programs generated by AIMMS are different. One approach to find these differences is described below.First create the constraint listings for both project versions by setting the following Solvers General options:'Constraint Listing' to 'At every solve' (or 'At first solve') 'Constraint Listing Variable Values' to 'Print variable values'By setting the second option AIMMS will not only print the level values of all variables in the generated math program, but also their upper and lower bounds.The constraint listing will be printed at the end of the solve (by default) but you can also generate it at the beginning of the solve by
Demo impressions for 21/01/2022
Today I participated in an internal demo to showcase some new internal developments. I want to share with the community my impressions: We have continued to evolve our OAuth capabilities on PRO/CLOUD with DEX and OpenAPI. If this is something you need, see that it was part of our release notes: DEX - Release notes Another very nice development that will help our team to replicate our Linux build agents we have a Dockerized Linux Environment. Much easier and guaranteed. (PD&I team was happy!) If your thing is automation, you will be happy to know that we have been working on allowing the Linux environment to build the .aimmspack for a project. This will be available in the AIMMS Command Line Tool. WebUI showed off some quality of life improvements for widget wizards. Even more exciting were the new features with the Combination Chart Widget that will be accessible in the experimental features. Bar chart, legends, zoom,… so many things! Our newest colleague (Vlad) also d
What we're reading (January 2022)
Hi folks, just taking a moment to share some good reads from the OR and optimization space that are making the rounds here... Optimization: From Its Inception by Thomas L. Magnanti Algebra: the maths working to solve the UK’s supply chain crisis by Michael Brooks You (also) need Mathematical Optimization in your organization … now! by Baris Cem Sal Art meets Operations Research — Menu Planning at HelloFresh by Robert Dochow Operations Research Analyst: The Fastest-Growing Job You've Never Heard Of by Edward Rothberg …feel free to share anything good you come across too!
Hi,Is there an pre-defined SAP integration? I am having issues (being approved by the IT for such access) to get SAP ODBC driver. Looking for alternatives, I found that using the SAP integration suite, companies have built APIs to access data from SAP. I wanted to know if AIMMS has such APIs available, or is the ODBC driver the only approach? Thanks
How to use the Data Exchange Library for data connectionHow-to
In this new How-To article, we explain the basics of the Data Exchange Library (DEX) and how to integrate a dataset (in our example: JSON) automatically into your AIMMS model by using a mapping file.This article is the start of a How-To series on the DEX. Let us know if you have any questions about using the DEX and/or suggestions for follow-up articles! Go to article: How to integrate the Data Exchange Library
Already have an account? Login
Please use your business or academic e-mail address to register
Login to the community
No account yet? Create an account
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.