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:
parent
977d8f7432
commit
8066a353d9
2 changed files with 15 additions and 1 deletions
|
|
@ -132,7 +132,7 @@ final class BestInsertion implements InsertionStrategy{
|
||||||
VehicleRoute newRoute = VehicleRoute.emptyRoute();
|
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);
|
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){
|
if(bestI instanceof InsertionData.NoInsertionFound){
|
||||||
throw new IllegalStateException(getErrorMsg(unassignedJob));
|
throw new NoSolutionFoundException(getErrorMsg(unassignedJob));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
bestInsertion = new Insertion(newRoute,bestI);
|
bestInsertion = new Insertion(newRoute,bestI);
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue