This repository contains the logistics Python package and the REST API server (server.py). The application is containerized using Docker.
To build the Docker image, run:
docker build -t logistics-scheduler .To run the container and expose the application on port 5000, execute:
docker run -p 5000:5000 logistics-schedulerOnce the container is running, you can access the application at:
http://0.0.0.0:5000
This endpoint accepts a JSON payload representing a scheduling problem and returns the solution.
time_limit: (Optional, int) The time limit in seconds for the solver. If not provided, the solver will run without a time constraint.
-
Success (200): If a solution is found, the response will contain a JSON object representing the solution.
-
Error (400): If no solution is found for the given problem, a message will be returned indicating that no solution was found.
-
Error (500): If an internal server error occurs, an error message will be returned.
To test the API, you can run the client_example.py script:
python examples/client_example.pyThis script sends a request to the running server and prints the response.
Alternatively, you can use curl:
curl -X POST --json @examples/instances/instance1.json "http://0.0.0.0:5000/schedule?time_limit=60"