wiki:TraCI

Version 1 (modified by cristian.gratie, 14 years ago) (diff)

--

Interacting with SUMO using TraCI

TraCI stands for Traffic Control Interface, a protocol that defines messages that can be used to control a traffic simulation that runs in client-server mode.

Communication uses TCP messages with the following structure:

+--------------------------+-----------+-----------+-----+-----------+
| message length (4 bytes) | command_1 | command_2 | ... | command_n |
+--------------------------+-----------+-----------+-----+-----------+

A command contains the following:

+-----------------+---------------------+---------+
| length (1 byte) | identifier (1 byte) | content |
+-----------------+---------------------+---------+

or, for longer commands

+------------+------------------+---------------------+---------+
| 0 (1 byte) | length (4 bytes) | identifier (1 byte) | content |
+------------+------------------+---------------------+---------+

The server will reply with a single message contaning the responses to every command received, in the same order.