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

added NoSolutionFoundException to improve exception handling

NoSolutionFoundException is still an IllegalStateException
This commit is contained in:
oblonski 2014-05-15 12:58:06 +02:00
parent 977d8f7432
commit 8066a353d9
2 changed files with 15 additions and 1 deletions

View file

@ -132,7 +132,7 @@ final class BestInsertion implements InsertionStrategy{
VehicleRoute newRoute = VehicleRoute.emptyRoute();
InsertionData bestI = bestInsertionCostCalculator.getInsertionData(newRoute, unassignedJob, NO_NEW_VEHICLE_YET, NO_NEW_DEPARTURE_TIME_YET, NO_NEW_DRIVER_YET, Double.MAX_VALUE);
if(bestI instanceof InsertionData.NoInsertionFound){
throw new IllegalStateException(getErrorMsg(unassignedJob));
throw new NoSolutionFoundException(getErrorMsg(unassignedJob));
}
else{
bestInsertion = new Insertion(newRoute,bestI);

View file

@ -0,0 +1,14 @@
package jsprit.core.algorithm.recreate;
public class NoSolutionFoundException extends IllegalStateException{
public NoSolutionFoundException(String errorMsg) {
super(errorMsg);
}
/**
*
*/
private static final long serialVersionUID = 1L;
}