Package org.goplanit.matsim.converter
Class MatsimIntermodalWriter
- java.lang.Object
-
- org.goplanit.matsim.converter.MatsimIntermodalWriter
-
- All Implemented Interfaces:
ConverterEntity,IntermodalWriter<ServiceNetwork,RoutedServices>,PairConverterWriter<MacroscopicNetwork,Zoning>
public class MatsimIntermodalWriter extends Object implements IntermodalWriter<ServiceNetwork,RoutedServices>
A class that takes a PLANit intermodal network and writes it as a MATSim intermodal network. Since an intermodal mapper requires transit elements to reference network elements, the only valid id mapping that we allow is either PLANit internal ids (default), or PLANit XML ids. External ids cannot be used since they cannot be guaranteed to be unique causing problems with references between links and stop facility link references. If the user still wants to check against the original extrnal ids in MATSim, we still write then as origids.- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected IdMapperTypeidMapperthe id mapper to useprotected MatsimIntermodalWriterSettingssettingsIntermodal settings to use
-
Constructor Summary
Constructors Modifier Constructor Description protectedMatsimIntermodalWriter(MatsimIntermodalWriterSettings settings)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IdMapperTypegetIdMapperType()collect the way the ids should be mappedMatsimIntermodalWriterSettingsgetSettings()Any settings to configure the writer can be configured by collecting these settingsvoidreset()reset the reader to allow for marking unnecessary resources for garbage collectionvoidsetIdMapperType(IdMapperType idMapper)set the way ids should be mappedvoidwrite(MacroscopicNetwork infrastructureNetwork, Zoning zoning)Persist the PLANit network and zoning as a MATSim network to diskvoidwriteWithServices(MacroscopicNetwork infrastructureNetwork, Zoning zoning, ServiceNetwork serviceNetwork, RoutedServices routedServices)Persist the PLANit network and zoning as a MATSIM compatible network to disk-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.converter.intermodal.IntermodalWriter
getTypeDescription
-
-
-
-
Field Detail
-
settings
protected final MatsimIntermodalWriterSettings settings
Intermodal settings to use
-
idMapper
protected IdMapperType idMapper
the id mapper to use
-
-
Constructor Detail
-
MatsimIntermodalWriter
protected MatsimIntermodalWriter(MatsimIntermodalWriterSettings settings)
Constructor- Parameters:
settings- to use
-
-
Method Detail
-
write
public void write(MacroscopicNetwork infrastructureNetwork, Zoning zoning) throws PlanItException
Persist the PLANit network and zoning as a MATSim network to disk- Specified by:
writein interfacePairConverterWriter<MacroscopicNetwork,Zoning>- Parameters:
infrastructureNetwork- to persist as MATSim networkzoning- to extract public transport infrastructure from (poles, platforms, stations)- Throws:
PlanItException- thrown if error
-
writeWithServices
public void writeWithServices(MacroscopicNetwork infrastructureNetwork, Zoning zoning, ServiceNetwork serviceNetwork, RoutedServices routedServices) throws PlanItException
Persist the PLANit network and zoning as a MATSIM compatible network to disk- Specified by:
writeWithServicesin interfaceIntermodalWriter<ServiceNetwork,RoutedServices>- Parameters:
zoning- to extract public transport infrastructure from (poles, platforms, stations)routedServices- to extract service routing information frominfrastructureNetwork- network to writeserviceNetwork- to write- Throws:
PlanItException- thrown if error
-
getIdMapperType
public IdMapperType getIdMapperType()
collect the way the ids should be mapped- Specified by:
getIdMapperTypein interfacePairConverterWriter<MacroscopicNetwork,Zoning>- Returns:
- the id mapping choice
-
setIdMapperType
public void setIdMapperType(IdMapperType idMapper)
set the way ids should be mapped- Specified by:
setIdMapperTypein interfacePairConverterWriter<MacroscopicNetwork,Zoning>- Parameters:
idMapper- to use
-
reset
public void reset()
reset the reader to allow for marking unnecessary resources for garbage collection- Specified by:
resetin interfaceConverterEntity
-
getSettings
public MatsimIntermodalWriterSettings getSettings()
Any settings to configure the writer can be configured by collecting these settings- Specified by:
getSettingsin interfacePairConverterWriter<MacroscopicNetwork,Zoning>- Returns:
- the settings to configure the writer
-
-