TraCI/Change Vehicle State

From Sumo
Revision as of 07:58, 27 May 2010 by Dkrajzew (talk | contribs) (Command 0xc4: Change Vehicle State)
Jump to navigation Jump to search

Command 0xc4: Change Vehicle State

ubyte string ubyte <value_type>
Variable Vehicle ID Type of the value New Value

Changes the state of a vehicle. Because it is possible to change different values of a vehicle, the number of parameter to supply and their types differ between commands. The following values can be changed, the parameter which must be given are also shown in the table.

Overview Changeable Vehicle Variables
Variable ValueType Description
max speed (0x11) float Sets the vehicle's maximum speed to the given value
stop (0x12) compound (string, float, byte, float), see below Lets the vehicle stop at the given edge, at the given position and lane. The vehicle will stop for the given duration.
change lane (0x13) compound (byte, float), see below Forces a lane change to the lane with the given index; if successfull, the lane will be chosen for the given amount of time.
slow down (0x14) compound (float, float), see below Reduces the speed to the given for the given amount of time.
change target (0x31) string (destination edge id) The vehicle's destination edge is set to the given. The route is rebuilt.
change route by id (0x54) string (route id) Assigns the named route to the vehicle, assuming a) the named route exists, and b) it starts on the edge the vehicle is currently at(1).
change route (0x57) stringList (ids of edges to pass) Assigns the list of edges as the vehicle's new route assuming the first edge given is the one the vehicle is curently at(1).
change edge travel time information (0x58) compound (begin time, end time, edgeID, value), see below Inserts the information about the travel time of edge "edgeID" valid from begin time to end time into the vehicle's internal edge weights container.
change edge effort information (0x59) compound (begin time, end time, edgeID, value), see below Inserts the information about the effort of edge "edgeID" valid from begin time to end time into the vehicle's internal edge weights container.
reroute (compute new route) by travel time (0x90) compound (<empty>), see below Computes a new route using the vehicle's internal and the global edge travel time information. Replaces the current route by the found.
reroute (compute new route) by effort (0x91) compound (<empty>), see below Computes a new route using the vehicle's internal and the global edge effort information. Replaces the current route by the found.


Please note:

(1): The first occurence of the edge is currently at is searched within the new route; the vehicle continues the route from this point in the route from. If the edge the vehicle is currently does not exist within the new route, an error is generated.


The message contents are as following:

max speed (0x11)

byte float
value type float New Maximum Speed

stop (0x12)

byte integer byte string byte float byte byte byte int
value type compound item number (always 4) value type string Edge ID value type float Position value type byte Lane Index value type int Duration [ms]

change lane (0x13)

byte integer byte byte byte int
value type compound item number (always 2) value type byte Lane Index value type int Duration [ms]

slow down (0x14)

byte integer byte float byte int
value type compound item number (always 2) value type float Speed value type int Duration [ms]

change target (0x31)

byte string
value type string Edge ID


change route by id (0x54)

byte string
value type string Route ID


change route (0x57)

byte int string
value type string list number of elements Edge ID


change edge travel time information (0x58)

This command can be sent using 4, 2, or 1 parameters. In the first form, it adds a new override of edge information to the list of existing overrides for the given vehicle, valid from begin time to end time. In the second form, it adds a new override that is valid throughout the simulation, replacing an earlier one for the same edge. In the third form, it removes as earlier override for the given edge, valid throughout the simulation.

byte int byte int byte int byte string byte float
value type compound number of elements (always=4) value type integer begin time (in s) value type integer end time (in s) value type string edge id value type float travel time value (in s)
byte int byte string byte float
value type compound number of elements (always=4) value type string edge id value type float travel time value (in s)
byte int byte string
value type compound number of elements (always=4) value type string edge id


change edge effort information (0x59)

This command can be sent using 4, 2, or 1 parameters. In the first form, it adds a new override of edge information to the list of existing overrides for the given vehicle, valid from begin time to end time. In the second form, it adds a new override that is valid throughout the simulation, replacing an earlier one for the same edge. In the third form, it removes as earlier override for the given edge, valid throughout the simulation.

byte int byte int byte int byte string byte float
value type compound number of elements (always=4) value type integer begin time (in s) value type integer end time (in s) value type string edge id value type float effort value (abstract)
byte int byte string byte float
value type compound number of elements (always=4) value type string edge id value type float effort value (abstract)
byte int byte string
value type compound number of elements (always=4) value type string edge id

reroute (compute new route) by travel time (0x90)

byte int
value type compound number of elements (always=0)

reroute (compute new route) by effort (0x91)

byte int
value type compound number of elements (always=0)