diff --git a/jsprit-examples/input/algorithmConfig_fix_schrimpf.xml b/jsprit-examples/input/algorithmConfig_fix_schrimpf.xml new file mode 100755 index 00000000..ab7f6d05 --- /dev/null +++ b/jsprit-examples/input/algorithmConfig_fix_schrimpf.xml @@ -0,0 +1,52 @@ + + + + + 2000 + + + + true + + + + + 1 + + + + + + 0.05 + 20 + + + + + 0.5 + + + + + 0.5 + + + + + + + + + 0.3 + + + + + 0.5 + + + + + + diff --git a/jsprit-examples/input/deliveries_solomon_specifiedVehicleEndLocations_c101.xml b/jsprit-examples/input/deliveries_solomon_specifiedVehicleEndLocations_c101.xml new file mode 100644 index 00000000..da1e27ce --- /dev/null +++ b/jsprit-examples/input/deliveries_solomon_specifiedVehicleEndLocations_c101.xml @@ -0,0 +1,1240 @@ + + + + INFINITE + HOMOGENEOUS + + + + solomonVehicle + solomonType + + 0 + + + + 101 + + + + 0.0 + 1236.0 + + true + + + + + solomonType + 200 + + 1000.0 + 1.0 + + + + + + + [x=5.0][y=35.0] + + 10 + 90.0 + + + 283.0 + 344.0 + + + + + [x=5.0][y=45.0] + + 10 + 90.0 + + + 665.0 + 716.0 + + + + + [x=8.0][y=40.0] + + 40 + 90.0 + + + 87.0 + 158.0 + + + + + [x=8.0][y=45.0] + + 20 + 90.0 + + + 751.0 + 816.0 + + + + + [x=0.0][y=45.0] + + 20 + 90.0 + + + 567.0 + 624.0 + + + + + [x=2.0][y=40.0] + + 20 + 90.0 + + + 383.0 + 434.0 + + + + + [x=0.0][y=40.0] + + 30 + 90.0 + + + 479.0 + 522.0 + + + + + [x=33.0][y=35.0] + + 10 + 90.0 + + + 16.0 + 80.0 + + + + + [x=33.0][y=32.0] + + 20 + 90.0 + + + 68.0 + 149.0 + + + + + [x=35.0][y=32.0] + + 10 + 90.0 + + + 166.0 + 235.0 + + + + + [x=35.0][y=30.0] + + 10 + 90.0 + + + 264.0 + 321.0 + + + + + [x=28.0][y=52.0] + + 20 + 90.0 + + + 812.0 + 883.0 + + + + + [x=28.0][y=55.0] + + 10 + 90.0 + + + 732.0 + 777.0 + + + + + [x=25.0][y=50.0] + + 10 + 90.0 + + + 65.0 + 144.0 + + + + + [x=25.0][y=52.0] + + 40 + 90.0 + + + 169.0 + 224.0 + + + + + [x=25.0][y=55.0] + + 10 + 90.0 + + + 622.0 + 701.0 + + + + + [x=23.0][y=52.0] + + 10 + 90.0 + + + 261.0 + 316.0 + + + + + [x=23.0][y=55.0] + + 20 + 90.0 + + + 546.0 + 593.0 + + + + + [x=20.0][y=50.0] + + 10 + 90.0 + + + 358.0 + 405.0 + + + + + [x=42.0][y=66.0] + + 10 + 90.0 + + + 65.0 + 146.0 + + + + + [x=45.0][y=70.0] + + 30 + 90.0 + + + 825.0 + 870.0 + + + + + [x=45.0][y=68.0] + + 10 + 90.0 + + + 912.0 + 967.0 + + + + + [x=20.0][y=55.0] + + 10 + 90.0 + + + 449.0 + 504.0 + + + + + [x=40.0][y=66.0] + + 20 + 90.0 + + + 170.0 + 225.0 + + + + + [x=40.0][y=69.0] + + 20 + 90.0 + + + 621.0 + 702.0 + + + + + [x=42.0][y=65.0] + + 10 + 90.0 + + + 15.0 + 67.0 + + + + + [x=10.0][y=40.0] + + 30 + 90.0 + + + 31.0 + 100.0 + + + + + [x=42.0][y=68.0] + + 10 + 90.0 + + + 727.0 + 782.0 + + + + + [x=10.0][y=35.0] + + 20 + 90.0 + + + 200.0 + 237.0 + + + + + [x=38.0][y=70.0] + + 10 + 90.0 + + + 534.0 + 605.0 + + + + + [x=38.0][y=68.0] + + 20 + 90.0 + + + 255.0 + 324.0 + + + + + [x=15.0][y=80.0] + + 10 + 90.0 + + + 278.0 + 345.0 + + + + + [x=18.0][y=75.0] + + 20 + 90.0 + + + 99.0 + 148.0 + + + + + [x=15.0][y=75.0] + + 20 + 90.0 + + + 179.0 + 254.0 + + + + + [x=20.0][y=80.0] + + 40 + 90.0 + + + 384.0 + 429.0 + + + + + [x=20.0][y=85.0] + + 40 + 90.0 + + + 475.0 + 528.0 + + + + + [x=22.0][y=75.0] + + 30 + 90.0 + + + 30.0 + 92.0 + + + + + [x=22.0][y=85.0] + + 10 + 90.0 + + + 567.0 + 620.0 + + + + + [x=35.0][y=69.0] + + 10 + 90.0 + + + 448.0 + 505.0 + + + + + [x=25.0][y=85.0] + + 20 + 90.0 + + + 652.0 + 721.0 + + + + + [x=30.0][y=52.0] + + 20 + 90.0 + + + 914.0 + 965.0 + + + + + [x=30.0][y=50.0] + + 10 + 90.0 + + + 10.0 + 73.0 + + + + + [x=55.0][y=80.0] + + 10 + 90.0 + + + 743.0 + 820.0 + + + + + [x=55.0][y=85.0] + + 20 + 90.0 + + + 647.0 + 726.0 + + + + + [x=58.0][y=75.0] + + 20 + 90.0 + + + 30.0 + 84.0 + + + + + [x=60.0][y=85.0] + + 30 + 90.0 + + + 561.0 + 622.0 + + + + + [x=60.0][y=80.0] + + 10 + 90.0 + + + 95.0 + 156.0 + + + + + [x=62.0][y=80.0] + + 30 + 90.0 + + + 196.0 + 239.0 + + + + + [x=65.0][y=82.0] + + 10 + 90.0 + + + 285.0 + 336.0 + + + + + [x=65.0][y=85.0] + + 40 + 90.0 + + + 475.0 + 518.0 + + + + + [x=67.0][y=85.0] + + 20 + 90.0 + + + 368.0 + 441.0 + + + + + [x=60.0][y=60.0] + + 10 + 90.0 + + + 836.0 + 889.0 + + + + + [x=60.0][y=55.0] + + 10 + 90.0 + + + 20.0 + 84.0 + + + + + [x=35.0][y=66.0] + + 10 + 90.0 + + + 357.0 + 410.0 + + + + + [x=65.0][y=60.0] + + 30 + 90.0 + + + 645.0 + 708.0 + + + + + [x=63.0][y=58.0] + + 10 + 90.0 + + + 737.0 + 802.0 + + + + + [x=87.0][y=30.0] + + 10 + 90.0 + + + 668.0 + 731.0 + + + + + [x=88.0][y=35.0] + + 20 + 90.0 + + + 109.0 + 170.0 + + + + + [x=88.0][y=30.0] + + 10 + 90.0 + + + 574.0 + 643.0 + + + + + [x=75.0][y=55.0] + + 20 + 90.0 + + + 369.0 + 420.0 + + + + + [x=72.0][y=55.0] + + 10 + 90.0 + + + 265.0 + 338.0 + + + + + [x=85.0][y=25.0] + + 10 + 90.0 + + + 769.0 + 820.0 + + + + + [x=85.0][y=35.0] + + 30 + 90.0 + + + 47.0 + 124.0 + + + + + [x=66.0][y=55.0] + + 10 + 90.0 + + + 173.0 + 238.0 + + + + + [x=65.0][y=55.0] + + 20 + 90.0 + + + 85.0 + 144.0 + + + + + [x=70.0][y=58.0] + + 20 + 90.0 + + + 458.0 + 523.0 + + + + + [x=68.0][y=60.0] + + 30 + 90.0 + + + 555.0 + 612.0 + + + + + [x=47.0][y=40.0] + + 10 + 90.0 + + + 12.0 + 77.0 + + + + + [x=47.0][y=35.0] + + 10 + 90.0 + + + 826.0 + 875.0 + + + + + [x=45.0][y=35.0] + + 10 + 90.0 + + + 916.0 + 969.0 + + + + + [x=45.0][y=30.0] + + 10 + 90.0 + + + 734.0 + 777.0 + + + + + [x=95.0][y=30.0] + + 30 + 90.0 + + + 387.0 + 456.0 + + + + + [x=95.0][y=35.0] + + 20 + 90.0 + + + 293.0 + 360.0 + + + + + [x=53.0][y=30.0] + + 10 + 90.0 + + + 450.0 + 505.0 + + + + + [x=92.0][y=30.0] + + 10 + 90.0 + + + 478.0 + 551.0 + + + + + [x=53.0][y=35.0] + + 50 + 90.0 + + + 353.0 + 412.0 + + + + + [x=45.0][y=65.0] + + 20 + 90.0 + + + 997.0 + 1068.0 + + + + + [x=90.0][y=35.0] + + 10 + 90.0 + + + 203.0 + 260.0 + + + + + [x=38.0][y=15.0] + + 10 + 90.0 + + + 651.0 + 740.0 + + + + + [x=38.0][y=5.0] + + 30 + 90.0 + + + 471.0 + 534.0 + + + + + [x=40.0][y=15.0] + + 40 + 90.0 + + + 35.0 + 87.0 + + + + + [x=40.0][y=5.0] + + 30 + 90.0 + + + 385.0 + 436.0 + + + + + [x=42.0][y=15.0] + + 10 + 90.0 + + + 95.0 + 158.0 + + + + + [x=48.0][y=30.0] + + 10 + 90.0 + + + 632.0 + 693.0 + + + + + [x=48.0][y=40.0] + + 10 + 90.0 + + + 76.0 + 129.0 + + + + + [x=50.0][y=35.0] + + 20 + 90.0 + + + 262.0 + 317.0 + + + + + [x=50.0][y=40.0] + + 50 + 90.0 + + + 171.0 + 218.0 + + + + + [x=35.0][y=5.0] + + 20 + 90.0 + + + 562.0 + 629.0 + + + + + [x=50.0][y=30.0] + + 10 + 90.0 + + + 531.0 + 610.0 + + + + + [x=28.0][y=35.0] + + 10 + 90.0 + + + 1001.0 + 1066.0 + + + + + [x=28.0][y=30.0] + + 10 + 90.0 + + + 632.0 + 693.0 + + + + + [x=30.0][y=30.0] + + 10 + 90.0 + + + 541.0 + 600.0 + + + + + [x=32.0][y=30.0] + + 10 + 90.0 + + + 359.0 + 412.0 + + + + + [x=30.0][y=35.0] + + 10 + 90.0 + + + 1054.0 + 1127.0 + + + + + [x=30.0][y=32.0] + + 30 + 90.0 + + + 448.0 + 509.0 + + + + + [x=25.0][y=30.0] + + 10 + 90.0 + + + 725.0 + 786.0 + + + + + [x=25.0][y=35.0] + + 10 + 90.0 + + + 912.0 + 969.0 + + + + + [x=44.0][y=5.0] + + 20 + 90.0 + + + 286.0 + 347.0 + + + + + [x=42.0][y=10.0] + + 40 + 90.0 + + + 186.0 + 257.0 + + + + + [x=26.0][y=32.0] + + 10 + 90.0 + + + 815.0 + 880.0 + + + + + diff --git a/jsprit-examples/input/pickups_and_deliveries_solomon_c101_withoutTWs_and_specifiedVehicleEndLocations.xml b/jsprit-examples/input/pickups_and_deliveries_solomon_c101_withoutTWs_and_specifiedVehicleEndLocations.xml new file mode 100644 index 00000000..e13eeccd --- /dev/null +++ b/jsprit-examples/input/pickups_and_deliveries_solomon_c101_withoutTWs_and_specifiedVehicleEndLocations.xml @@ -0,0 +1,1239 @@ + + + + INFINITE + HOMOGENEOUS + + + + solomonVehicle + solomonType + + 0 + + + + 101 + + + + 0.0 + 1236.0 + + + + + + solomonType + 200 + + 500.0 + 1.0 + + + + + + + [x=5.0][y=35.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=5.0][y=45.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=8.0][y=40.0] + + 40 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=8.0][y=45.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=0.0][y=45.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=2.0][y=40.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=0.0][y=40.0] + + 30 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=33.0][y=35.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=33.0][y=32.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=35.0][y=32.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=35.0][y=30.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=28.0][y=52.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=28.0][y=55.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=25.0][y=50.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=25.0][y=52.0] + + 40 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=25.0][y=55.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=23.0][y=52.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=23.0][y=55.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=20.0][y=50.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=42.0][y=66.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=45.0][y=70.0] + + 30 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=45.0][y=68.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=20.0][y=55.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=40.0][y=66.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=40.0][y=69.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=42.0][y=65.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=10.0][y=40.0] + + 30 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=42.0][y=68.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=10.0][y=35.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=38.0][y=70.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=38.0][y=68.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=15.0][y=80.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=18.0][y=75.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=15.0][y=75.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=20.0][y=80.0] + + 40 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=20.0][y=85.0] + + 40 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=22.0][y=75.0] + + 30 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=22.0][y=85.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=35.0][y=69.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=25.0][y=85.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=30.0][y=52.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=30.0][y=50.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=55.0][y=80.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=55.0][y=85.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=58.0][y=75.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=60.0][y=85.0] + + 30 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=60.0][y=80.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=62.0][y=80.0] + + 30 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=65.0][y=82.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=65.0][y=85.0] + + 40 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=67.0][y=85.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=60.0][y=60.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=60.0][y=55.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=35.0][y=66.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=65.0][y=60.0] + + 30 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=63.0][y=58.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=87.0][y=30.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=88.0][y=35.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=88.0][y=30.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=75.0][y=55.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=72.0][y=55.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=85.0][y=25.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=85.0][y=35.0] + + 30 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=66.0][y=55.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=65.0][y=55.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=70.0][y=58.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=68.0][y=60.0] + + 30 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=47.0][y=40.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=47.0][y=35.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=45.0][y=35.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=45.0][y=30.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=95.0][y=30.0] + + 30 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=95.0][y=35.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=53.0][y=30.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=92.0][y=30.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=53.0][y=35.0] + + 50 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=45.0][y=65.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=90.0][y=35.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=38.0][y=15.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=38.0][y=5.0] + + 30 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=40.0][y=15.0] + + 40 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=40.0][y=5.0] + + 30 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=42.0][y=15.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=48.0][y=30.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=48.0][y=40.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=50.0][y=35.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=50.0][y=40.0] + + 50 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=35.0][y=5.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=50.0][y=30.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=28.0][y=35.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=28.0][y=30.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=30.0][y=30.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=32.0][y=30.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=30.0][y=35.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=30.0][y=32.0] + + 30 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=25.0][y=30.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=25.0][y=35.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=44.0][y=5.0] + + 20 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=42.0][y=10.0] + + 40 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + [x=26.0][y=32.0] + + 10 + 90.0 + + + 0.0 + 1.7976931348623157E308 + + + + + diff --git a/jsprit-examples/src/main/java/jsprit/examples/SolomonExampleWithSpecifiedVehicleEndLocations.java b/jsprit-examples/src/main/java/jsprit/examples/SolomonExampleWithSpecifiedVehicleEndLocations.java new file mode 100644 index 00000000..9cb6b2c5 --- /dev/null +++ b/jsprit-examples/src/main/java/jsprit/examples/SolomonExampleWithSpecifiedVehicleEndLocations.java @@ -0,0 +1,109 @@ +/******************************************************************************* + * Copyright (C) 2013 Stefan Schroeder + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + ******************************************************************************/ +package jsprit.examples; + +import java.io.File; +import java.util.Collection; + +import jsprit.analysis.toolbox.AlgorithmSearchProgressChartListener; +import jsprit.analysis.toolbox.GraphStreamViewer; +import jsprit.analysis.toolbox.GraphStreamViewer.Label; +import jsprit.analysis.toolbox.Plotter; +import jsprit.analysis.toolbox.SolutionPrinter; +import jsprit.core.algorithm.VehicleRoutingAlgorithm; +import jsprit.core.algorithm.io.VehicleRoutingAlgorithms; +import jsprit.core.algorithm.selector.SelectBest; +import jsprit.core.problem.VehicleRoutingProblem; +import jsprit.core.problem.io.VrpXMLReader; +import jsprit.core.problem.solution.VehicleRoutingProblemSolution; + + +public class SolomonExampleWithSpecifiedVehicleEndLocations { + + public static void main(String[] args) { + /* + * some preparation - create output folder + */ + File dir = new File("output"); + // if the directory does not exist, create it + if (!dir.exists()){ + System.out.println("creating directory ./output"); + boolean result = dir.mkdir(); + if(result) System.out.println("./output created"); + } + + /* + * Build the problem. + * + * But define a problem-builder first. + */ + VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance(); + + /* + * A solomonReader reads solomon-instance files, and stores the required information in the builder. + */ + new VrpXMLReader(vrpBuilder).read("input/deliveries_solomon_specifiedVehicleEndLocations_c101.xml"); + + /* + * Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances). + */ + VehicleRoutingProblem vrp = vrpBuilder.build(); + + Plotter pblmPlotter = new Plotter(vrp); + pblmPlotter.plot("output/solomon_C101_specifiedVehicleEndLocations.png","C101"); + + /* + * Define the required vehicle-routing algorithms to solve the above problem. + * + * The algorithm can be defined and configured in an xml-file. + */ +// VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp); + VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_fix.xml"); + vra.setNuOfIterations(20000); +// vra.setPrematureBreak(100); + vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png")); + /* + * Solve the problem. + * + * + */ + Collection solutions = vra.searchSolutions(); + + /* + * Retrieve best solution. + */ + VehicleRoutingProblemSolution solution = new SelectBest().selectSolution(solutions); + + /* + * print solution + */ + SolutionPrinter.print(solution); + + /* + * Plot solution. + */ +// SolutionPlotter.plotSolutionAsPNG(vrp, solution, "output/solomon_C101_specifiedVehicleEndLocations_solution.png","C101"); + Plotter solPlotter = new Plotter(vrp, solution); + solPlotter.plot("output/solomon_C101_specifiedVehicleEndLocations_solution.png","C101"); + + + new GraphStreamViewer(vrp, solution).setRenderDelay(50).labelWith(Label.ID).setEnableAutoLayout(true).display(); + + + } + +} diff --git a/jsprit-examples/src/main/java/jsprit/examples/SolomonExampleWithSpecifiedVehicleEndLocationsWithoutTWs.java b/jsprit-examples/src/main/java/jsprit/examples/SolomonExampleWithSpecifiedVehicleEndLocationsWithoutTWs.java new file mode 100644 index 00000000..71dadb1f --- /dev/null +++ b/jsprit-examples/src/main/java/jsprit/examples/SolomonExampleWithSpecifiedVehicleEndLocationsWithoutTWs.java @@ -0,0 +1,109 @@ +/******************************************************************************* + * Copyright (C) 2013 Stefan Schroeder + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + ******************************************************************************/ +package jsprit.examples; + +import java.io.File; +import java.util.Collection; + +import jsprit.analysis.toolbox.GraphStreamViewer; +import jsprit.analysis.toolbox.GraphStreamViewer.Label; +import jsprit.analysis.toolbox.Plotter; +import jsprit.analysis.toolbox.SolutionPrinter; +import jsprit.core.algorithm.VehicleRoutingAlgorithm; +import jsprit.core.algorithm.io.VehicleRoutingAlgorithms; +import jsprit.core.algorithm.selector.SelectBest; +import jsprit.core.problem.VehicleRoutingProblem; +import jsprit.core.problem.io.VrpXMLReader; +import jsprit.core.problem.solution.VehicleRoutingProblemSolution; + + +public class SolomonExampleWithSpecifiedVehicleEndLocationsWithoutTWs { + + public static void main(String[] args) { + /* + * some preparation - create output folder + */ + File dir = new File("output"); + // if the directory does not exist, create it + if (!dir.exists()){ + System.out.println("creating directory ./output"); + boolean result = dir.mkdir(); + if(result) System.out.println("./output created"); + } + + /* + * Build the problem. + * + * But define a problem-builder first. + */ + VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance(); + + /* + * A solomonReader reads solomon-instance files, and stores the required information in the builder. + */ + new VrpXMLReader(vrpBuilder).read("input/pickups_and_deliveries_solomon_c101_withoutTWs_and_specifiedVehicleEndLocations.xml"); + + /* + * Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances). + */ +// vrpBuilder.addProblemConstraint(Constraint.DELIVERIES_FIRST); + VehicleRoutingProblem vrp = vrpBuilder.build(); + + Plotter pblmPlotter = new Plotter(vrp); + pblmPlotter.plot("output/solomon_C101_specifiedVehicleEndLocations_withoutTWs.png","C101"); + + /* + * Define the required vehicle-routing algorithms to solve the above problem. + * + * The algorithm can be defined and configured in an xml-file. + */ +// VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp); + VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfigWithSchrimpfAcceptance.xml"); + vra.setNuOfIterations(20000); +// vra.setPrematureBreak(100); +// vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png")); + /* + * Solve the problem. + * + * + */ + Collection solutions = vra.searchSolutions(); + + /* + * Retrieve best solution. + */ + VehicleRoutingProblemSolution solution = new SelectBest().selectSolution(solutions); + + /* + * print solution + */ + SolutionPrinter.print(solution); + + /* + * Plot solution. + */ +// SolutionPlotter.plotSolutionAsPNG(vrp, solution, "output/solomon_C101_specifiedVehicleEndLocations_solution.png","C101"); + Plotter solPlotter = new Plotter(vrp, solution); + solPlotter.plot("output/solomon_C101_specifiedVehicleEndLocations_withoutTWs_solution.png","C101"); + + + new GraphStreamViewer(vrp, solution).setRenderDelay(50).labelWith(Label.ID).setEnableAutoLayout(true).display(); + + + } + +}