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:
parent
90a8edaa6d
commit
d4106fb6d0
2 changed files with 27 additions and 21 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue