Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
172 lines (157 sloc) 47.5 KB
# cellular_emulation.sh
# Copyright (c) 2016 Akamai Technologies, Inc. Released under Apache License Version 2.0.
# Version 0.1
declare -a lat_array
declare -a thru_array
declare -a gap_array
declare -a loss_array
if [ "$1" == "loss_based" ]
then
lat_array=(22 31 43 96 30 39 81 29 39 60 29 38 56 28 33 52 255 37 50 26 32 49 162 33 48 24 33 46 22 31 43 96 30 39 81 30 41 80 30 38 73 30 37 65 27 37 50 26 32 49 162 31 40 120 31 46 22 31 43 90 30 39 81 29 39 58 29 33 56 22 33 52 255 37 50 26 32 49 145.2 31 40 120 30 40 69 30 40 65 30 35 61 25 39 58 29 33 56 22 32 44 30 40 90 29 39 60 29 34 58 23 38 52 28 32 51 26 32 50 162 31 41 130 30 40 70 30 37 69 27 40 86 29 39 60 29 33 56 23 33 46 22 30 42 90 30 42 81 31 41 130 30 40 70 30 37 65 27 36 50 26 34 48 24 31 48 110 33 46 22 30 42 90 30 39 81 30 39 76 29 38 54 28 32 51 218 36 50 26 32 48 24 31 47 110 31 40 100 30 40 62)
if [ "$2" == "good" ]
then
echo "Simulating good connections."
thru_array=(2.196708 144.6429 2761.239 10062.17 97.91667 1241 8812.5 25.66964 1175 5581.25 24.55357 963.9509 5140.625 17.47946 430.5342 4700 14687.5 645.9866 4341.429 9.616815 289.2857 3854.554 12983.82 456.25 3525 4.249841 449.1071 3182.143 1.326141 144.6429 2761.239 10062.17 97.91667 1241 8812.5 75.26339 2133.25 8373.103 57.70089 963.9509 7637.5 46.98661 743.3571 6756.25 11.54018 645.9866 4341.429 7.507068 289.2857 3854.554 12983.82 228.2455 2048.314 11456.25 146.875 3182.143 1.326141 144.6429 2761.239 9693.75 97.91667 1241 8812.5 25.66964 1128.962 5322.545 23.26339 456.25 5140.625 2.196708 430.5342 4700 14687.5 645.9866 4341.429 7.507068 289.2857 3854.554 12585.87 203.2366 2048.314 11456.25 53.73661 1762.5 7050 30.02232 1468.75 6756.25 28.125 578.5714 6168.75 5.771652 1128.962 5322.545 23.26339 449.1071 5140.625 2.196708 353.1 2937.5 97.91667 1446.429 9693.75 25.66964 1175 5875 24.55357 467.808 5322.545 3.152311 867.8571 4700 13.95089 293.75 4531.473 9.616815 289.2857 4112.5 12983.82 228.2455 2133.25 12022.88 53.73661 1865.772 7343.75 46.98661 743.3571 7050 11.54018 1446.429 9253.125 25.66964 1175 5875 24.55357 456.25 5140.625 3.152311 430.5342 3182.143 1.326141 118.5268 2603.571 9693.75 92.57812 2365.379 8812.5 228.2455 2133.25 12022.88 53.73661 1762.5 7343.75 46.98661 743.3571 6756.25 11.54018 587.5 4341.429 7.507068 533.9777 3724.272 4.249841 203.2366 3525 10964.03 430.5342 3182.143 1.326141 118.5268 2603.571 9693.75 92.57812 1175 8812.5 65.06696 1128.962 8000.893 23.26339 881.25 4917.857 13.95089 353.1 4531.473 14100 587.5 4112.5 7.507068 267.6339 3724.272 4.249841 203.2366 3300.888 10964.03 146.875 1762.5 10575 38.11533 1468.75 6462.5)
gap_array=(0.07 0.63 1.54 3.36 0.56 1.19 2.94 0.315 1.19 2.1 0.28 1.12 2.03 0.21 0.91 1.96 5.425 1.05 1.855 0.175 0.77 1.785 4.2 0.98 1.68 0.07 0.98 1.61 0.07 0.63 1.54 3.36 0.56 1.19 2.94 0.49 1.4 2.8 0.455 1.12 2.59 0.42 1.085 2.38 0.175 1.05 1.855 0.14 0.77 1.785 4.2 0.735 1.365 3.885 0.63 1.61 0.07 0.63 1.54 3.22 0.56 1.19 2.94 0.315 1.155 2.065 0.28 0.98 2.03 0.07 0.91 1.96 5.425 1.05 1.855 0.14 0.77 1.785 4.06 0.7 1.365 3.885 0.455 1.295 2.45 0.35 1.26 2.38 0.35 1.05 2.24 0.14 1.155 2.065 0.28 0.98 2.03 0.07 0.91 1.575 0.56 1.225 3.22 0.315 1.19 2.17 0.28 1.015 2.065 0.07 1.085 1.96 0.21 0.84 1.925 0.175 0.77 1.82 4.2 0.735 1.4 3.99 0.455 1.33 2.52 0.42 1.085 2.45 0.175 1.225 3.045 0.315 1.19 2.17 0.28 0.98 2.03 0.07 0.91 1.61 0.07 0.595 1.505 3.22 0.525 1.47 2.94 0.735 1.4 3.99 0.455 1.295 2.52 0.42 1.085 2.38 0.175 1.05 1.855 0.14 1.015 1.75 0.07 0.7 1.68 3.71 0.91 1.61 0.07 0.595 1.505 3.22 0.525 1.19 2.94 0.49 1.155 2.73 0.28 1.12 2.0196 0.21 0.91 1.925 4.795 1.05 1.82 0.14 0.77 1.75 0.07 0.7 1.645 3.71 0.63 1.295 3.5 0.385 1.26 2.31)
loss_array=(0.703122 7.1429 50 60 5.8824 33.3333 50 2.5641 33.3333 50 2.381 26.6667 50 1.8519 14.2857 50 75 25 50 1.4085 11.1111 50 66.6667 16.6667 50 0.9174 16.6667 50 0.5556 7.1429 50 60 5.8824 33.3333 50 5.2632 50 50 4.5455 26.6667 50 3.8462 25 50 1.5385 25 50 1.2821 11.1111 50 66.6667 9.0909 50 66.6667 7.6923 50 0.5556 7.1429 50 50 5.8824 33.3333 50 2.5641 33.3333 50 2.2222 16.6667 50 0.703122 14.2857 50 75 25 50 1.2821 11.1111 50 66.6667 8.928868 50 66.6667 4.1667 40 50 3.3333 33.3333 50 3.0303 20 50 1.14082 33.3333 50 2.2222 16.6667 50 0.703122 14.2857 50 5.8824 33.3333 50 2.5641 33.3333 50 2.381 16.6667 50 0.817489 25 50 1.6949 12.5 50 1.4085 11.1111 50 66.6667 9.0909 50 66.6667 4.1667 50 50 3.8462 25 50 1.5385 33.3333 50 2.5641 33.3333 50 2.381 16.6667 50 0.817489 14.2857 50 0.5556 6.6667 50 50 5.5556 50 50 9.0909 50 66.6667 4.1667 40 50 3.8462 25 50 1.5385 20 50 1.2821 20 50 0.9174 8.928868 50 66.6667 14.2857 50 0.5556 6.6667 50 50 5.5556 33.3333 50 4.7619 33.3333 50 2.2222 25 50 1.6949 14.2857 50 71.4286 20 50 1.2821 10 50 0.9174 8.928868 50 66.6667 7.6923 40 66.6667 3.5714 33.3333 50)
elif [ "$2" == "median" ]
then
echo "Simulating median connections/"
thru_array=(2.845982 35.27679 850.6384 6462.5 28.34821 451.2277 5207.143 20.42411 447.9911 2643.75 19.19643 381.4326 2262.528 13.14935 137.686 1912.277 13885.71 289.2857 1664.583 8.441369 68.10789 1439.696 10575 146.875 1157.143 5.691964 144.6429 937.9353 1.646205 35.27679 850.6384 6462.5 28.34821 451.2277 5207.143 26.11607 578.5714 4865.147 25.22321 381.4326 4476.594 23.4375 289.2857 3633.594 10.41425 289.2857 1664.583 6.609747 68.10789 1439.696 10575 57.70089 482.1429 8225 36.71875 937.9353 1.646205 35.27679 850.6384 5962.277 28.34821 451.2277 5207.143 20.42411 432.7009 2371.366 17.52232 146.875 2262.528 2.845982 137.686 1912.277 13885.71 289.2857 1664.583 6.609747 68.10789 1439.696 9693.75 48.95833 482.1429 8225 24.24107 459.933 3910.737 21.65179 457.1429 3633.594 21.65179 225.8929 3096.558 5.691964 432.7009 2371.366 17.52232 144.6429 2262.528 2.845982 108.4821 867.8571 28.34821 453.9062 5962.277 20.42411 447.9911 2892.857 19.19643 183.2589 2371.366 4.347098 293.75 1912.277 11.91406 95.53571 1762.5 8.441369 68.10789 1468.75 10575 57.70089 578.5714 8874.777 24.24107 465.8482 4209.821 23.4375 289.2857 3910.737 10.41425 453.9062 5581.25 20.42411 447.9911 2892.857 19.19643 146.875 2262.528 4.347098 137.686 937.9353 1.646205 29.375 733.1122 5962.277 27.23214 593.1518 5207.143 57.70089 578.5714 8874.777 24.24107 459.933 4209.821 23.4375 289.2857 3633.594 10.41425 246.3393 1664.583 6.609747 195.8333 1227.567 5.691964 48.95833 1157.143 7591.853 137.686 937.9353 1.646205 29.375 733.1122 5962.277 27.23214 447.9911 5207.143 25.22321 432.7009 4553.125 17.52232 293.75 2056.25 11.91406 108.4821 1762.5 12631.25 246.3393 1468.75 6.609747 57.70089 1227.567 5.691964 48.95833 1095.411 7591.853 36.71875 459.933 7050 22.76786 457.1429 3358.705)
gap_array=(0.07 0.245 0.49 0.98 0.21 0.385 0.91 0.14 0.375 0.63 0.105 0.35 0.595 0.07 0.28 0.56 3.5 0.35 0.56 0.07 0.28 0.525 1.89 0.315 0.49 0.07 0.29 0.49 0.07 0.245 0.49 0.98 0.21 0.385 0.91 0.21 0.42 0.84 0.21 0.35 0.805 0.175 0.35 0.7 0.07 0.35 0.56 0.07 0.28 0.525 1.89 0.28 0.42 1.19 0.28 0.49 0.07 0.245 0.49 0.945 0.21 0.385 0.91 0.14 0.35 0.63 0.07 0.315 0.595 0.07 0.28 0.56 3.5 0.35 0.56 0.07 0.28 0.525 1.61 0.28 0.42 1.19 0.175 0.42 0.735 0.14 0.385 0.7 0.14 0.315 0.665 0.07 0.35 0.63 0.07 0.29 0.595 0.07 0.28 0.49 0.21 0.385 0.945 0.14 0.375 0.64 0.105 0.315 0.63 0.07 0.35 0.56 0.07 0.28 0.56 0.07 0.28 0.525 1.89 0.28 0.42 1.4 0.175 0.42 0.77 0.175 0.35 0.735 0.07 0.385 0.91 0.14 0.375 0.64 0.105 0.315 0.595 0.07 0.28 0.49 0.07 0.21 0.455 0.945 0.21 0.455 0.91 0.28 0.42 1.4 0.175 0.42 0.77 0.175 0.35 0.7 0.07 0.315 0.56 0.07 0.315 0.49 0.07 0.28 0.49 1.05 0.28 0.49 0.07 0.21 0.455 0.945 0.21 0.375 0.91 0.21 0.35 0.84 0.07 0.35 0.572 0.07 0.28 0.56 2.59 0.315 0.525 0.07 0.28 0.49 0.07 0.28 0.49 1.05 0.28 0.42 0.98 0.14 0.385 0.7)
loss_array=(0.9434 16.6667 50 66.6667 14.2857 50 66.6667 4.7619 50 60 4.3478 44.23392 55.5556 3.125 25 50 80 33.3333 50 2.2727 25 50 75 28.5714 50 1.3514 27.2727 50 0.7042 16.6667 50 66.6667 14.2857 50 66.6667 11.7647 50 66.6667 10 44.23392 66.6667 7.6923 33.3333 66.6667 2.5 33.3333 50 2.0408 25 50 75 20 50 66.6667 16.6667 50 0.7042 16.6667 50 66.6667 14.2857 50 66.6667 4.7619 50 57.1429 4 28.5714 55.5556 0.9434 25 50 80 33.3333 50 2.0408 25 50 71.4286 20 50 66.6667 9.0909 50 66.6667 6.6667 50 66.6667 5.8824 33.3333 62.5 1.8182 50 57.1429 4 27.2727 55.5556 0.9434 25 50 14.2857 50 66.6667 4.7619 50 60 4.3478 33.3333 57.1429 1.1364 33.3333 50 2.8571 25 50 2.2727 25 50 75 20 50 66.6667 9.0909 50 66.6667 7.6923 33.3333 66.6667 2.5 50 66.6667 4.7619 50 60 4.3478 28.5714 55.5556 1.1364 25 50 0.7042 16.6667 50 66.6667 12.5 50 66.6667 20 50 66.6667 9.0909 50 66.6667 7.6923 33.3333 66.6667 2.5 33.3333 50 2.0408 33.3333 50 1.3514 20 50 66.6667 25 50 0.7042 16.6667 50 66.6667 12.5 50 66.6667 11.1111 50 66.6667 4 40 50 2.8571 25 50 75 33.3333 50 2.0408 25 50 1.3514 20 50 66.6667 16.6667 50 66.6667 7.1429 50 66.6667)
elif [ "$2" == "poor" ]
then
echo "Simulating poor connections."
thru_array=(5.691964 27.90179 578.5714 4700 25.22321 289.2857 4506.25 22.76786 282.1429 2669.509 22.76786 227.0614 2284.263 20.42411 69.67411 1784.426 11456.25 146.875 1473.757 19.19643 46.20815 1175 7189.192 89.12946 945.5279 6.708147 73.4375 734.7768 2.846354 27.90179 578.5714 4700 25.22321 289.2857 4506.25 25.22321 457.4777 4506.25 25.22321 227.0614 4426.844 25.22321 146.875 3762.298 20.42411 146.875 1473.757 15.625 46.20815 1175 7189.192 37.26786 456.3616 5399.33 28.92857 734.7768 2.846354 27.90179 578.5714 4521.875 25.22321 289.2857 4506.25 22.76786 256.5848 2490.848 22.76786 89.12946 2284.263 5.691964 69.67411 1784.426 11456.25 146.875 1473.757 15.625 46.20815 1175 6462.5 36.16071 456.3616 5399.33 25.22321 449.3571 4040.402 23.32589 310.2165 3762.298 22.76786 120.8884 3229.397 12.98363 256.5848 2490.848 22.76786 73.4375 2284.263 5.691964 58.75 587.5 25.22321 293.75 4521.875 22.76786 282.1429 2937.5 22.76786 96.42857 2490.848 5.691964 153.311 1784.426 20.42411 57.70089 1726.116 19.19643 46.20815 1419.688 7189.192 37.26786 457.4777 5932.254 25.22321 453.9062 4235.045 25.22321 146.875 4040.402 20.42411 293.75 4515.848 22.76786 282.1429 2937.5 22.76786 89.12946 2284.263 5.691964 69.67411 734.7768 2.846354 26.89732 526.7857 4521.875 25.22321 477.6786 4506.25 37.26786 457.4777 5932.254 25.22321 449.3571 4235.045 25.22321 146.875 3762.298 20.42411 144.6429 1473.757 15.625 97.91667 1150 6.708147 36.16071 945.5279 5094.42 69.67411 734.7768 2.846354 26.89732 526.7857 4521.875 25.22321 282.1429 4506.25 25.22321 256.5848 4488.281 22.76786 189.8438 2025.393 20.42411 58.75 1726.116 9400 144.6429 1419.688 15.625 43.19196 1150 6.708147 36.16071 867.8571 5094.42 28.92857 449.3571 4936.779 24.10714 310.2165 3517.455)
gap_array=(0.07 0.07 0.21 0.42 0.07 0.175 0.35 0.07 0.17 0.245 0.07 0.155 0.245 0.07 0.14 0.245 2.31 0.14 0.245 0.07 0.105 0.215 0.77 0.14 0.21 0.07 0.14 0.21 0.07 0.07 0.21 0.42 0.07 0.175 0.35 0.07 0.21 0.35 0.07 0.155 0.35 0.07 0.14 0.28 0.07 0.14 0.245 0.07 0.105 0.215 0.77 0.07 0.175 0.49 0.07 0.21 0.07 0.07 0.21 0.42 0.07 0.175 0.35 0.07 0.165 0.245 0.07 0.14 0.245 0.07 0.14 0.245 2.31 0.14 0.245 0.07 0.105 0.215 0.63 0.07 0.175 0.49 0.07 0.175 0.28 0.07 0.175 0.28 0.07 0.14 0.28 0.07 0.165 0.245 0.07 0.14 0.245 0.07 0.14 0.21 0.07 0.175 0.42 0.07 0.17 0.28 0.07 0.14 0.245 0.07 0.14 0.245 0.07 0.105 0.245 0.07 0.105 0.235 0.77 0.07 0.21 0.56 0.07 0.175 0.28 0.07 0.14 0.28 0.07 0.175 0.385 0.07 0.17 0.28 0.07 0.14 0.245 0.07 0.14 0.21 0.07 0.07 0.21 0.42 0.07 0.21 0.35 0.07 0.21 0.56 0.07 0.175 0.28 0.07 0.14 0.28 0.07 0.14 0.245 0.07 0.14 0.21 0.07 0.07 0.21 0.49 0.14 0.21 0.07 0.07 0.21 0.42 0.07 0.17 0.35 0.07 0.165 0.35 0.07 0.14 0.245 0.07 0.14 0.245 1.4 0.14 0.235 0.07 0.105 0.21 0.07 0.07 0.21 0.49 0.07 0.175 0.455 0.07 0.175 0.28)
loss_array=(0.9901 15.6863 50 75 12.5 50 71.4286 2.9412 50 66.6667 2.5 50 66.6667 1.9608 33.3333 66.6667 88.8889 42.8571 66.6667 1.5873 25 60 83.3333 33.3333 60 1.2048 33.3333 57.1429 0.8403 15.6863 50 75 12.5 50 71.4286 9.0909 50 66.6667 7.1429 50 66.6667 5.5556 46.1538 66.6667 1.6949 42.8571 66.6667 1.4925 25 60 83.3333 20 50 80 16.6667 57.1429 0.8403 15.6863 50 75 12.5 50 71.4286 2.9412 50 66.6667 2.2727 33.3333 66.6667 0.9901 33.3333 66.6667 88.8889 42.8571 66.6667 1.4925 25 60 83.3333 20 50 80 6.25 50 66.6667 4.3478 50 66.6667 3.8462 36.3636 66.6667 1.4286 50 66.6667 2.2727 33.3333 66.6667 0.9901 28.5714 53.8462 12.5 50 75 2.9412 50 66.6667 2.5 33.3333 66.6667 1.1111 50 66.6667 1.80195 25 66.6667 1.5873 25 62.5 83.3333 20 50 83.3333 6.25 50 66.6667 5.5556 46.1538 66.6667 1.6949 50 71.4286 2.9412 50 66.6667 2.5 33.3333 66.6667 1.1111 33.3333 57.1429 0.8403 14.2857 50 75 11.1111 50 71.4286 20 50 83.3333 6.25 50 66.6667 5.5556 46.1538 66.6667 1.6949 40 66.6667 1.4925 33.3333 60 1.2048 20 60 77.7778 33.3333 57.1429 0.8403 14.2857 50 75 11.1111 50 71.4286 8.3333 50 66.6667 2.2727 50 66.6667 1.80195 28.5714 66.6667 83.97435 40 62.5 1.4925 22.2222 60 1.2048 20 57.1429 77.7778 16.6667 50 75 4.9695 50 66.6667)
else
echo "Please select a valid network condition to simulate. Valid values are good, median, and poor."
exit 1
fi
elif [ "$1" == "experience_based" ]
then
if [ "$2" == "noloss" ]
then
echo "Simulating no loss experiences."
lat_array=(20.56 30.7592 43.9624 153.344 30.16 39.4964 118.9918 25.533 39.42 68.1714 25.2544 39.22 61.515 24.4012 35.4 59.082 672.2598 38.109 54.6944 23.4624 33.7564 51.2916 351.5868 36.148 49.0964 21.3584 35.7596 45.49 20.2346 30.7592 43.9624 153.344 30.16 39.4964 118.9918 29.5268 40.2752 108.1076 28.5304 39.22 89.0132 27.326 38.7588 77.8762 23.88 38.109 54.6944 22.96 33.7564 51.2916 351.5868 32.8068 40 235.9766 31.1934 45.49 20.2346 30.7592 43.9624 139.6554 30.16 39.4964 118.9918 25.533 39.34 65.18 24.9466 36.148 61.515 20.56 35.4 59.082 672.2598 38.109 54.6944 22.96 33.7564 51.2916 310.28 32.1326 40 235.9766 27.8244 39.8692 80.616 26.36 39.7 77.8762 26.01 37.3326 71.1716 22.3952 39.34 65.18 24.9466 35.7596 61.515 20.56 35.1168 44.6748 30.16 39.6 139.6554 25.533 39.42 69.6688 25.2544 36.5462 65.18 21.0192 39.0454 59.082 24.16 34.82 56.9152 23.4624 33.7564 52.706 351.5868 32.8068 40.2752 279.092 27.8244 39.93 84.1918 27.326 38.7588 80.616 23.88 39.6 127.6508 25.533 39.42 69.6688 25.2544 36.148 61.515 21.0192 35.4 45.49 20.2346 30.3814 42.3784 139.6554 29.835 41.3906 118.9918 32.8068 40.2752 279.092 27.8244 39.8692 84.1918 27.326 38.7588 77.8762 23.88 37.7232 54.6944 22.96 36.88 49.7652 21.3584 32.1326 49.0964 199.9244 35.4 45.49 20.2346 30.3814 42.3784 139.6554 29.835 39.42 118.9918 29.03 39.34 95.423 24.9466 39.14 60.2036 24.16 35.1168 56.9152 529.9752 37.7232 52.706 22.96 33.3324 49.7652 21.3584 32.1326 46.976 199.9244 31.1934 39.8692 177.2254 26.8 39.7 74.108)
thru_array=(395.221 6554.214 7461.344 8323.839 6429.107 7232.143 8202.533 4589.431 7221.044 7804.938 4502.281 7119.916 7608.482 4311.079 6756.25 7521.429 9828.482 6942.857 7521.429 4080.344 6667 7499.558 9306.643 6756.25 7490.625 1855.857 6756.25 7484.414 205.3672 6554.214 7461.344 8323.839 6429.107 7232.143 8202.533 6333 7398.513 8174.621 6172.661 7119.916 8125.045 6093.75 6942.857 7985.732 4147.655 6942.857 7521.429 3851.882 6667 7499.558 9306.643 6655.286 7385.275 8501.585 6632.554 7484.414 205.3672 6554.214 7461.344 8278.813 6429.107 7232.143 8202.533 4589.431 7170.48 7684.5 4456.248 6756.25 7608.482 395.221 6756.25 7521.429 9828.482 6942.857 7521.429 3851.882 6667 7499.558 9209.933 6653.571 7385.275 8501.585 6132.188 7339.286 8045.036 5357.571 7247.768 7985.732 4906.266 6873.812 7940.652 3276.326 7170.48 7684.5 4456.248 6756.25 7608.482 395.221 6756.25 7477.138 6429.107 7232.143 8278.813 4589.431 7221.044 7925.375 4502.281 6756.25 7684.5 973.5335 6987.666 7521.429 4220.614 6735.036 7521.429 4080.344 6667 7512.187 9306.643 6655.286 7398.513 8855.759 6132.188 7363.448 8101.708 6093.75 6942.857 8045.036 4147.655 7232.143 8233.786 4589.431 7221.044 7925.375 4502.281 6756.25 7608.482 973.5335 6756.25 7484.414 205.3672 6475.875 7433.522 8278.813 6388.839 7405.701 8202.533 6655.286 7398.513 8855.759 6132.188 7339.286 8101.708 6093.75 6942.857 7985.732 4147.655 6942.857 7521.429 3851.882 6797.304 7490.625 1855.857 6653.571 7490.625 8374.036 6756.25 7484.414 205.3672 6475.875 7433.522 8278.813 6388.839 7221.044 8202.533 6252.83 7170.48 8148.382 4456.248 7055.71 7560.893 4220.614 6756.25 7521.429 9531.964 6942.857 7512.187 3851.882 6661.143 7490.625 1855.857 6653.571 7490.625 8374.036 6632.554 7339.286 8351.705 5832 7247.768 7950.536)
gap_array=(99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999 99999)
loss_array=(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 )
elif [ "$2" == "good" ]
then
echo "Simulating good experiences."
lat_array=(20.56 30.7592 43.9624 153.344 30.16 39.4964 118.9918 25.533 39.42 68.1714 25.2544 39.22 61.515 24.4012 35.4 59.082 672.2598 38.109 54.6944 23.4624 33.7564 51.2916 351.5868 36.148 49.0964 21.3584 35.7596 45.49 20.2346 30.7592 43.9624 153.344 30.16 39.4964 118.9918 29.5268 40.2752 108.1076 28.5304 39.22 89.0132 27.326 38.7588 77.8762 23.88 38.109 54.6944 22.96 33.7564 51.2916 351.5868 32.8068 40 235.9766 31.1934 45.49 20.2346 30.7592 43.9624 139.6554 30.16 39.4964 118.9918 25.533 39.34 65.18 24.9466 36.148 61.515 20.56 35.4 59.082 672.2598 38.109 54.6944 22.96 33.7564 51.2916 310.28 32.1326 40 235.9766 27.8244 39.8692 80.616 26.36 39.7 77.8762 26.01 37.3326 71.1716 22.3952 39.34 65.18 24.9466 35.7596 61.515 20.56 35.1168 44.6748 30.16 39.6 139.6554 25.533 39.42 69.6688 25.2544 36.5462 65.18 21.0192 39.0454 59.082 24.16 34.82 56.9152 23.4624 33.7564 52.706 351.5868 32.8068 40.2752 279.092 27.8244 39.93 84.1918 27.326 38.7588 80.616 23.88 39.6 127.6508 25.533 39.42 69.6688 25.2544 36.148 61.515 21.0192 35.4 45.49 20.2346 30.3814 42.3784 139.6554 29.835 41.3906 118.9918 32.8068 40.2752 279.092 27.8244 39.8692 84.1918 27.326 38.7588 77.8762 23.88 37.7232 54.6944 22.96 36.88 49.7652 21.3584 32.1326 49.0964 199.9244 35.4 45.49 20.2346 30.3814 42.3784 139.6554 29.835 39.42 118.9918 29.03 39.34 95.423 24.9466 39.14 60.2036 24.16 35.1168 56.9152 529.9752 37.7232 52.706 22.96 33.3324 49.7652 21.3584 32.1326 46.976 199.9244 31.1934 39.8692 177.2254 26.8 39.7 74.108)
thru_array=(395.221 6554.214 7461.344 8323.839 6429.107 7232.143 8202.533 4589.431 7221.044 7804.938 4502.281 7119.916 7608.482 4311.079 6756.25 7521.429 9828.482 6942.857 7521.429 4080.344 6667 7499.558 9306.643 6756.25 7490.625 1855.857 6756.25 7484.414 205.3672 6554.214 7461.344 8323.839 6429.107 7232.143 8202.533 6333 7398.513 8174.621 6172.661 7119.916 8125.045 6093.75 6942.857 7985.732 4147.655 6942.857 7521.429 3851.882 6667 7499.558 9306.643 6655.286 7385.275 8501.585 6632.554 7484.414 205.3672 6554.214 7461.344 8278.813 6429.107 7232.143 8202.533 4589.431 7170.48 7684.5 4456.248 6756.25 7608.482 395.221 6756.25 7521.429 9828.482 6942.857 7521.429 3851.882 6667 7499.558 9209.933 6653.571 7385.275 8501.585 6132.188 7339.286 8045.036 5357.571 7247.768 7985.732 4906.266 6873.812 7940.652 3276.326 7170.48 7684.5 4456.248 6756.25 7608.482 395.221 6756.25 7477.138 6429.107 7232.143 8278.813 4589.431 7221.044 7925.375 4502.281 6756.25 7684.5 973.5335 6987.666 7521.429 4220.614 6735.036 7521.429 4080.344 6667 7512.187 9306.643 6655.286 7398.513 8855.759 6132.188 7363.448 8101.708 6093.75 6942.857 8045.036 4147.655 7232.143 8233.786 4589.431 7221.044 7925.375 4502.281 6756.25 7608.482 973.5335 6756.25 7484.414 205.3672 6475.875 7433.522 8278.813 6388.839 7405.701 8202.533 6655.286 7398.513 8855.759 6132.188 7339.286 8101.708 6093.75 6942.857 7985.732 4147.655 6942.857 7521.429 3851.882 6797.304 7490.625 1855.857 6653.571 7490.625 8374.036 6756.25 7484.414 205.3672 6475.875 7433.522 8278.813 6388.839 7221.044 8202.533 6252.83 7170.48 8148.382 4456.248 7055.71 7560.893 4220.614 6756.25 7521.429 9531.964 6942.857 7512.187 3851.882 6661.143 7490.625 1855.857 6653.571 7490.625 8374.036 6632.554 7339.286 8351.705 5832 7247.768 7950.536)
gap_array=(0.14 0.28 0.63 2.52 0.28 0.49 2.03 0.21 0.48 1.05 0.21 0.42 0.98 0.21 0.35 0.91 6.9167 0.42 0.8043 0.14 0.35 0.77 4.13 0.35 0.7 0.14 0.35 0.63 0.07 0.28 0.63 2.52 0.28 0.49 2.03 0.28 0.56 1.89 0.28 0.42 1.75 0.26 0.42 1.3573 0.21 0.42 0.8043 0.14 0.35 0.77 4.13 0.28 0.56 3.22 0.28 0.63 0.07 0.28 0.63 2.38 0.28 0.49 2.03 0.21 0.42 1.05 0.21 0.35 0.98 0.14 0.35 0.91 6.9167 0.42 0.8043 0.14 0.35 0.77 3.99 0.28 0.56 3.22 0.28 0.49 1.47 0.21 0.49 1.3573 0.21 0.42 1.19 0.14 0.42 1.05 0.21 0.35 0.98 0.14 0.35 0.63 0.28 0.49 2.38 0.21 0.48 1.12 0.21 0.35 1.05 0.14 0.42 0.91 0.21 0.35 0.84 0.14 0.35 0.77 4.13 0.28 0.56 3.5602 0.28 0.56 1.61 0.26 0.42 1.47 0.21 0.49 2.17 0.21 0.48 1.12 0.21 0.35 0.98 0.14 0.35 0.63 0.07 0.28 0.63 2.38 0.28 0.56 2.03 0.28 0.56 3.5602 0.28 0.49 1.61 0.26 0.42 1.3573 0.21 0.42 0.8043 0.14 0.35 0.7 0.14 0.28 0.7 2.94 0.35 0.63 0.07 0.28 0.63 2.38 0.28 0.48 2.03 0.28 0.42 1.82 0.21 0.42 0.91 0.21 0.35 0.84 5.46 0.42 0.77 0.14 0.35 0.7 0.14 0.28 0.7 2.94 0.28 0.49 2.73 0.21 0.49 1.26)
loss_array=(2.838572 16.6667 33.3333 50 16.6667 33.3333 50 9.0909 33.3333 50 9.0909 33.3333 50 7.1429 21.89471 50 73.42858 25 50 5.8824 20 50 66.6667 25 40 3.780248 25 37.5 1.7241 16.6667 33.3333 50 16.6667 33.3333 50 14.2857 33.3333 50 14.2857 33.3333 50 12.5 25 50 6.25 25 50 5.2632 20 50 66.6667 20 33.3333 50 16.6667 37.5 1.7241 16.6667 33.3333 50 16.6667 33.3333 50 9.0909 33.3333 50 8.878772 25 50 2.838572 21.89471 50 73.42858 25 50 5.2632 20 50 59.8919 20 33.3333 50 12.5 33.3333 50 11.1111 33.3333 50 11.1111 25 50 5 33.3333 50 8.878772 25 50 2.838572 20 33.3333 16.6667 33.3333 50 9.0909 33.3333 50 9.0909 25 50 3.3701 26.55441 50 6.6667 20 50 5.8824 20 50 66.6667 20 33.3333 50 12.5 33.3333 50 12.5 25 50 6.25 33.3333 50 9.0909 33.3333 50 9.0909 25 50 3.3701 21.89471 37.5 1.7241 16.6667 33.3333 50 14.2857 33.3333 50 20 33.3333 50 12.5 33.3333 50 12.5 25 50 6.25 25 50 5.2632 25 45.24671 3.780248 20 40 50 21.89471 37.5 1.7241 16.6667 33.3333 50 14.2857 33.3333 50 14.2857 33.3333 50 8.878772 30 50 6.6667 20 50 66.6667 25 50 5.2632 20 45.24671 3.780248 20 40 50 16.6667 33.3333 50 11.1111 33.3333 50)
elif [ "$2" == "fair" ]
then
echo "Simulating fair experiences."
lat_array=(24.5532 39.64 68.1866 248.802 39.4232 57.3712 180.0614 35.513 56.1282 92.7914 35.23 54.1672 86.805 33.7704 43.3392 81.9986 704.6982 49.559 78.4564 31.3656 40.7452 75.0716 449.7536 44.99 71.5382 27.354 44.2998 69.682 22.6184 39.64 68.1866 248.802 39.4232 57.3712 180.0614 39.2568 63.9138 160.3852 39.0204 54.1672 140.0204 37.89 50.3144 118.9692 32.1504 49.559 78.4564 30.3974 40.7452 75.0716 449.7536 40.0324 62.9956 326.6704 39.7278 69.682 22.6184 39.64 68.1866 220.3746 39.4232 57.3712 180.0614 35.513 55.12 89.4212 34.93 44.99 86.805 24.5532 43.3392 81.9986 704.6982 49.559 78.4564 30.3974 40.7452 75.0716 410.303 39.9342 62.9956 326.6704 38.5288 60.7084 123.4372 36.87 59.208 118.9692 36.5388 47.6 102.874 29.8128 55.12 89.4212 34.93 44.2998 86.805 24.5532 42.43 68.7744 39.4232 58.5176 220.3746 35.513 56.1282 97.502 35.23 45.711 89.4212 25.9576 51.877 81.9986 33.024 41.6956 80.0712 31.3656 40.7452 77.7 449.7536 40.0324 63.9138 363.8056 38.5288 61.7 130.611 37.89 50.3144 123.4372 32.1504 58.5176 198.55 35.513 56.1282 97.502 35.23 44.99 86.805 25.9576 43.3392 69.682 22.6184 39.54 67.1804 220.3746 39.35 65.95 180.0614 40.0324 63.9138 363.8056 38.5288 60.7084 130.611 37.89 50.3144 118.9692 32.1504 48.7008 78.4564 30.3974 46.46 73.6604 27.354 39.9342 71.5382 303.9104 43.3392 69.682 22.6184 39.54 67.1804 220.3746 39.35 56.1282 180.0614 39.12 55.12 149.876 34.93 52.9276 84.3612 33.024 42.43 80.0712 624.2464 48.7008 77.7 30.3974 40.3524 73.6604 27.354 39.9342 70.33 303.9104 39.7278 60.7084 280.336 37.3816 59.208 110.692)
thru_array=(391.7165 2622.857 3513.047 4316.049 2603.571 3197.857 4088.136 1887.98 3172.962 3818.75 1732.022 3089.315 3817.857 1334.866 2892.857 3811.593 5427.866 2912.946 3769.586 1174.393 2669.138 3761.653 4882.571 2892.857 3635.786 493.8929 2892.857 3525 195.9141 2622.857 3513.047 4316.049 2603.571 3197.857 4088.136 2583.571 3384.717 4064.799 2481.071 3089.315 4050 2347.143 2931.25 4038.538 1199.652 2912.946 3769.586 1072.106 2669.138 3761.653 4882.571 2646.991 3338.152 4386.179 2639.33 3525 195.9141 2622.857 3513.047 4220.779 2603.571 3197.857 4088.136 1887.98 3131.138 3818.75 1573.788 2892.857 3817.857 391.7165 2892.857 3811.593 5427.866 2912.946 3769.586 1072.106 2669.138 3761.653 4681.964 2643.75 3338.152 4386.179 2414.5 3231.25 4044.487 2245.366 3231.25 4038.538 2192.002 2892.857 3903.279 803.9129 3131.138 3818.75 1573.788 2892.857 3817.857 391.7165 2892.857 3525 2603.571 3217.991 4220.779 1887.98 3172.962 3818.75 1732.022 2892.857 3818.75 483.5056 2976.011 3811.593 1241.518 2839.554 3790.589 1174.393 2669.138 3762.98 4882.571 2646.991 3384.717 4534.071 2414.5 3281.96 4050 2347.143 2931.25 4044.487 1199.652 3217.991 4125.509 1887.98 3172.962 3818.75 1732.022 2892.857 3817.857 483.5056 2892.857 3525 195.9141 2606.384 3484.219 4220.779 2603.571 3455.391 4088.136 2646.991 3384.717 4534.071 2414.5 3231.25 4050 2347.143 2931.25 4038.538 1199.652 2894.643 3769.586 1072.106 2892.857 3732.429 493.8929 2643.75 3635.786 4339.286 2892.857 3525 195.9141 2606.384 3484.219 4220.779 2603.571 3172.962 4088.136 2532.321 3131.138 4050 1573.788 3034.491 3816.393 1241.518 2892.857 3790.589 5274.482 2894.643 3762.98 1072.106 2658.065 3732.429 493.8929 2643.75 3539.143 4339.286 2639.33 3231.25 4339.286 2290.942 3231.25 3992.143)
gap_array=(0.14 0.28 0.56 2.24 0.28 0.42 1.82 0.21 0.42 0.98 0.21 0.42 0.91 0.21 0.35 0.77 6.9167 0.42 0.77 0.14 0.2984 0.7 4.06 0.35 0.63 0.14 0.35 0.63 0.07 0.28 0.56 2.24 0.28 0.42 1.82 0.28 0.56 1.68 0.28 0.42 1.4 0.21 0.42 1.1595 0.21 0.42 0.77 0.14 0.2984 0.7 4.06 0.28 0.49 2.94 0.28 0.63 0.07 0.28 0.56 2.03 0.28 0.42 1.82 0.21 0.42 0.91 0.21 0.35 0.91 0.14 0.35 0.77 6.9167 0.42 0.77 0.14 0.2984 0.7 3.85 0.28 0.49 2.94 0.24 0.49 1.2132 0.21 0.49 1.1595 0.21 0.35 1.05 0.14 0.42 0.91 0.21 0.35 0.91 0.14 0.35 0.63 0.28 0.49 2.03 0.21 0.42 0.98 0.21 0.35 0.91 0.14 0.42 0.77 0.21 0.35 0.77 0.14 0.2984 0.7 4.06 0.28 0.56 3.22 0.24 0.49 1.33 0.21 0.42 1.2132 0.21 0.49 1.89 0.21 0.42 0.98 0.21 0.35 0.91 0.14 0.35 0.63 0.07 0.28 0.56 2.03 0.28 0.56 1.82 0.28 0.56 3.22 0.24 0.49 1.33 0.21 0.42 1.1595 0.21 0.42 0.77 0.14 0.35 0.7 0.14 0.28 0.63 2.6936 0.35 0.63 0.07 0.28 0.56 2.03 0.28 0.42 1.82 0.28 0.42 1.54 0.21 0.42 0.84 0.21 0.35 0.77 5.46 0.42 0.7 0.14 0.28 0.7 0.14 0.28 0.63 2.6936 0.28 0.49 2.45 0.21 0.49 1.12)
loss_array=(3.308304 20 50 66.6667 20 46.86628 60 11.1111 40 50 11.1111 34.66666 50 9.0909 33.3333 50 80 33.3333 50 7.1429 25 50 75 33.3333 50 4.5455 33.3333 50 2.589188 20 50 66.6667 20 46.86628 60 19.05712 50 57.1429 16.6667 34.66666 50 14.2857 33.3333 50 7.6923 33.3333 50 6.25 25 50 75 25 50 66.6667 20 50 2.589188 20 50 66.6667 20 46.86628 60 11.1111 38.4615 50 10 33.3333 50 3.308304 33.3333 50 80 33.3333 50 6.25 25 50 71.14288 25 50 66.6667 16.6667 50 50 14.2857 50 50 12.5 33.3333 50 5.8824 38.4615 50 10 33.3333 50 3.308304 26.83638 50 20 50 66.6667 11.1111 40 50 11.1111 33.3333 50 4.053344 33.3333 50 8.3333 25 50 7.1429 25 50 75 25 50 66.6667 16.6667 50 50 14.2857 33.3333 50 7.6923 50 65.50002 11.1111 40 50 11.1111 33.3333 50 4.053344 33.3333 50 2.589188 20 50 66.6667 20 50 60 25 50 66.6667 16.6667 50 50 14.2857 33.3333 50 7.6923 33.3333 50 6.25 33.3333 50 4.5455 25 50 66.6667 33.3333 50 2.589188 20 50 66.6667 20 40 60 16.6667 38.4615 55.32568 10 33.3333 50 8.3333 26.83638 50 75.23077 33.3333 50 6.25 25 50 4.5455 25 50 66.6667 20 50 66.6667 14.2857 50 50)
elif [ "$2" == "passable" ]
then
echo "Simulating passable experiences."
lat_array=(27.067 43.524 79.901 292.35 41.322 68.13 233.148 39.32 67.197 129.7615 39.18 64.8 117.585 37.8935 55.151 106.979 720.645 61.11 99.265 35.98 49.831 91.1785 470.262 57.08 87.277 32.556 56.3315 83.535 24.109 43.524 79.901 292.35 41.322 68.13 233.148 40.494 74.7915 218.506 39.917 64.8 185.762 39.75 61.88 153.917 36.5865 61.11 99.265 35.52 49.831 91.1785 470.262 47.732 73.476 369.396 44.525 83.535 24.109 43.524 79.901 270.4085 41.322 68.13 233.148 39.32 65.78 123.76 39.1 57.08 117.585 27.067 55.151 106.979 720.645 61.11 99.265 35.52 49.831 91.1785 435.335 46.387 73.476 369.396 39.8285 70.996 160.097 39.58 69.666 153.917 39.49 59.8695 140.0315 34.848 65.78 123.76 39.1 56.3315 117.585 27.067 53.8455 81.866 41.322 68.822 270.4085 39.32 67.197 136.295 39.18 58.407 123.76 30.2065 62.9795 106.979 37.14 52.458 101.52 35.98 49.831 94.545 470.262 47.732 74.7915 410.042 39.8285 71.884 174.504 39.75 61.88 160.097 36.5865 68.822 253.526 39.32 67.197 136.295 39.18 57.08 117.585 30.2065 55.151 83.535 24.109 42.371 79.11 270.4085 40.845 78.168 233.148 47.732 74.7915 410.042 39.8285 70.996 174.504 39.75 61.88 153.917 36.5865 60.588 99.265 35.52 59.234 89.012 32.556 46.387 87.277 331.576 55.151 83.535 24.109 42.371 79.11 270.4085 40.845 67.197 233.148 40.0055 65.78 199.365 39.1 63.704 110.654 37.14 53.8455 101.52 640.259 60.588 94.545 35.52 48.8095 89.012 32.556 46.387 85.246 331.576 44.525 70.996 314.0905 39.6715 69.666 148.31)
thru_array=(190.2857 435.5893 578.5714 710.1786 433.9286 485.1964 591.0893 296.4453 480.5926 587.5 295.7321 478.6708 587.5 291.5625 462.6295 587.5 1294.554 478.0301 587.5 289.2857 457.1429 581.1607 777.1429 468.7054 578.5714 268.6741 462.721 578.5714 95.19866 435.5893 578.5714 710.1786 433.9286 485.1964 591.0893 417.7857 578.5714 588.8929 335.0536 478.6708 587.5 319.6429 478.3504 587.5 289.2857 478.0301 587.5 289.2857 457.1429 581.1607 777.1429 457.1429 578.5714 723.5915 437.0078 578.5714 95.19866 435.5893 578.5714 656.7321 433.9286 485.1964 591.0893 296.4453 479.6317 587.5 294.6339 468.7054 587.5 190.2857 462.6295 587.5 1294.554 478.0301 587.5 289.2857 457.1429 581.1607 725.971 451.4141 578.5714 723.5915 326.5067 575.2098 587.5 304.0469 506.2969 587.5 296.5368 477.6786 587.5 289.2857 479.6317 587.5 294.6339 462.721 587.5 190.2857 462.5379 578.5714 433.9286 490.8248 656.7321 296.4453 480.5926 587.5 295.7321 474.8371 587.5 245.1998 478.4598 587.5 289.7321 461.2143 587.5 289.2857 457.1429 584.8214 777.1429 457.1429 578.5714 724.7813 326.5067 578.5714 587.5 319.6429 478.3504 587.5 289.2857 490.8248 603.2857 296.4453 480.5926 587.5 295.7321 468.7054 587.5 245.1998 462.6295 578.5714 95.19866 434.1708 578.5714 656.7321 433.9286 578.5714 591.0893 457.1429 578.5714 724.7813 326.5067 575.2098 587.5 319.6429 478.3504 587.5 289.2857 477.7098 587.5 289.2857 477.6786 578.5714 268.6741 451.4141 578.5714 723.2143 462.6295 578.5714 95.19866 434.1708 578.5714 656.7321 433.9286 480.5926 591.0893 376.4196 479.6317 587.5 294.6339 478.4598 587.5 289.7321 462.5379 587.5 998.0357 477.7098 584.8214 289.2857 457.1429 578.5714 268.6741 451.4141 578.5714 723.2143 437.0078 575.2098 723.2143 312.1462 506.2969 587.5)
gap_array=(0.07 0.28 0.56 1.946 0.28 0.42 1.54 0.21 0.42 0.84 0.21 0.42 0.77 0.1568 0.35 0.7 6.9146 0.35 0.7 0.14 0.28 0.63 3.6484 0.35 0.63 0.14 0.35 0.56 0.07 0.28 0.56 1.946 0.28 0.42 1.54 0.26 0.49 1.4 0.21 0.42 1.19 0.21 0.35 1.05 0.14 0.35 0.7 0.14 0.28 0.63 3.6484 0.28 0.49 2.4822 0.28 0.56 0.07 0.28 0.56 1.82 0.28 0.42 1.54 0.21 0.42 0.77 0.21 0.35 0.77 0.07 0.35 0.7 6.9146 0.35 0.7 0.14 0.28 0.63 3.143 0.28 0.49 2.4822 0.21 0.49 1.05 0.21 0.42 1.05 0.21 0.35 0.91 0.14 0.42 0.77 0.21 0.35 0.77 0.07 0.2856 0.56 0.28 0.42 1.82 0.21 0.42 0.91 0.21 0.35 0.77 0.14 0.42 0.7 0.14 0.28 0.7 0.14 0.28 0.63 3.6484 0.28 0.49 2.7776 0.21 0.49 1.12 0.21 0.35 1.05 0.14 0.42 1.68 0.21 0.42 0.91 0.21 0.35 0.77 0.14 0.35 0.56 0.07 0.28 0.56 1.82 0.28 0.49 1.54 0.28 0.49 2.7776 0.21 0.49 1.12 0.21 0.35 1.05 0.14 0.35 0.7 0.14 0.35 0.63 0.14 0.28 0.63 2.31 0.35 0.56 0.07 0.28 0.56 1.82 0.28 0.42 1.54 0.21 0.42 1.26 0.21 0.42 0.77 0.14 0.2856 0.7 5.1884 0.35 0.63 0.14 0.28 0.63 0.14 0.28 0.56 2.31 0.28 0.49 2.1 0.21 0.42 0.98)
loss_array=(0 3.4345 25 50 75 20 50 71.4286 12.5 50 66.6667 11.1111 50 66.6667 9.0909 33.3333 62.5 83.3333 39.6923 55.5556 7.1429 33.3333 50 80.82522 33.3333 50 4.5455 33.3333 50 2.7027 25 50 75 20 50 71.4286 20 50 71.4286 16.6667 50 66.6667 16.6667 50 66.6667 7.6923 39.6923 55.5556 6.283336 33.3333 50 80.82522 25 50 78.85383 25 50 2.7027 25 50 75 20 50 71.4286 12.5 50 66.6667 11.1111 33.3333 66.6667 3.4345 33.3333 62.5 83.3333 39.6923 55.5556 6.283336 33.3333 50 80 25 50 78.85383 16.6667 50 66.6667 14.2857 50 66.6667 14.2857 33.3333 66.6667 5.8824 50 66.6667 11.1111 33.3333 66.6667 3.4345 33.3333 50 20 50 75 12.5 50 66.6667 11.1111 33.3333 66.6667 4.1667 50 62.5 9.0909 33.3333 60 7.1429 33.3333 50 80.82522 25 50 80 16.6667 50 66.6667 16.6667 50 66.6667 7.6923 50 75 12.5 50 66.6667 11.1111 33.3333 66.6667 4.1667 33.3333 50 2.7027 20 50 75 20 50 71.4286 25 50 80 16.6667 50 66.6667 16.6667 50 66.6667 7.6923 34.23899 55.5556 6.283336 33.3333 50 4.5455 25 50 75 33.3333 50 2.7027 20 50 75 20 50 71.4286 20 50 71.4286 11.1111 50 66.6667 9.0909 33.3333 60 83.3333 34.23899 50 6.283336 25 50 4.5455 25 50 75 25 50 75 14.2857 50 66.6667)
elif [ "$2" == "poor" ]
then
echo "Simulating poor experiences."
lat_array=(25.7696 44.738 86.852 309.572 42.6192 70.3264 258.0316 39.253 69.6964 148.3806 39.0948 67.7718 137.01 37.0004 56.5448 123.3224 720.87 63.3 112.766 35.2636 51.95 102.0044 501.8212 58.806 96.7186 29.9812 57.4378 91.051 23.582 44.738 86.852 309.572 42.6192 70.3264 258.0316 40.9 79.2838 244.4508 39.9808 67.7718 214.0656 39.77 64.1644 181.5894 35.91 63.3 112.766 34.0748 51.95 102.0044 501.8212 49.472 78.2556 393.2282 45.719 91.051 23.582 44.738 86.852 291.1656 42.6192 70.3264 258.0316 39.253 68.76 141.3916 38.7198 58.806 137.01 25.7696 56.5448 123.3224 720.87 63.3 112.766 34.0748 51.95 102.0044 448.015 48.4178 78.2556 393.2282 39.88 75.3784 191.2936 39.5876 72.2352 181.5894 39.48 61.3278 159.5956 33.5004 68.76 141.3916 38.7198 57.4378 137.01 25.7696 55.87 88.7448 42.6192 71.136 291.1656 39.253 69.6964 152.9192 39.0948 59.64 141.3916 28.423 65.3086 123.3224 36.42 54.6052 118.3164 35.2636 51.95 109.238 501.8212 49.472 79.2838 415.9 39.88 77.3992 201.2512 39.77 64.1644 191.2936 35.91 71.136 271.736 39.253 69.6964 152.9192 39.0948 58.806 137.01 28.423 56.5448 91.051 23.582 43.767 84.9368 291.1656 41.49 83.061 258.0316 49.472 79.2838 415.9 39.88 75.3784 201.2512 39.77 64.1644 181.5894 35.91 62.3308 112.766 34.0748 60.4944 99.6776 29.9812 48.4178 96.7186 347.6744 56.5448 91.051 23.582 43.767 84.9368 291.1656 41.49 69.6964 258.0316 40.4674 68.76 229.332 38.7198 66.4708 129.7108 36.42 55.87 118.3164 640.3208 62.3308 109.238 34.0748 50.2318 99.6776 29.9812 48.4178 93.4524 347.6744 45.719 75.3784 324.5362 39.6958 72.2352 169.944)
thru_array=(11.91741 145.2857 146.875 188.2589 144.6429 146.875 186.0223 93.41518 146.875 146.875 76.77232 146.875 146.875 41.79018 146.875 146.875 282.6049 146.875 146.875 27.25893 146.875 146.875 218.8482 146.875 146.875 22.50893 146.875 146.875 6.014511 145.2857 146.875 188.2589 144.6429 146.875 186.0223 144.6429 146.875 184.7411 144.6429 146.875 178.0536 144.6429 146.875 153.5112 27.625 146.875 146.875 27.00893 146.875 146.875 218.8482 146.875 146.875 188.3929 145.8348 146.875 6.014511 145.2857 146.875 187.7098 144.6429 146.875 186.0223 93.41518 146.875 146.875 64.78348 146.875 146.875 11.91741 146.875 146.875 282.6049 146.875 146.875 27.00893 146.875 146.875 188.3929 146.6161 146.875 188.3929 144.6429 146.875 163.8527 144.6429 146.875 153.5112 142.8348 146.875 147.3973 27.00893 146.875 146.875 64.78348 146.875 146.875 11.91741 146.875 146.875 144.6429 146.875 187.7098 93.41518 146.875 146.875 76.77232 146.875 146.875 17.38393 146.875 146.875 30.625 146.875 146.875 27.25893 146.875 146.875 218.8482 146.875 146.875 188.3929 144.6429 146.875 173.7522 144.6429 146.875 163.8527 27.625 146.875 187.1607 93.41518 146.875 146.875 76.77232 146.875 146.875 17.38393 146.875 146.875 6.014511 144.7366 146.875 187.7098 144.6429 146.875 186.0223 146.875 146.875 188.3929 144.6429 146.875 173.7522 144.6429 146.875 153.5112 27.625 146.875 146.875 27.00893 146.875 146.875 22.50893 146.6161 146.875 188.3929 146.875 146.875 6.014511 144.7366 146.875 187.7098 144.6429 146.875 186.0223 144.6429 146.875 182.3549 64.78348 146.875 146.875 30.625 146.875 146.875 275.9241 146.875 146.875 27.00893 146.875 146.875 22.50893 146.6161 146.875 188.3929 145.8348 146.875 188.3929 144.6429 146.875 147.9464)
gap_array=(0.07 0.28 0.49 1.82 0.21 0.42 1.33 0.21 0.42 0.77 0.14 0.35 0.7 0.14 0.28 0.7 6.9167 0.35 0.63 0.14 0.28 0.63 3.22 0.28 0.56 0.07 0.28 0.56 0.07 0.28 0.49 1.82 0.21 0.42 1.33 0.21 0.49 1.26 0.21 0.35 1.12 0.21 0.35 0.98 0.14 0.35 0.63 0.14 0.28 0.63 3.22 0.28 0.42 2.3569 0.28 0.56 0.07 0.28 0.49 1.6737 0.21 0.42 1.33 0.21 0.42 0.77 0.14 0.28 0.7 0.07 0.28 0.7 6.9167 0.35 0.63 0.14 0.28 0.63 2.87 0.28 0.42 2.3569 0.21 0.42 0.98 0.21 0.42 0.98 0.21 0.35 0.84 0.14 0.42 0.77 0.14 0.28 0.7 0.07 0.28 0.5332 0.21 0.42 1.6737 0.21 0.42 0.84 0.14 0.35 0.77 0.07 0.35 0.7 0.14 0.28 0.63 0.14 0.28 0.63 3.22 0.28 0.49 2.5802 0.21 0.42 1.05 0.21 0.35 0.98 0.14 0.42 1.54 0.21 0.42 0.84 0.14 0.28 0.7 0.07 0.28 0.56 0.07 0.24 0.49 1.6737 0.21 0.49 1.33 0.28 0.49 2.5802 0.21 0.42 1.05 0.21 0.35 0.98 0.14 0.35 0.63 0.14 0.35 0.56 0.07 0.28 0.56 2.1 0.28 0.56 0.07 0.24 0.49 1.6737 0.21 0.42 1.33 0.21 0.42 1.1475 0.14 0.35 0.7 0.14 0.28 0.63 4.97 0.35 0.63 0.14 0.28 0.56 0.07 0.28 0.56 2.1 0.28 0.42 1.89 0.21 0.42 0.91)
loss_array=(3.4483 25 50 83.3333 20 50 81.51371 12.5 50 71.4286 12.5 50 66.6667 9.208416 33.3333 66.6667 85.7143 50 66.6667 7.6923 33.3333 66.6667 83.3333 33.3333 66.6667 4.709964 33.3333 59.33332 2.735744 25 50 83.3333 20 50 81.51371 20 50 80 16.6667 50 80 16.6667 50 75 8.3333 50 66.6667 6.704796 33.3333 66.6667 83.3333 25 50 83.3333 25 59.33332 2.735744 25 50 83.3333 20 50 81.51371 12.5 50 71.4286 11.1111 33.3333 66.6667 3.4483 33.3333 66.6667 85.7143 50 66.6667 6.704796 33.3333 66.6667 83.3333 25 50 83.3333 16.6667 50 75 14.2857 50 75 14.2857 33.3333 75 6.117664 50 71.4286 11.1111 33.3333 66.6667 3.4483 33.3333 50 20 50 83.3333 12.5 50 75 12.5 33.3333 71.4286 4.287916 50 66.6667 9.0909 33.3333 66.6667 7.6923 33.3333 66.6667 83.3333 25 50 83.3333 16.6667 50 80 16.6667 50 75 8.3333 50 83.3333 12.5 50 75 12.5 33.3333 66.6667 4.287916 33.3333 59.33332 2.735744 20 50 83.3333 20 50 81.51371 25 50 83.3333 16.6667 50 80 16.6667 50 75 8.3333 40.83077 66.6667 6.704796 33.3333 66.6667 4.709964 25 66.6667 83.3333 33.3333 59.33332 2.735744 20 50 83.3333 20 50 81.51371 20 50 80 11.1111 50 66.6667 9.0909 33.3333 66.6667 85.7143 40.83077 66.6667 6.704796 26.71699 66.6667 4.709964 25 62.5 83.3333 25 50 83.3333 16.6667 50 75)
elif [ "$2" == "verypoor" ]
then
echo "Simulating very poor experiences."
lat_array=(25.7696 44.7592 87.8132 313.076 42.6728 70.6276 264.8418 39.253 69.9446 150.5224 39.0948 68.007 139.99 37.0004 56.6448 127.7086 720.87 63.38 115.0416 35.2636 52.3896 105.3186 508.776 58.828 98.1294 29.9812 57.6778 92.378 23.582 44.7592 87.8132 313.076 42.6728 70.6276 264.8418 40.9136 79.967 248.7832 40 68.007 220.222 39.77 64.34 187.75 35.91 63.38 115.0416 34.0748 52.3896 105.3186 508.776 49.5572 78.678 399.4336 45.769 92.378 23.582 44.7592 87.8132 297.5126 42.6728 70.6276 264.8418 39.253 68.99 145.4408 38.7198 58.828 139.99 25.7696 56.6448 127.7086 720.87 63.38 115.0416 34.0748 52.3896 105.3186 448.529 48.6742 78.678 399.4336 39.88 75.746 196.594 39.5876 73.0452 187.75 39.48 61.3552 167.1096 33.5004 68.99 145.4408 38.7198 57.6778 139.99 25.7696 55.9502 89.892 42.6728 71.4106 297.5126 39.253 69.9446 158.4188 39.0948 59.6648 145.4408 28.423 65.4508 127.7086 36.42 54.7364 120.4064 35.2636 52.3896 110.66 508.776 49.5572 79.967 416.6324 39.88 77.8896 207.996 39.77 64.34 196.594 35.91 71.4106 280.7444 39.253 69.9446 158.4188 39.0948 58.828 139.99 28.423 56.6448 92.378 23.582 43.817 85.9964 297.5126 41.49 83.9514 264.8418 49.5572 79.967 416.6324 39.88 75.746 207.996 39.77 64.34 187.75 35.91 62.3408 115.0416 34.0748 60.5352 100.6884 29.9812 48.6742 98.1294 354.2584 56.6448 92.378 23.582 43.817 85.9964 297.5126 41.49 69.9446 264.8418 40.4886 68.99 233.957 38.7198 66.7144 132.0828 36.42 55.9502 120.4064 640.3208 62.3408 110.66 34.0748 50.4412 100.6884 29.9812 48.6742 94.5568 354.2584 45.769 75.746 328.54 39.6958 73.0452 179.476)
thru_array=(0.11161 21.04464 37.34152 144.6429 17.1875 27.90179 144.6429 14.67634 27.90179 122.135 12.21652 27.90179 90.70871 5.69196 27.00893 83.64062 144.6429 27.59487 56.73437 2.799108 27.00893 48.84598 144.6429 27.00893 45.56027 0.11161 27.00893 41.96987 0.11161 21.04464 37.34152 144.6429 17.1875 27.90179 144.6429 17.0625 29.96094 144.6429 16.42188 27.90179 144.6429 16.40625 27.82366 144.6429 4.446426 27.59487 56.73437 1.470985 27.00893 48.84598 144.6429 27.00893 28.79464 144.6429 24.33928 41.96987 0.11161 21.04464 37.34152 144.6429 17.1875 27.90179 144.6429 14.67634 27.90179 100.6741 8.60156 27.00893 90.70871 0.11161 27.00893 83.64062 144.6429 27.59487 56.73437 1.470985 27.00893 48.84598 144.6429 26.49107 28.79464 144.6429 16.40625 28.75893 144.6429 15.92188 28.02679 144.6429 15.59152 27.21987 144.6429 0.83036 27.90179 100.6741 8.60156 27.00893 90.70871 0.11161 27.00893 39.36161 17.1875 27.90179 144.6429 14.67634 27.90179 143.596 12.21652 27.00893 100.6741 0.11161 27.90179 83.64062 5.69196 27.00893 70.1875 2.799108 27.00893 51.31696 144.6429 27.00893 29.96094 144.6429 16.40625 28.79464 144.6429 16.40625 27.82366 144.6429 4.446426 27.90179 144.6429 14.67634 27.90179 143.596 12.21652 27.00893 90.70871 0.11161 27.00893 41.96987 0.11161 17.75 36.15179 144.6429 17.1875 34.96206 144.6429 27.00893 29.96094 144.6429 16.40625 28.75893 144.6429 16.40625 27.82366 144.6429 4.446426 27.36607 56.73437 1.470985 27.08259 46.75 0.11161 26.49107 45.56027 144.6429 27.00893 41.96987 0.11161 17.75 36.15179 144.6429 17.1875 27.90179 144.6429 16.74219 27.90179 144.6429 8.60156 27.90179 88.10045 5.69196 27.00893 70.1875 144.6429 27.36607 51.31696 1.470985 27.00893 46.75 0.11161 26.49107 44.37054 144.6429 24.33928 28.75893 144.6429 16.24219 28.02679 144.6429)
gap_array=(0.07 0.21 0.49 1.61 0.21 0.35 1.19 0.14 0.35 0.7 0.14 0.35 0.7 0.14 0.28 0.63 6.8201 0.35 0.63 0.07 0.28 0.56 2.94 0.28 0.56 0.07 0.28 0.49 0.07 0.21 0.49 1.61 0.21 0.35 1.19 0.21 0.42 1.12 0.21 0.35 0.98 0.21 0.35 0.84 0.07 0.35 0.63 0.07 0.28 0.56 2.94 0.28 0.42 2.1 0.21 0.49 0.07 0.21 0.49 1.47 0.21 0.35 1.19 0.14 0.35 0.7 0.14 0.28 0.7 0.07 0.28 0.63 6.8201 0.35 0.63 0.07 0.28 0.56 2.66 0.28 0.42 2.1 0.21 0.42 0.91 0.21 0.42 0.84 0.14 0.3417 0.77 0.07 0.35 0.7 0.14 0.28 0.7 0.07 0.28 0.49 0.21 0.42 1.47 0.14 0.35 0.77 0.14 0.28 0.7 0.07 0.35 0.63 0.14 0.28 0.63 0.07 0.28 0.56 2.94 0.28 0.42 2.38 0.21 0.42 0.98 0.21 0.35 0.91 0.07 0.42 1.33 0.14 0.35 0.77 0.14 0.28 0.7 0.07 0.28 0.49 0.07 0.21 0.49 1.47 0.21 0.49 1.19 0.28 0.42 2.38 0.21 0.42 0.98 0.21 0.35 0.84 0.07 0.35 0.63 0.07 0.28 0.56 0.07 0.28 0.56 1.89 0.28 0.49 0.07 0.21 0.49 1.47 0.21 0.35 1.19 0.21 0.35 1.05 0.14 0.35 0.63 0.14 0.28 0.63 4.6802 0.35 0.56 0.07 0.28 0.56 0.07 0.28 0.49 1.89 0.21 0.42 1.7703 0.21 0.42 0.84)
loss_array=(3.4483 25 50 83.3333 20 50 83.3333 12.5 50 75 12.5 50 75 9.854544 33.3333 66.6667 90.9091 50 66.6667 7.6923 33.3333 66.6667 88.8889 33.3333 66.6667 4.709964 33.3333 62.5 2.735744 25 50 83.3333 20 50 83.3333 20 50 83.3333 20 50 83.3333 16.6667 50 80 8.3333 50 66.6667 6.704796 33.3333 66.6667 88.8889 25 50 85.7143 25 62.5 2.735744 25 50 83.3333 20 50 83.3333 12.5 50 75 11.1111 33.3333 75 3.4483 33.3333 66.6667 90.9091 50 66.6667 6.704796 33.3333 66.6667 85.7143 25 50 85.7143 16.6667 50 80 14.2857 50 80 14.2857 37.16666 75 6.117664 50 75 11.1111 33.3333 75 3.4483 33.3333 55.80957 20 50 83.3333 12.5 50 75 12.5 33.3333 75 4.287916 50 66.6667 9.0909 33.3333 66.6667 7.6923 33.3333 66.6667 88.8889 25 50 85.7143 16.6667 50 83.3333 16.6667 50 80 8.3333 50 83.3333 12.5 50 75 12.5 33.3333 75 4.287916 33.3333 62.5 2.735744 20.7333 50 83.3333 20 50 83.3333 25 50 85.7143 16.6667 50 83.3333 16.6667 50 80 8.3333 50 66.6667 6.704796 33.3333 66.6667 4.709964 25 66.6667 84.47618 33.3333 62.5 2.735744 20.7333 50 83.3333 20 50 83.3333 20 50 83.3333 11.1111 50 71.4286 9.0909 33.3333 66.6667 90.10909 50 66.6667 6.704796 28.87905 66.6667 4.709964 25 66.6667 84.47618 25 50 83.3333 16.6667 50 80)
else
echo "Please select a valid network experience to simulate. Valid values are noloss, good, fair, passable, poor, and verypoor."
exit 1
fi
else
echo "Please select a valid simulation technique. Valid values are loss_based and experience_based."
exit 1
fi
#initializing TC NETEM
reset_netem () {
sudo tc qdisc del dev eth1 root
sudo tc qdisc add dev eth1 root handle 1:0 netem delay 0ms loss 0%
sudo tc qdisc add dev eth1 parent 1:1 handle 10: tbf rate 4mbit buffer 64k limit 128k
sudo tc qdisc del dev eth2 root
sudo tc qdisc add dev eth2 root handle 1:0 netem delay 0ms loss 0%
sudo tc qdisc add dev eth2 parent 1:1 handle 10: tbf rate 4mbit buffer 64k limit 128k
echo "Resetting all TC Netem configurations to client and server."
}
echo "$(reset_netem)"
count=0
current_time=9999
interval=0.07
loss_loop=0
get_current_time () {
echo $(date +%s%3N)
}
#Run the outer loop for about 5150*200*70*ms = about 20hours
for ((outer_loop=0;outer_loop<5150;outer_loop++))
do
for ((loop=0;loop<=199;loop++));
do
#echo "$(get_current_time)"
latency=${lat_array[$loop]}
half_latency=$(python -c "print $latency*0.5")
thru=${thru_array[$loop]}
loss=${loss_array[$loss_loop]}
if [[ (($count == 0)) ]]
then
#inject latency and 0% loss when new time gap starts
sudo tc qdisc change dev eth1 root handle 1:0 netem delay ${half_latency}ms loss 0%
sudo tc qdisc change dev eth2 root handle 1:0 netem delay ${half_latency}ms loss 0%
#echo "Resetting loss"
#fetch the time gap value before the loss needs to be injected
gap=${gap_array[$loop]}
current_time=$gap
elif [[ (("$count" > "$current_time")) || (("$count" == "$current_time")) ]]
then
#inject latency and loss after the time gap is over
sudo tc qdisc change dev eth1 root handle 1:0 netem delay ${half_latency}ms loss ${loss}%
sudo tc qdisc change dev eth2 root handle 1:0 netem delay ${half_latency}ms loss ${loss}%
#get new time gap value
((loss_loop++))
if [ $loss_loop == 199 ]
then
loss_loop=0
fi
loss=${loss_array[$loss_loop]}
gap=${gap_array[$loop]}
current_time=$gap
count=0
else
#inject latency and 0loss% until new time gap value is not fetched
loss=0
sudo tc qdisc change dev eth1 root handle 1:0 netem delay ${half_latency}ms loss 0%
sudo tc qdisc change dev eth2 root handle 1:0 netem delay ${half_latency}ms loss 0%
#echo "Runing TC Command without loss $loss"
fi
#set throughput on the link
sudo tc qdisc change dev eth1 parent 1:1 handle 10: tbf rate ${thru}kbit buffer 64k limit 128k
sudo tc qdisc change dev eth2 parent 1:1 handle 10: tbf rate ${thru}kbit buffer 64k limit 128k
echo "Setting latency on each link: $half_latency, thru: $thru, gap: $gap, loss: $loss%"
count=$(python -c "print $count+$interval")
sleep 0.032
done
echo "$(reset_netem)"
done
sudo tc qdisc del dev eth1 root netem
sudo tc qdisc del dev eth2 root netem
#TC takes 4 ms to execute
#get_current_time takes 2 ms to execute
#python takes 9ms to execute
You can’t perform that action at this time.