#!/bin/bash

IMAGE_NAME="osrm-backend"
CONTAINER_NAME="osrm-container"
OSRM_PORT=5000

code_path=`realpath .`
data_path=`realpath ../osrm_test/uk`

echo "Building OSRM Docker image..."
docker build --tag $IMAGE_NAME .

echo "Starting OSRM container..."
docker run \
    -v $data_path:/data \
    -v $code_path:/usr/local/src/osrm-backend \
    -p 5001:$OSRM_PORT \
    -it $IMAGE_NAME bash

# run test
# cd /source && bash ./run_all_tests.sh

# extract
# osrm-extract -p /data/out/car.lua /data/out/input.osm.pbf

# partition
# time osrm-partition /data/out/input.osrm

# customise
# time osrm-customize /data/out/input.osrm --segment-speed-file /data/ssp.csv
# time osrm-customize /data/out/input.osrm --segment-speed-file /data/ssp.csv --selective-cell-customization true --speed-difference-threshold 0.05

# run mld
# osrm-routed --algorithm mld /data/out/input.osrm