Class GtfsConverterReaderSettingsWithModeMapping

    • Field Detail

      • routeTypeChoice

        protected final RouteTypeChoice routeTypeChoice
        Indicates what route types are applied, e.g. the default or the extended
      • defaultGtfsMode2PrefinedModeTypeMap

        protected final Map<RouteType,​List<PredefinedModeType>> defaultGtfsMode2PrefinedModeTypeMap
        Default mapping (specific to this (services) network) from each supported GTFS mode to PLANit predefined mode. Not each mapping is necessarily activated. Multiple mappings per GTFS mode may exist indicating a primary mapping (first) and fallback mappings where the latter indicate a GTFS mode may access pre-existing stops/transfer zones of the seconday type in case the primary type is not present, e.g. trams using available lightrail tagged stops for instance
      • activatedGtfsModes

        protected final Set<RouteType> activatedGtfsModes
        Activated GTFS modes. Not all possible mappings might be activated for parsing.
    • Constructor Detail

      • GtfsConverterReaderSettingsWithModeMapping

        protected GtfsConverterReaderSettingsWithModeMapping​(String inputSource,
                                                             String countryName,
                                                             RouteTypeChoice routeTypeChoice)
        Constructor with user defined source locale
        Parameters:
        inputSource - to use
        countryName - to base source locale on
        routeTypeChoice - to apply
      • GtfsConverterReaderSettingsWithModeMapping

        protected GtfsConverterReaderSettingsWithModeMapping​(URL inputSource,
                                                             String countryName,
                                                             RouteTypeChoice routeTypeChoice)
        Constructor with user defined source locale
        Parameters:
        inputSource - to use
        countryName - to base source locale on
        routeTypeChoice - to apply
      • GtfsConverterReaderSettingsWithModeMapping

        protected GtfsConverterReaderSettingsWithModeMapping​(GtfsConverterReaderSettingsWithModeMapping other)
        Copy constructor (reference copy because we use it to share the same mode mapping across multiple instance) todo not great because technically this is a hack and we do not create a shallow copy but simply assign references...
        Parameters:
        other - to use
    • Method Detail

      • initialiseDefaultModeMappings

        protected void initialiseDefaultModeMappings()
        Conduct general initialisation for any instance of this class
      • setDefaultGtfs2PredefinedModeTypeMapping

        protected void setDefaultGtfs2PredefinedModeTypeMapping​(RouteType gtfsRouteType,
                                                                PredefinedModeType planitMode)
        Set mapping from GTFS mode to PLANit mode
        Parameters:
        gtfsRouteType - to map from
        planitMode - mode type to map to
      • setDefaultGtfs2PredefinedModeTypeMapping

        protected void setDefaultGtfs2PredefinedModeTypeMapping​(RouteType gtfsRouteType,
                                                                List<PredefinedModeType> planitModes)
        Set mapping from GTFS mode to PLANit mode
        Parameters:
        gtfsRouteType - to map from
        planitModes - mode types to map to
      • activateGtfsRouteTypeMode

        protected void activateGtfsRouteTypeMode​(RouteType gtfsMode)
        Activate an GTFS mode, i.e., route type, based on its default mapping to a PLANit mode
        Parameters:
        gtfsMode - to map from
      • deactivateGtfsMode

        public void deactivateGtfsMode​(RouteType gtfsMode)
        Deactivate an OSM mode. This means that the osmMode will not be added to the PLANit network You can only remove a mode when it is already added.
        Parameters:
        gtfsMode - to remove
      • isGtfsModeActivated

        public boolean isGtfsModeActivated​(RouteType gtfsMode)
        Verify if Gtfs Mode has been activated or not
        Parameters:
        gtfsMode - to verify
        Returns:
        true when activate, false otherwise
      • deactivateGtfsModes

        public void deactivateGtfsModes​(Collection<RouteType> GtfsModes)
        Remove all provided GTFS modes from active mapping
        Parameters:
        GtfsModes - to deactivate
      • deactivateAllModesExcept

        public void deactivateAllModesExcept​(List<RouteType> remainingGtfsModes)
        remove all GTFS modes from mapping except for the passed in ones
        Parameters:
        remainingGtfsModes - to explicitly keep from the GTFSModesToRemove
      • getAcivatedGtfsModes

        public Collection<RouteType> getAcivatedGtfsModes()
        Convenience method that provides access to all the currently active GTFS modes (unmodifiable)
        Returns:
        mapped GTFS modes, if not available (due to lack of mapping or inactive parser) empty collection is returned
      • getAcivatedPlanitPredefinedModes

        public Set<PredefinedModeType> getAcivatedPlanitPredefinedModes()
        Currently activated mapped PLANit modes as a new set, i.e., modifying this set does not impact the configuration
        Returns:
        activated, i.e., mapped PLANit predefined mode types
      • getAcivatedPlanitPredefinedModes

        public List<PredefinedModeType> getAcivatedPlanitPredefinedModes​(RouteType gtfsMode)
        Find the currently mapped PLANit predefined modes for a given gtfsMode
        Parameters:
        gtfsMode - to find modes for
        Returns:
        found mapped PLANit modes starting with primary mapping (if GTFS mode is activated), otherwise null
      • getAcivatedGtfsModes

        public List<RouteType> getAcivatedGtfsModes​(PredefinedModeType planitModeType)
        Find the currently mapped GTFS modes for a given PLANit predefined mode type
        Parameters:
        planitModeType - to find modes for
        Returns:
        found mapped GTFS modes (may be empty)
      • findGtfsModesFor

        public Set<RouteType> findGtfsModesFor​(PredefinedModeType predefinedModeType)
        Find the GTFS mode that is mapped to the given predefined PLANit mode
        Parameters:
        predefinedModeType - to collect Gtfs route types for
        Returns:
        found mappings
      • getRouteTypeChoice

        public RouteTypeChoice getRouteTypeChoice()
        The route type choice used for identifying the GTFS route modes and mapping them to PLANit modes
        Returns:
        chosen route type choice