Skip to content

DNA-Evolutions/Java-TourOptimizer-Examples

Repository files navigation

Java-JOpt-TourOptimizer-Examples

DNA-Evolutions

This repository is part of our JOpt-TourOptimizer-Suite for Java. It includes an extensive collection of examples (written in Java). This fully functional Maven project can be cloned and used as a base for starting with JOpt-TourOptimizer. Further, a sandbox can be utilized (requiring a running Docker environment), lifting the challenge to set up an IDE.

Contact

If you need any help, please contact us via our company website www.dna-evolutions.com or write an email to info@dna-evolutions.com.

Outline

The project is subdivided into four major types of examples:

  1. Basic Examples
  2. Advanced Examples
  3. Expert Examples
  4. RESTful Examples

Each of the example-sections has its own README.

Further Documentation and Links

The release notes of this repository RELEASE_NOTES.md.

The changelog of this repository and the underlying JOpt library is available in CHANGELOG.md.

The FAQ of this repository is available in FAQ.md.

Short Introduction

JOpt is a flexible routing optimization-engine written in Java, allowing to solve tour-optimization problems that are highly restricted, for example, regarding time windows, skills, and even mandatory constraints can be applied.

Click, to open video:

Introduction Video for DNA's JOpt

Getting Started with the Examples

You can start using our example in different ways.

Use our sandbox in your browser (Docker required)

If you need help setting up docker, you can follow the official installation guide.

In case you want to get started without the hassle of installing Java, Maven and an IDE, we provide a sandbox. The sandbox is based on code-server and can be used inside your browser, the interface itself is based on Visual Code. The sandbox is available via DockerHub (here). You have to host the sandbox in your Docker environment (Please provide at least 2-4Gb of Ram and 2 Cores). You can pull the sandbox from our DockerHub account (The Dockerfile for creating the sandbox is included in this repository). The latest version of our examples is cloned by default on launching the Docker container, and you can start testing JOpt right away.

Preview (click to enlarge):

Starting the sandbox and persist your changes

You must mount a volume to which the examples of this project are downloaded on the container's startup. After re-launching the container, the latest version of our examples is only cloned if the folder is not already existing, keeping your files safe from being overridden.

Launching a sanbox and mount your current directory ('$PWD') or any other directory you want:

docker run -it -d --name jopt-examples -p 127.0.0.1:8042:8080 -v "$PWD/:/home/coder/project" dnaevolutions/jopt_example_server:latest

Using the sandbox

After starting the container, you can open http://localhost:8042/ with your browser and login with the password:

jopt

During the run of your first example file, some dependencies are downloaded, and it will take some time (below 1 minute depending on your internet connection). In case you need help, contact us.

Please visit our tutorial video (approx. 3 minutes duration) hosted on YouTube on how to use our sandbox.

Clone this repository

Clone this repository, import it as Maven project in your IDE and start any example.

Download the Jar directly or as Dependency

The latest native java library of JOpt-TourOptimizer can be either downloaded via our official nexus repository, from our company website or as a a direct download from here (always links the latest release):

As Dependency (Recommended)

However, it is recommended to use our nexus-endpoint as a repository and download the jars as a dependency into your project. You can also search for older versions of JOpt in our nexus repository.

Snippet for Maven

We are recommending always using the latest version of JOpt.

Major Changes (version 7.5.1+):

  • Java Version Upgrade: Our core library has been moved from Java 8 to Java 17. Version 7.5.1 will be the last version to include a Java 8 compatible version along with a corresponding legacy dll version. Future updates will require users who are still on Java 8 or prefer to use dll to switch to our JOpt.TourOptimizer, which is a Spring Application with a Swagger interface. This allows for building clients in a desired language and version.

For adding the JOpt dependency to your pom.xml you can use the following snippet (for help on how to set dependencies, please visit the official Maven documentation):

<dependency>
  <groupId>jopt</groupId>
  <artifactId>jopt.core.pg</artifactId>
   <version>7.5.1-j17</version>
  <classifier>shaded</classifier>
</dependency>

or latest

<dependency>
  <groupId>jopt</groupId>
  <artifactId>jopt.core.pg</artifactId>
   <version>7.5.1-rc2-j17</version>
  <classifier>shaded</classifier>
</dependency>

We are recommending always using the latest version of JOpt (rc) (if present).

JavaDocs

In case you want to add our JavaDocs to your project, further add the following dependency:

<dependency>
  <groupId>jopt</groupId>
  <artifactId>jopt.core.pg</artifactId>
  <version>7.5.1-j17</version>
  <classifier>javadoc</classifier>
</dependency>

or latest

<dependency>
  <groupId>jopt</groupId>
  <artifactId>jopt.core.pg</artifactId>
   <version>7.5.1-rc2-j17</version>
  <classifier>javadoc</classifier>
</dependency>

(The latest JavaDocs version is also available online as a browsable page.)

Repository

In addition, it is mandatory to add our nexus-server as a repository source (for help, please visit the official Maven documentation).

In your pom.xml add the following repository:

<repository>
	<id>jopt4-maven</id>
	<url>https://public.repo.dna-evolutions.com/repository/maven-public/</url>
	<releases>
		<enabled>true</enabled>
	</releases>
	<snapshots>
		<enabled>true</enabled>
	</snapshots>
</repository>

Java 8 legacy version

Version 7.5.1 will be the last version to include a Java 8 compatible version along with a corresponding legacy dll version. Future updates will require users who are still on Java 8 or prefer to use dll to switch to our JOpt.TourOptimizer, which is a Spring Application with a Swagger interface. This allows for building clients in a desired language and version.

<dependency>
  <groupId>jopt</groupId>
  <artifactId>jopt.core.pg</artifactId>
  <version>7.5.1</version>
  <classifier>javadoc</classifier>
</dependency>

Download our .NET legacy version

We still support a legacy .NET version of JOpt. We utilize IKVM.NET that is effectively a Java framework running on top of the .NET's framework.

Release dll (archived as zip) as download (7.5.1-legacy):

Release dll (archived as zip) as download (7.5.0-legacy):

Release candidate dll (archived as zip) as download (7.4.9-rc4-legacy):

Release candidate dll (archived as zip) as download (7.4.9-rc2-legacy):

Release dll (archived as zip) as download (7.4.8-legacy):

Release dll (archived as zip) as download (7.4.6-legacy):

The IKVM.NET framework as download:

Non-Maven projects

In case you use Gradle, SBT, IVY, Grape, Leiningen, Builder, or others, you can browse our nexus-repository, select the desired dependency, and look out for the Usage container. Alternatively, you can use an online conversion tool to convert the Maven dependency into your desired format. Please keep in mind that you will have to add our repository in any case.

Prerequisites

  • In your IDE as native Java dependency: Install at least Java 17 and Maven
  • In our sandbox: Working Docker environment
  • Till and including version 7.5.1: Legacy verion Java 8
  • In your IDE as .NET legacy version: IKVM libraries imported in your project and a working .NET 4.X Framework.

Agreement

For reading our license agreement and for further information about license plans, please visit www.dna-evolutions.com.


Authors

A product by dna-evolutions ©