| Ateji Newsletter - July 2008 |
Welcome to the first edition of Ateji's bi-monthly online newsletter. We designed it to be informative and discuss topics that matter to you. We'll keep you informed about Ateji and
- deepen your understanding of our technology vision
- illustrate the paradigm shift it represents for the operations research community.
Please tell us what you think - and feel free to propose content related to DSLs, Java and Optimization. Real life examples of how you use OptimJ are welcome. -- The Ateji Team
Using Cplex, Mosek, Lp_solve in a Java environment ?
A novel approach to modeling, OptimJ is an algebraic modeling language designed as a Java extension with support under Eclipse. It enables an intuitive and concise expression of your optimization models, while remaining compatible with Java libraries and development tools.
PRODUCT NEWS
OptimJ 1.2 released
"With OptimJ v1.2, ATEJI now supports all the common features available in algebraic modeling languages", says David Gravot, consulting expert in optimization and founder of Rostudel. "Integrating optimization projects in a Java environment becomes a breeze using the Eclipse IDE, shortening project development times up to 50%". MORE>
|
TECHNICAL CORNER
Associative Arrays
Associative arrays are a basic tool for modeling the data part of optimization models, but are absent from mainstream programming languages. With OptimJ 1.2, associative arrays can now be defined over any Java data type. MORE>
|
|
Â
Â
News and Events
OptimJ 1.2 released
ATEJI announced on June 15th an update to OptimJ, its Java based optimization modeling language. In version 1.2, OptimJ adds two main features: associative arrays and a generalized initialization syntax.
- Associative arrays enable a concise and mathematical-like expression of optimization models, with improved type-checking that help catch errors early. They remain compatible with the Java language and legacy arrays.
- Java lacking a flexible initializer syntax, OptimJ makes it easy to instanciate any data type or collection with an extremely concise syntax in-line. This eliminates the need for a lot of verbose Java writing and greatly simplifies prototyping.
An extension of the Java programming language, OptimJ has support for writing optimization models and powerful abstractions for bulk data processing. Developers can have the best of two worlds, using market leading optimization engines and leveraging the simplicity of a standard Java environment based on the acclaimed Eclipse IDE.
OptimJ solver links are available today for lp_solve, Mosek, CPLEX, as well as LP and MPS file formats.
"OptimJ drastically reduces the amount of time from problem definition to final delivery", says David Gravot, consulting expert in optimization and founder of Rostudel.
Roadef Challenge
Ateji sponsors the Roadef Challenge. This challenge is open to everyone, and particularly to young researchers. This year, the challenge is proposed by Amadeus and deals with disruption management for commercial aviation. Commercial airlines operate flights according to a published flight schedule that is optimized from a revenue standpoint. However, external events such as mechanical failures, personnel strikes, or inclement weather frequently occur, disrupting planned airline operations. In such cases, it is necessary to find efficient solutions that minimize the duration of the disruption, thus minimizing its impact. Ateji offers a complete commercial OptimJ licence to the winner.
Technical Corner
Associative Arrays
Associative arrays are common in algebraic modeling languages such as AMPL, GAMS, OPL, etc., where they allow for a concise and mathematical-like expression of optimization problems. They are often the basic tool for data modeling, enabling a concise expression of relationships between data collections. The data modeling part of the canonical "Diet Model" example is commonly expressed as follows, here in OptimJ syntax:
String[] vitamins = { "A", "B1", "B2", "C" }; String[] foods = { "Beef", "Chicken", "Fish", "Ham" }; double[String] cost = { "Beef" -> 3.19, "Chicken" -> 2.59, "Fish" -> 2.29, "Ham" -> 2.89 }; ...
This conciseness of this presentation of the Diet Model makes it well suited for small examples. For programming in the large, another approach based on Object Oriented Modeling is described in our whitepaper "Object-Oriented Modeling with OptimJ" . Of course associative arrays can also contain decision variables:
var double[String] Buy;
In a more general programming context, associative arrays are also one of the driving force behind the adoption of so-called scripting languages such as JavaScript or Ruby. Strangely enough, they're absent from the mainstream generalist languages of the C++/Java family. OptimJ 1.2 fills this gap with the introduction of associative arrays compatible with any Java type. Associative arrays are like standard arrays but can be indexed with any given collection of values (whereas Java arrays can only be indexed with 0-based integers). Alternatively, associative arrays can be thought of as maps with built-in language support and a fixed an immutable set of keys (refering to a non-existent key raises an ArrayIndexOutOfBoundsException). Here is the OptimJ version of the canonical example from Wikipedia :
String[String] phoneBook = { "Sally Smart" -> "555-9999", "John Doe" -> "555-1212", "J. Random Hacker" -> "553-1337" }; for(String number : phoneBook) { System.out.println(number); } for(String name : phoneBook.keys) { System.out.println(name + " -> " + phoneBook[name]); }
The type String[String] denotes an array of strings indexed by strings. To see how associative arrays differ from Java arrays, consider the two definitions :
String[] a1 = { "a", "b", "c" }; String[int] a2 = { 12 -> "a", 3 -> "b", 7 -> "c" };
Here a1 is indexed by 0, 1, 2 and a2 is indexed by 3, 7, 12. Note how their types are different.
Java and associative array dimensions can be mixed freely:
int [String][][double] a;
Here a is a 3-dimensional array. The first dimension is associative, indexed by doubles. The second dimension is a Java array dimension, indexed by 0-based integers. The third dimension is associative, indexed by strings. As usual in Java, an array index expression is written with indices in the opposite order of the types:
int i = a[3.1416][10]["abc"];
Now you know everything that's needed to put associative arrays into action.
Try OptimJ hands-on with a free evaluation licence
|