Shipments not being assigned

Hello,

We are currently facing an issue with jsprit, it is a typical case of Shipments and vehicles with timewindows. We are having difficulty in understanding why Shipments are not being assigned despite having sufficient time window and capacity.
Here, we have 3 orders of same location with service time of 15 minutes and we have 1 vehicle with sufficient capacity to serve all the shipments. However, only 2 of them are getting assigned and there is still time left to server 3rd shipment. Ideally we expect that all 3 shipments should get served by 1 vehicle only.

Below is the solution file for this problem.

<?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> </problemType> <vehicles> <vehicle> <id>vehicle-2655</id> <typeId>vehicle-type2655</typeId> <startLocation> <id>1</id> </startLocation> <endLocation> <id>1</id> </endLocation> <timeSchedule> <start>0.0</start> <end>17154.0</end> </timeSchedule> <returnToDepot>false</returnToDepot> <skills>trk</skills> </vehicle> </vehicles> <vehicleTypes> <type> <id>vehicle-type2655</id> <capacity-dimensions> <dimension index="0">18</dimension> <dimension index="1">4000000</dimension> <dimension index="2">750</dimension> </capacity-dimensions> <costs> <fixed>0.0</fixed> <distance>1.0</distance> <time>0.0</time> </costs> </type> </vehicleTypes> <services> <service id="2" type="service"> <location> <id>2</id> <coord x="21.1117002" y="79.0729793"/> </location> <capacity-dimensions> <dimension index="0">1</dimension> <dimension index="1">1</dimension> <dimension index="2">0</dimension> </capacity-dimensions> <duration>15.0</duration> <timeWindows> <timeWindow> <start>16674.0</start> <end>17154.0</end> </timeWindow> </timeWindows> </service> <service id="3" type="service"> <location> <id>3</id> <coord x="21.1117002" y="79.0729793"/> </location> <capacity-dimensions> <dimension index="0">1</dimension> <dimension index="1">1</dimension> <dimension index="2">0</dimension> </capacity-dimensions> <duration>15.0</duration> <timeWindows> <timeWindow> <start>16674.0</start> <end>17154.0</end> </timeWindow> </timeWindows> </service> <service id="4" type="service"> <location> <id>4</id> <coord x="21.1117002" y="79.0729793"/> </location> <capacity-dimensions> <dimension index="0">1</dimension> <dimension index="1">1</dimension> <dimension index="2">0</dimension> </capacity-dimensions> <duration>15.0</duration> <timeWindows> <timeWindow> <start>16674.0</start> <end>17154.0</end> </timeWindow> </timeWindows> </service> </services> <solutions> <solution> <cost>3.64001638E8</cost> <routes> <route> <driverId>noDriver</driverId> <vehicleId>vehicle-2655</vehicleId> <start>0.0</start> <act type="service"> <serviceId>2</serviceId> <arrTime>545.457</arrTime> <endTime>16689.0</endTime> </act> <act type="service"> <serviceId>3</serviceId> <arrTime>16689.0</arrTime> <endTime>16704.0</endTime> </act> <end>16704.0</end> </route> </routes> <unassignedJobs> <job id="4"/> </unassignedJobs> </solution> </solutions> </problem>

Please let us know if we are doing/interpreting something wrong here. Thanks in advance for help.

Hi, it might be related to this bug. Would you mind to try this with the latest master?

Thank you @stefan. I used the 1.6.3 snapshot as below:

<repositories> <repository> <id>jsprit-snapshots</id> <url>https://github.com/jsprit/mvn-rep/raw/master/snapshots</url> </repository> </repositories> <dependency> <groupId>jsprit</groupId> <artifactId>jsprit-core</artifactId> <version>1.6.3-SNAPSHOT</version> </dependency>

I changed the import names from jsprit… to com.graphhopper.jsprit… but i get below exception while running the algorithm but same works fine for older version. Can you please suggest what i could be doing wrong here?
P.S. I tried below things but none of them worked

  1. I pulled the code in my workspace but i was unable to build the project as all the test cases were failing because of below error.
  2. I built the JAR by skipping the tests added it in my class path, but then again i got the same error while running the algo.

Previously I was using 1.6.2 release.

Caused by: org.apache.commons.configuration.ConfigurationException: Error parsing file:/data/algoConfig.xml at org.apache.commons.configuration.XMLConfiguration.load(XMLConfiguration.java:950) at org.apache.commons.configuration.XMLConfiguration.load(XMLConfiguration.java:908) at org.apache.commons.configuration.XMLConfiguration$XMLFileConfigurationDelegate.load(XMLConfiguration.java:1583) at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:324) at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:234) at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.load(AbstractHierarchicalFileConfiguration.java:184) at com.graphhopper.jsprit.core.algorithm.io.AlgorithmConfigXmlReader.read(AlgorithmConfigXmlReader.java:83) ... 44 common frames omitted Caused by: org.xml.sax.SAXParseException: cvc-elt.1.a: Cannot find the declaration of element 'algorithm'. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

Never mind, looks like i was doing something wrong here. Changed my workspace and everything started working.

Also, Thanks a lot stefan. Using the latest master did solve the issue.

1 Like