JOpt sandboxes and integration paths

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
- Docker.
- A license if your optimization has more elements than JOpt allows without one: License guide: element limits.
- For the REST client sandboxes and the Angular demo client: a running TourOptimizer REST endpoint, see TourOptimizer REST endpoint.
What it does
JOpt offers two integration paths:
- Java SDK (in-process): your Java code runs the optimization directly, optionally inside a CodeServer sandbox.
- 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 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.

When to use it
| Goal | Recommended path |
|---|---|
| Learn JOpt modeling and the depth of its features | Java SDK examples (sandbox A) |
| Integrate into any stack or language | REST endpoint and a REST client sandbox (B, C or D) |
| Evaluate with minimal setup | The CodeServer sandbox images (optional) |
| Enterprise rollout | Self-hosted REST endpoint, pinned versions, regression runs with snapshots |
| Live demo | Run or change the Angular demo client |
Recommended order
- Run the Java SDK examples first. They teach the modeling patterns and the depth of the features.
- Start a REST endpoint. Run the Docker REST TourOptimizer service locally as a stable integration target.
- Pick your client sandbox (Java, Python or C#). Configure the base URL, run the scenarios and parse the results.
- 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.

- Source on GitHub: Angular-Demo-Application-Source
- Open in StackBlitz: Angular-Demo-Application-Source in StackBlitz
- Hosted reference: demo.dna-evolutions.com
- Backend: the client needs a TourOptimizer REST endpoint, self-hosted or hosted by DNA Evolutions; for self-hosting, see the Docker-REST-TourOptimizer quick start.
- Endpoint configuration: with the Docker image
dnaevolutions/jopt_demoapplication:latest, setJOPT_SWAGGER_HOSTandJOPT_SWAGGER_PORT; withng serve, sethostandportinsrc/assets/env.js. - Tutorial: Angular demo app tutorial on YouTube.
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.
http://host.docker.internal:8081, not http://localhost:8081: inside the container, localhost refers to the container itself.Related examples
- Java-TourOptimizer-Examples: the Java SDK examples, basic, advanced and expert
- Java-REST-Client-Examples: the Java REST client examples
- Python-REST-Client-Examples: the Python REST client examples
- C-Sharp-REST-Client-Examples: the C# REST client examples
- Angular-Demo-Application-Source: the Angular demo client
- Docker-REST-TourOptimizer: the TourOptimizer REST service
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
- Java SDK sandbox tutorial on YouTube
- TourOptimizer as a service (REST), part 1 on YouTube
- TourOptimizer as a service (REST), part 2 on YouTube
- Angular demo app tutorial on YouTube
Related pages
- Sandbox quickstart: the Docker commands of all sandboxes and of the REST endpoint in one place
- Getting started: a first run on the Java SDK path or the REST path
- REST server: the settings of the TourOptimizer container
- Angular demo client guide: the demo client in full
- License guide: the licenses and their element limits
Added: 2026-02-27 (JOpt core 7.5.3-j17) | Last updated: 2026-10-19
Flexible start time
FlexTime and StartReductionTime in JOpt turn the fixed start of a resource's working hours into a bounded time window: FlexTime shifts it later, StartReductionTime earlier for driving.
MagnetoCondition (MagnetoNodeConstraint)
Feature guide to MagnetoCondition, a soft node constraint that keeps selected nodes on the same route (attraction) or on different routes (repulsion).