From 3acf8836b7489840d0087e37928ea98837406081 Mon Sep 17 00:00:00 2001 From: tkchouaki Date: Tue, 12 Mar 2024 09:52:45 +0100 Subject: [PATCH] fix: using the person analysis filter in PublicTransportLegReaderFromPopulation (#203) --- .../analysis/pt/PublicTransportLegReaderFromPopulation.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/eqasim/core/analysis/pt/PublicTransportLegReaderFromPopulation.java b/core/src/main/java/org/eqasim/core/analysis/pt/PublicTransportLegReaderFromPopulation.java index e20e37a4c..67d339e61 100644 --- a/core/src/main/java/org/eqasim/core/analysis/pt/PublicTransportLegReaderFromPopulation.java +++ b/core/src/main/java/org/eqasim/core/analysis/pt/PublicTransportLegReaderFromPopulation.java @@ -38,7 +38,10 @@ public Collection readPublicTransportLegs(String populat } public Collection readPublicTransportLegs(Population population) { - return population.getPersons().values().stream().flatMap(person -> getPublicTransportLegs(person).stream()).collect(Collectors.toList()); + return population.getPersons().values().stream() + .filter(person -> personAnalysisFilter.analyzePerson(person.getId())) + .flatMap(person -> getPublicTransportLegs(person).stream()) + .collect(Collectors.toList()); } public Collection getPublicTransportLegs(Person person) {