mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
6d7087f8ca
3 changed files with 39 additions and 1 deletions
|
|
@ -288,7 +288,12 @@ public class VehicleRoutingProblem {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Adds an initial vehicle route.
|
||||
*
|
||||
* @param route initial route
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder addInitialVehicleRoute(VehicleRoute route){
|
||||
addVehicle((AbstractVehicle)route.getVehicle());
|
||||
for(TourActivity act : route.getActivities()){
|
||||
|
|
@ -324,6 +329,12 @@ public class VehicleRoutingProblem {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a collection of initial vehicle routes.
|
||||
*
|
||||
* @param routes initial routes
|
||||
* @return the builder
|
||||
*/
|
||||
public Builder addInitialVehicleRoutes(Collection<VehicleRoute> routes){
|
||||
for(VehicleRoute r : routes){
|
||||
addInitialVehicleRoute(r);
|
||||
|
|
@ -728,20 +739,37 @@ public class VehicleRoutingProblem {
|
|||
return activityCosts;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return returns all location, i.e. from vehicles and jobs.
|
||||
*/
|
||||
public Locations getLocations(){
|
||||
return locations;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param job for which the corresponding activities needs to be returned
|
||||
* @return associated activities
|
||||
*/
|
||||
public List<AbstractActivity> getActivities(Job job){
|
||||
return Collections.unmodifiableList(activityMap.get(job));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return total number of activities
|
||||
*/
|
||||
public int getNuActivities(){ return nuActivities; }
|
||||
|
||||
/**
|
||||
* @return factory that creates the activities associated to a job
|
||||
*/
|
||||
public JobActivityFactory getJobActivityFactory(){
|
||||
return jobActivityFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param job for which the corresponding activities needs to be returned
|
||||
* @return a copy of the activities that are associated to the specified job
|
||||
*/
|
||||
public List<AbstractActivity> copyAndGetActivities(Job job){
|
||||
List<AbstractActivity> acts = new ArrayList<AbstractActivity>();
|
||||
if(activityMap.containsKey(job)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue