if (trafficSourceData.isSetInflow()) {
InflowTimeSeries inflowTimeSeries = new InflowTimeSeries(trafficSourceData.getInflow());
trafficSource = new TrafficSourceMacro(composition, roadSegment, inflowTimeSeries);
} else if (trafficSourceData.isSetInflowFromFile()) {
trafficSource = new TrafficSourceMicro(composition, roadSegment);
MicroInflowFileReader reader = new MicroInflowFileReader(trafficSourceData.getInflowFromFile(),
roadSegment.laneCount(), timeOffsetMillis, routing, (TrafficSourceMicro) trafficSource);
reader.readData();
}
if (trafficSource != null) {
if (trafficSourceData.isLogging()) {
trafficSource.setRecorder(new FileTrafficSourceData(roadSegment.userId()));
}