-
Notifications
You must be signed in to change notification settings - Fork 0
/
live_batch.sh
executable file
·98 lines (90 loc) · 3.36 KB
/
live_batch.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
# Automate the routing process. Pass straight to sort
# NOTE: Docker container that actually runs the scripts must already be built
base_coords="/home/deve/devrepo/coords/maps/pk/volumes/rdm/coords"
base_fr="/home/deve/devrepo/coords/submodules/faster-routes"
# Map desired config into container
cfg=${base_fr}/config_sp_kn.json
echo "Using configuration:"
cat ${cfg}
#area="cam"
# Apex
#fences=("apex_compark" "apex_dt" "danvers")
# Cary
#area="cary"
#fences=("parkwaypnt" "ritterpark" "bond" "cary_cbd" "northwoods" "waverly" "caryglenn" "tbrooks")
# CAM
#area="cam"
#fences=("apex_compark" "apex_dt" "danvers" "parkwaypnt" "ritterpark" "bond" "cary_cbd" "northwoods" "waverly" "caryglenn" "tbrooks")
# Raleigh CBD
#area="raleigh"
#fences=("ral_cntl")
# Raleigh NW
#area="raleigh_NW"
#fences=("dtwf" "6forks" "crabtree" "glenwood" "neuse" "northhills")
# GSO
area="gso"
# gso all
fences=("arbor" "downtown" "friendly" "uncg" "cust_mbob_hood0" "cust_mbob_ghillcem" "cust_candh_hood")
# gso main
#fences=("arbor" "downtown" "friendly" "uncg")
# gso loyalty fences
#fences=("cust_mbob_hood0" "cust_mbob_ghillcem" "cust_candh_hood")
# Cabarrus
#area="cabarrus"
#fences=("cmills" "concord_cbd" "kannapolis_cbd" "liskepark")
# Asheboro
#area="asheboro"
#fences=("cbd" "walmart" "zoo-in" "zoo-ext")
# Chapel Hill
#area="chapelhill"
#fences=("cbd" "umall" "svillage")
# Durham
#area="durham"
#fences=("southpoint" "briercreek" "dtdur" "dukegardens" "maplewood" "atc")
# chatham co
#area="chatham"
#fences=("dtpitts" "powell" "chathampk" "briarchapel" "fearrington" "bynum")
# alamance
#area="alamance"
#fences="elon"
# fuquay-varina
#area="fv"
#fences=("fvcore")
#harnett co
#area="harnett"
#fences=("angier" "campbell")
#holly springs
#area=hollysprings
#fences=("stinson" "arborcreek" "braxtonvillage" "southpark" "12oaks")
# winston salem
#area="wsm"
#fences=("dtlews" "dtclem")
#fences=("dtlews" "dtclem" "hwoods" "wellesley")
# charlotte
#area="clt"
#fences=("cascnlake" "hollyrdg" "nlakemall" "smithcor" "brytontrce" "plumcrk" "freedom_park" "airport_terminal" "elmwood_cem" "forest_lawn_park" "no_meck_park" "hornets_nest_park")
#fences=("cascnlake" "nlakemall" "brytontrce" "elmwood_cem" "forest_lawn_park")
i=0
for fence in ${!fences[@]}
do
echo "routing ${area}/${fences[$fence]}"
/usr/bin/docker run -it --rm -v ${base_fr}/route.txt:/usr/src/app/route.txt -v ${cfg}:/usr/src/app/config.json -v ${base_coords}/${area}/${fences[$fence]}.fence:/usr/src/app/fence.txt faster-routes
/usr/bin/docker run -it --rm -v ${base_fr}/route.txt:/usr/src/app/infile.txt sct python cluster.py -jsf infile.txt
cp ${base_fr}/route.txt ${base_fr}/coords/${area}/${fence}.route
if [ "$i" -eq "0" ];
then
# First one only - overwrite the existing route
#echo "backup the existing master route to: ${base_coords}/${area}/${area}_M.route_bak"
#cp ${base_coords}/${area}/${area}_M.route ${base_coords}/${area}/${area}_M.route_bak
echo "creating ${area}_M.route"
cat ${base_fr}/route.txt > ${base_coords}/${area}/${area}_M.route
else
echo "adding ${fences[$fence]} to ${area}_M.route"
cat ${base_fr}/route.txt >> ${base_coords}/${area}/${area}_M.route
fi
let "i++"
done
echo "\n\n"
echo "Sort the final master route"
/usr/bin/docker run -it --rm -v ${base_coords}/${area}/${area}_M.route:/usr/src/app/infile.txt sct python cluster.py -jsf infile.txt