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