Comprehensive Guide to Using JOptTourOptimizer Spring Server and native JOpt with Docker and Sandboxes
The JOptTourOptimizer suite offers a flexible routing optimization engine designed to solve complex tour-optimization problems. This powerful tool can handle various constraints such as time windows, skills, and mandatory requirements. This document provides a comprehensive guide on setting up and using the TourOptimizer locally via Docker, accessing various sandboxes, using the native Java library, and exploring an Angular sample application.
Please note that you can also use the sandboxes to access a JoptTourOptimizer that is NOT hosted locally.
To start the JOptTourOptimizer Spring Server locally using Docker, follow these steps:
- Pull the Docker Image:
docker pull dnaevolutions/jopt_touroptimizer:latest
- Run the Docker Container:
docker run -d -p 8080:8080 --name jopt_touroptimizer dnaevolutions/jopt_touroptimizer:latest
- Access the Swagger Interface:
Open your browser and navigate to
http://localhost:8080/swagger-ui.htmlto interact with the API using the Swagger interface.
For more detailed instructions, refer to the Docker-REST-TourOptimizer README.
The JOptTourOptimizer also supports a fire and forget mode, allowing you to submit optimization requests without waiting for immediate results. This is particularly useful for handling large datasets or complex optimization scenarios. For more information on the fire and forget mode, refer to its documentation.
You can use several sandboxes implemented via code-server and Docker to interact with the locally running TourOptimizer engine. These sandboxes provide an easy way to experiment with the optimizer without setting up a complete development environment.
Please note that each sandbox is a docker container and you need to connect to a local JOptTourOptimizer via the endpoint http://host.docker.internal:8081 instead of .http://localhost:8081
- Pull and Run the Python Sandbox:
docker run -it -d --name jopt-py-rest-examples -p 127.0.0.1:8033:8080 -v "$PWD/:/home/coder/project" dnaevolutions/jopt_py_example_server:latest - Access the Sandbox:
Open your browser and go to
http://localhost:8033and log in with the passwordjopt.
- Pull and Run the Java Sandbox:
docker run -it -d --name jopt-rest-examples -p 127.0.0.1:8043:8080 -v "$PWD/:/home/coder/project" dnaevolutions/jopt_rest_example_server:latest - Access the Sandbox:
Open your browser and go to
http://localhost:8043and log in with the passwordjoptrest.
- Pull and Run the C# Sandbox:
docker run -it -d --name jopt-net-rest-examples -p 127.0.0.1:8023:8080 -v "$PWD/:/home/coder/project" dnaevolutions/jopt_net_example_server:latest - Access the Sandbox:
Open your browser and go to
http://localhost:8023and log in with the passwordjoptrest.
For more details, visit the respective repositories:
For those who prefer using the native Java library without REST, we provide a sandbox environment using Docker. This sandbox is based on code-server and includes the Java TourOptimizer examples.
- Pull and Run the Java Sandbox:
docker run -it -d --name jopt-examples -p 127.0.0.1:8042:8080 -v "$PWD/:/home/coder/project" dnaevolutions/jopt_example_server:latest - Access the Sandbox:
Open your browser and go to
http://localhost:8042and log in with the passwordjopt.
This environment allows you to use the Java TourOptimizer examples directly within your browser, leveraging the full capabilities of the JOptTourOptimizer library.
Refer to the Java-TourOptimizer-Examples for more information.
We also provide an Angular sample application to demonstrate how to integrate the JOptTourOptimizer into a web application. This application serves as a practical example of using the optimizer's capabilities in a modern web framework.
For more details and to access the sample application, please visit the Docker-REST-TourOptimizer repository.
