From caef965315d8eecd1fe1dba56fa71586bd733507 Mon Sep 17 00:00:00 2001 From: Stefan Schroeder <4sschroeder@gmail.com> Date: Tue, 18 Jun 2013 14:15:44 +0200 Subject: [PATCH] improve error message when throwing IllegalStateException in BestInsertion --- jsprit-core/src/main/java/algorithms/BestInsertion.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jsprit-core/src/main/java/algorithms/BestInsertion.java b/jsprit-core/src/main/java/algorithms/BestInsertion.java index c0bbf801..e65fef18 100644 --- a/jsprit-core/src/main/java/algorithms/BestInsertion.java +++ b/jsprit-core/src/main/java/algorithms/BestInsertion.java @@ -137,7 +137,12 @@ final class BestInsertion extends AbstractInsertionStrategy{ System.out.println("reason="+s); } throw new IllegalStateException("given the vehicles, could not insert job\n" + - "\t" + unassignedJob + "\n\t"); + "\t" + unassignedJob + + "\n\tthis might have the following reasons:\n" + + "\t- no vehicle has the capacity to transport the job [check whether there is at least one vehicle that is capable to transport the job]\n" + + "\t- the time-window cannot be met, even in a commuter tour the time-window is missed [check whether it is possible to reach the time-window on the shortest path or make hard time-windows soft]\n" + + "\t- if you deal with finite vehicles, and the available vehicles are already fully employed, no vehicle can be found anymore to transport the job [add penalty-vehicles]" + ); } } else{