Files
ricycleplanner/tests/test_town_avoidance.sh
2025-05-01 23:12:35 +02:00

38 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
cd "$(dirname "$0")/.."
# Create a test GPX file with a simple route
cat > test_route.gpx << EOF
<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.1" creator="Test">
<trk>
<name>Test Route</name>
<trkseg>
<trkpt lat="59.0" lon="18.0"><ele>10</ele></trkpt>
<trkpt lat="59.1" lon="18.1"><ele>20</ele></trkpt>
<trkpt lat="59.2" lon="18.2"><ele>30</ele></trkpt>
<trkpt lat="59.3" lon="18.3"><ele>40</ele></trkpt>
<trkpt lat="59.4" lon="18.4"><ele>50</ele></trkpt>
<trkpt lat="59.5" lon="18.5"><ele>60</ele></trkpt>
<trkpt lat="59.6" lon="18.6"><ele>70</ele></trkpt>
<trkpt lat="59.7" lon="18.7"><ele>80</ele></trkpt>
<trkpt lat="59.8" lon="18.8"><ele>90</ele></trkpt>
<trkpt lat="59.9" lon="18.9"><ele>100</ele></trkpt>
</trkseg>
</trk>
</gpx>
EOF
# Run the bicycle planner with debug output to see town avoidance in action
echo "Testing town avoidance feature with performance improvements"
echo "Running first time (no cache)..."
time go run main.go --input="test_route.gpx" --days=5 --elevFactor=4 --forestRadius=5 --resupplyRadius=5000
echo ""
echo "Running second time (with cache)..."
time go run main.go --input="test_route.gpx" --days=5 --elevFactor=4 --forestRadius=5 --resupplyRadius=5000
# Clean up
rm test_route.gpx