2018-10-20 18:35:07 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-02-18 01:56:17 +03:00
|
|
|
set -e
|
2018-10-20 18:35:07 +03:00
|
|
|
|
2019-12-03 23:22:59 +03:00
|
|
|
mkdir -p data/system/maps/
|
2019-12-03 22:42:02 +03:00
|
|
|
|
|
|
|
# Need this first
|
2019-12-03 22:55:54 +03:00
|
|
|
if [ ! -f data/input/popdat.bin ]; then
|
2019-12-03 22:42:02 +03:00
|
|
|
# We probably don't have this map yet.
|
2019-12-03 23:22:59 +03:00
|
|
|
if [ ! -f data/system/maps/huge_seattle.bin ]; then
|
2019-12-03 22:42:02 +03:00
|
|
|
cd precompute;
|
2019-12-03 23:06:49 +03:00
|
|
|
RUST_BACKTRACE=1 cargo run --release ../data/input/raw_maps/huge_seattle.bin --disable_psrc_scenarios;
|
2019-12-03 22:42:02 +03:00
|
|
|
cd ..;
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd popdat;
|
|
|
|
cargo run --release;
|
|
|
|
cd ..;
|
|
|
|
fi
|
|
|
|
|
2018-12-20 23:15:58 +03:00
|
|
|
release_mode=""
|
2019-09-19 21:44:52 +03:00
|
|
|
psrc_scenarios=""
|
2019-11-01 01:55:02 +03:00
|
|
|
no_fixes=""
|
2018-12-20 23:15:58 +03:00
|
|
|
for arg in "$@"; do
|
|
|
|
if [ "$arg" == "--release" ]; then
|
|
|
|
release_mode="--release";
|
2019-09-19 21:44:52 +03:00
|
|
|
elif [ "$arg" == "--disable_psrc_scenarios" ]; then
|
|
|
|
psrc_scenarios="--disable_psrc_scenarios";
|
2019-11-01 01:55:02 +03:00
|
|
|
elif [ "$arg" == "--nofixes" ]; then
|
|
|
|
no_fixes="--nofixes";
|
2018-12-20 23:15:58 +03:00
|
|
|
else
|
2019-06-18 01:44:10 +03:00
|
|
|
# Just recompute a single map.
|
|
|
|
cd precompute;
|
2019-12-03 23:06:49 +03:00
|
|
|
RUST_BACKTRACE=1 cargo run $release_mode ../data/input/raw_maps/$arg.bin $psrc_scenarios $no_fixes;
|
2019-06-18 01:44:10 +03:00
|
|
|
cd ..;
|
|
|
|
exit;
|
2018-12-20 23:15:58 +03:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2019-12-03 23:06:49 +03:00
|
|
|
for map_path in `ls data/input/raw_maps/`; do
|
2019-06-11 23:47:12 +03:00
|
|
|
map=`basename $map_path .bin`;
|
2019-03-19 01:15:14 +03:00
|
|
|
echo "Precomputing $map";
|
2019-01-11 07:56:15 +03:00
|
|
|
cd precompute;
|
2019-12-03 23:06:49 +03:00
|
|
|
RUST_BACKTRACE=1 cargo run $release_mode ../data/input/raw_maps/$map.bin $psrc_scenarios $no_fixes;
|
2019-01-11 07:56:15 +03:00
|
|
|
cd ..;
|
2018-10-20 18:35:07 +03:00
|
|
|
done
|