From 34abc1b73710e8a6681850513c83e46932d89f3b Mon Sep 17 00:00:00 2001 From: oblonski <4sschroeder@gmail.com> Date: Thu, 3 Jul 2014 10:02:35 +0200 Subject: [PATCH] bugfix #111 --- .../main/java/jsprit/analysis/toolbox/Plotter.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/jsprit-analysis/src/main/java/jsprit/analysis/toolbox/Plotter.java b/jsprit-analysis/src/main/java/jsprit/analysis/toolbox/Plotter.java index dc981409..a5ab00d3 100644 --- a/jsprit-analysis/src/main/java/jsprit/analysis/toolbox/Plotter.java +++ b/jsprit-analysis/src/main/java/jsprit/analysis/toolbox/Plotter.java @@ -128,7 +128,8 @@ public class Plotter { if(activity.equals(Activity.DELIVERY)) return DELIVERY_COLOR; if(activity.equals(Activity.SERVICE)) return SERVICE_COLOR; if(activity.equals(Activity.START)) return START_COLOR; - return END_COLOR; + if(activity.equals(Activity.END)) return END_COLOR; + throw new IllegalStateException("activity at "+dataItem.toString()+" cannot be assigned to a color"); } } @@ -219,7 +220,7 @@ public class Plotter { * Constructs Plotter with problem and routes to render individual routes. * * @param vrp - * @param solution + * @param routes */ public Plotter(VehicleRoutingProblem vrp, Collection routes) { super(); @@ -231,8 +232,8 @@ public class Plotter { /** * * @param show - * @return - * @deprecate always true + * @return plotter + * @deprecated always true */ @Deprecated public Plotter setShowFirstActivity(boolean show){ @@ -614,7 +615,9 @@ public class Plotter { if(!v.getStartLocationId().equals(v.getEndLocationId())){ Coordinate endCoord = v.getEndLocationCoordinate(); if(endCoord == null) throw new NoLocationFoundException(); - activities.add(endCoord.getX()*scalingFactor,endCoord.getY()*scalingFactor); + XYDataItem enditem = new XYDataItem(endCoord.getX()*scalingFactor,endCoord.getY()*scalingFactor); + markItem(enditem,Activity.END, null); + activities.add(enditem); } } for(Job job : vrp.getJobs().values()){