specifying multiple time windows

201 views
Skip to first unread message

Apoorv Jain

unread,
Jan 16, 2015, 12:53:38 PM1/16/15
to jsprit-ma...@googlegroups.com
Please lt me know how do i provide multiple time windows for a Service. Each of these time windows is an option and satisfying any one of them is sufficient to consider a vehicleroutingsolution a valid solution.

in...@opendoorlogistics.com

unread,
Jan 16, 2015, 12:59:46 PM1/16/15
to jsprit-ma...@googlegroups.com
Hi Apoorv,

as far as I know jsprit doesn't currently support multiple time windows, so you'd need to implement them yourself in the jsprit code I'm afraid. Stefan - the jsprit author - would know about this better than I do, but I suspect it would be a lot of work to do this.

Have you tried setting different vehicles to be available on different days? For example if you only have one vehicle in real life, called 'VehicleA' but you create 3 vehicles 'VehicleA_Monday', 'VehicleA_Tuesday' and 'VehicleA_Wednesday'. Then if you only need one time window per day you're OK.
 
Philip Welch
Open Door Logistics Limited
Specialists in open source solutions for transport logistics.

Skype: opendoorlogistics



----- Original Message -----

To:
<jsprit-ma...@googlegroups.com>
Cc:

Sent:
Fri, 16 Jan 2015 09:53:38 -0800 (PST)
Subject:
[jsprit-mailing-list] specifying multiple time windows



Please lt me know how do i provide multiple time windows for a Service. Each of these time windows is an option and satisfying any one of them is sufficient to consider a vehicleroutingsolution a valid solution.

--
You received this message because you are subscribed to the Google Groups "jsprit-mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsprit-mailing-...@googlegroups.com.
To post to this group, send email to jsprit-ma...@googlegroups.com.
Visit this group at http://groups.google.com/group/jsprit-mailing-list.
For more options, visit https://groups.google.com/d/optout.

tns

unread,
Jan 17, 2015, 4:41:16 AM1/17/15
to jsprit-ma...@googlegroups.com
Hi Apoorv .

Can you send an illustration.

One possible way of exploring for a solution - if i understand your question correctly - without modifying jsprit -
 
Model your service S available for twindows , twi,twj  as multiple services
If tws are overlapping or distant it should not matter.
  1. have "n" different service configurations which will include (one each) of all the tw variations per service - but only one for each specific Service in a given configuration
  2. make sure the service configurations are grouped by locality of time - consider having a global time window for a services configuration
  3. iterating through different service configurations should give a solution (you can run them in parallel for speed etc.)

Apoorv Jain

unread,
Jan 18, 2015, 12:56:01 PM1/18/15
to jsprit-ma...@googlegroups.com
Hi,
If you look at the use case. It is simple. The delivery can be made at a specified day say 20th of Jan. If the delivery cannot be made then the earliest it can be delivered is say 24th Jan. Reason the person to receive the consignment is out of town from 21st to 23rd.
 
Coming to the solution you gave, being new to jspirit, I could partially understand your answer.  Is it possible for you to provide a code snippet.

One more thing I want to understand is how ConstraintsStatus.NOT_FULFILLED_BREAK works.

I tried playing with HardActivityConstraint. Thought of handling the multiple time window outside jspirit and validating it inside HardActivityConstraint, ie. based on 

prevActDepTime and distance between the two location ,I tried manipulating the calendar . Whenever condition does not satisfy, I returned ConstraintsStatus.NOT_FULFILLED_BREAK. There was an error in my logic because of which I always returned ConstraintsStatus.NOT_FULFILLED_BREAK.  My understanding was it would invalidate the route but it did not happen.

Simply put I want to know, how do I enforce that a specific delivery is made , even if it is the most un-optimal solution from cost perspective.

regards,

Apoorv

tns

unread,
Jan 18, 2015, 1:23:36 PM1/18/15
to jsprit-ma...@googlegroups.com

Hi Apoorv,

can you share the fleet and service info (as xml) - will try to provide a snippet .

Apoorv Jain

unread,
Sep 23, 2015, 3:14:38 PM9/23/15
to jsprit-mailing-list
Hi Tns,
Sorry for the late response. I had suspended my effort in this area for some personal reason. I am uploading a sample data. For reference I have added multiple time windows in one of the services in the xml. Can you please provide a sample.

regards,
Apoorv
sampleData.xml
Reply all
Reply to author
Forward
0 new messages