1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

Merge branch 'master' into OPTI-871-serialize-vrp-object

This commit is contained in:
hilaminster 2019-12-01 11:36:33 +02:00
commit cea61b104e

View file

@ -123,6 +123,8 @@ public class VehicleRoute {
private Set<Shipment> openShipments = new HashSet<Shipment>();
private Object routeData;
private JobActivityFactory jobActivityFactory = new JobActivityFactory() {
@Override
@ -171,6 +173,11 @@ public class VehicleRoute {
return this;
}
public Builder setRouteData(Object routeData) {
this.routeData = routeData;
return this;
}
/**
* Adds a service to this route. Activity is initialized with .getTimeWindow(). If you want to explicitly set another time window
* use .addService(Service service, TimeWindow timeWindow)
@ -335,6 +342,8 @@ public class VehicleRoute {
private End end;
private Object routeData;
/**
* Copy constructor copying a route.
*
@ -346,6 +355,7 @@ public class VehicleRoute {
this.tourActivities = TourActivities.copyOf(route.getTourActivities());
this.vehicle = route.getVehicle();
this.driver = route.getDriver();
this.routeData = route.getRouteData();
}
/**
@ -359,6 +369,7 @@ public class VehicleRoute {
this.driver = builder.driver;
this.start = builder.start;
this.end = builder.end;
this.routeData = builder.routeData;
}
/**
@ -397,6 +408,9 @@ public class VehicleRoute {
return driver;
}
public Object getRouteData() {
return routeData;
}
/**
* Sets the vehicle and its departureTime from <code>vehicle.getStartLocationId()</code>.
* <p>
@ -473,6 +487,10 @@ public class VehicleRoute {
return end;
}
public void setRouteData(Object routeData) {
this.routeData = routeData;
}
@Override
public String toString() {
return "[start=" + start + "][end=" + end + "][departureTime=" + start.getEndTime() + "][vehicle=" + vehicle + "][driver=" + driver + "][nuOfActs=" + tourActivities.getActivities().size() + "]";