JOpt sandboxes and integration paths

Illustration on a dark street grid: a container with a gear in the middle, linked to tiles for Java, Python, C#, TypeScript and an API

This guide describes the JOpt sandboxes and the two integration paths they belong to: the Java SDK, which runs the optimization in your Java process, and the REST API of JOpt.TourOptimizer, which a client in any language can call. A sandbox is a browser IDE (CodeServer) in a Docker container with the examples of one repository. The guide is for developers who want to try JOpt without a local Java, Maven or IDE setup, or who choose a path for their integration. For the Docker commands alone, see the sandbox quickstart.

Before you start

What it does

JOpt offers two integration paths:

  1. Java SDK (in-process): your Java code runs the optimization directly, optionally inside a CodeServer sandbox.
  2. REST / OpenAPI (service): a client in any language calls JOpt.TourOptimizer as a service; the examples cover Java, Python and C#. This path needs a TourOptimizer REST endpoint, self-hosted with Docker or hosted by DNA Evolutions (see the product pages).

A CodeServer sandbox is an optional browser IDE that starts with the examples in the language of your choice. It is a convenience: you can always clone the repository and run the examples locally.

The Java SDK sandbox in the browser at localhost:8042, with FirstOptimizationExample.java open in the editor and the optimization progress in the terminal

The TourOptimizer REST endpoint is the optimization backend of the REST client sandboxes. It is a Spring service with an OpenAPI schema and a Swagger UI, which you run self-hosted (Docker or another container platform) or use as an endpoint hosted by DNA Evolutions. The endpoint is not a sandbox: the REST clients need it to run an optimization.

The Swagger UI of JOpt.TourOptimizer at localhost:8081, with the endpoints of the optimization service

When to use it

GoalRecommended path
Learn JOpt modeling and the depth of its featuresJava SDK examples (sandbox A)
Integrate into any stack or languageREST endpoint and a REST client sandbox (B, C or D)
Evaluate with minimal setupThe CodeServer sandbox images (optional)
Enterprise rolloutSelf-hosted REST endpoint, pinned versions, regression runs with snapshots
Live demoRun or change the Angular demo client
  1. Run the Java SDK examples first. They teach the modeling patterns and the depth of the features.
  2. Start a REST endpoint. Run the Docker REST TourOptimizer service locally as a stable integration target.
  3. Pick your client sandbox (Java, Python or C#). Configure the base URL, run the scenarios and parse the results.
  4. Move to reproducible snapshots. Store the inputs as JSON snapshots, rerun them across environments and compare the results for acceptance.

How to use it

Java SDK examples (sandbox A)

Repository: Java-TourOptimizer-Examples

  • Examples by level: basic, advanced and expert.
  • Examples for learning to model constraints and real-world behaviour.
  • Runs in-process with the Java library as a dependency; no REST endpoint needed.

Clone and run locally:

git clone https://github.com/DNA-Evolutions/Java-TourOptimizer-Examples
cd Java-TourOptimizer-Examples
# Open in your IDE and run any *Example.java containing a main() method

Or run the same repository in the CodeServer sandbox (optional), image dnaevolutions/jopt_example_server:latest:

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

Open http://localhost:8042 and log in with the CodeServer password jopt.

TourOptimizer REST endpoint

Repository: Docker-REST-TourOptimizer

A Spring application that exposes JOpt.TourOptimizer through a REST API, with an OpenAPI schema and a Swagger UI. The REST client sandboxes (Java, Python, C#) are clients only and need such an endpoint:

  • Self-hosted: locally with Docker, in CI or on Kubernetes.
  • Hosted by DNA Evolutions: managed access, see the product pages.

Start it self-hosted:

docker run -d --rm --name jopt-touroptimizer   -p 8081:8081   -e SPRING_PROFILES_ACTIVE=cors   dnaevolutions/jopt_touroptimizer:latest

The Swagger UI answers at http://localhost:8081/swagger-ui/index.html. The REST server page describes the container's settings, among them the port and the license.

Java REST client examples (sandbox B)

Repository: Java-REST-Client-Examples

  • Integration through the OpenAPI-generated models in Java.
  • Creating a request, submitting a run and parsing the result.
  • Suited to JVM enterprise stacks.

The examples need an endpoint: a self-hosted one such as http://localhost:8081 (a sample address) or one hosted by DNA Evolutions.

CodeServer sandbox (optional), image dnaevolutions/jopt_rest_example_server:latest:

docker run -it -d --name jopt-java-rest-sandbox   -p 127.0.0.1:8043:8080   -v "$PWD/:/home/coder/project"   dnaevolutions/jopt_rest_example_server:latest

Open http://localhost:8043 and log in with the CodeServer password joptrest.

Python REST client examples (sandbox C)

Repository: Python-REST-Client-Examples

  • Integration of JOpt.TourOptimizer into Python: data pipelines, automation, analytics.
  • Submitting snapshots, parsing results, generating reports.

The examples need an endpoint, self-hosted with Docker or hosted by DNA Evolutions.

CodeServer sandbox (optional), image dnaevolutions/jopt_py_example_server:latest:

docker run -it -d --name jopt-python-rest-sandbox   -p 127.0.0.1:8033:8080   -v "$PWD/:/home/coder/project"   dnaevolutions/jopt_py_example_server:latest

Open http://localhost:8033 and log in with the CodeServer password jopt.

C# REST client examples (sandbox D)

Repository: C-Sharp-REST-Client-Examples

  • .NET enterprise integration through the OpenAPI client.
  • Integration into ERP, TMS and WFM architectures.

The examples need an endpoint, self-hosted with Docker or hosted by DNA Evolutions.

CodeServer sandbox (optional), image dnaevolutions/jopt_net_example_server:latest:

docker run -it -d --name jopt-csharp-rest-sandbox   -p 127.0.0.1:8023:8080   -v "$PWD/:/home/coder/project"   dnaevolutions/jopt_net_example_server:latest

Open http://localhost:8023 and log in with the CodeServer password joptrest.

Angular demo client in TypeScript

The Angular demo client in TypeScript is for evaluations that start from a UI and for quick proofs of concept. It opens in StackBlitz without a local setup, where you can edit it and run it in the browser. A hosted reference runs at demo.dna-evolutions.com.

The JOpt.TourOptimizer demo with the example selection, the buttons Start Optimization and Show latest result, and the routes of two resources on a map of Germany

The Angular demo client guide describes the demo in full.

Limits

  • The REST client sandboxes and the Angular demo client are clients only. Without a TourOptimizer REST endpoint they cannot run an optimization.
  • The Java SDK sandbox needs at least 2 GB RAM and 2 CPU cores.
If a REST client runs inside a CodeServer container and your TourOptimizer REST service runs on your host machine, the client must use http://host.docker.internal:8081, not http://localhost:8081: inside the container, localhost refers to the container itself.

Each client repository describes in its README how its client code is generated from the OpenAPI schema and how to generate it again: the Java repository in "How the REST client is generated", the Python repository in "API architecture", the C# repository in "The architecture of the generated REST-Client-API" and the Angular repository in "Regenerate TypeScript models".

Tutorial videos


Added: 2026-02-27 (JOpt core 7.5.3-j17) | Last updated: 2026-10-19