mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
modify io to read and write shipments, add tests to test reader/writer
This commit is contained in:
parent
d06f6ddc4b
commit
3740225058
14 changed files with 514 additions and 62 deletions
89
jsprit-core/src/test/resources/finiteVrp.xml
Normal file
89
jsprit-core/src/test/resources/finiteVrp.xml
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<problem xmlns="http://www.w3schools.com"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.w3schools.com vrp_xml_schema.xsd">
|
||||
<problemType>
|
||||
<fleetSize>FINITE</fleetSize>
|
||||
<fleetComposition>HETEROGENEOUS</fleetComposition>
|
||||
</problemType>
|
||||
|
||||
<vehicles>
|
||||
<vehicle>
|
||||
<id>v1</id>
|
||||
<location>
|
||||
<id>depotLoc2</id>
|
||||
<coord x="100.0" y="100.0"/>
|
||||
</location>
|
||||
<typeId>vehType</typeId>
|
||||
<timeSchedule>
|
||||
<start>0.0</start>
|
||||
<end>1000.0</end>
|
||||
</timeSchedule>
|
||||
</vehicle>
|
||||
<vehicle>
|
||||
<id>v2</id>
|
||||
<location>
|
||||
<id>depotLoc</id>
|
||||
<coord x="10.0" y="100.0"/>
|
||||
</location>
|
||||
<typeId>vehType2</typeId>
|
||||
<timeSchedule>
|
||||
<start>0.0</start>
|
||||
<end>1000.0</end>
|
||||
</timeSchedule>
|
||||
</vehicle>
|
||||
</vehicles>
|
||||
<vehicleTypes>
|
||||
<type>
|
||||
<id>vehType</id>
|
||||
<capacity>20</capacity>
|
||||
<costs>
|
||||
<fixed>0.0</fixed>
|
||||
<distance>0.0</distance>
|
||||
<time>0.0</time>
|
||||
</costs>
|
||||
</type>
|
||||
<type>
|
||||
<id>vehType2</id>
|
||||
<capacity>200</capacity>
|
||||
<costs>
|
||||
<fixed>0.0</fixed>
|
||||
<distance>0.0</distance>
|
||||
<time>0.0</time>
|
||||
</costs>
|
||||
</type>
|
||||
</vehicleTypes>
|
||||
|
||||
<services>
|
||||
<service id="1" type="service">
|
||||
<locationId>j(1,5)</locationId>
|
||||
<coord x="10.0" y="10.0"/>
|
||||
<capacity-demand>1</capacity-demand>
|
||||
<duration>0.0</duration>
|
||||
<timeWindows>
|
||||
<timeWindow>
|
||||
<start>0.0</start>
|
||||
<end>4000.0</end>
|
||||
</timeWindow>
|
||||
</timeWindows>
|
||||
</service>
|
||||
|
||||
<service id="2" type="service">
|
||||
<locationId>i(3,9)</locationId>
|
||||
<coord x="10.0" y="10.0"/>
|
||||
<capacity-demand>1</capacity-demand>
|
||||
<duration>0.0</duration>
|
||||
<timeWindows>
|
||||
<timeWindow>
|
||||
<start>0.0</start>
|
||||
<end>4000.0</end>
|
||||
</timeWindow>
|
||||
</timeWindows>
|
||||
</service>
|
||||
|
||||
</services>
|
||||
|
||||
|
||||
|
||||
</problem>
|
||||
|
|
@ -102,5 +102,33 @@
|
|||
</service>
|
||||
|
||||
</services>
|
||||
|
||||
<shipments>
|
||||
<shipment id="3">
|
||||
<pickup>
|
||||
<locationId>i(3,9)</locationId>
|
||||
<coord x="10.0" y="10.0"/>
|
||||
<duration>0.0</duration>
|
||||
<timeWindows>
|
||||
<timeWindow>
|
||||
<start>0.0</start>
|
||||
<end>4000.0</end>
|
||||
</timeWindow>
|
||||
</timeWindows>
|
||||
</pickup>
|
||||
<delivery>
|
||||
<locationId>i(9,9)</locationId>
|
||||
<coord x="10.0" y="0.0"/>
|
||||
<duration>0.0</duration>
|
||||
<timeWindows>
|
||||
<timeWindow>
|
||||
<start>0.0</start>
|
||||
<end>4000.0</end>
|
||||
</timeWindow>
|
||||
</timeWindows>
|
||||
</delivery>
|
||||
<capacity-demand>1</capacity-demand>
|
||||
</shipment>
|
||||
</shipments>
|
||||
|
||||
</problem>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,149 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<problem xmlns="http://www.w3schools.com"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.w3schools.com vrp_xml_schema.xsd">
|
||||
<problemType>
|
||||
<fleetSize>FINITE</fleetSize>
|
||||
<fleetComposition>HETEROGENEOUS</fleetComposition>
|
||||
</problemType>
|
||||
|
||||
<vehicles>
|
||||
<vehicle>
|
||||
<id>v1</id>
|
||||
<location>
|
||||
<id>depotLoc2</id>
|
||||
<coord x="100.0" y="100.0"/>
|
||||
</location>
|
||||
<typeId>vehType</typeId>
|
||||
<timeSchedule>
|
||||
<start>0.0</start>
|
||||
<end>1000.0</end>
|
||||
</timeSchedule>
|
||||
</vehicle>
|
||||
<vehicle>
|
||||
<id>v2</id>
|
||||
<location>
|
||||
<id>depotLoc</id>
|
||||
<coord x="10.0" y="100.0"/>
|
||||
</location>
|
||||
<typeId>vehType2</typeId>
|
||||
<timeSchedule>
|
||||
<start>0.0</start>
|
||||
<end>1000.0</end>
|
||||
</timeSchedule>
|
||||
</vehicle>
|
||||
</vehicles>
|
||||
<vehicleTypes>
|
||||
<type>
|
||||
<id>vehType</id>
|
||||
<capacity>20</capacity>
|
||||
<costs>
|
||||
<fixed>0.0</fixed>
|
||||
<distance>0.0</distance>
|
||||
<time>0.0</time>
|
||||
</costs>
|
||||
</type>
|
||||
<type>
|
||||
<id>vehType2</id>
|
||||
<capacity>200</capacity>
|
||||
<costs>
|
||||
<fixed>0.0</fixed>
|
||||
<distance>0.0</distance>
|
||||
<time>0.0</time>
|
||||
</costs>
|
||||
</type>
|
||||
</vehicleTypes>
|
||||
|
||||
<services>
|
||||
<service id="1" type="service">
|
||||
<locationId>j(1,5)</locationId>
|
||||
<coord x="10.0" y="10.0"/>
|
||||
<capacity-demand>1</capacity-demand>
|
||||
<duration>0.0</duration>
|
||||
<timeWindows>
|
||||
<timeWindow>
|
||||
<start>0.0</start>
|
||||
<end>4000.0</end>
|
||||
</timeWindow>
|
||||
</timeWindows>
|
||||
</service>
|
||||
|
||||
<service id="2" type="service">
|
||||
<locationId>i(3,9)</locationId>
|
||||
<coord x="10.0" y="10.0"/>
|
||||
<capacity-demand>1</capacity-demand>
|
||||
<duration>0.0</duration>
|
||||
<timeWindows>
|
||||
<timeWindow>
|
||||
<start>0.0</start>
|
||||
<end>4000.0</end>
|
||||
</timeWindow>
|
||||
</timeWindows>
|
||||
</service>
|
||||
</services>
|
||||
|
||||
<shipments>
|
||||
<shipment id="3">
|
||||
<pickup>
|
||||
<locationId>i(3,9)</locationId>
|
||||
<coord x="10.0" y="10.0"/>
|
||||
<duration>0.0</duration>
|
||||
<timeWindows>
|
||||
<timeWindow>
|
||||
<start>0.0</start>
|
||||
<end>4000.0</end>
|
||||
</timeWindow>
|
||||
</timeWindows>
|
||||
</pickup>
|
||||
<delivery>
|
||||
<locationId>i(9,9)</locationId>
|
||||
<coord x="10.0" y="0.0"/>
|
||||
<duration>0.0</duration>
|
||||
<timeWindows>
|
||||
<timeWindow>
|
||||
<start>0.0</start>
|
||||
<end>4000.0</end>
|
||||
</timeWindow>
|
||||
</timeWindows>
|
||||
</delivery>
|
||||
<capacity-demand>1</capacity-demand>
|
||||
</shipment>
|
||||
</shipments>
|
||||
|
||||
<solutions>
|
||||
<solution>
|
||||
<cost>100.0</cost>
|
||||
<routes>
|
||||
<route>
|
||||
<cost>0.0</cost>
|
||||
<driverId>noDriver</driverId>
|
||||
<vehicleId>v1</vehicleId>
|
||||
<start>10.0</start>
|
||||
<act type="service">
|
||||
<serviceId>1</serviceId>
|
||||
<arrTime>20.0</arrTime>
|
||||
<endTime>30.0</endTime>
|
||||
</act>
|
||||
<act type="service">
|
||||
<serviceId>2</serviceId>
|
||||
<arrTime>40.0</arrTime>
|
||||
<endTime>80.0</endTime>
|
||||
</act>
|
||||
<act type="pickupShipment">
|
||||
<shipmentId>3</shipmentId>
|
||||
<arrTime>40.0</arrTime>
|
||||
<endTime>80.0</endTime>
|
||||
</act>
|
||||
<act type="deliverShipment">
|
||||
<shipmentId>3</shipmentId>
|
||||
<arrTime>40.0</arrTime>
|
||||
<endTime>80.0</endTime>
|
||||
</act>
|
||||
<end>100.0</end>
|
||||
</route>
|
||||
</routes>
|
||||
</solution>
|
||||
</solutions>
|
||||
|
||||
</problem>
|
||||
Loading…
Add table
Add a link
Reference in a new issue