mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
event based sheduling and insertion
This commit is contained in:
parent
71fbc8ad38
commit
4172478abd
3 changed files with 56 additions and 32 deletions
|
|
@ -69,8 +69,6 @@ public abstract class AbstractInsertionStrategy implements InsertionStrategy{
|
|||
|
||||
private InsertionListeners insertionsListeners;
|
||||
|
||||
private Inserter inserter;
|
||||
|
||||
private EventListeners eventListeners;
|
||||
|
||||
protected VehicleRoutingProblem vrp;
|
||||
|
|
@ -78,7 +76,6 @@ public abstract class AbstractInsertionStrategy implements InsertionStrategy{
|
|||
public AbstractInsertionStrategy(VehicleRoutingProblem vrp) {
|
||||
this.insertionsListeners = new InsertionListeners();
|
||||
this.vrp = vrp;
|
||||
inserter = new Inserter(insertionsListeners, vrp);
|
||||
eventListeners = new EventListeners();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,8 @@ final class ServiceInsertionCalculator implements JobInsertionCostsCalculator{
|
|||
JobInsertionContext insertionContext = new JobInsertionContext(currentRoute, jobToInsert, newVehicle, newDriver, newVehicleDepartureTime);
|
||||
Service service = (Service)jobToInsert;
|
||||
int insertionIndex = InsertionData.NO_INDEX;
|
||||
TourActivity deliveryAct2Insert = activityFactory.createActivities(service).get(0);
|
||||
|
||||
TourActivity deliveryAct2Insert = activityFactory.createActivities(service).get(0);
|
||||
insertionContext.getAssociatedActivities().add(deliveryAct2Insert);
|
||||
|
||||
/*
|
||||
|
|
@ -111,7 +112,6 @@ final class ServiceInsertionCalculator implements JobInsertionCostsCalculator{
|
|||
/*
|
||||
generate new start and end for new vehicle
|
||||
*/
|
||||
// Start start = Start.newInstance(newVehicle.getStartLocationId(), newVehicle.getEarliestDeparture(), Double.MAX_VALUE);
|
||||
Start start = new Start(newVehicle.getStartLocation(), newVehicle.getEarliestDeparture(), Double.MAX_VALUE);
|
||||
start.setEndTime(newVehicleDepartureTime);
|
||||
End end = new End(newVehicle.getEndLocation(), 0.0, newVehicle.getLatestArrival());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue