FCDReplay

The FCD replay device uses floating car data (FCD) to replay recorded vehicle and person trajectories in a microscopic simulation.

Record and replay#

Record trajectories as XML. Keep the default network coordinates and FCD attributes for replay.

sumo -n network.net.xml -r demand.rou.xml --step-length 0.1 --fcd-output recorded.xml

Replay the recording on the same network. SUMO creates the recorded vehicles and persons from the FCD file. Use the same step length as the recording when you want to retain every sample.

sumo -n network.net.xml --step-length 0.1 --device.fcd-replay.files recorded.xml --fcd-output replayed.xml

Use sumo-gui to view the replay, or compare replayed.xml with recorded.xml at the recorded times.

Replay input#

  • Use FCD XML with timestamped <timestep> elements that contain <vehicle> or <person> elements. The standard FCD output includes positions in the network's Cartesian coordinate system. If you recorded with --fcd-output.geo or --fcd-output.utm, convert the positions to network coordinates before replaying them.
  • Keep the vehicle lane and person edge attributes when you have them. If a vehicle's initial sample omits its lane, SUMO uses its coordinates to find a nearby lane.
  • Load any custom vehicle or person types referenced in the recording, for example with --additional-files. When SUMO creates vehicles or persons from a recording, assign distinct IDs to any separate demand.

Vehicle map matching and speed replay#

Select attributes from a complete recording with --device.fcd-replay.consistency or supply XML with the desired attributes. Use x and y for position replay. The recorded lane, when present, identifies the edge and lane index. The pos field gives the initial offset along a recorded lane, and angle supplies the heading for matching.

Input attributes Replay behavior
x, y, and lane SUMO uses the recorded lane as a hint and applies TraCI matching with keepRoute=7. Matching keeps the current route, permits off-network positions, and ignores lane permissions.
x and y SUMO finds a nearby lane for the first sample. Later samples without a lane hint use keepRoute=0, which can match other edges and respects lane permissions.
speed Define the vehicles and their routes in a route file with IDs that match the recording. SUMO uses their routes and lane movement to determine positions and applies the recorded speeds.

See TraCI moveToXY for the matching flags. In person records the corresponding location hint is edge. Selecting either edge or lane enables the hint appropriate to each object.

To use the speeds from a full recording, load the matching routes and select speed.

sumo -n network.net.xml -r demand.rou.xml --device.fcd-replay.files recorded.xml --device.fcd-replay.consistency speed

The replay reader reports No lane in fcd replay file when it tries to create a vehicle from speed-only data. Vehicles loaded from the route file receive their recorded speeds by ID.

Timing#

SUMO reads samples at the times recorded in the file. With a coarser simulation step, the vehicle replay device applies the latest sample due at the current step. A vehicle created from the recording is removed after SUMO has applied its final sample and reached the end of its input file.

Options#

Option Description
--device.fcd-replay.files Read one or more FCD XML files. Separate multiple paths with commas. --device.fcd-replay.file is an alias.
--device.fcd-replay.consistency Select which attributes to use. The default, all, uses all supported fields. To select individual fields, give a comma-separated list from x, y, edge, lane, speed, position (the XML attribute pos), angle, and type. Include both x and y to replay Cartesian positions.