ODL Connect is a tool which lets you call ODL Studio functionality from the command line. It is designed to let you embed ODL Studio into larger systems, so you can run route optimisation or other tasks in the background either on-demand or at regular intervals (using Windows Task Scheduler or the Linux Cron command). Your external system calls ODL Connect when it needs to perform an ODL Studio task. ODL Connect is 100% compatible with existing ODL Studio functionality so you can - for example - run route optimisation in the background and then load the generated vehicle routes into ODL Studio later-on if you need to perform further analysis.
ODL Connect is a closed-source software module; the income from its sales helps fund the development of our open source software. For pricing see our current pricelist and contact us if you’re interested in purchasing.
There are several steps to install and configure ODL Connect which require the user to be familiar with basic system administration and command line usage.
ODL Connect is shipped with the following zip files:
ODL Connect sits on top of the ODL Studio installation. The reference version of ODL Studio is the recommended version to run ODL Connect against, although in most cases your version of ODL Connect should also work with versions of ODL Studio newer than the reference version. Never use ODL Connect with a version of ODL Studio older than the reference version. To install:
Program Files
. If using the zip on Linux, extract the zip to a directory of your choice ensuring the full directory path contains no spaces.com.opendoorlogistics.connect.jar
must be in the same directory as com.opendoorlogistics.studio.jar
.Always set the working directory to your installation directory before running the command line as ODL Studio loads its configuration, data and plugins from the respective subdirectories of the working directory. If you start ODL Connect or ODL Studio and the vehicle routing component is unavailable, it is highly likely you have the wrong working directory set.
If you’re using 64-bit Windows and the Java runtime supplied with ODL Studio, the following line will run ODL Connect and print out its help document:
jre8_64-bit\bin\java.exe -cp com.opendoorlogistics.connect.jar;com.opendoorlogistics.studio.jar com.opendoorlogistics.connect.CommandLine -help
To run the same on Linux using a pre-installed Java runtime, run
java -cp "com.opendoorlogistics.connect.jar:com.opendoorlogistics.studio.jar" com.opendoorlogistics.connect.CommandLine -help
This command line adds both ODL Connect and ODL Studio to the java classpath and then runs the main method in com.opendoorlogistics.connect.CommandLine
. One or more commands, prefixed by -, can then be placed after com.opendoorlogistics.connect.CommandLine. To call other commands, simple replace -help
with one or more of your own commands, as listed in the commands index.
For example,
jre8_64-bit\bin\java.exe -cp com.opendoorlogistics.connect.jar;com.opendoorlogistics.studio.jar com.opendoorlogistics.connect.CommandLine -itab "stops.txt" -ex "Stops.xlsx"
will import a tab-separated file called “stops.txt” into the table Stops and then export it back out again to an Excel file.
ODL Connect uses a temporary in-memory datastore, which is a set of data tables which only exist whilst ODL Connect is running. You import data into the tables, run operations on the tables (e.g. create routes) and then export the data back out, typically to text files or Excels. Normally the operations would be contained within ODL scripts - for example the optimise operation if you use a vehicle routing script. You should configure and test these scripts within the ODL Studio user interface and then use ODL Connect to automate running them.
If you a performing a memory-intensive task - for example using a Graphhopper road network file which covers all North America (see here) - you will need to increase the max memory Java is allotted. This is done using the Java -Xmx command. You should place this command directly after the call to java.exe, so:
jre8_64-bit\bin\java.exe -Xmx4G -cp com.opendoorlogistics.connect.jar;com.opendoorlogistics.studio.jar com.opendoorlogistics.connect.CommandLine ...
tells Java it can use 4 GB RAM when running ODL Connect.
Having a large number of commands called from a single command line can be cumbersome; ODL Connect therefore allows you to collect these commands into a single batch file. The command -rb tells ODL Connect to run a batch file.
Batch file format is straightforward and near-identical to the format of the command line, except:
The command,
jre8_64-bit\bin\java.exe -cp com.opendoorlogistics.connect.jar;com.opendoorlogistics.studio.jar com.opendoorlogistics.connect.CommandLine -itab "stops.txt" -ex "Stops.xlsx"
can therefore be replaced by a batch file called mybatchfile.odlbat
containing the following text:
itab "stops.txt"
ex "Stops.xlsx"
where this command calls the batch file:
jre8_64-bit\bin\java.exe -cp com.opendoorlogistics.connect.jar;com.opendoorlogistics.studio.jar com.opendoorlogistics.connect.CommandLine -rb "mybatchfile.odlbat"
Before setting up the command-line, you should configure route optimisation for your own data within the ODL Studio user-interface (see the tutorial video). With ODL Connect you basically call the same processing steps you would call manually from the UI, but automated from the command line; familiarity with how the UI is configured (particularly the scripts) is therefore strongly advised.
The basic steps involved in setting up automated command-line route optimisation are:
The ODL Connect distribution includes example files which (a) call vehicle route optimisation for fake data based in Malta and (b) export the routes to a text file, together with predicted arrival times and other useful statistics. For 64-bit Windows users, if you open a command prompt and change the directory to the install directory, the following command line will run the Malta data. Note you should create a directory c:\temp
on your computer before running this command, ensuring ODL Connect has write privileges to it.
jre8_64-bit\bin\java.exe -cp com.opendoorlogistics.connect.jar;com.opendoorlogistics.studio.jar com.opendoorlogistics.connect.CommandLine -inputdir "Examples\VRP" -ix "Malta-input-vehicles-and-empty-stop-order-table.xlsx" -itab "stops.txt" -r "jsprit malta.odlx" "Optimise" -r "jsprit malta.odlx" "Export stop-details" -etab "Exported-Stop-Details" "Examples\VRP\output-stop-details.txt" -ex "c:\temp\VRPLog%TIMESTAMP%.xlsx"
For Linux users, again navigate to the install directory and run this instead:
java -cp "com.opendoorlogistics.connect.jar:com.opendoorlogistics.studio.jar" com.opendoorlogistics.connect.CommandLine -inputdir "Examples/VRP" -ix "Malta-input-vehicles-and-empty-stop-order-table.xlsx" -itab "stops.txt" -r "jsprit malta.odlx" "Optimise" -r "jsprit malta.odlx" "Export stop-details" -etab "Exported-Stop-Details" "Examples/VRP/output-stop-details.txt" -ex "VRPLog%TIMESTAMP%.xlsx"
Alternatively you can run this using a batch file containing these commands. Under Windows run:
jre8_64-bit\bin\java.exe -cp com.opendoorlogistics.connect.jar;com.opendoorlogistics.studio.jar com.opendoorlogistics.connect.CommandLine -rb "Examples\VRP\batchfile-windows.odlbat"
…and under Linux:
java -cp com.opendoorlogistics.connect.jar;com.opendoorlogistics.studio.jar com.opendoorlogistics.connect.CommandLine -rb "Examples/VRP/batchfile-linux.odlbat"
An output Excel will be saved containing all processed tables and a stop-details file will be written to the Examples directory.
We breakdown these processing steps and examine each one in-turn:
jre8_64-bit\bin\java.exe -cp ....... com.opendoorlogistics.connect.CommandLine
. This is just our standard launcher command for ODL Connect.-inputdir "Examples\VRP"
. This tells ODL Connect all input files should be loaded from this directory. Alternatively we could have used full path names for all input files.-ix "Malta-input-vehicles-and-empty-stop-order-table.xlsx"
. This loads an Excel containing the vehicles and an empty Stop-Order table.-itab "stops.txt"
. This loads a tab-separated file containing the stops. The file must be called stops
as the imported in-memory table is named after the filename (and the stops table is expected).-r "jsprit malta.odlx" "Optimise"
. This runs the optimise option in the example script "jsprit malta.odlx" (within the input directory) to create the routes.-r "jsprit malta.odlx" "Export stop-details"
. This runs the "Export stop-details" option in the "jsprit malta.odlx" script, which exports the stop-details (i.e. routes) to the in-memory datastore only. The in-memory datastore is operated on by ODL Connect and only exists whilst Connect is running.-etab "Exported-Stop-Details" "Examples\VRP\output-stop-details.txt"
. This exports the "Exported-Stop-Details" table from the in-memory datastore to a file on the hard drive, to be read later by your own external system.-ex "c:\\temp\VRPLog%TIMESTAMP%.xlsx"
. This exports the entire in-memory datastore to a file on your computer, replacing %TIMESTAMP% with a timestamp based on date and time down to milliseconds accuracy - e.g. VRPLog2015-07-27-T10-04-25-266.xlsx. You can use this to construct an archive of all route optimisation runs, should you need to manually inspect the results in ODL Studio later-on.The following commands are available in ODL Connect: