1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00
This commit is contained in:
oblonski 2014-05-14 23:53:26 +02:00
parent 7620988273
commit 312ebc8313

View file

@ -9,7 +9,7 @@ import jsprit.core.util.CalculationUtils;
/**
* ljsljslfjs
*
* @author stefan
*
*/
@ -27,9 +27,19 @@ import jsprit.core.util.CalculationUtils;
@Override
public ConstraintsStatus fulfilled(JobInsertionContext iFacts, TourActivity prevAct, TourActivity newAct, TourActivity nextAct, double prevActDepTime) {
double latestVehicleArrival = iFacts.getNewVehicle().getLatestArrival();
if(latestVehicleArrival < prevAct.getTheoreticalEarliestOperationStartTime() ||
latestVehicleArrival < newAct.getTheoreticalEarliestOperationStartTime() ||
latestVehicleArrival < nextAct.getTheoreticalEarliestOperationStartTime()){
return ConstraintsStatus.NOT_FULFILLED_BREAK;
}
if(newAct.getTheoreticalLatestOperationStartTime() < prevAct.getTheoreticalEarliestOperationStartTime()){
return ConstraintsStatus.NOT_FULFILLED_BREAK;
}
double arrTimeAtNextOnDirectRouteWithNewVehicle = prevActDepTime + routingCosts.getTransportTime(prevAct.getLocationId(), nextAct.getLocationId(), prevActDepTime, iFacts.getNewDriver(), iFacts.getNewVehicle());
if(arrTimeAtNextOnDirectRouteWithNewVehicle > nextAct.getTheoreticalLatestOperationStartTime()){
return ConstraintsStatus.NOT_FULFILLED_BREAK;
}
if(newAct.getTheoreticalEarliestOperationStartTime() > nextAct.getTheoreticalLatestOperationStartTime()){
return ConstraintsStatus.NOT_FULFILLED;
}
@ -47,7 +57,6 @@ import jsprit.core.util.CalculationUtils;
if(arrTimeAtNextAct > latestArrTimeAtNextAct){
return ConstraintsStatus.NOT_FULFILLED;
}
double arrTimeAtNextOnDirectRouteWithNewVehicle = prevActDepTime + routingCosts.getTransportTime(prevAct.getLocationId(), nextAct.getLocationId(), prevActDepTime, iFacts.getNewDriver(), iFacts.getNewVehicle());
// if vehicle cannot even manage direct-route - break
if(arrTimeAtNextOnDirectRouteWithNewVehicle > latestArrTimeAtNextAct){
return ConstraintsStatus.NOT_FULFILLED_BREAK;