forked from reinterpretcat/vrp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsolve_problem.sh
executable file
·24 lines (20 loc) · 957 Bytes
/
solve_problem.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# A handy script to run solver on pragmatic problem using routing approximation.
# Output is a solution in pragmatic and geojson formats stored in the same folder
# using the problem's file pattern.
#set -eux
if [[ $# -eq 0 ]] ; then
echo -e '\033[0;31mExpected a path to file with pragmatic problem definition\033[0m'
echo "Hint: try 'examples/data/pragmatic/objectives/berlin.default.problem.json'"
exit 0
fi
ALL_ARGS=("$@")
PROBLEM_FILE_PATH="$1"
PROBLEM_FILE_BASE="${PROBLEM_FILE_PATH%.*}"
REST_ARGS=("${ALL_ARGS[@]:1}")
cargo run -p vrp-cli --release -- solve pragmatic "${PROBLEM_FILE_PATH}" \
--out-result "${PROBLEM_FILE_BASE}_solution.json" \
--geo-json "${PROBLEM_FILE_BASE}_solution.geojson" \
--log \
--check \
"${REST_ARGS[@]}"