Topics about getting started or leveling up as an AIMMS developer. Datalinks, AIMMS language, building apps...
- 557 Topics
- 1,205 Replies
How to Customize Settings for Errors and WarningsHow-To
This article explains how you can control settings for errors and warnings within AIMMS. In AIMMS, the difference between errors and warnings is summed up: [list] [*][b]Errors[/b] indicate that something is not correct. [*][b]Warnings[/b] indicate that something might not be completely correct. [/list] AIMMS has options that allow you to control almost every warning in AIMMS. These options have the following possible values: [list=1] [*]Off [*]Warning Collect [*]Common Warning Default [*]Warning Handle [*]Strict Warning Default [*]Error [/list] [url=https://how-to.aimms.com/Articles/265/265-settings-for-errors-and-warnings.html]Read more...[/url]
How To Check Computations with Units of Measurement NoteHow-To
A classical method employed by physicists to check equations is the use of units of measurement. The following equation, intended to model that a ship is kept afloat, is slightly wrong: MaxWeight * WaterDensity <= ShipVolume Deploying units of measurement, it is easy to recognize the mistake; and realize it should have been written MaxWeight <= ShipVolume * WaterDensity Question is: do you want to check this for all the expressions in your model? Probably not. The good news is that you can leave this kind of checking up to AIMMS. How does this work? [url=https://how-to.aimms.com/Articles/266/266-units-of-measurement-check-equations.html]Read more...[/url]
How to Localize Units of Measurement per UserHow-To
Optimization applications deal with numeric data. We find it easier to interpret when represented by familiar units of measurement. However, there is a risk of serious errors resulting from incorrect unit assumptions. Remember the Mars spacecraft NASA engineers lost due to this problem? One solution is to add code to an application in order to convert a value measured in, say, miles to a value measured in kilometers. But this can cause loss of accuracy, is prone to errors, and can become difficult to maintain. Luckily, AIMMS automates the task of adopting the numeric values to the units preferred by the user. [url=https://how-to.aimms.com/Articles/266/266-units-of-measurement-localized-data.html]Read more...[/url]
How to Save a Case from an AIMMS ProcedureHow-To
There are times you might want to save a case from within a procedure. For example, let’s say you want to run multiple scenarios and store the result of each one to a separate case. Instead of manually saving a case after running each scenario, you can save cases automatically with a procedure. That way, you can run a procedure that solves all your scenarios and saves cases after each solve, and let it run unattended. [url=https://how-to.aimms.com/Articles/258/258-save-a-case-from-aimms-procedure.html]Read more...[/url]
How to identify errorsHow-to
Need to track down the cause of errors in your project? When creating a case file, for instance during a [code]pro::DelegateToServer[/code], errors may occur during the evaluation of the definitions. Here we show a little trick to identify the set or parameter that has the definition in which this error occurred. [url=https://how-to.aimms.com/Articles/292/292-identifying-error.html]Read more...[/url]
How to identify data differences after refactorizationHow-to
We'll show you a streamlined process to identify the cause of data differences in a model after a refactorization using a diff tool. The process we’re following can be summarized like this: [list=1] [*]You’ll want to separate out each element, so it will be easy to break down the differences. [*]Then send each identifier to a separate output file in an output folder. [*]Do that for each version of the model, so you’ll have two output folders each containing output files to be compared. [*]Finally you’ll compare the two output folders with a diff tool to find the differences between the individual files. [/list] [url=https://how-to.aimms.com/Articles/290/290-identifying-differences.html]Read more...[/url]
How to Extract XML File from a Server with the HTTP LibraryHow-to
In this article, we will create an HTTP request to extract a file from a server without an identification system using the AIMMS HTTP library. An [b]HTTP request[/b] is used to communicate with servers. The following information is needed for the request: [quote][b]Method[/b] : The action you want the server to do. The most common methods are:[list] [*]GET (obtaining an object) [*]POST (sending an object to the server) [*]DELETE (deleting an object from the server) [/list][b]URL[/b] : The address of the server where the request should be addressed.[b]Headers[/b] : The headers are specification of the request. For example, specifying the type of file you want from the server. You can find a list of possible Headers for your request in this [url=https://en.wikipedia.org/wiki/List_of_HTTP_header_fields]Wikipedia article[/url].[b]Body (optional)[/b] : Used to store data you want to send to the server, for example in a POST method request.[/quote] [url=https://how-to.aimms.com/Articles/2
How to Extract Data from an XML FileHow-to
In this article, we will learn how to extract data from an XML file using the AIMMS XML schema mapping tool. You can apply the process to whatever data you like, but we'll use a breakfast menu as a simple example. [h3][b]File formats related to XML[/b][/h3] [list] [*][b]XML[/b] (EXtensible Markup Language) is a format optimized to transport data with a given hierarchical structure. It can be seen as a tree containing elements. Those elements can contain child elements, data, and parameters. Each parameter contains one piece of information about the element. [*][b]XSD[/b] (XML Schema Definition) is a file used as a schema for an XML file. It defines the elements and attributes which can be used, their hierarchy, data types, and can also define fixed values. [*][b]AXM[/b] is used in AIMMS as a mapping file. It specifies links between the XML elements and AIMMS objects. [/list][h3] [/h3][h3][b]Use Case[/b][/h3] [url=https://how-to.aimms.com/Articles/293/293-extracting-data-from-XML.html]
How to Retrieve Geographic Data with Google Maps APIHow-to
In this article, we will learn how to use the HTTP Library to obtain data from a Google Maps API. Those data will be distances between different places. Let’s say we’re planning a road trip in Europe. We can use the Distance Matrix API from Google Maps to calculate important information for our trip. We want to know: [list] [*]Distances between locations [*]Travel time from one location to another [/list][h2] [/h2][h3][b]Prerequisites[/b][/h3] Before we begin, there are a couple things you’ll need to have in place. [url=https://how-to.aimms.com/Articles/296/296-obtaining-geographic-data-through-the-google-api.html]Read more...[/url]
How to Extract Photos Using the Flickr APIHow-to
In this article, we’ll learn how to use the Flickr REST API with the AIMMS HTTP Client Library. The process to deal with a REST API in AIMMS is very similar from case to case, however you can find details of some differences in [url=https://documentation.aimms.com/httpclient/index.html]AIMMS Documentation: HTTP Client Library[/url]. Here, we use a concrete example of extracting photos from a Flickr gallery. [h2] [/h2][h3][b]Prerequisites[/b][/h3]Make sure the following have been done: [list] [*]Install the [url=https://documentation.aimms.com/httpclient/library.html#adding-the-http-client-library-to-your-model]AIMMS HTTP Client Library[/url] [*]Obtain an API Key [/list] [url=https://how-to.aimms.com/Articles/298/298-use-flickr-api.html]Read more...[/url]
How to Convert JSON to XMLHow-To
When you need input data from JSON files, you first need to convert JSON files to XML files to make the data compatible with AIMMS. Here we provide a conversion tool in the form of a custom AIMMS library. It contains a two-way conversion AIMMS library between XML and JSON files: [list] [*]ConvertFromJsonToXML [*]ConvertFromXMLToJson [/list] [url=https://how-to.aimms.com/Articles/283/283-convert-json-to-xml.html]Read more...[/url]
How to Use the IBM Image Recognition APIHow-To
In this article, we will show how to use the Image Recognition API from IBM to identify an image. This API takes an image (JPG, PNG, GIF, etc) and returns a JSON file (which we'll convert to XML) explaining the result of the machine learning algorithm trying to recognize it. [h3][b]Prerequisites[/b][/h3] Before we begin, make sure you have done the following: [list] [*]Read the [url=https://cloud.ibm.com/docs/services/visual-recognition?topic=visual-recognition-getting-started-tutorial]IBM tutorial[/url] to obtain your own API Key [*]Install the AIMMS HTTP Client Library according to [url=https://documentation.aimms.com/httpclient/library.html#adding-the-http-client-library-to-your-model]AIMMS Documentation: Adding the HTTP Client Library[/url]. [/list] [url=https://how-to.aimms.com/Articles/301/301-Image-Recognition.html]Read more...[/url]
How to Adapt a Solve Procedure with Callbacks for GMPHow-To
This article presents a general guide to converting from solve statements to using GMP, and how to adapt the existing callbacks and their activation.As an experienced model builder, you may want to convert from solving using the solve statement to using GMP functionality (with prefix gmp::). Using GMP offers several benefits, such as:Speed up Monte Carlo analysis Work with multiple solutions Use multi-objective, both weighted and lexicographic Solve in parallelHowever, when callbacks are used on the mathematical program, the callback procedures need to be modified and activated differently when using GMP. Read more...
How to Use the HTTP Client LibraryHow-To
In this article you’ll find an overview of the HTTP Client Library itself, plus a guide to existing How-To tutorials for using the HTTP Client Library. These articles cover some possible use cases for HTTP requests to give you guidance and inspiration for your own applications.Basic overviewAIMMS provides multiple tools to connect your models with other applications.The HTTP Client Library provides built-in functionality to submit HTTP requests from AIMMS.HTTP requests are used to communicate directly with servers to call services or download online documents. Read more...
Convert Files from DAT to DATAHow-To
AIMMS 3.0 stores cases were in so-called “data manager files”. AIMMS 3.12 introduced the .data format as an alternative. When upgrading AIMMS on a particular project, the data management style persists. For these upgraded projects, the data management style can be changed; it is a setting of the project. Read more...
How to Convert a GAMS Model to an AIMMS ModelHow-To
Got a GAMS model that you want to turn into an AIMMS model? Don’t start from scratch...it’s not really that hard to convert!You can follow this procedure to convert a GAMS file to an AIMMS project:1. Download AIMMS 3.14 and convert the .gms file to a .aim file.2. Download current AIMMS version and convert the old AIMMS project to a modern one using .ams file.3. Open the newly converted project in current version of AIMMS. These steps are discussed in further detail below. Read more... And, of course, if you need any help please leave us a comment or contact support!
How to Use UNICODE in AIMMS applicationsHow-To
Some older AIMMS applications were developed based on ASCII, and can be upgraded to using UTF8, thus empowering users with texts using the UNICODE character set. This article outlines this topic in detail:basic terminology overview of the use of character sets in the various AIMMS versions concerns on changing character sets how to upgrade older AIMMS applications for UNICODE Read more...
How to Connect AIMMS with GurobiHow-to
You can connect your on-premise Gurobi installation to AIMMS and use Gurobi as the solver for your math programs. Gurobi offers different kinds of on-premise licenses: 1. Single machine (named user or unlimited user) 2. Compute server This article outlines the process to connect AIMMS for each kind of Gurobi license. Read more...
Creating a Waterfall
Thanks to one of our users (thanks @Wim), who shared an App that showed a waterfall chart, I learned this can be easily achieved using the Bar Chart in combination with the WebUI Annotations and making the ‘base’ transparant.Knowing this is an important chart for some, please see below the result based on a flow of financial values. Attached the example project as well so you can check out the details.Enjoy.
How to use multiple indices for one setHow-To
You can use different indices to refer to the elements of the same set. Suppose we have a set, [code]Cities[/code], and a parameter, [code]Distance[/code]. We want to define [code]Distance[/code] over 2 dimensions ([code]from[/code] and [code]to[/code]) for the same set, [code]Cities[/code]. If you didn’t know that AIMMS can handle [b]multiple[/b] indices for a set, you might create two new subsets [code]CitiesFrom[/code] and [code]CitiesTo[/code], containing all elements of the set [code]Cities[/code], and each with its own index. Luckily, you can just assign [b]multiple[/b] indices to one set. [url=https://how-to.aimms.com/Articles/272/272-using-multiple-indices-for-one-set.html]Read more...[/url]
How to use a multi-objective approachHow-To
In this article we will compare a [b]multi[/b]-[b]objective[/b] approach to separately solving single objectives. Let’s take for an example a problem trying to find a healthy diet for a reasonable price. First let’s define our objectives: [list] [*]Minimize calories: I’m trying to lose some weight, so my healthy diet should be low in calories. [*]Minimize price: A reasonable price means that it doesn’t have to be the absolute minimum, but should be within a close range. [/list] Now, let’s use the [b]multi[/b]-[b]objective[/b] feature to solve. [url=https://how-to.aimms.com/Articles/276/276-multi-objective-approach.html]Read more...[/url]
How to tune CPLEX options with AIMMSHow-TO
The CPLEX solver has many options that influence the way CPLEX solves your model. For certain types of constraints and/or models, you can make an educated guess about which combination of options works best for your problem. However, sometimes you need more help. To help you out, CPLEX has some automatic tuning options. In AIMMS, you can access this CPLEX tuning tool via the following two functions: [code]GMP::Tuning::TuneMultipleMPS [/code] [b][img]https://clipboardjs.com/assets/images/clippy.svg[/img][/b] [code]GMP::Tuning::TuneSingleGMP [/code] [url=https://how-to.aimms.com/Articles/264/264-tune-cplex-options.html]Read more...[/url]
How to solve multiple problems in parallel with asynchronous solver sessionsHow-To
In this article, we explain how to use the [b]asynchronous[/b] solver sessions in AIMMS to solve multiple mathematical programs simultaneously, each using its own CPU core. Why use asynchronous solves? The current engine of AIMMS does not make use of the multiple cores that exist in most modern computers. This means that even if your computer has multiple cores, AIMMS only uses one to execute your project. However, some solvers support using multiple cores. This means that if you are solving a large LP or MIP problem, a solver like CPLEX or Gurobi use multiple cores in your computer to solve your problem. [url=https://how-to.aimms.com/Articles/261/261-solve-with-asynchronous-solver-sessions.html]Read more...[/url]
How to install CDM serviceHow-To
Installing CDM service allows multiple users to collaborate on a single AIMMS model. When developing an application using CDM, the embedded CDM server is ideal, as mistakes and restarts are easily captured by manually switching and/or clearing the database that stores the CDM data. When testing or deploying an application with multiple collaborating users, a CDM service needs to be installed that handles commits by storing the data and informing other users of these commits. [url=https://how-to.aimms.com/Articles/280/280-install-cdm-service.html]Read more...[/url]
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.