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

Merge branch 'bugfix-openroutes'

This commit is contained in:
oblonski 2014-06-11 11:32:24 +02:00
commit 1c9437898d
2 changed files with 122 additions and 0 deletions

View file

@ -2,6 +2,7 @@ package jsprit.core.problem.constraint;
import jsprit.core.problem.cost.VehicleRoutingTransportCosts;
import jsprit.core.problem.misc.JobInsertionContext;
import jsprit.core.problem.solution.route.activity.End;
import jsprit.core.problem.solution.route.activity.TourActivity;
import jsprit.core.problem.solution.route.state.RouteAndActivityStateGetter;
import jsprit.core.problem.solution.route.state.StateFactory;
@ -78,6 +79,12 @@ import jsprit.core.util.CalculationUtils;
if(arrTimeAtNewAct > latestArrTimeAtNewAct){
return ConstraintsStatus.NOT_FULFILLED;
}
if(nextAct instanceof End){
if(!iFacts.getNewVehicle().isReturnToDepot()){
return ConstraintsStatus.FULFILLED;
}
}
// log.info(newAct + " arrTime=" + arrTimeAtNewAct);
double endTimeAtNewAct = CalculationUtils.getActivityEndTime(arrTimeAtNewAct, newAct);
double arrTimeAtNextAct = endTimeAtNewAct + routingCosts.getTransportTime(newAct.getLocationId(), nextAct.getLocationId(), endTimeAtNewAct, iFacts.getNewDriver(), iFacts.getNewVehicle());