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

merged fixed plotter from skills-branch

This commit is contained in:
oblonski 2014-07-03 10:48:34 +02:00
parent 582a6c0d0e
commit bfab93f3d9

View file

@ -128,7 +128,8 @@ public class Plotter {
if(activity.equals(Activity.DELIVERY)) return DELIVERY_COLOR; if(activity.equals(Activity.DELIVERY)) return DELIVERY_COLOR;
if(activity.equals(Activity.SERVICE)) return SERVICE_COLOR; if(activity.equals(Activity.SERVICE)) return SERVICE_COLOR;
if(activity.equals(Activity.START)) return START_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. * Constructs Plotter with problem and routes to render individual routes.
* *
* @param vrp * @param vrp
* @param solution * @param routes
*/ */
public Plotter(VehicleRoutingProblem vrp, Collection<VehicleRoute> routes) { public Plotter(VehicleRoutingProblem vrp, Collection<VehicleRoute> routes) {
super(); super();
@ -231,8 +232,8 @@ public class Plotter {
/** /**
* *
* @param show * @param show
* @return * @return plotter
* @deprecate always true * @deprecated always true
*/ */
@Deprecated @Deprecated
public Plotter setShowFirstActivity(boolean show){ public Plotter setShowFirstActivity(boolean show){
@ -614,7 +615,9 @@ public class Plotter {
if(!v.getStartLocationId().equals(v.getEndLocationId())){ if(!v.getStartLocationId().equals(v.getEndLocationId())){
Coordinate endCoord = v.getEndLocationCoordinate(); Coordinate endCoord = v.getEndLocationCoordinate();
if(endCoord == null) throw new NoLocationFoundException(); 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()){ for(Job job : vrp.getJobs().values()){