Author Archives: Deanne Zhang
AIMMS provides a good selection of functions, such as arithmetic functions, string manipulation functions, time functions, distribution functions, file functions, and more, for app developers to build prescriptive analytics applications.
However, if you already have another program for certain tasks that you don’t want to rebuild in AIMMS or if the functionality you need is not available, you can use the Execute function to call the program from AIMMS.
Do you know Set is a god of the desert, storms, disorder, violence and foreigners in ancient Egyptian? So it is totally possible that his disturbance power influenced mathematical world, which is considered employing set theory as foundation system. From 5th century Greek in west India in the east to today’s modern society, there are struggles, debates, paradoxes around set theories. You can find lots of readings about them, or if reading history sounds boring, there will be a little fun video to watch at the end of this blog.
Set in AIMMS can also be confusing for new AIMMS users. We often get questions regarding how to use set, subset, indices, mappings, etc. While working on my own Fantasy Football project, I think it might be helpful to share how I started building one of my models to clarify some of the ambiguity by this example.
The AimmsXLLibrary was introduced in AIMMS 4.20. The new library can communicate with Excel files in server environments, where Excel is not installed. For instance, while running AIMMS through a WebUI on PRO or on Linux. Excel is usually not installed in such environments. However, this isn’t a problem. The AimmsXLLibrary doesn’t require Excel to be installed in order to read from or write to an Excel (.xls/.xlsx) file. By using this library, you can deploy your AIMMS project to more platforms with less restrictions.
In order to use the library, you first need to add the system library ‘AIMMSXLLibrary’ to your model. Then, you can use the functions, which start with prefix “axll”(Aimms eXeL Library), provided in the library. This blog post illustrates how these functions work. Let’s take a look.
Modeling the forest: Ontario’s Ministry of Natural Resources takes us through decades of effective forest managementPosted on April 01, 2014 by Deanne ZhangLeave a reply
Forest ecosystems are highly complex and influenced by a diversity of factors. Sustainable forest management is therefore an ongoing and constantly evolving process which requires an integrated approach. Government bodies, such as The Ontario Ministry of Natural Resources (OMNR), must conform to provincial policies and standards, while taking economical and ecological considerations into account to arrive at optimal forest management policies. OMNR manages 27 million ha of Ontario’s public forest and has been using an AIMMS-based model for this purpose since 1994. The Strategic Forest Management Model, or SFMM, enables foresters to analyze the relationships between forest condition, silvicultural practices, wood supply and potential wildlife habitat. This analysis enables them to understand how a forest develops through time and explore alternative forest management strategies and trade-offs. Today, nearly 2 decades after its launch, we spoke with Dirk Kloss, OMNR’s Resource Modeling Specialist, to find out where SFMM stands today and what their experience using AIMMS has been like.
SET: identifier : RootSet index : i
SET: identifier : MySubSet subset of : RootSet
What is the difference between expression ( i in MySubSet ) and ( i | i in MySubSet ) ?
In the integrated environment or under Linux system, AIMMS supports a command line tool through which you can control an AIMMS project externally. In the command window, you can start the AIMMS command line tool by running:
AIMMS command line tool offers a set of commends, for example,
- assigning values:
Let Demand := 100;
- displaying the contents:
- running procedures:
Run MainExecution ;
Instead of running each command one by one, you can also run batch commands by writing all the commands you want to execute in a text file. For example, the contents of file “MyComannds.txt” are:
Let Demand := 100; Display Supply; Run MainExecution;
By running the following command, you can have them all executed.
AimmsCmd ExampleProject.prj < MyCommands.txt
By doing this, all the running results will be displayed on the command window. If you want to redirect the output to a text file, you can add it to the running command as well.
AimmsCmd ExampleProject.prj < MyCommands.txt > RunLog.txt
AIMMS Data Page facilities directly view of the data associated with a particular identifier. With some clicks, drag & drops, a data page can also be quickly modified to display one or more identifiers in different formats.
A data page can be opened via the Data button, via the right mouse menu, or via shortcut key Ctrl + D for every global identifier.
Continue reading »
A 2D Chart not only makes it possible to display your AIMMS data in various two-dimensional chart types, such as a plot chart, a bar chart, a pie chart, etc, it also allows displaying multiple identifiers with different measurements and different chart types in the same chart, like the following.
In this charts, “Existing Resources” and “Capacity Deficit” are in MW and displayed as stacking bars; “Demand Growth” and “New Resources Growth” are in percentage and displayed as plot curves. In order to set this chart up, you only need to specify the Y-Axis and Y2-Axis properties in the 2D chart properties dialog as shown below.
The appearance of each identifier, for example, colors, width, labels, etc. can be modified to the desired look in the properties dialog. For the details, you may check the attached 2D Chart example.
1. Avoid ‘For’ Loop
for (i,j) do A(i,j) := B(i,j) + C(i,j) endfor;
A(i,j) := B(i,j) + C(i,j);
2. Pay attention to index order
When declaring a parameter with multiple indices, usually index with small cardinality goes first and running index goes last. For example, in the following statement, k is used as running index:
A(i,j) := Sum[(k), D(i,j,k)];
Another thing to keep in mind is to put the indices in same order. For example the following statement
isActive(p,t,s):= 1 $ (t >= Begin(p,s) and t < (Begin(p,s)+Duration(t,s)));
runs much faster than
isActive(p,s,t):= 1 $ (t >= Begin(p,s) and t < (Begin(p,s)+Duration(t,s)));
3. Use index domain condition
Domain condition puts restriction on the indices and thus reduces memory and time consumption. Use it whenever possible. The usage of index domain can be found on related posts. One thing to be careful when using domain condition is to avoid sub index expression.
A sub index expression is the expression depend on fewer indices than the entire expression. For example, in the following statement,
F(i,k) := G(i,k) * Sum[j | A(i,j) = B(i,j), H(j)]
FP(i) := Sum[j | A(i,j) = B(i,j), H(j)] ; F(i,k) := G(i,k) * FP(i) ;
sum[(t,s,i,j,k) | ElementPara(i,j) = k, …]
SumCondition(i,j,k) := (ElementPara(i,j) = k); sum[(t,sc,i,j,k) | SumCondition(i,j,k), …];