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

prevent casting of non-job activities to JobActivity

This commit is contained in:
Michal Maciejewski 2018-08-20 23:31:38 +02:00
parent 90a8edaa6d
commit d4106fb6d0
No known key found for this signature in database
GPG key ID: 015947E60A2AD77B
2 changed files with 27 additions and 21 deletions

View file

@ -572,6 +572,7 @@ public class GraphStreamViewer {
n.addAttribute("ui.label", "start");
}
for (TourActivity act : route.getActivities()) {
if (act instanceof JobActivity) {
Job job = ((JobActivity) act).getJob();
String currIdentifier = makeId(job.getId(), act.getLocation().getId());
if (label.equals(Label.ACTIVITY)) {
@ -595,6 +596,7 @@ public class GraphStreamViewer {
vehicle_edgeId++;
sleep(renderDelay_in_ms);
}
}
if (route.getVehicle().isReturnToDepot()) {
String lastIdentifier = makeId(route.getVehicle().getId(), route.getVehicle().getEndLocation().getId());
g.addEdge(makeEdgeId(routeId, vehicle_edgeId), prevIdentifier, lastIdentifier, true);

View file

@ -104,6 +104,10 @@ public final class RuinWorst extends AbstractRuinStrategy {
TourActivity actBefore = route.getStart();
TourActivity actToEval = null;
for (TourActivity act : route.getActivities()) {
if (!(act instanceof TourActivity.JobActivity)) {
continue;
}
if (actToEval == null) {
actToEval = act;
continue;