Package org.goplanit.network
Class MacroscopicNetworkLayerConfigurator
- java.lang.Object
-
- org.goplanit.network.MacroscopicNetworkLayerConfigurator
-
public class MacroscopicNetworkLayerConfigurator extends Object
Configurator class that allows one to create and modify a setup for the mapping of modes and macroscopic network layers without actually creating them yet. The final result can be used to instantiate the layers on the actual network when the time is right. We also provide some default suggestions for quick setups avoiding complicated manual configurations.- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description static String
ACTIVE_LAYER_XML_ID
proposed active layer idstatic String
ALL_IN_ONE_LAYER_ID
proposed all-in-one layer idprotected Map<Mode,String>
modeToLayerXmlId
track mode to layer mappingstatic String
ON_STREET_LAYER_XML_ID
proposed on_street layer idstatic String
RAIL_LAYER_ID
proposed rail layer idprotected Set<String>
transportLayersByXmlId
track unique proposed layers
-
Constructor Summary
Constructors Constructor Description MacroscopicNetworkLayerConfigurator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addLayer(String layerXmlId)
add a proposed layerstatic MacroscopicNetworkLayerConfigurator
createAllInOneConfiguration(Modes modes)
create a configuration that maps all passed in modes to a single proposed all-in-one layerstatic MacroscopicNetworkLayerConfigurator
createMultiLayerConfiguration(Collection<PredefinedMode> predefinedModes)
create a multi-layer configuration that maps all passed in modes to either a rail, active, or on-street layer.boolean
isModeMappedToLayer(Mode mode, String layerXmlId)
verify if mode is assigned to the layerboolean
removeLayer(String layerXmlId)
remove a proposed layer, this means that all modes mapped to this layer are no longer mapped at allString
removeMode(Mode mode)
remove mode from any layerString
setModeToLayer(Mode mode, String layerXmlId)
set mode to a layer
-
-
-
Field Detail
-
transportLayersByXmlId
protected final Set<String> transportLayersByXmlId
track unique proposed layers
-
ON_STREET_LAYER_XML_ID
public static final String ON_STREET_LAYER_XML_ID
proposed on_street layer id- See Also:
- Constant Field Values
-
ACTIVE_LAYER_XML_ID
public static final String ACTIVE_LAYER_XML_ID
proposed active layer id- See Also:
- Constant Field Values
-
RAIL_LAYER_ID
public static final String RAIL_LAYER_ID
proposed rail layer id- See Also:
- Constant Field Values
-
ALL_IN_ONE_LAYER_ID
public static final String ALL_IN_ONE_LAYER_ID
proposed all-in-one layer id- See Also:
- Constant Field Values
-
-
Method Detail
-
createAllInOneConfiguration
public static MacroscopicNetworkLayerConfigurator createAllInOneConfiguration(Modes modes)
create a configuration that maps all passed in modes to a single proposed all-in-one layer- Parameters:
modes
- to use for all in one layer configuration- Returns:
- configuration reflective of all-in-one approach
-
createMultiLayerConfiguration
public static MacroscopicNetworkLayerConfigurator createMultiLayerConfiguration(Collection<PredefinedMode> predefinedModes)
create a multi-layer configuration that maps all passed in modes to either a rail, active, or on-street layer. Note that only predefined PLANit modes are automatically mapped. Custom modes must be manually mapped afterwards to the appropriate layer. The mapping works as follows: on-street layer:- bus
- car HOV
- car
- car share
- goods
- heavy goods
- large heavy goods
- light rail
- motor bike
- tram
active layer:
- bicycle
- pedestrian
rail layer:
- subway
- train
- Parameters:
predefinedModes
- for multi-layer configuration- Returns:
- configuration reflective of all-in-one approach
-
addLayer
public boolean addLayer(String layerXmlId)
add a proposed layer- Parameters:
layerXmlId
- to add- Returns:
- true if not already present, false otherwise
-
removeLayer
public boolean removeLayer(String layerXmlId) throws PlanItException
remove a proposed layer, this means that all modes mapped to this layer are no longer mapped at all- Parameters:
layerXmlId
- to remove- Returns:
- true if removed, false otherwise
- Throws:
PlanItException
- thrown if error
-
setModeToLayer
public String setModeToLayer(Mode mode, String layerXmlId)
set mode to a layer- Parameters:
mode
- to addlayerXmlId
- to use- Returns:
- previous layer the mode was added to (if any)
-
isModeMappedToLayer
public boolean isModeMappedToLayer(Mode mode, String layerXmlId)
verify if mode is assigned to the layer- Parameters:
mode
- to verifylayerXmlId
- to check- Returns:
- true when mapped, false otherwise
-
-