SUMO - Simulation of Urban MObility
TraCIConstants.h
Go to the documentation of this file.
00001 /****************************************************************************/
00015 /****************************************************************************/
00016 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00017 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00018 /****************************************************************************/
00019 //
00020 //   This file is part of SUMO.
00021 //   SUMO is free software: you can redistribute it and/or modify
00022 //   it under the terms of the GNU General Public License as published by
00023 //   the Free Software Foundation, either version 3 of the License, or
00024 //   (at your option) any later version.
00025 //
00026 /****************************************************************************/
00027 #ifndef TRACICONSTANTS_H
00028 #define TRACICONSTANTS_H
00029 
00030 
00031 // ****************************************
00032 // VERSION
00033 // ****************************************
00034 #define TRACI_VERSION 3
00035 
00036 // ****************************************
00037 // COMMANDS
00038 // ****************************************
00039 // command: get version
00040 #define CMD_GETVERSION 0x00
00041 
00042 // command: simulation step (new version)
00043 #define CMD_SIMSTEP2 0x02
00044 
00045 // command: stop node
00046 #define CMD_STOP 0x12
00047 
00048 // command: set lane
00049 #define CMD_CHANGELANE 0x13
00050 
00051 // command: slow down
00052 #define CMD_SLOWDOWN 0x14
00053 
00054 // command: change target
00055 #define CMD_CHANGETARGET 0x31
00056 
00057 // command: Position Conversion
00058 #define CMD_POSITIONCONVERSION 0x71
00059 
00060 // command: Distance Request
00061 #define CMD_DISTANCEREQUEST 0x72
00062 
00063 // command: add vehicle
00064 #define CMD_ADDVEHICLE 0x74
00065 
00066 // command: move node
00067 #define CMD_MOVENODE 0x80
00068 
00069 // command: close sumo
00070 #define CMD_CLOSE 0x7F
00071 
00072 
00073 
00074 // command: get induction loop (e1) variable
00075 #define CMD_GET_INDUCTIONLOOP_VARIABLE 0xa0
00076 // response: get induction loop (e1) variable
00077 #define RESPONSE_GET_INDUCTIONLOOP_VARIABLE 0xb0
00078 // command: subscribe induction loop (e1) variable
00079 #define CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE 0xd0
00080 // response: subscribe induction loop (e1) variable
00081 #define RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE 0xe0
00082 
00083 // command: get multi-entry/multi-exit detector (e3) variable
00084 #define CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE 0xa1
00085 // response: get areal detector (e3) variable
00086 #define RESPONSE_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE 0xb1
00087 // command: subscribe multi-entry/multi-exit detector (e3) variable
00088 #define CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE 0xd1
00089 // response: subscribe areal detector (e3) variable
00090 #define RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE 0xe1
00091 
00092 // command: get traffic lights variable
00093 #define CMD_GET_TL_VARIABLE 0xa2
00094 // response: get traffic lights variable
00095 #define RESPONSE_GET_TL_VARIABLE 0xb2
00096 // command: set traffic lights variable
00097 #define CMD_SET_TL_VARIABLE 0xc2
00098 // command: subscribe traffic lights variable
00099 #define CMD_SUBSCRIBE_TL_VARIABLE 0xd2
00100 // response: subscribe traffic lights variable
00101 #define RESPONSE_SUBSCRIBE_TL_VARIABLE 0xe2
00102 
00103 // command: get lane variable
00104 #define CMD_GET_LANE_VARIABLE 0xa3
00105 // response: get lane variable
00106 #define RESPONSE_GET_LANE_VARIABLE 0xb3
00107 // command: set lane variable
00108 #define CMD_SET_LANE_VARIABLE 0xc3
00109 // command: subscribe lane variable
00110 #define CMD_SUBSCRIBE_LANE_VARIABLE 0xd3
00111 // response: subscribe lane variable
00112 #define RESPONSE_SUBSCRIBE_LANE_VARIABLE 0xe3
00113 
00114 // command: get vehicle variable
00115 #define CMD_GET_VEHICLE_VARIABLE 0xa4
00116 // response: get vehicle variable
00117 #define RESPONSE_GET_VEHICLE_VARIABLE 0xb4
00118 // command: set vehicle variable
00119 #define CMD_SET_VEHICLE_VARIABLE 0xc4
00120 // command: subscribe vehicle variable
00121 #define CMD_SUBSCRIBE_VEHICLE_VARIABLE 0xd4
00122 // response: subscribe vehicle variable
00123 #define RESPONSE_SUBSCRIBE_VEHICLE_VARIABLE 0xe4
00124 
00125 // command: get vehicle type variable
00126 #define CMD_GET_VEHICLETYPE_VARIABLE 0xa5
00127 // response: get vehicle type variable
00128 #define RESPONSE_GET_VEHICLETYPE_VARIABLE 0xb5
00129 // command: set vehicle type variable
00130 #define CMD_SET_VEHICLETYPE_VARIABLE 0xc5
00131 // command: subscribe vehicle type variable
00132 #define CMD_SUBSCRIBE_VEHICLETYPE_VARIABLE 0xd5
00133 // response: subscribe vehicle type variable
00134 #define RESPONSE_SUBSCRIBE_VEHICLETYPE_VARIABLE 0xe5
00135 
00136 // command: get route variable
00137 #define CMD_GET_ROUTE_VARIABLE 0xa6
00138 // response: get route variable
00139 #define RESPONSE_GET_ROUTE_VARIABLE 0xb6
00140 // command: set route variable
00141 #define CMD_SET_ROUTE_VARIABLE 0xc6
00142 // command: subscribe route variable
00143 #define CMD_SUBSCRIBE_ROUTE_VARIABLE 0xd6
00144 // response: subscribe route variable
00145 #define RESPONSE_SUBSCRIBE_ROUTE_VARIABLE 0xe6
00146 
00147 // command: get poi variable
00148 #define CMD_GET_POI_VARIABLE 0xa7
00149 // response: get poi variable
00150 #define RESPONSE_GET_POI_VARIABLE 0xb7
00151 // command: set poi variable
00152 #define CMD_SET_POI_VARIABLE 0xc7
00153 // command: subscribe poi variable
00154 #define CMD_SUBSCRIBE_POI_VARIABLE 0xd7
00155 // response: subscribe poi variable
00156 #define RESPONSE_SUBSCRIBE_POI_VARIABLE 0xe7
00157 
00158 // command: get polygon variable
00159 #define CMD_GET_POLYGON_VARIABLE 0xa8
00160 // response: get polygon variable
00161 #define RESPONSE_GET_POLYGON_VARIABLE 0xb8
00162 // command: set polygon variable
00163 #define CMD_SET_POLYGON_VARIABLE 0xc8
00164 // command: subscribe polygon variable
00165 #define CMD_SUBSCRIBE_POLYGON_VARIABLE 0xd8
00166 // response: subscribe polygon variable
00167 #define RESPONSE_SUBSCRIBE_POLYGON_VARIABLE 0xe8
00168 
00169 // command: get junction variable
00170 #define CMD_GET_JUNCTION_VARIABLE 0xa9
00171 // response: get junction variable
00172 #define RESPONSE_GET_JUNCTION_VARIABLE 0xb9
00173 // command: set junction variable
00174 #define CMD_SET_JUNCTION_VARIABLE 0xc9
00175 // command: subscribe junction variable
00176 #define CMD_SUBSCRIBE_JUNCTION_VARIABLE 0xd9
00177 // response: subscribe junction variable
00178 #define RESPONSE_SUBSCRIBE_JUNCTION_VARIABLE 0xe9
00179 
00180 // command: get edge variable
00181 #define CMD_GET_EDGE_VARIABLE 0xaa
00182 // response: get edge variable
00183 #define RESPONSE_GET_EDGE_VARIABLE 0xba
00184 // command: set edge variable
00185 #define CMD_SET_EDGE_VARIABLE 0xca
00186 // command: subscribe edge variable
00187 #define CMD_SUBSCRIBE_EDGE_VARIABLE 0xda
00188 // response: subscribe edge variable
00189 #define RESPONSE_SUBSCRIBE_EDGE_VARIABLE 0xea
00190 
00191 // command: get simulation variable
00192 #define CMD_GET_SIM_VARIABLE 0xab
00193 // response: get simulation variable
00194 #define RESPONSE_GET_SIM_VARIABLE 0xbb
00195 // command: set simulation variable
00196 #define CMD_SET_SIM_VARIABLE 0xcb
00197 // command: subscribe simulation variable
00198 #define CMD_SUBSCRIBE_SIM_VARIABLE 0xdb
00199 // response: subscribe simulation variable
00200 #define RESPONSE_SUBSCRIBE_SIM_VARIABLE 0xeb
00201 
00202 // command: get GUI variable
00203 #define CMD_GET_GUI_VARIABLE 0xac
00204 // response: get GUI variable
00205 #define RESPONSE_GET_GUI_VARIABLE 0xbc
00206 // command: set GUI variable
00207 #define CMD_SET_GUI_VARIABLE 0xcc
00208 // command: subscribe GUI variable
00209 #define CMD_SUBSCRIBE_GUI_VARIABLE 0xdc
00210 // response: subscribe GUI variable
00211 #define RESPONSE_SUBSCRIBE_GUI_VARIABLE 0xec
00212 
00213 
00214 
00215 // ****************************************
00216 // POSITION REPRESENTATIONS
00217 // ****************************************
00218 // Position in geo-coordinates
00219 #define POSITION_LAT_LON 0x00
00220 // 2D cartesian coordinates
00221 #define POSITION_2D 0x01
00222 // Position in geo-coordinates with altitude
00223 #define POSITION_LAT_LON_ALT 0x02
00224 // 3D cartesian coordinates
00225 #define POSITION_3D 0x03
00226 // Position on road map
00227 #define POSITION_ROADMAP 0x04
00228 
00229 
00230 
00231 // ****************************************
00232 // DATA TYPES
00233 // ****************************************
00234 // Boundary Box (4 doubles)
00235 #define TYPE_BOUNDINGBOX 0x05
00236 // Polygon (2*n doubles)
00237 #define TYPE_POLYGON 0x06
00238 // unsigned byte
00239 #define TYPE_UBYTE 0x07
00240 // signed byte
00241 #define TYPE_BYTE 0x08
00242 // 32 bit signed integer
00243 #define TYPE_INTEGER 0x09
00244 // float
00245 #define TYPE_FLOAT 0x0A
00246 // double
00247 #define TYPE_DOUBLE 0x0B
00248 // 8 bit ASCII string
00249 #define TYPE_STRING 0x0C
00250 // list of traffic light phases
00251 #define TYPE_TLPHASELIST 0x0D
00252 // list of strings
00253 #define TYPE_STRINGLIST 0x0E
00254 // compound object
00255 #define TYPE_COMPOUND 0x0F
00256 // color (four ubytes)
00257 #define TYPE_COLOR 0x11
00258 
00259 
00260 
00261 // ****************************************
00262 // RESULT TYPES
00263 // ****************************************
00264 // result type: Ok
00265 #define RTYPE_OK 0x00
00266 // result type: not implemented
00267 #define RTYPE_NOTIMPLEMENTED 0x01
00268 // result type: error
00269 #define RTYPE_ERR 0xFF
00270 
00271 // return value for invalid queries (especially vehicle is not on the road)
00272 #define INVALID_DOUBLE_VALUE -1001.
00273 // return value for invalid queries (especially vehicle is not on the road)
00274 #define INVALID_INT_VALUE -1
00275 
00276 
00277 
00278 // ****************************************
00279 // TRAFFIC LIGHT PHASES
00280 // ****************************************
00281 // red phase
00282 #define TLPHASE_RED 0x01
00283 // yellow phase
00284 #define TLPHASE_YELLOW 0x02
00285 // green phase
00286 #define TLPHASE_GREEN 0x03
00287 // tl is blinking
00288 #define TLPHASE_BLINKING 0x04
00289 // tl is off and not blinking
00290 #define TLPHASE_NOSIGNAL 0x05
00291 
00292 
00293 
00294 // ****************************************
00295 // DIFFERENT DISTANCE REQUESTS
00296 // ****************************************
00297 // air distance
00298 #define REQUEST_AIRDIST 0x00
00299 // driving distance
00300 #define REQUEST_DRIVINGDIST 0x01
00301 
00302 
00303 
00304 // ****************************************
00305 // VARIABLE TYPES (for CMD_GET_*_VARIABLE)
00306 // ****************************************
00307 // list of instances' ids (get: all)
00308 #define ID_LIST 0x00
00309 
00310 // count of instances (get: all)
00311 #define ID_COUNT 0x01
00312 
00313 // last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges)
00314 #define LAST_STEP_VEHICLE_NUMBER 0x10
00315 
00316 // last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges)
00317 #define LAST_STEP_MEAN_SPEED 0x11
00318 
00319 // last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges)
00320 #define LAST_STEP_VEHICLE_ID_LIST 0x12
00321 
00322 // last step occupancy (get: induction loops, lanes, edges)
00323 #define LAST_STEP_OCCUPANCY 0x13
00324 
00325 // last step vehicle halting number (get: multi-entry/multi-exit detector, lanes, edges)
00326 #define LAST_STEP_VEHICLE_HALTING_NUMBER 0x14
00327 
00328 // last step mean vehicle length (get: induction loops, lanes, edges)
00329 #define LAST_STEP_LENGTH 0x15
00330 
00331 // last step time since last detection (get: induction loops)
00332 #define LAST_STEP_TIME_SINCE_DETECTION 0x16
00333 
00334 // entry times
00335 #define LAST_STEP_VEHICLE_DATA 0x17
00336 
00337 
00338 // traffic light states, encoded as rRgGyYoO tuple (get: traffic lights)
00339 #define TL_RED_YELLOW_GREEN_STATE 0x20
00340 
00341 // index of the phase (set: traffic lights)
00342 #define TL_PHASE_INDEX 0x22
00343 
00344 // traffic light program (set: traffic lights)
00345 #define TL_PROGRAM 0x23
00346 
00347 // phase duration (set: traffic lights)
00348 #define TL_PHASE_DURATION 0x24
00349 
00350 // controlled lanes (get: traffic lights)
00351 #define TL_CONTROLLED_LANES 0x26
00352 
00353 // controlled links (get: traffic lights)
00354 #define TL_CONTROLLED_LINKS 0x27
00355 
00356 // index of the current phase (get: traffic lights)
00357 #define TL_CURRENT_PHASE 0x28
00358 
00359 // name of the current program (get: traffic lights)
00360 #define TL_CURRENT_PROGRAM 0x29
00361 
00362 // controlled junctions (get: traffic lights)
00363 #define TL_CONTROLLED_JUNCTIONS 0x2a
00364 
00365 // complete definition (get: traffic lights)
00366 #define TL_COMPLETE_DEFINITION_RYG 0x2b
00367 
00368 // complete program (set: traffic lights)
00369 #define TL_COMPLETE_PROGRAM_RYG 0x2c
00370 
00371 // assumed time to next switch (get: traffic lights)
00372 #define TL_NEXT_SWITCH 0x2d
00373 
00374 
00375 
00376 // outgoing link number (get: lanes)
00377 #define LANE_LINK_NUMBER 0x30
00378 
00379 // id of parent edge (get: lanes)
00380 #define LANE_EDGE_ID 0x31
00381 
00382 // outgoing link definitions (get: lanes)
00383 #define LANE_LINKS 0x33
00384 
00385 // list of allowed vehicle classes (get&set: lanes)
00386 #define LANE_ALLOWED 0x34
00387 
00388 // list of not allowed vehicle classes (get&set: lanes)
00389 #define LANE_DISALLOWED 0x35
00390 
00391 
00392 // speed (get: vehicle)
00393 #define VAR_SPEED 0x40
00394 
00395 // maximum allowed/possible speed (get: vehicle types, lanes, set: edges, lanes)
00396 #define VAR_MAXSPEED 0x41
00397 
00398 // position (2D) (get: vehicle, poi, set: poi)
00399 #define VAR_POSITION 0x42
00400 
00401 // angle (get: vehicle)
00402 #define VAR_ANGLE 0x43
00403 
00404 // angle (get: vehicle types, lanes, set: lanes)
00405 #define VAR_LENGTH 0x44
00406 
00407 // color (get: vehicles, vehicle types, polygons, pois)
00408 #define VAR_COLOR 0x45
00409 
00410 // max. acceleration (get: vehicle types)
00411 #define VAR_ACCEL 0x46
00412 
00413 // max. deceleration (get: vehicle types)
00414 #define VAR_DECEL 0x47
00415 
00416 // driver reaction time (get: vehicle types)
00417 #define VAR_TAU 0x48
00418 
00419 // vehicle class (get: vehicle types)
00420 #define VAR_VEHICLECLASS 0x49
00421 
00422 // emission class (get: vehicle types)
00423 #define VAR_EMISSIONCLASS 0x4a
00424 
00425 // shape class (get: vehicle types)
00426 #define VAR_SHAPECLASS 0x4b
00427 
00428 // minimum gap (get: vehicle types)
00429 #define VAR_MINGAP 0x4c
00430 
00431 // width (get: vehicle types, lanes)
00432 #define VAR_WIDTH 0x4d
00433 
00434 // shape (get: polygons)
00435 #define VAR_SHAPE 0x4e
00436 
00437 // type id (get: vehicles, polygons, pois)
00438 #define VAR_TYPE 0x4f
00439 
00440 // road id (get: vehicles)
00441 #define VAR_ROAD_ID 0x50
00442 
00443 // lane id (get: vehicles)
00444 #define VAR_LANE_ID 0x51
00445 
00446 // lane index (get: vehicles)
00447 #define VAR_LANE_INDEX 0x52
00448 
00449 // route id (get & set: vehicles)
00450 #define VAR_ROUTE_ID 0x53
00451 
00452 // edges (get: routes)
00453 #define VAR_EDGES 0x54
00454 
00455 // filled? (get: polygons)
00456 #define VAR_FILL 0x55
00457 
00458 // position (1D along lane) (get: vehicle)
00459 #define VAR_LANEPOSITION 0x56
00460 
00461 // route (set: vehicles)
00462 #define VAR_ROUTE 0x57
00463 
00464 // travel time information (get&set: vehicle)
00465 #define VAR_EDGE_TRAVELTIME 0x58
00466 
00467 // effort information (get&set: vehicle)
00468 #define VAR_EDGE_EFFORT 0x59
00469 
00470 // last step travel time (get: edge, lane)
00471 #define VAR_CURRENT_TRAVELTIME 0x5a
00472 
00473 // signals state (get/set: vehicle)
00474 #define VAR_SIGNALS 0x5b
00475 
00476 // new lane/position along (set: vehicle)
00477 #define VAR_MOVE_TO 0x5c
00478 
00479 // driver imperfection (set: vehicle)
00480 #define VAR_IMPERFECTION 0x5d
00481 
00482 // speed factor (set: vehicle)
00483 #define VAR_SPEED_FACTOR 0x5e
00484 
00485 // speed deviation (set: vehicle)
00486 #define VAR_SPEED_DEVIATION 0x5f
00487 
00488 // speed without TraCI influence (get: vehicle)
00489 #define VAR_SPEED_WITHOUT_TRACI 0xb1
00490 
00491 // best lanes (get: vehicle)
00492 #define VAR_BEST_LANES 0xb2
00493 
00494 // how speed is set (set: vehicle)
00495 #define VAR_SPEEDSETMODE 0xb3
00496 
00497 
00498 
00499 
00500 // current CO2 emission of a node (get: vehicle, lane, edge)
00501 #define VAR_CO2EMISSION 0x60
00502 
00503 // current CO emission of a node (get: vehicle, lane, edge)
00504 #define VAR_COEMISSION 0x61
00505 
00506 // current HC emission of a node (get: vehicle, lane, edge)
00507 #define VAR_HCEMISSION 0x62
00508 
00509 // current PMx emission of a node (get: vehicle, lane, edge)
00510 #define VAR_PMXEMISSION 0x63
00511 
00512 // current NOx emission of a node (get: vehicle, lane, edge)
00513 #define VAR_NOXEMISSION 0x64
00514 
00515 // current fuel consumption of a node (get: vehicle, lane, edge)
00516 #define VAR_FUELCONSUMPTION 0x65
00517 
00518 // current noise emission of a node (get: vehicle, lane, edge)
00519 #define VAR_NOISEEMISSION 0x66
00520 
00521 
00522 
00523 // current time step (get: simulation)
00524 #define VAR_TIME_STEP 0x70
00525 
00526 // number of loaded vehicles (get: simulation)
00527 #define VAR_LOADED_VEHICLES_NUMBER 0x71
00528 
00529 // loaded vehicle ids (get: simulation)
00530 #define VAR_LOADED_VEHICLES_IDS 0x72
00531 
00532 // number of departed vehicle (get: simulation)
00533 #define VAR_DEPARTED_VEHICLES_NUMBER 0x73
00534 
00535 // departed vehicle ids (get: simulation)
00536 #define VAR_DEPARTED_VEHICLES_IDS 0x74
00537 
00538 // number of vehicles starting to teleport (get: simulation)
00539 #define VAR_TELEPORT_STARTING_VEHICLES_NUMBER 0x75
00540 
00541 // ids of vehicles starting to teleport (get: simulation)
00542 #define VAR_TELEPORT_STARTING_VEHICLES_IDS 0x76
00543 
00544 // number of vehicles ending to teleport (get: simulation)
00545 #define VAR_TELEPORT_ENDING_VEHICLES_NUMBER 0x77
00546 
00547 // ids of vehicles ending to teleport (get: simulation)
00548 #define VAR_TELEPORT_ENDING_VEHICLES_IDS 0x78
00549 
00550 // number of arrived vehicles (get: simulation)
00551 #define VAR_ARRIVED_VEHICLES_NUMBER 0x79
00552 
00553 // ids of arrived vehicles (get: simulation)
00554 #define VAR_ARRIVED_VEHICLES_IDS 0x7a
00555 
00556 // delta t (get: simulation)
00557 #define VAR_DELTA_T 0x7b
00558 
00559 // bounding box (get: simulation)
00560 #define VAR_NET_BOUNDING_BOX 0x7c
00561 
00562 // minimum number of expected vehicles (get: simulation)
00563 #define VAR_MIN_EXPECTED_VEHICLES 0x7d
00564 
00565 
00566 
00567 // add an instance (poi, polygon, vehicle, route)
00568 #define ADD 0x80
00569 
00570 // remove an instance (poi, polygon)
00571 #define REMOVE 0x81
00572 
00573 // convert coordinates
00574 #define POSITION_CONVERSION 0x82
00575 
00576 // distance between points or vehicles
00577 #define DISTANCE_REQUEST 0x83
00578 
00579 
00580 // force rerouting based on travel time (vehicles)
00581 #define CMD_REROUTE_TRAVELTIME 0x90
00582 
00583 // force rerouting based on effort (vehicles)
00584 #define CMD_REROUTE_EFFORT 0x91
00585 
00586 // validates current route (vehicles)
00587 #define VAR_ROUTE_VALID 0x92
00588 
00589 
00590 
00591 // zoom
00592 #define VAR_VIEW_ZOOM 0xa0
00593 
00594 // view position
00595 #define VAR_VIEW_OFFSET 0xa1
00596 
00597 // view schema
00598 #define VAR_VIEW_SCHEMA 0xa2
00599 
00600 // view by boundary
00601 #define VAR_VIEW_BOUNDARY 0xa3
00602 
00603 // screenshot
00604 #define VAR_SCREENSHOT 0xa5
00605 
00606 // track vehicle
00607 #define VAR_TRACK_VEHICLE 0xa6
00608 
00609 
00610 
00611 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines