public void findPatterns ( ) { PatternFinder patternFinder = new PatternFinder ( ) ; // Iterate over trips and process each trip and its stop times. for ( Trip trip : this . trips . values ( ) ) { Iterable < StopTime > orderedStopTimesForTrip = this . getOrderedStopTimesForTrip ( trip . trip_id ) ; patternFinder . processTrip ( trip , orderedStopTimesForTrip ) ; } Map < TripPatternKey , Pattern > patternObjects = patternFinder . createPatternObjects ( this . stops , null ) ; this . patterns . putAll ( patternObjects . values ( ) . stream ( ) . collect ( Collectors . toMap ( Pattern :: getId , pattern -> pattern ) ) ) ; }
MapDB - based implementation to find patterns .