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

API CHANGED - insertionStarts (method para changed), jobInserted

(method para changed) and vehicleRoute (new method)
This commit is contained in:
Stefan Schroeder 2013-08-16 16:30:29 +02:00
parent cd65f66c86
commit e35603ed34
3 changed files with 8 additions and 2 deletions

View file

@ -22,10 +22,11 @@ package basics.algo;
import java.util.Collection;
import basics.Job;
import basics.route.VehicleRoute;
public interface InsertionStartsListener extends InsertionListener {
public void informInsertionStarts(Collection<VehicleRoute> vehicleRoutes, int nOfJobs2Recreate);
public void informInsertionStarts(Collection<VehicleRoute> vehicleRoutes, Collection<Job> unassignedJobs);
}

View file

@ -30,5 +30,5 @@ import basics.route.VehicleRoute;
public interface JobInsertedListener extends InsertionListener{
public void informJobInserted(int nOfJobsStill2Recreate, Job job2insert, VehicleRoute insertedIn);
public void informJobInserted(Job job2insert, VehicleRoute inRoute);
}

View file

@ -158,6 +158,11 @@ public class VehicleRoute {
start.setEndTime(vehicleDepTime);
}
public double getDepartureTime(){
if(start == null) throw new IllegalStateException("cannot get departureTime without having a vehicle on this route. use setVehicle(vehicle,departureTime) instead.");
return start.getEndTime();
}
private void setStartAndEnd(Vehicle vehicle, double vehicleDepTime) {
if(!(vehicle instanceof NoVehicle)){
if(start == null && end == null){