Package org.goplanit.matsim.converter
Class MatsimIntermodalWriter
- java.lang.Object
-
- org.goplanit.matsim.converter.MatsimIntermodalWriter
-
- All Implemented Interfaces:
ConverterEntity,IntermodalWriter,MultiConverterWriter<MacroscopicNetwork,Zoning>
public class MatsimIntermodalWriter extends Object implements IntermodalWriter
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()Default constructor using all default settings for underlying writersprotectedMatsimIntermodalWriter(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 and 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()
Default constructor using all default settings for underlying writers
-
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 and a MATSIM compatible network to disk- Specified by:
writein interfaceMultiConverterWriter<MacroscopicNetwork,Zoning>- Parameters:
infrastructureNetwork- to persist as MATSIM networkzoning- to extract public transport infratructure from (poles, platforms, stations)- Throws:
PlanItException- thrown if error
-
getIdMapperType
public IdMapperType getIdMapperType()
collect the way the ids should be mapped- Specified by:
getIdMapperTypein interfaceMultiConverterWriter<MacroscopicNetwork,Zoning>- Returns:
- the id mapping choice
-
setIdMapperType
public void setIdMapperType(IdMapperType idMapper)
set the way ids should be mapped- Specified by:
setIdMapperTypein interfaceMultiConverterWriter<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 interfaceMultiConverterWriter<MacroscopicNetwork,Zoning>- Returns:
- the settings to configure the writer
-
-