Package org.matsim.core.population.io
Class PopulationWriter
- java.lang.Object
-
- org.matsim.core.utils.io.AbstractMatsimWriter
-
- org.matsim.core.population.io.PopulationWriter
-
- All Implemented Interfaces:
MatsimSomeWriter
,MatsimWriter
public final class PopulationWriter extends AbstractMatsimWriter implements MatsimWriter
-
-
Field Summary
-
Fields inherited from class org.matsim.core.utils.io.AbstractMatsimWriter
NL, useCompression, writer
-
-
Constructor Summary
Constructors Constructor Description PopulationWriter(Population population)
PopulationWriter(Population population, Network network)
Creates a new PlansWriter to write out the specified plans to the file and with version as specified in the configuration.PopulationWriter(Population population, Network network, double fraction)
Creates a new PlansWriter to write out the specified plans to the specified file and with the specified version.PopulationWriter(CoordinateTransformation coordinateTransformation, Population population)
PopulationWriter(CoordinateTransformation coordinateTransformation, Population population, Network network)
PopulationWriter(CoordinateTransformation coordinateTransformation, Population population, Network network, double fraction)
Creates a new PlansWriter to write out the specified plans to the specified file and with the specified version.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
putAttributeConverter(Class<?> key, AttributeConverter<?> converter)
void
putAttributeConverters(Map<Class<?>,AttributeConverter<?>> converters)
void
setWriterHandler(PopulationWriterHandler handler)
void
write(OutputStream outputStream)
Writes all plans to the output stream and closes it.void
write(String filename)
Writes all plans to the file.void
writeV0(String filename)
void
writeV4(String filename)
void
writeV5(String filename)
void
writeV6(OutputStream stream)
void
writeV6(String filename)
-
Methods inherited from class org.matsim.core.utils.io.AbstractMatsimWriter
close, openFile, openOutputStream, useCompression
-
-
-
-
Constructor Detail
-
PopulationWriter
public PopulationWriter(Population population)
-
PopulationWriter
public PopulationWriter(CoordinateTransformation coordinateTransformation, Population population)
-
PopulationWriter
public PopulationWriter(Population population, Network network)
Creates a new PlansWriter to write out the specified plans to the file and with version as specified in the configuration. If plans-streaming is on, the file will already be opened and the file-header be written. If plans-streaming is off, the file will not be created untilwrite(java.lang.String)
is called.- Parameters:
population
- the population to write to file
-
PopulationWriter
public PopulationWriter(CoordinateTransformation coordinateTransformation, Population population, Network network)
-
PopulationWriter
public PopulationWriter(CoordinateTransformation coordinateTransformation, Population population, Network network, double fraction)
Creates a new PlansWriter to write out the specified plans to the specified file and with the specified version. If plans-streaming is on, the file will already be opened and the file-header be written. If plans-streaming is off, the file will not be created untilwrite(java.lang.String)
is called.- Parameters:
coordinateTransformation
- transformation from the internal CRS to the CRS in which the file should be writtenpopulation
- the population to write to filefraction
- of persons to write to the plans file
-
PopulationWriter
public PopulationWriter(Population population, Network network, double fraction)
Creates a new PlansWriter to write out the specified plans to the specified file and with the specified version. If plans-streaming is on, the file will already be opened and the file-header be written. If plans-streaming is off, the file will not be created untilwrite(java.lang.String)
is called.- Parameters:
population
- the population to write to filefraction
- of persons to write to the plans file
-
-
Method Detail
-
putAttributeConverters
public void putAttributeConverters(Map<Class<?>,AttributeConverter<?>> converters)
-
putAttributeConverter
public void putAttributeConverter(Class<?> key, AttributeConverter<?> converter)
-
write
public final void write(String filename)
Writes all plans to the file.- Specified by:
write
in interfaceMatsimWriter
-
write
public final void write(OutputStream outputStream)
Writes all plans to the output stream and closes it.
-
writeV6
public final void writeV6(OutputStream stream)
-
setWriterHandler
public final void setWriterHandler(PopulationWriterHandler handler)
-
-