Commit a54698f4 authored by Benedikt Zoennchen's avatar Benedikt Zoennchen
Browse files

Fix bug in TargetIdProcessor: call new functions to get the correct current agent target.

parent d44d8257
Pipeline #189512 passed with stages
in 121 minutes and 28 seconds
......@@ -21,7 +21,7 @@ public class FootStepTargetIDProcessor extends DataProcessor<EventtimePedestrian
protected void doUpdate(SimulationState state) {
Collection<Pedestrian> peds = state.getTopography().getElements(Pedestrian.class);
peds.forEach(p -> p.getTrajectory().getFootSteps().forEach(fs -> {
this.putValue(new EventtimePedestrianIdKey(fs.getStartTime(), p.getId()), p.getTargets().isEmpty() ? -1 : p.getTargets().getFirst());
this.putValue(new EventtimePedestrianIdKey(fs.getStartTime(), p.getId()), !p.hasNextTarget() ? -1 : p.getNextTargetId());
}));
}
}
......@@ -23,7 +23,8 @@ public class PedestrianTargetIdProcessor extends DataProcessor<TimestepPedestria
Collection<Pedestrian> peds = state.getTopography().getElements(Pedestrian.class);
peds.forEach(p -> this.putValue(new TimestepPedestrianIdKey(state.getStep(), p.getId()),
p.getTargets().isEmpty() ? -1 : p.getTargets().getFirst()));
!p.hasNextTarget() ? -1 :
p.getNextTargetId()));
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment