Search in sources :

Example 6 with FrequencyBlockStopTimeEntry

use of org.onebusaway.transit_data_federation.services.transit_graph.FrequencyBlockStopTimeEntry in project onebusaway-application-modules by camsys.

the class BlockStopTimeIndicesFactory method createFrequencyIndicesFromGroups.

/**
 **
 *
 ***
 */
private List<FrequencyBlockStopTimeIndex> createFrequencyIndicesFromGroups(Map<BlockStopTimeKey, List<BlockStopTimeEntry>> stopTimesByKey) {
    List<FrequencyBlockStopTimeIndex> allIndices = new ArrayList<FrequencyBlockStopTimeIndex>();
    int count = 0;
    for (List<BlockStopTimeEntry> stopTimes : stopTimesByKey.values()) {
        if (_verbose && count % 100 == 0)
            _log.info("groups processed: " + count + "/" + stopTimesByKey.size());
        count++;
        List<FrequencyBlockStopTimeEntry> frequencyStopTimes = getStopTimesAsFrequencyStopTimes(stopTimes);
        List<List<FrequencyBlockStopTimeEntry>> groupedStopTimes = BlockLibrary.createStrictlyOrderedGroups(frequencyStopTimes, _frequencyBlockStopTimeLooseComparator, _frequencyBlockStopTimeStrictComparator);
        for (List<FrequencyBlockStopTimeEntry> group : groupedStopTimes) {
            FrequencyBlockStopTimeIndex index = createFrequencyBlockStopTimeIndexForGroup(group);
            allIndices.add(index);
        }
    }
    return allIndices;
}
Also used : FrequencyBlockStopTimeIndex(org.onebusaway.transit_data_federation.services.blocks.FrequencyBlockStopTimeIndex) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) BlockStopTimeEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockStopTimeEntry) FrequencyBlockStopTimeEntry(org.onebusaway.transit_data_federation.services.transit_graph.FrequencyBlockStopTimeEntry) FrequencyBlockStopTimeEntry(org.onebusaway.transit_data_federation.services.transit_graph.FrequencyBlockStopTimeEntry)

Aggregations

BlockStopTimeEntry (org.onebusaway.transit_data_federation.services.transit_graph.BlockStopTimeEntry)6 FrequencyBlockStopTimeEntry (org.onebusaway.transit_data_federation.services.transit_graph.FrequencyBlockStopTimeEntry)6 ArrayList (java.util.ArrayList)5 FrequencyBlockStopTimeIndex (org.onebusaway.transit_data_federation.services.blocks.FrequencyBlockStopTimeIndex)4 FrequencyEntry (org.onebusaway.transit_data_federation.services.transit_graph.FrequencyEntry)4 StopTimeInstance (org.onebusaway.transit_data_federation.model.StopTimeInstance)3 InstanceState (org.onebusaway.transit_data_federation.services.blocks.InstanceState)3 Date (java.util.Date)2 ServiceDate (org.onebusaway.gtfs.model.calendar.ServiceDate)2 BlockConfigurationEntry (org.onebusaway.transit_data_federation.services.transit_graph.BlockConfigurationEntry)2 BlockTripEntry (org.onebusaway.transit_data_federation.services.transit_graph.BlockTripEntry)2 List (java.util.List)1 AgencyAndId (org.onebusaway.gtfs.model.AgencyAndId)1 ServiceInterval (org.onebusaway.gtfs.model.calendar.ServiceInterval)1 FrequencyBlockStopTimeEntryImpl (org.onebusaway.transit_data_federation.impl.transit_graph.FrequencyBlockStopTimeEntryImpl)1 BlockStopSequenceIndex (org.onebusaway.transit_data_federation.services.blocks.BlockStopSequenceIndex)1 ServiceIdActivation (org.onebusaway.transit_data_federation.services.transit_graph.ServiceIdActivation)1 TripEntry (org.onebusaway.transit_data_federation.services.transit_graph.TripEntry)1