Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup time at Activity level #224

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

braktar
Copy link
Contributor

@braktar braktar commented Apr 1, 2016

Define to each activity a SetupTime, which is the time it takes to ready the vehicle to execute one or some activities at this Location.

Once the first activity at this Location is performed, the setup time is not considered for the direct next sequence to this specific place.

It is vehicle dependent, using a coefficient defined for each vehicle.

@braktar braktar force-pushed the setupTime branch 5 times, most recently from 6ea07dd to 11320d3 Compare April 13, 2016 09:37
@braktar braktar force-pushed the setupTime branch 11 times, most recently from 2344365 to df55576 Compare April 29, 2016 11:10
@braktar braktar force-pushed the setupTime branch 14 times, most recently from 17ce9ea to acb6b02 Compare May 9, 2016 08:45
@oblonski
Copy link
Member

oblonski commented Jun 29, 2016

Sounds good! Thanks. I do not have time this week, however, I will review this next week latest.

@lafave
Copy link

lafave commented Jul 25, 2016

Just wanted to share our experience w/ getting a similar feature working by just implementing our own AbstractForwardVehicleRoutingTransportCosts:

In our override of getTransportTime our return value is (distance / velocity) + parkingTime where parkingTime is one of the following values:

  • 0 seconds if the vehicle has already started servicing a location AND is within a certain distance threshold.
  • N seconds (we use our own constant based on historical parking times) otherwise.

A vehicle can only service one location at a time so if we determine that a vehicle has already started servicing a location then all other locations within the distance threshold we defined will also have no parking time (which appears to be one of the benefits in the PR here).

To determine whether or not a vehicle has already started servicing a location we do however maintain some state outside of jsprit and pass it into the constructor of the transport costs. Specifically, the vehicles in our system can have a few different states including EN_ROUTE, SERVICING, etc. and we pass in all of "our" vehicles to the constructor which then lets us look up the state of jsprit's vehicles since they share an id (our vehicle id matches the id of jsprit's vehicle).

Anyways, hopefully this different approach to the same problem is useful as I think it requires quite a bit less work. Apologies if I misunderstood what the PR here is solving.

@oblonski
Copy link
Member

Smart! Thanks for sharing 👍 .

@muzuro
Copy link
Contributor

muzuro commented May 14, 2017

@braktar Great work! I have a questions about implementation:

  • If activity A1 with location L1 will be ruined in com.graphhopper.jsprit.core.algorithm.ruin.RuinStrategy.ruin(Collection)? Will second activity A2 with location L1 change service time?
  • If activity A1 with location L1 will be inserted before activity A2 with location L1, will A2 service time be changed?

@braktar
Copy link
Contributor Author

braktar commented May 15, 2017

Thanks

  • Since the solution is updated after every ruin, yes the setup time will be consider for A2. By the way the cost induced by the setup time is also consider in the ruin step.

  • I don't think i manage this case at the insertion step, I consider that at the insertion step it doesn't really matters if A1 or A2 is served first or not, so if the insertion can be done A2 will tend to be inserted after A1. In any case the route time are updated afterwise, so it's always correct if the insertion is performed.

@grantm009
Copy link

Hi @braktar
Im not very familiar with GitHub operations. Has this feature been put into the main jsprit version? If so what version number please.

I have a requirement that I think fits this perfectly.

When a truck arrives at a depot and has to pickup or deliver several items from the same place, it has an "admin" time where the driver visits the site manager and gets documents etc before loading/unloading the pallets onto the truck. it is this "Admin" time that I need to add so that it only applies to the first pickup/delivery on the site.

Do you agree that this is the intention of this function ?

thanks
Grant

@braktar
Copy link
Contributor Author

braktar commented Jun 4, 2018

Hi @grantm009

It is indeed designed to answer this kind of purpose, which was exactly my starting point ;)

This feature is not include in the main version.

@grantm009
Copy link

grantm009 commented Jun 4, 2018 via email

@braktar
Copy link
Contributor Author

braktar commented Jun 4, 2018

The last version i provide is from August 2016

https://github.com/graphhopper/jsprit/pull/273/files

I'm not active on Jsprit for a while, if interested feel free to update this feature.

@grantm009
Copy link

Thanks for the reply @braktar

I don't have the skills to do that. I will keep hunting.
regards
Grant

@phanthanhdat1902
Copy link

Define to each activity a SetupTime, which is the time it takes to ready the vehicle to execute one or some activities at this Location.

Once the first activity at this Location is performed, the setup time is not considered for the direct next sequence to this specific place.

It is vehicle dependent, using a coefficient defined for each vehicle.

Hi bro, i'm developing a function such as depot.service time. Suppose I have a depot, Is there any way to define the service time in depot? I mean, something similar to Service.ServiceTime. Fixed for N minutes (regardless of the number of luggage). Can you suggest me?
Example: Depot.service time is 30.
I arrive at the depot at 10:
If i pickup two shipments , I leave at 40.
If i pickup three shipments , I leave at 40.
...
no matter how many shipments I pickup, i still leave at 40.
How can i resolve ? Many tks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants