Skip to content

Commit

Permalink
fix: using the person analysis filter in PublicTransportLegReaderFrom…
Browse files Browse the repository at this point in the history
…Population (#203)
  • Loading branch information
tkchouaki authored Mar 12, 2024
1 parent 6082c28 commit 3acf883
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public Collection<PublicTransportLegItem> readPublicTransportLegs(String populat
}

public Collection<PublicTransportLegItem> 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<PublicTransportLegItem> getPublicTransportLegs(Person person) {
Expand Down

0 comments on commit 3acf883

Please sign in to comment.