[sumo] 04/18: Imported Upstream version 0.24.0+dfsg1
Anton Gladky
gladk at moszumanska.debian.org
Tue Jan 12 21:37:08 UTC 2016
This is an automated email from the git hooks/post-receive script.
gladk pushed a commit to branch master
in repository sumo.
commit 07c80f8a3a37ce71917059c01b944234d3c8c597
Author: Anton Gladky <gladk at debian.org>
Date: Sat Sep 12 21:38:07 2015 +0200
Imported Upstream version 0.24.0+dfsg1
---
AUTHORS | 6 +
INSTALL | 15 +-
Makefile.am | 11 +-
Makefile.in | 13 +-
README | 8 +-
bin/Makefile.am | 2 +-
bin/Makefile.in | 2 +-
config.guess | 421 +-
config.sub | 277 +-
configure | 28 +-
configure.ac | 6 +-
data/typemap/opendriveNetconvert.typ.xml | 8 +
data/typemap/opendriveNetconvertBicycle.typ.xml | 3 +
.../typemap/opendriveNetconvertPedestrians.typ.xml | 3 +
data/typemap/osmBidiRailNetconvert.typ.xml | 7 +
data/typemap/osmNetconvert.typ.xml | 75 +-
data/typemap/osmNetconvertBicycle.typ.xml | 6 +
data/typemap/osmNetconvertPedestrians.typ.xml | 47 +-
data/typemap/osmNetconvertShips.typ.xml | 6 +-
data/typemap/osmNetconvertUrbanDe.typ.xml | 49 +-
data/typemap/osmPolyconvert.typ.xml | 1 +
data/xsd/activitygenConfiguration.xsd | 2 +-
data/xsd/additional_file.xsd | 1 +
data/xsd/baseTypes.xsd | 36 +
data/xsd/connections_file.xsd | 4 +-
data/xsd/dfrouterConfiguration.xsd | 2 +-
data/xsd/duarouterConfiguration.xsd | 5 +-
data/xsd/edgediff_file.xsd | 1 +
data/xsd/edges_file.xsd | 7 +
data/xsd/jtrrouterConfiguration.xsd | 5 +-
data/xsd/marouterConfiguration.xsd | 5 +-
data/xsd/meandataTypes.xsd | 2 +-
data/xsd/net_file.xsd | 2 +
data/xsd/netconvertConfiguration.xsd | 12 +-
data/xsd/netgenerateConfiguration.xsd | 6 +-
data/xsd/nodes_file.xsd | 17 +-
data/xsd/od2tripsConfiguration.xsd | 5 +-
data/xsd/polyconvertConfiguration.xsd | 3 +-
data/xsd/routeTypes.xsd | 75 +-
data/xsd/sumoConfiguration.xsd | 16 +-
data/xsd/types_file.xsd | 27 +-
depcomp | 531 +-
.../data/pedcrossing.con.xml | 4 +
.../data/pedcrossing.edg.xml | 33 +
.../data/pedcrossing.netccfg | 19 +
.../data/pedcrossing.nod.xml | 33 +
.../data/pedcrossing.rou.xml | 4 +
.../data/pedcrossing.tll.xml | 9 +
.../traci_pedestrian_crossing/data/run.sumocfg | 20 +
.../data/viewsettings.xml | 551 ++
docs/tutorial/traci_pedestrian_crossing/runner.py | 169 +
install-sh | 35 +-
missing | 461 +-
src/Makefile.am | 13 +-
src/Makefile.in | 8 +-
src/activitygen/activitygen_main.cpp | 6 +-
src/activitygen/city/AGCity.cpp | 4 +-
src/activitygen/city/AGPosition.cpp | 6 +-
src/config.h | 11 +-
src/config.h.in | 3 -
src/dfrouter/RODFDetFlowLoader.h | 4 +-
src/dfrouter/RODFDetector.cpp | 4 +-
src/dfrouter/RODFDetectorFlow.cpp | 7 +-
src/dfrouter/RODFNet.cpp | 12 +-
src/dfrouter/dfrouter_main.cpp | 5 +-
src/duarouter/RODUAEdgeBuilder.cpp | 5 +-
src/duarouter/RODUAEdgeBuilder.h | 8 +-
src/duarouter/RODUAFrame.cpp | 7 +-
src/duarouter/duarouter_main.cpp | 54 +-
src/foreign/additional.txt | 12 +-
src/foreign/eulerspiral/BiArc.cpp | 1 +
src/foreign/mersenne/MersenneTwister.h | 28 +
src/foreign/nvwa/debug_new.cpp | 269 +-
src/foreign/nvwa/debug_new.h | 78 +-
src/foreign/nvwa/fast_mutex.h | 134 +-
src/foreign/nvwa/static_assert.h | 28 +-
src/foreign/tcpip/socket.cpp | 28 +-
src/foreign/tcpip/storage.cpp | 7 +-
src/gui/GUIApplicationWindow.cpp | 126 +-
src/gui/GUIApplicationWindow.h | 22 +-
src/gui/GUIEvent_Screenshot.h | 80 +
src/gui/GUILoadThread.cpp | 52 +-
src/gui/GUILoadThread.h | 11 +-
src/gui/GUISUMOViewParent.cpp | 17 +-
src/gui/GUISUMOViewParent.h | 6 +-
src/gui/Makefile.am | 2 +-
src/gui/Makefile.in | 2 +-
src/gui/TraCIServerAPI_GUI.cpp | 28 +-
src/gui/TraCIServerAPI_GUI.h | 9 +-
src/gui/dialogs/GUIDialog_Breakpoints.cpp | 6 +-
src/guinetload/GUITriggerBuilder.cpp | 23 +-
src/guinetload/GUITriggerBuilder.h | 23 +-
src/guisim/GUIBusStop.cpp | 8 +-
src/guisim/GUIBusStop.h | 10 +-
src/guisim/GUIChrgStn.cpp | 242 +
src/guisim/GUIChrgStn.h | 168 +
src/guisim/GUIContainer.cpp | 4 +-
src/guisim/GUIContainer.h | 4 +-
src/guisim/GUIContainerControl.cpp | 4 +-
src/guisim/GUIContainerControl.h | 4 +-
src/guisim/GUIContainerStop.cpp | 8 +-
src/guisim/GUIContainerStop.h | 10 +-
src/guisim/GUIEdge.cpp | 8 +-
src/guisim/GUIEdge.h | 10 +-
src/guisim/GUIJunctionWrapper.cpp | 4 +-
src/guisim/GUILane.cpp | 19 +-
src/guisim/GUILane.h | 7 +-
src/guisim/GUIPerson.cpp | 4 +-
src/guisim/GUIPerson.h | 4 +-
src/guisim/GUIPersonControl.cpp | 6 +-
src/guisim/GUIPersonControl.h | 4 +-
src/guisim/GUIVehicle.cpp | 22 +-
src/guisim/Makefile.am | 1 +
src/guisim/Makefile.in | 6 +-
src/guisim_main.cpp | 14 +-
src/jtrrouter/ROJTRRouter.cpp | 4 +-
src/jtrrouter/ROJTRTurnDefLoader.cpp | 6 +-
src/jtrrouter/jtrrouter_main.cpp | 7 +-
src/marouter/Makefile.am | 3 +-
src/marouter/Makefile.in | 7 +-
src/marouter/ROMAAssignments.cpp | 47 +-
src/marouter/ROMAAssignments.h | 15 +-
src/marouter/ROMAEdge.cpp | 4 +-
src/marouter/ROMAEdge.h | 21 +-
src/marouter/ROMAEdgeBuilder.cpp | 5 +-
src/marouter/ROMAEdgeBuilder.h | 8 +-
src/marouter/ROMAFrame.cpp | 18 +-
src/marouter/ROMAFrame.h | 4 +-
src/marouter/ROMARouteHandler.cpp | 66 +
src/marouter/ROMARouteHandler.h | 94 +
src/marouter/marouter_main.cpp | 147 +-
src/microsim/MSBaseVehicle.cpp | 28 +-
src/microsim/MSBaseVehicle.h | 14 +-
src/microsim/MSBitSetLogic.h | 9 +-
src/microsim/MSCModel_NonInteracting.cpp | 4 +-
src/microsim/MSCModel_NonInteracting.h | 8 +-
src/microsim/MSContainer.cpp | 156 +-
src/microsim/MSContainer.h | 300 +-
src/microsim/MSContainerControl.cpp | 28 +-
src/microsim/MSContainerControl.h | 33 +-
src/microsim/MSEdge.cpp | 81 +-
src/microsim/MSEdge.h | 53 +-
src/microsim/MSFrame.cpp | 24 +-
src/microsim/MSInsertionControl.cpp | 7 +-
src/microsim/MSInternalJunction.cpp | 11 +-
src/microsim/MSJunctionLogic.cpp | 4 +-
src/microsim/MSJunctionLogic.h | 11 +-
src/microsim/MSLane.cpp | 153 +-
src/microsim/MSLane.h | 45 +-
src/microsim/MSLaneChanger.cpp | 84 +-
src/microsim/MSLink.cpp | 8 +-
src/microsim/MSLink.h | 14 +-
src/microsim/MSLogicJunction.h | 11 +-
src/microsim/MSNet.cpp | 97 +-
src/microsim/MSNet.h | 105 +-
src/microsim/MSPersonControl.cpp | 34 +-
src/microsim/MSPersonControl.h | 24 +-
src/microsim/MSRightOfWayJunction.cpp | 14 +-
src/microsim/MSRoute.cpp | 4 +-
src/microsim/MSRouteHandler.cpp | 106 +-
src/microsim/MSRouteHandler.h | 12 +-
src/microsim/MSStateHandler.cpp | 11 +-
src/microsim/MSStoppingPlace.cpp | 114 +
src/microsim/MSStoppingPlace.h | 204 +
src/microsim/MSTransportable.cpp | 157 +
src/microsim/MSTransportable.h | 306 +
src/microsim/MSVehicle.cpp | 204 +-
src/microsim/MSVehicle.h | 51 +-
src/microsim/MSVehicleTransfer.cpp | 5 +-
src/microsim/Makefile.am | 4 +-
src/microsim/Makefile.in | 11 +-
src/microsim/actions/Command_SaveTLCoupledDet.cpp | 4 +-
src/microsim/actions/Command_SaveTLCoupledDet.h | 4 +-
.../actions/Command_SaveTLCoupledLaneDet.cpp | 4 +-
.../actions/Command_SaveTLCoupledLaneDet.h | 4 +-
src/microsim/cfmodels/MSCFModel_IDM.cpp | 10 +-
src/microsim/cfmodels/MSCFModel_IDM.h | 6 +-
src/microsim/cfmodels/MSCFModel_KraussPS.cpp | 7 +-
src/microsim/devices/MSDevice.cpp | 21 +-
src/microsim/devices/MSDevice_Battery.cpp | 667 +++
src/microsim/devices/MSDevice_Battery.h | 379 ++
src/microsim/devices/MSDevice_Container.cpp | 18 +-
src/microsim/devices/MSDevice_Container.h | 8 +-
src/microsim/devices/MSDevice_Example.cpp | 6 +-
src/microsim/devices/MSDevice_Person.cpp | 16 +-
src/microsim/devices/MSDevice_Person.h | 8 +-
src/microsim/devices/MSDevice_Routing.cpp | 21 +-
src/microsim/devices/MSDevice_Routing.h | 5 +-
src/microsim/devices/MSDevice_Vehroutes.cpp | 29 +-
src/microsim/devices/MSDevice_Vehroutes.h | 9 +-
src/microsim/devices/Makefile.am | 1 +
src/microsim/devices/Makefile.in | 6 +-
.../lcmodels/MSAbstractLaneChangeModel.cpp | 58 +-
src/microsim/lcmodels/MSAbstractLaneChangeModel.h | 40 +-
src/microsim/lcmodels/MSLCM_DK2008.cpp | 15 +-
src/microsim/lcmodels/MSLCM_JE2013.cpp | 19 +-
src/microsim/lcmodels/MSLCM_LC2013.cpp | 17 +-
src/microsim/output/MSBatteryExport.cpp | 151 +
src/microsim/output/MSBatteryExport.h | 81 +
src/microsim/output/MSDetectorControl.cpp | 4 +-
src/microsim/output/MSDetectorControl.h | 4 +-
src/microsim/output/MSE3Collector.cpp | 4 +-
src/microsim/output/MSFCDExport.cpp | 25 +-
src/microsim/output/MSFCDExport.h | 5 +-
src/microsim/output/MSMeanData.cpp | 6 +-
src/microsim/output/MSVTypeProbe.cpp | 25 +-
src/microsim/output/MSXMLRawOut.cpp | 10 +-
src/microsim/output/Makefile.am | 1 +
src/microsim/output/Makefile.in | 8 +-
src/microsim/pedestrians/MSPModel.h | 5 +-
.../pedestrians/MSPModel_NonInteracting.cpp | 8 +-
src/microsim/pedestrians/MSPModel_NonInteracting.h | 3 +-
src/microsim/pedestrians/MSPModel_Striping.cpp | 47 +-
src/microsim/pedestrians/MSPModel_Striping.h | 3 +-
src/microsim/pedestrians/MSPerson.cpp | 172 +-
src/microsim/pedestrians/MSPerson.h | 261 +-
.../traffic_lights/MSActuatedTrafficLightLogic.cpp | 4 +-
.../traffic_lights/MSSimpleTrafficLightLogic.cpp | 4 +-
src/microsim/traffic_lights/MSTLLogicControl.cpp | 8 +-
src/microsim/trigger/MSBusStop.cpp | 115 -
src/microsim/trigger/MSBusStop.h | 204 -
src/microsim/trigger/MSCalibrator.cpp | 4 +-
src/microsim/trigger/MSChrgStn.cpp | 133 +
src/microsim/trigger/MSChrgStn.h | 131 +
src/microsim/trigger/MSContainerStop.cpp | 115 -
src/microsim/trigger/MSContainerStop.h | 205 -
src/microsim/trigger/MSTriggeredRerouter.cpp | 13 +-
src/microsim/trigger/Makefile.am | 5 +-
src/microsim/trigger/Makefile.in | 14 +-
src/netbuild/NBAlgorithms.cpp | 75 +-
src/netbuild/NBAlgorithms.h | 14 +-
src/netbuild/NBAlgorithms_Ramps.cpp | 41 +-
src/netbuild/NBAlgorithms_Ramps.h | 14 +-
src/netbuild/NBConnection.cpp | 6 +-
src/netbuild/NBContHelper.cpp | 20 +-
src/netbuild/NBDistrict.cpp | 9 +-
src/netbuild/NBDistrict.h | 5 +-
src/netbuild/NBEdge.cpp | 416 +-
src/netbuild/NBEdge.h | 74 +-
src/netbuild/NBEdgeCont.cpp | 65 +-
src/netbuild/NBEdgeCont.h | 27 +-
src/netbuild/NBFrame.cpp | 24 +-
src/netbuild/NBHeightMapper.cpp | 11 +-
src/netbuild/NBLoadedSUMOTLDef.cpp | 29 +-
src/netbuild/NBLoadedSUMOTLDef.h | 6 +-
src/netbuild/NBLoadedTLDef.cpp | 10 +-
src/netbuild/NBLoadedTLDef.h | 10 +-
src/netbuild/NBNetBuilder.cpp | 77 +-
src/netbuild/NBNetBuilder.h | 13 +-
src/netbuild/NBNode.cpp | 360 +-
src/netbuild/NBNode.h | 61 +-
src/netbuild/NBNodeCont.cpp | 241 +-
src/netbuild/NBNodeCont.h | 16 +-
src/netbuild/NBNodeShapeComputer.cpp | 25 +-
src/netbuild/NBNodeShapeComputer.h | 8 +-
src/netbuild/NBOwnTLDef.cpp | 11 +-
src/netbuild/NBRequest.cpp | 78 +-
src/netbuild/NBRequest.h | 17 +-
src/netbuild/NBTypeCont.cpp | 121 +-
src/netbuild/NBTypeCont.h | 100 +-
src/netconvert_main.cpp | 5 +-
src/netgen/NGFrame.cpp | 24 +-
src/netgen/netgen_main.cpp | 5 +-
src/netimport/Makefile.am | 4 +
src/netimport/Makefile.in | 17 +-
src/netimport/NIFrame.cpp | 26 +-
src/netimport/NIImporter_ArcView.cpp | 7 +-
src/netimport/NIImporter_OpenDrive.cpp | 16 +-
src/netimport/NIImporter_OpenStreetMap.cpp | 234 +-
src/netimport/NIImporter_OpenStreetMap.h | 75 +-
src/netimport/NIImporter_SUMO.cpp | 15 +-
src/netimport/NIImporter_SUMO.h | 4 +-
src/netimport/NIImporter_VISUM.cpp | 39 +-
src/netimport/NIImporter_VISUM.h | 10 +-
src/netimport/NILoader.cpp | 37 +-
src/netimport/NILoader.h | 6 +-
src/netimport/NIXMLConnectionsHandler.cpp | 30 +-
src/netimport/NIXMLEdgesHandler.cpp | 46 +-
src/netimport/NIXMLEdgesHandler.h | 14 +-
src/netimport/NIXMLNodesHandler.cpp | 47 +-
src/netimport/NIXMLNodesHandler.h | 12 +-
src/netimport/NIXMLTrafficLightsHandler.cpp | 10 +-
src/netimport/NIXMLTypesHandler.cpp | 83 +-
src/netimport/NIXMLTypesHandler.h | 5 +-
src/netimport/typemap.h | 52 +
src/netimport/vissim/NIImporter_Vissim.cpp | 634 +-
src/netimport/vissim/NIImporter_Vissim.h | 485 +-
src/netimport/vissim/tempstructs/Makefile.am | 1 +
src/netimport/vissim/tempstructs/Makefile.in | 4 +-
.../vissim/tempstructs/NIVissimConflictArea.cpp | 165 +
.../vissim/tempstructs/NIVissimConflictArea.h | 141 +
src/netimport/vissim/tempstructs/NIVissimEdge.cpp | 5 +-
src/netimport/vissim/tempstructs/NIVissimEdge.h | 4 +-
src/netload/NLDetectorBuilder.cpp | 12 +-
src/netload/NLDetectorBuilder.h | 14 +-
src/netload/NLHandler.cpp | 28 +-
src/netload/NLHandler.h | 5 +-
src/netload/NLJunctionControlBuilder.cpp | 4 +-
src/netload/NLJunctionControlBuilder.h | 4 +-
src/netload/NLTriggerBuilder.cpp | 57 +-
src/netload/NLTriggerBuilder.h | 33 +-
src/netwrite/NWWriter_SUMO.cpp | 59 +-
src/netwrite/NWWriter_SUMO.h | 8 +-
src/netwrite/NWWriter_XML.cpp | 30 +-
src/netwrite/NWWriter_XML.h | 8 +-
src/od/ODCell.h | 11 +-
src/od/ODDistrictCont.cpp | 27 +-
src/od/ODDistrictCont.h | 6 +-
src/od/ODMatrix.cpp | 67 +-
src/od/ODMatrix.h | 33 +-
src/od2trips_main.cpp | 29 +-
src/polyconvert/PCLoaderArcView.cpp | 7 +-
src/polyconvert/PCLoaderOSM.cpp | 157 +-
src/polyconvert/PCLoaderOSM.h | 125 +-
src/polyconvert/PCLoaderVisum.cpp | 34 +-
src/polyconvert/PCNetProjectionLoader.cpp | 5 +-
src/polyconvert/PCPolyContainer.cpp | 6 +-
src/polyconvert/polyconvert_main.cpp | 10 +-
src/router/Makefile.am | 2 +-
src/router/Makefile.in | 2 +-
src/router/ROEdge.cpp | 68 +-
src/router/ROEdge.h | 89 +-
src/router/ROFrame.cpp | 13 +-
src/router/ROHelper.cpp | 38 +-
src/router/ROLoader.cpp | 19 +-
src/router/ROLoader.h | 6 +-
src/router/RONet.cpp | 139 +-
src/router/RONet.h | 74 +-
src/router/RONetHandler.cpp | 42 +-
src/router/RONetHandler.h | 5 +-
src/router/RONode.h | 4 +-
src/router/RORoute.cpp | 6 +-
src/router/RORouteAggregator.h | 197 -
src/router/RORouteDef.cpp | 50 +-
src/router/RORouteHandler.cpp | 6 +-
src/router/ROVehicle.h | 4 +-
src/sumo_main.cpp | 5 +-
src/tools/TrajectoriesHandler.cpp | 6 +-
src/tools/emissionsDrivingCycle_main.cpp | 5 +-
src/tools/emissionsMap_main.cpp | 5 +-
src/traci-server/TraCIConstants.h | 36 +-
src/traci-server/TraCIServer.cpp | 25 +-
src/traci-server/TraCIServer.h | 8 +-
src/traci-server/TraCIServerAPI_ArealDetector.cpp | 30 +-
src/traci-server/TraCIServerAPI_Edge.cpp | 26 +-
src/traci-server/TraCIServerAPI_Person.cpp | 11 +-
src/traci-server/TraCIServerAPI_Simulation.cpp | 10 +-
src/traci-server/TraCIServerAPI_TLS.cpp | 10 +-
src/traci-server/TraCIServerAPI_Vehicle.cpp | 369 +-
src/traci-server/TraCIServerAPI_Vehicle.h | 5 +-
src/traci_testclient/TraCITestClient.cpp | 6 +-
src/traci_testclient/TraCITestClient.h | 6 +-
src/utils/common/RandHelper.h | 12 +-
src/utils/common/SUMOTime.h | 12 +-
src/utils/common/SUMOVehicleClass.cpp | 53 +-
src/utils/common/SUMOVehicleClass.h | 30 +-
src/utils/common/StdDefs.cpp | 3 +-
src/utils/common/StdDefs.h | 4 +-
src/utils/common/StringUtils.cpp | 72 +-
src/utils/common/StringUtils.h | 10 +-
src/utils/common/SysUtils.cpp | 8 +-
src/utils/common/SystemFrame.cpp | 4 +-
src/utils/common/ToString.h | 8 +-
src/utils/common/TplConvert.h | 57 +-
src/utils/foxtools/FXWorkerThread.h | 13 +-
src/utils/geom/PositionVector.cpp | 26 +-
src/utils/geom/PositionVector.h | 8 +-
src/utils/gui/div/GLHelper.cpp | 4 +-
src/utils/gui/div/GUIParameterTableWindow.cpp | 10 +-
src/utils/gui/div/GUIParameterTableWindow.h | 12 +-
src/utils/gui/events/GUIEvent.h | 6 +-
src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp | 6 +-
src/utils/gui/globjects/GUIPointOfInterest.cpp | 10 +-
src/utils/gui/globjects/GUIPolygon.cpp | 12 +-
.../gui/settings/GUIVisualizationSettings.cpp | 20 +-
src/utils/gui/settings/GUIVisualizationSettings.h | 6 +-
src/utils/gui/windows/GUIAppEnum.h | 4 +-
.../gui/windows/GUIDanielPerspectiveChanger.cpp | 91 +-
.../gui/windows/GUIDanielPerspectiveChanger.h | 3 +-
src/utils/gui/windows/GUIDialog_ViewSettings.cpp | 10 +-
src/utils/gui/windows/GUIDialog_ViewSettings.h | 4 +-
src/utils/gui/windows/GUIMainWindow.h | 16 +-
src/utils/gui/windows/GUIPerspectiveChanger.cpp | 11 +-
src/utils/gui/windows/GUIPerspectiveChanger.h | 4 +-
src/utils/gui/windows/GUISUMOAbstractView.cpp | 39 +-
src/utils/gui/windows/GUISUMOAbstractView.h | 10 +-
src/utils/iodevices/OutputDevice_File.cpp | 6 +-
src/utils/iodevices/OutputDevice_String.cpp | 4 +-
src/utils/options/Option.cpp | 9 +-
src/utils/options/Option.h | 13 +-
src/utils/options/OptionsCont.cpp | 8 +-
src/utils/options/OptionsIO.cpp | 19 +-
src/utils/options/OptionsIO.h | 22 +-
src/utils/traci/TraCIAPI.cpp | 26 +-
src/utils/traci/TraCIAPI.h | 6 +-
src/utils/vehicle/AStarRouter.h | 44 +-
src/utils/vehicle/BulkStarRouter.h | 383 --
src/utils/vehicle/CHRouter.h | 4 +-
src/utils/vehicle/CHRouterWrapper.h | 6 +-
src/utils/vehicle/DijkstraRouterEffort.h | 35 +-
src/utils/vehicle/DijkstraRouterTT.h | 53 +-
src/utils/vehicle/Makefile.am | 1 -
src/utils/vehicle/Makefile.in | 1 -
src/utils/vehicle/PedestrianRouter.h | 12 +-
src/utils/vehicle/SUMOAbstractRouter.h | 27 +-
src/utils/vehicle/SUMOVTypeParameter.cpp | 4 +-
src/utils/vehicle/SUMOVTypeParameter.h | 3 +-
src/utils/vehicle/SUMOVehicle.h | 24 +-
src/utils/vehicle/SUMOVehicleParameter.cpp | 7 +-
src/utils/vehicle/SUMOVehicleParameter.h | 11 +-
src/utils/xml/SUMOSAXAttributes.cpp | 8 +-
src/utils/xml/SUMOSAXAttributes.h | 4 +-
src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp | 4 +-
src/utils/xml/SUMOSAXAttributesImpl_Binary.h | 4 +-
src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp | 4 +-
src/utils/xml/SUMOSAXAttributesImpl_Xerces.h | 4 +-
src/utils/xml/SUMOVehicleParserHelper.cpp | 23 +-
src/utils/xml/SUMOXMLDefinitions.cpp | 30 +-
src/utils/xml/SUMOXMLDefinitions.h | 21 +-
src/version.h | 1 +
src/windows_config.h | 7 +-
tools/assign/duaIterate.py | 6 +-
tools/build/buildHTMLDocs.py | 5 +-
tools/build/dailyBuildMSVC.py | 44 +-
tools/build/dailyUpdateMakeGCC.sh | 2 +-
tools/build/typemap.py | 49 +
tools/build/wix.py | 6 +-
.../+traci/+areal/getContextSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+areal/getIDCount.m | 10 -
.../TraCI4Matlab/+traci/+areal/getIDList.m | 12 -
.../+traci/+areal/getJamLengthMeters.m | 13 -
.../+traci/+areal/getJamLengthVehicle.m | 13 -
.../+traci/+areal/getLastStepMeanSpeed.m | 12 -
.../+traci/+areal/getLastStepOccupancy.m | 12 -
.../+traci/+areal/getSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+areal/getUniversal.m | 25 -
.../TraCI4Matlab/+traci/+areal/subscribe.m | 43 -
.../TraCI4Matlab/+traci/+areal/subscribeContext.m | 51 -
.../TraCI4Matlab/+traci/+edge/adaptTraveltime.m | 17 -
.../+traci/+edge/getAdaptedTraveltime.m | 19 -
.../TraCI4Matlab/+traci/+edge/getCO2Emission.m | 12 -
.../TraCI4Matlab/+traci/+edge/getCOEmission.m | 12 -
.../+traci/+edge/getContextSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+edge/getEffort.m | 19 -
.../TraCI4Matlab/+traci/+edge/getFuelConsumption.m | 12 -
.../TraCI4Matlab/+traci/+edge/getHCEmission.m | 12 -
.../TraCI4Matlab/+traci/+edge/getIDCount.m | 10 -
.../TraCI4Matlab/+traci/+edge/getIDList.m | 12 -
.../+traci/+edge/getLastStepHaltingNumber.m | 13 -
.../TraCI4Matlab/+traci/+edge/getLastStepLength.m | 12 -
.../+traci/+edge/getLastStepMeanSpeed.m | 12 -
.../+traci/+edge/getLastStepOccupancy.m | 12 -
.../+traci/+edge/getLastStepVehicleIDs.m | 13 -
.../+traci/+edge/getLastStepVehicleNumber.m | 13 -
.../TraCI4Matlab/+traci/+edge/getNOxEmission.m | 12 -
.../TraCI4Matlab/+traci/+edge/getNoiseEmission.m | 12 -
.../TraCI4Matlab/+traci/+edge/getPmxEmission.m | 12 -
.../+traci/+edge/getSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+edge/getTraveltime.m | 12 -
.../TraCI4Matlab/+traci/+edge/getUniversal.m | 25 -
.../TraCI4Matlab/+traci/+edge/setEffort.m | 17 -
.../TraCI4Matlab/+traci/+edge/setMaxSpeed.m | 12 -
.../TraCI4Matlab/+traci/+edge/subscribe.m | 43 -
.../TraCI4Matlab/+traci/+edge/subscribeContext.m | 51 -
.../TraCI4Matlab/+traci/+gui/getBoundary.m | 16 -
.../+traci/+gui/getContextSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+gui/getIDList.m | 12 -
.../TraCI4Matlab/+traci/+gui/getOffset.m | 16 -
.../TraCI4Matlab/+traci/+gui/getSchema.m | 16 -
.../+traci/+gui/getSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+gui/getUniversal.m | 25 -
.../contributed/TraCI4Matlab/+traci/+gui/getZoom.m | 16 -
.../TraCI4Matlab/+traci/+gui/screenshot.m | 14 -
.../TraCI4Matlab/+traci/+gui/setBoundary.m | 16 -
.../TraCI4Matlab/+traci/+gui/setOffset.m | 15 -
.../TraCI4Matlab/+traci/+gui/setSchema.m | 12 -
.../contributed/TraCI4Matlab/+traci/+gui/setZoom.m | 11 -
.../TraCI4Matlab/+traci/+gui/subscribe.m | 37 -
.../TraCI4Matlab/+traci/+gui/subscribeContext.m | 46 -
.../TraCI4Matlab/+traci/+gui/trackVehicle.m | 12 -
.../+inductionloop/getContextSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+inductionloop/getIDList.m | 13 -
.../TraCI4Matlab/+traci/+inductionloop/getLaneID.m | 11 -
.../+traci/+inductionloop/getLastStepMeanLength.m | 12 -
.../+traci/+inductionloop/getLastStepMeanSpeed.m | 13 -
.../+traci/+inductionloop/getLastStepOccupancy.m | 12 -
.../+traci/+inductionloop/getLastStepVehicleIDs.m | 13 -
.../+inductionloop/getLastStepVehicleNumber.m | 13 -
.../+traci/+inductionloop/getPosition.m | 12 -
.../+traci/+inductionloop/getSubscriptionResults.m | 26 -
.../+traci/+inductionloop/getTimeSinceDetection.m | 12 -
.../+traci/+inductionloop/getUniversal.m | 25 -
.../+traci/+inductionloop/getVehicleData.m | 12 -
.../+traci/+inductionloop/readVehicleData.m | 24 -
.../TraCI4Matlab/+traci/+inductionloop/subscribe.m | 38 -
.../+traci/+inductionloop/subscribeContext.m | 46 -
.../+junction/getContextSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+junction/getIDList.m | 12 -
.../TraCI4Matlab/+traci/+junction/getPosition.m | 12 -
.../+traci/+junction/getSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+junction/getUniversal.m | 25 -
.../TraCI4Matlab/+traci/+junction/subscribe.m | 38 -
.../+traci/+junction/subscribeContext.m | 46 -
.../TraCI4Matlab/+traci/+lane/getAllowed.m | 13 -
.../TraCI4Matlab/+traci/+lane/getCO2Emission.m | 12 -
.../TraCI4Matlab/+traci/+lane/getCOEmission.m | 12 -
.../+traci/+lane/getContextSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+lane/getDisallowed.m | 12 -
.../TraCI4Matlab/+traci/+lane/getEdgeID.m | 12 -
.../TraCI4Matlab/+traci/+lane/getFuelConsumption.m | 12 -
.../TraCI4Matlab/+traci/+lane/getHCEmission.m | 12 -
.../TraCI4Matlab/+traci/+lane/getIDList.m | 12 -
.../+traci/+lane/getLastStepHaltingNumber.m | 13 -
.../TraCI4Matlab/+traci/+lane/getLastStepLength.m | 12 -
.../+traci/+lane/getLastStepMeanSpeed.m | 12 -
.../+traci/+lane/getLastStepOccupancy.m | 12 -
.../+traci/+lane/getLastStepVehicleIDs.m | 13 -
.../+traci/+lane/getLastStepVehicleNumber.m | 13 -
.../TraCI4Matlab/+traci/+lane/getLength.m | 11 -
.../TraCI4Matlab/+traci/+lane/getLinkNumber.m | 12 -
.../TraCI4Matlab/+traci/+lane/getLinks.m | 12 -
.../TraCI4Matlab/+traci/+lane/getMaxSpeed.m | 12 -
.../TraCI4Matlab/+traci/+lane/getNOxEmission.m | 12 -
.../TraCI4Matlab/+traci/+lane/getNoiseEmission.m | 12 -
.../TraCI4Matlab/+traci/+lane/getPMxEmission.m | 12 -
.../TraCI4Matlab/+traci/+lane/getShape.m | 12 -
.../+traci/+lane/getSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+lane/getTraveltime.m | 12 -
.../TraCI4Matlab/+traci/+lane/getUniversal.m | 25 -
.../TraCI4Matlab/+traci/+lane/getWidth.m | 11 -
.../TraCI4Matlab/+traci/+lane/readLinks.m | 30 -
.../TraCI4Matlab/+traci/+lane/setAllowed.m | 22 -
.../TraCI4Matlab/+traci/+lane/setDisallowed.m | 21 -
.../TraCI4Matlab/+traci/+lane/setLength.m | 11 -
.../TraCI4Matlab/+traci/+lane/setMaxSpeed.m | 12 -
.../TraCI4Matlab/+traci/+lane/subscribe.m | 38 -
.../TraCI4Matlab/+traci/+lane/subscribeContext.m | 47 -
.../getContextSubscriptionResults.m | 27 -
.../+traci/+multientryexit/getIDList.m | 12 -
.../+multientryexit/getLastStepHaltingNumber.m | 14 -
.../+traci/+multientryexit/getLastStepMeanSpeed.m | 13 -
.../+traci/+multientryexit/getLastStepVehicleIDs.m | 13 -
.../+multientryexit/getLastStepVehicleNumber.m | 13 -
.../+multientryexit/getSubscriptionResults.m | 27 -
.../+traci/+multientryexit/getUniversal.m | 25 -
.../+traci/+multientryexit/subscribe.m | 39 -
.../+traci/+multientryexit/subscribeContext.m | 48 -
tools/contributed/TraCI4Matlab/+traci/+poi/add.m | 36 -
.../TraCI4Matlab/+traci/+poi/getColor.m | 11 -
.../+traci/+poi/getContextSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+poi/getIDList.m | 12 -
.../TraCI4Matlab/+traci/+poi/getPosition.m | 12 -
.../+traci/+poi/getSubscriptionResults.m | 26 -
.../contributed/TraCI4Matlab/+traci/+poi/getType.m | 11 -
.../TraCI4Matlab/+traci/+poi/getUniversal.m | 25 -
.../contributed/TraCI4Matlab/+traci/+poi/remove.m | 18 -
.../TraCI4Matlab/+traci/+poi/setColor.m | 16 -
.../TraCI4Matlab/+traci/+poi/setPosition.m | 14 -
.../contributed/TraCI4Matlab/+traci/+poi/setType.m | 15 -
.../TraCI4Matlab/+traci/+poi/subscribe.m | 38 -
.../TraCI4Matlab/+traci/+poi/subscribeContext.m | 46 -
.../contributed/TraCI4Matlab/+traci/+polygon/add.m | 50 -
.../TraCI4Matlab/+traci/+polygon/getColor.m | 11 -
.../+polygon/getContextSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+polygon/getIDList.m | 12 -
.../TraCI4Matlab/+traci/+polygon/getShape.m | 14 -
.../+traci/+polygon/getSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+polygon/getType.m | 11 -
.../TraCI4Matlab/+traci/+polygon/getUniversal.m | 25 -
.../TraCI4Matlab/+traci/+polygon/remove.m | 18 -
.../TraCI4Matlab/+traci/+polygon/setColor.m | 16 -
.../TraCI4Matlab/+traci/+polygon/setShape.m | 20 -
.../TraCI4Matlab/+traci/+polygon/setType.m | 15 -
.../TraCI4Matlab/+traci/+polygon/subscribe.m | 38 -
.../+traci/+polygon/subscribeContext.m | 46 -
tools/contributed/TraCI4Matlab/+traci/+route/add.m | 22 -
.../+traci/+route/getContextSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+route/getEdges.m | 13 -
.../TraCI4Matlab/+traci/+route/getIDList.m | 12 -
.../+traci/+route/getSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+route/getUniversal.m | 25 -
.../TraCI4Matlab/+traci/+route/subscribe.m | 38 -
.../TraCI4Matlab/+traci/+route/subscribeContext.m | 45 -
.../TraCI4Matlab/+traci/+simulation/convert2D.m | 38 -
.../TraCI4Matlab/+traci/+simulation/convertGeo.m | 38 -
.../TraCI4Matlab/+traci/+simulation/convertRoad.m | 38 -
.../+traci/+simulation/getArrivedIDList.m | 13 -
.../+traci/+simulation/getArrivedNumber.m | 13 -
.../+traci/+simulation/getCurrentTime.m | 12 -
.../TraCI4Matlab/+traci/+simulation/getDeltaT.m | 11 -
.../+traci/+simulation/getDepartedIDList.m | 13 -
.../+traci/+simulation/getDepartedNumber.m | 12 -
.../+traci/+simulation/getDistance2D.m | 46 -
.../+traci/+simulation/getDistanceRoad.m | 36 -
.../+traci/+simulation/getEndingTeleportIDList.m | 13 -
.../+traci/+simulation/getEndingTeleportNumber.m | 12 -
.../+traci/+simulation/getLoadedIDList.m | 12 -
.../+traci/+simulation/getLoadedNumber.m | 12 -
.../+traci/+simulation/getMinExpectedNumber.m | 17 -
.../+traci/+simulation/getNetBoundary.m | 13 -
.../+traci/+simulation/getStartingTeleportIDList.m | 13 -
.../+traci/+simulation/getStartingTeleportNumber.m | 12 -
.../+traci/+simulation/getSubscriptionResults.m | 19 -
.../TraCI4Matlab/+traci/+simulation/getUniversal.m | 25 -
.../TraCI4Matlab/+traci/+simulation/subscribe.m | 36 -
.../TraCI4Matlab/+traci/+trafficlights/Logic.m | 43 -
.../TraCI4Matlab/+traci/+trafficlights/Phase.m | 38 -
.../getCompleteRedYellowGreenDefinition.m | 14 -
.../+trafficlights/getContextSubscriptionResults.m | 26 -
.../+traci/+trafficlights/getControlledLanes.m | 13 -
.../+traci/+trafficlights/getControlledLinks.m | 14 -
.../TraCI4Matlab/+traci/+trafficlights/getIDList.m | 12 -
.../+traci/+trafficlights/getNextSwitch.m | 12 -
.../TraCI4Matlab/+traci/+trafficlights/getPhase.m | 12 -
.../+traci/+trafficlights/getProgram.m | 11 -
.../+traci/+trafficlights/getRedYellowGreenState.m | 14 -
.../+traci/+trafficlights/getSubscriptionResults.m | 27 -
.../+traci/+trafficlights/getUniversal.m | 25 -
.../TraCI4Matlab/+traci/+trafficlights/readLinks.m | 22 -
.../+traci/+trafficlights/readLogics.m | 38 -
.../setCompleteRedYellowGreenDefinition.m | 44 -
.../TraCI4Matlab/+traci/+trafficlights/setPhase.m | 14 -
.../+traci/+trafficlights/setPhaseDuration.m | 14 -
.../+traci/+trafficlights/setProgram.m | 12 -
.../+traci/+trafficlights/setRedYellowGreenState.m | 14 -
.../TraCI4Matlab/+traci/+trafficlights/subscribe.m | 38 -
.../+traci/+trafficlights/subscribeContext.m | 46 -
.../contributed/TraCI4Matlab/+traci/+vehicle/add.m | 57 -
.../TraCI4Matlab/+traci/+vehicle/changeLane.m | 20 -
.../TraCI4Matlab/+traci/+vehicle/changeTarget.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getAccel.m | 12 -
.../+traci/+vehicle/getAdaptedTraveltime.m | 21 -
.../TraCI4Matlab/+traci/+vehicle/getAngle.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getBestLanes.m | 14 -
.../TraCI4Matlab/+traci/+vehicle/getCO2Emission.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getCOEmission.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getColor.m | 11 -
.../+vehicle/getContextSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+vehicle/getDecel.m | 12 -
.../+traci/+vehicle/getDrivingDistance.m | 24 -
.../+traci/+vehicle/getDrivingDistance2D.m | 19 -
.../TraCI4Matlab/+traci/+vehicle/getEffort.m | 21 -
.../+traci/+vehicle/getEmissionClass.m | 12 -
.../+traci/+vehicle/getFuelConsumption.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getHCEmission.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getIDList.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getImperfection.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getLaneID.m | 15 -
.../TraCI4Matlab/+traci/+vehicle/getLaneIndex.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getLanePosition.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getLeader.m | 30 -
.../TraCI4Matlab/+traci/+vehicle/getLength.m | 11 -
.../TraCI4Matlab/+traci/+vehicle/getMaxSpeed.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getMinGap.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getNOxEmission.m | 12 -
.../+traci/+vehicle/getNoiseEmission.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getPMxEmission.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getPosition.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getRoadID.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getRoute.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getRouteID.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getShapeClass.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getSignals.m | 30 -
.../TraCI4Matlab/+traci/+vehicle/getSpeed.m | 12 -
.../+traci/+vehicle/getSpeedDeviation.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getSpeedFactor.m | 12 -
.../+traci/+vehicle/getSpeedWithoutTraCI.m | 8 -
.../+traci/+vehicle/getSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+vehicle/getTau.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getTypeID.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getUniversal.m | 25 -
.../TraCI4Matlab/+traci/+vehicle/getVehicleClass.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/getWidth.m | 11 -
.../TraCI4Matlab/+traci/+vehicle/isRouteValid.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/moveTo.m | 21 -
.../TraCI4Matlab/+traci/+vehicle/moveToVTD.m | 22 -
.../TraCI4Matlab/+traci/+vehicle/readBestLanes.m | 31 -
.../TraCI4Matlab/+traci/+vehicle/remove.m | 17 -
.../TraCI4Matlab/+traci/+vehicle/rerouteEffort.m | 19 -
.../+traci/+vehicle/rerouteTraveltime.m | 19 -
.../TraCI4Matlab/+traci/+vehicle/setAccel.m | 12 -
.../+traci/+vehicle/setAdaptedTraveltime.m | 24 -
.../TraCI4Matlab/+traci/+vehicle/setColor.m | 16 -
.../TraCI4Matlab/+traci/+vehicle/setDecel.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/setEffort.m | 24 -
.../+traci/+vehicle/setEmissionClass.m | 11 -
.../TraCI4Matlab/+traci/+vehicle/setImperfection.m | 13 -
.../+traci/+vehicle/setLaneChangeMode.m | 18 -
.../TraCI4Matlab/+traci/+vehicle/setLength.m | 11 -
.../TraCI4Matlab/+traci/+vehicle/setMaxSpeed.m | 11 -
.../TraCI4Matlab/+traci/+vehicle/setMinGap.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/setRoute.m | 28 -
.../TraCI4Matlab/+traci/+vehicle/setRouteID.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/setShapeClass.m | 11 -
.../TraCI4Matlab/+traci/+vehicle/setSignals.m | 29 -
.../TraCI4Matlab/+traci/+vehicle/setSpeed.m | 12 -
.../+traci/+vehicle/setSpeedDeviation.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/setSpeedFactor.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/setSpeedMode.m | 19 -
.../TraCI4Matlab/+traci/+vehicle/setStop.m | 38 -
.../TraCI4Matlab/+traci/+vehicle/setTau.m | 11 -
.../TraCI4Matlab/+traci/+vehicle/setVehicleClass.m | 12 -
.../TraCI4Matlab/+traci/+vehicle/setWidth.m | 11 -
.../TraCI4Matlab/+traci/+vehicle/slowDown.m | 19 -
.../TraCI4Matlab/+traci/+vehicle/subscribe.m | 38 -
.../+traci/+vehicle/subscribeContext.m | 46 -
.../TraCI4Matlab/+traci/+vehicletype/getAccel.m | 12 -
.../TraCI4Matlab/+traci/+vehicletype/getColor.m | 11 -
.../+vehicletype/getContextSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+vehicletype/getDecel.m | 12 -
.../+traci/+vehicletype/getEmissionClass.m | 12 -
.../TraCI4Matlab/+traci/+vehicletype/getIDList.m | 12 -
.../+traci/+vehicletype/getImperfection.m | 12 -
.../TraCI4Matlab/+traci/+vehicletype/getLength.m | 12 -
.../TraCI4Matlab/+traci/+vehicletype/getMaxSpeed.m | 12 -
.../TraCI4Matlab/+traci/+vehicletype/getMinGap.m | 12 -
.../+traci/+vehicletype/getShapeClass.m | 12 -
.../+traci/+vehicletype/getSpeedDeviation.m | 12 -
.../+traci/+vehicletype/getSpeedFactor.m | 12 -
.../+traci/+vehicletype/getSubscriptionResults.m | 26 -
.../TraCI4Matlab/+traci/+vehicletype/getTau.m | 12 -
.../+traci/+vehicletype/getUniversal.m | 25 -
.../+traci/+vehicletype/getVehicleClass.m | 12 -
.../TraCI4Matlab/+traci/+vehicletype/getWidth.m | 12 -
.../TraCI4Matlab/+traci/+vehicletype/setAccel.m | 12 -
.../TraCI4Matlab/+traci/+vehicletype/setColor.m | 16 -
.../TraCI4Matlab/+traci/+vehicletype/setDecel.m | 12 -
.../+traci/+vehicletype/setEmissionClass.m | 12 -
.../+traci/+vehicletype/setImperfection.m | 13 -
.../TraCI4Matlab/+traci/+vehicletype/setLength.m | 12 -
.../TraCI4Matlab/+traci/+vehicletype/setMaxSpeed.m | 12 -
.../TraCI4Matlab/+traci/+vehicletype/setMinGap.m | 12 -
.../+traci/+vehicletype/setShapeClass.m | 12 -
.../+traci/+vehicletype/setSpeedDeviation.m | 12 -
.../+traci/+vehicletype/setSpeedFactor.m | 12 -
.../TraCI4Matlab/+traci/+vehicletype/setTau.m | 12 -
.../+traci/+vehicletype/setVehicleClass.m | 11 -
.../TraCI4Matlab/+traci/+vehicletype/setWidth.m | 11 -
.../TraCI4Matlab/+traci/+vehicletype/subscribe.m | 38 -
.../+traci/+vehicletype/subscribeContext.m | 46 -
tools/contributed/TraCI4Matlab/+traci/Message.m | 13 -
.../TraCI4Matlab/+traci/RETURN_VALUE_FUNC.m | 222 -
tools/contributed/TraCI4Matlab/+traci/Socket.m | 35 -
tools/contributed/TraCI4Matlab/+traci/Storage.m | 70 -
.../TraCI4Matlab/+traci/SubscriptionResults.m | 87 -
.../contributed/TraCI4Matlab/+traci/beginMessage.m | 29 -
.../contributed/TraCI4Matlab/+traci/checkResult.m | 33 -
tools/contributed/TraCI4Matlab/+traci/close.m | 28 -
tools/contributed/TraCI4Matlab/+traci/constants.m | 676 ---
tools/contributed/TraCI4Matlab/+traci/getVersion.m | 33 -
tools/contributed/TraCI4Matlab/+traci/init.m | 70 -
tools/contributed/TraCI4Matlab/+traci/packInt32.m | 14 -
tools/contributed/TraCI4Matlab/+traci/packInt64.m | 10 -
.../TraCI4Matlab/+traci/readSubscription.m | 136 -
tools/contributed/TraCI4Matlab/+traci/recvExact.m | 52 -
.../contributed/TraCI4Matlab/+traci/sendByteCmd.m | 13 -
.../TraCI4Matlab/+traci/sendDoubleCmd.m | 14 -
tools/contributed/TraCI4Matlab/+traci/sendExact.m | 62 -
tools/contributed/TraCI4Matlab/+traci/sendIntCmd.m | 14 -
.../TraCI4Matlab/+traci/sendReadOneStringCmd.m | 11 -
.../TraCI4Matlab/+traci/sendStringCmd.m | 18 -
.../TraCI4Matlab/+traci/simulationStep.m | 58 -
tools/contributed/TraCI4Matlab/+traci/subscribe.m | 36 -
.../TraCI4Matlab/+traci/subscribeContext.m | 51 -
.../TraCI4Matlab/+traci/switchConnection.m | 13 -
tools/contributed/TraCI4Matlab/+traci/time2steps.m | 10 -
.../contributed/TraCI4Matlab/examples/traci_test.m | 19 -
.../TraCI4Matlab/examples/traci_test2.m | 608 --
.../sumolib4matlab/+sumolib/+demand/BusStop.m | 43 +
.../sumolib4matlab/+sumolib/+demand/Flow.m | 109 +
.../sumolib4matlab/+sumolib/+demand/Stop.m | 69 +
.../+sumolib/+demand/TurnProbability.m | 44 +
.../sumolib4matlab/+sumolib/+demand/VehicleType.m | 104 +
.../+sumolib/+demand/generateDemand.m | 259 +
.../inter_palmas/generateDemand_inter_palmas.m | 67 +
.../inter_palmas/inter_palmas_notls.net.xml | 326 +
.../edu/unalmed/gaunal/sumolib/net/Connection.java | 40 +
.../co/edu/unalmed/gaunal/sumolib/net/Edge.java | 139 +
.../co/edu/unalmed/gaunal/sumolib/net/Lane.java | 61 +
.../src/co/edu/unalmed/gaunal/sumolib/net/Net.java | 225 +
.../edu/unalmed/gaunal/sumolib/net/NetReader.java | 248 +
.../co/edu/unalmed/gaunal/sumolib/net/Node.java | 84 +
.../edu/unalmed/gaunal/sumolib/net/Roundabout.java | 25 +
.../src/co/edu/unalmed/gaunal/sumolib/net/TLS.java | 54 +
.../edu/unalmed/gaunal/sumolib/net/TLSProgram.java | 40 +
.../unalmed/gaunal/sumolib/net/NetReaderTest.java | 300 +
.../co/edu/unalmed/gaunal/sumolib/net/NetTest.java | 503 ++
tools/contributed/sumoplayer/AUTHOR | 2 -
tools/contributed/sumoplayer/LICENSE | 280 -
tools/contributed/sumoplayer/README | 54 -
tools/contributed/sumoplayer/build.xml | 96 -
.../sumoplayer/convert_sumoplayer_op_2_lonlat.py | 53 -
.../sumoplayer/SUMOGeoCoordinatesResolver.java | 68 -
.../src/java/de/psi/telco/sumoplayer/SUMOLane.java | 95 -
.../psi/telco/sumoplayer/SUMOLocationListener.java | 14 -
.../java/de/psi/telco/sumoplayer/SUMONetwork.java | 31 -
.../sumoplayer/SUMOPipedLocationListener.java | 24 -
.../java/de/psi/telco/sumoplayer/SUMOPlayer.java | 158 -
.../de/psi/telco/sumoplayer/SUMOSAXHandler.java | 148 -
.../telco/sumoplayer/SUMOSAXNeworkfileHandler.java | 136 -
.../java/de/psi/telco/sumoplayer/util/GeoCalc.java | 68 -
.../java/de/psi/telco/sumoplayer/util/Line.java | 23 -
.../de/psi/telco/sumoplayer/util/LineImpl.java | 28 -
.../psi/telco/sumoplayer/util/PROJTransformer.java | 70 -
.../java/de/psi/telco/sumoplayer/util/Point.java | 6 -
.../de/psi/telco/sumoplayer/util/PointImpl.java | 43 -
.../java/de/psi/telco/sumoplayer/util/Vector.java | 9 -
.../traas/src/de/tudresden/sumo/cmd/Vehicle.java | 4 +-
.../src/de/tudresden/sumo/config/Constants.java | 3 +
.../traas/src/de/tudresden/ws/Traci.java | 4 +-
.../polito/appeal/traci/SumoTraciConnection.java | 2 +
.../it/polito/appeal/traci/ChangeStateQuery.java | 1 -
.../java/it/polito/appeal/traci/MultiQuery.java | 1 +
.../polito/appeal/traci/SumoTraciConnection.java | 6 +-
.../traci4j/src/xml/traciObjects/TrafficLight.xml | 4 +-
.../+traci/+areal/getContextSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+areal/getIDCount.m | 10 +
.../traci4matlab/+traci/+areal/getIDList.m | 12 +
.../+traci/+areal/getJamLengthMeters.m | 13 +
.../+traci/+areal/getJamLengthVehicle.m | 13 +
.../+traci/+areal/getLastStepMeanSpeed.m | 12 +
.../+traci/+areal/getLastStepOccupancy.m | 12 +
.../+traci/+areal/getSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+areal/getUniversal.m | 25 +
.../traci4matlab/+traci/+areal/subscribe.m | 43 +
.../traci4matlab/+traci/+areal/subscribeContext.m | 51 +
.../traci4matlab/+traci/+edge/adaptTraveltime.m | 17 +
.../+traci/+edge/getAdaptedTraveltime.m | 19 +
.../traci4matlab/+traci/+edge/getCO2Emission.m | 12 +
.../traci4matlab/+traci/+edge/getCOEmission.m | 12 +
.../+traci/+edge/getContextSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+edge/getEffort.m | 19 +
.../traci4matlab/+traci/+edge/getFuelConsumption.m | 12 +
.../traci4matlab/+traci/+edge/getHCEmission.m | 12 +
.../traci4matlab/+traci/+edge/getIDCount.m | 10 +
.../traci4matlab/+traci/+edge/getIDList.m | 12 +
.../+traci/+edge/getLastStepHaltingNumber.m | 13 +
.../traci4matlab/+traci/+edge/getLastStepLength.m | 12 +
.../+traci/+edge/getLastStepMeanSpeed.m | 12 +
.../+traci/+edge/getLastStepOccupancy.m | 12 +
.../+traci/+edge/getLastStepPersonIDs.m | 12 +
.../+traci/+edge/getLastStepVehicleIDs.m | 13 +
.../+traci/+edge/getLastStepVehicleNumber.m | 13 +
.../traci4matlab/+traci/+edge/getNOxEmission.m | 12 +
.../traci4matlab/+traci/+edge/getNoiseEmission.m | 12 +
.../traci4matlab/+traci/+edge/getPmxEmission.m | 12 +
.../+traci/+edge/getSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+edge/getTraveltime.m | 12 +
.../traci4matlab/+traci/+edge/getUniversal.m | 25 +
.../traci4matlab/+traci/+edge/setEffort.m | 17 +
.../traci4matlab/+traci/+edge/setMaxSpeed.m | 12 +
.../traci4matlab/+traci/+edge/subscribe.m | 43 +
.../traci4matlab/+traci/+edge/subscribeContext.m | 51 +
.../traci4matlab/+traci/+gui/getBoundary.m | 16 +
.../+traci/+gui/getContextSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+gui/getIDList.m | 12 +
.../traci4matlab/+traci/+gui/getOffset.m | 16 +
.../traci4matlab/+traci/+gui/getSchema.m | 16 +
.../+traci/+gui/getSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+gui/getUniversal.m | 25 +
.../contributed/traci4matlab/+traci/+gui/getZoom.m | 16 +
.../traci4matlab/+traci/+gui/screenshot.m | 14 +
.../traci4matlab/+traci/+gui/setBoundary.m | 16 +
.../traci4matlab/+traci/+gui/setOffset.m | 15 +
.../traci4matlab/+traci/+gui/setSchema.m | 12 +
.../contributed/traci4matlab/+traci/+gui/setZoom.m | 11 +
.../traci4matlab/+traci/+gui/subscribe.m | 37 +
.../traci4matlab/+traci/+gui/subscribeContext.m | 46 +
.../traci4matlab/+traci/+gui/trackVehicle.m | 12 +
.../+inductionloop/getContextSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+inductionloop/getIDList.m | 13 +
.../traci4matlab/+traci/+inductionloop/getLaneID.m | 11 +
.../+traci/+inductionloop/getLastStepMeanLength.m | 12 +
.../+traci/+inductionloop/getLastStepMeanSpeed.m | 13 +
.../+traci/+inductionloop/getLastStepOccupancy.m | 12 +
.../+traci/+inductionloop/getLastStepVehicleIDs.m | 13 +
.../+inductionloop/getLastStepVehicleNumber.m | 13 +
.../+traci/+inductionloop/getPosition.m | 12 +
.../+traci/+inductionloop/getSubscriptionResults.m | 26 +
.../+traci/+inductionloop/getTimeSinceDetection.m | 12 +
.../+traci/+inductionloop/getUniversal.m | 25 +
.../+traci/+inductionloop/getVehicleData.m | 12 +
.../+traci/+inductionloop/readVehicleData.m | 24 +
.../traci4matlab/+traci/+inductionloop/subscribe.m | 38 +
.../+traci/+inductionloop/subscribeContext.m | 46 +
.../+junction/getContextSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+junction/getIDList.m | 12 +
.../traci4matlab/+traci/+junction/getPosition.m | 12 +
.../+traci/+junction/getSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+junction/getUniversal.m | 25 +
.../traci4matlab/+traci/+junction/subscribe.m | 38 +
.../+traci/+junction/subscribeContext.m | 46 +
.../traci4matlab/+traci/+lane/getAllowed.m | 13 +
.../traci4matlab/+traci/+lane/getCO2Emission.m | 12 +
.../traci4matlab/+traci/+lane/getCOEmission.m | 12 +
.../+traci/+lane/getContextSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+lane/getDisallowed.m | 12 +
.../traci4matlab/+traci/+lane/getEdgeID.m | 12 +
.../traci4matlab/+traci/+lane/getFuelConsumption.m | 12 +
.../traci4matlab/+traci/+lane/getHCEmission.m | 12 +
.../traci4matlab/+traci/+lane/getIDList.m | 12 +
.../+traci/+lane/getLastStepHaltingNumber.m | 13 +
.../traci4matlab/+traci/+lane/getLastStepLength.m | 12 +
.../+traci/+lane/getLastStepMeanSpeed.m | 12 +
.../+traci/+lane/getLastStepOccupancy.m | 12 +
.../+traci/+lane/getLastStepVehicleIDs.m | 13 +
.../+traci/+lane/getLastStepVehicleNumber.m | 13 +
.../traci4matlab/+traci/+lane/getLength.m | 11 +
.../traci4matlab/+traci/+lane/getLinkNumber.m | 12 +
.../traci4matlab/+traci/+lane/getLinks.m | 13 +
.../traci4matlab/+traci/+lane/getMaxSpeed.m | 12 +
.../traci4matlab/+traci/+lane/getNOxEmission.m | 12 +
.../traci4matlab/+traci/+lane/getNoiseEmission.m | 12 +
.../traci4matlab/+traci/+lane/getPMxEmission.m | 12 +
.../traci4matlab/+traci/+lane/getShape.m | 12 +
.../+traci/+lane/getSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+lane/getTraveltime.m | 12 +
.../traci4matlab/+traci/+lane/getUniversal.m | 25 +
.../traci4matlab/+traci/+lane/getWidth.m | 11 +
.../traci4matlab/+traci/+lane/readLinks.m | 30 +
.../traci4matlab/+traci/+lane/setAllowed.m | 22 +
.../traci4matlab/+traci/+lane/setDisallowed.m | 21 +
.../traci4matlab/+traci/+lane/setLength.m | 11 +
.../traci4matlab/+traci/+lane/setMaxSpeed.m | 12 +
.../traci4matlab/+traci/+lane/subscribe.m | 38 +
.../traci4matlab/+traci/+lane/subscribeContext.m | 47 +
.../getContextSubscriptionResults.m | 27 +
.../+traci/+multientryexit/getIDList.m | 12 +
.../+multientryexit/getLastStepHaltingNumber.m | 14 +
.../+traci/+multientryexit/getLastStepMeanSpeed.m | 13 +
.../+traci/+multientryexit/getLastStepVehicleIDs.m | 13 +
.../+multientryexit/getLastStepVehicleNumber.m | 13 +
.../+multientryexit/getSubscriptionResults.m | 27 +
.../+traci/+multientryexit/getUniversal.m | 25 +
.../+traci/+multientryexit/subscribe.m | 39 +
.../+traci/+multientryexit/subscribeContext.m | 48 +
.../traci4matlab/+traci/+person/getAngle.m | 12 +
.../traci4matlab/+traci/+person/getColor.m | 11 +
.../+traci/+person/getContextSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+person/getIDCount.m | 10 +
.../traci4matlab/+traci/+person/getIDList.m | 12 +
.../traci4matlab/+traci/+person/getLanePosition.m | 12 +
.../traci4matlab/+traci/+person/getLength.m | 11 +
.../traci4matlab/+traci/+person/getMinGap.m | 12 +
.../traci4matlab/+traci/+person/getNextEdge.m | 13 +
.../traci4matlab/+traci/+person/getPosition.m | 12 +
.../traci4matlab/+traci/+person/getPosition3D.m | 12 +
.../traci4matlab/+traci/+person/getRoadID.m | 12 +
.../traci4matlab/+traci/+person/getSpeed.m | 12 +
.../+traci/+person/getSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+person/getTypeID.m | 12 +
.../traci4matlab/+traci/+person/getUniversal.m | 25 +
.../traci4matlab/+traci/+person/getWaitingTime.m | 14 +
.../traci4matlab/+traci/+person/getWidth.m | 11 +
.../traci4matlab/+traci/+person/subscribe.m | 38 +
.../traci4matlab/+traci/+person/subscribeContext.m | 46 +
tools/contributed/traci4matlab/+traci/+poi/add.m | 36 +
.../traci4matlab/+traci/+poi/getColor.m | 11 +
.../+traci/+poi/getContextSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+poi/getIDList.m | 12 +
.../traci4matlab/+traci/+poi/getPosition.m | 12 +
.../+traci/+poi/getSubscriptionResults.m | 26 +
.../contributed/traci4matlab/+traci/+poi/getType.m | 11 +
.../traci4matlab/+traci/+poi/getUniversal.m | 25 +
.../contributed/traci4matlab/+traci/+poi/remove.m | 18 +
.../traci4matlab/+traci/+poi/setColor.m | 16 +
.../traci4matlab/+traci/+poi/setPosition.m | 14 +
.../contributed/traci4matlab/+traci/+poi/setType.m | 15 +
.../traci4matlab/+traci/+poi/subscribe.m | 38 +
.../traci4matlab/+traci/+poi/subscribeContext.m | 46 +
.../contributed/traci4matlab/+traci/+polygon/add.m | 50 +
.../traci4matlab/+traci/+polygon/getColor.m | 11 +
.../+polygon/getContextSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+polygon/getIDList.m | 12 +
.../traci4matlab/+traci/+polygon/getShape.m | 14 +
.../+traci/+polygon/getSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+polygon/getType.m | 11 +
.../traci4matlab/+traci/+polygon/getUniversal.m | 25 +
.../traci4matlab/+traci/+polygon/remove.m | 18 +
.../traci4matlab/+traci/+polygon/setColor.m | 16 +
.../traci4matlab/+traci/+polygon/setShape.m | 20 +
.../traci4matlab/+traci/+polygon/setType.m | 15 +
.../traci4matlab/+traci/+polygon/subscribe.m | 38 +
.../+traci/+polygon/subscribeContext.m | 46 +
tools/contributed/traci4matlab/+traci/+route/add.m | 22 +
.../+traci/+route/getContextSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+route/getEdges.m | 13 +
.../traci4matlab/+traci/+route/getIDList.m | 12 +
.../+traci/+route/getSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+route/getUniversal.m | 25 +
.../traci4matlab/+traci/+route/subscribe.m | 38 +
.../traci4matlab/+traci/+route/subscribeContext.m | 45 +
.../traci4matlab/+traci/+simulation/convert2D.m | 38 +
.../traci4matlab/+traci/+simulation/convertGeo.m | 38 +
.../traci4matlab/+traci/+simulation/convertRoad.m | 38 +
.../+traci/+simulation/getArrivedIDList.m | 13 +
.../+traci/+simulation/getArrivedNumber.m | 13 +
.../+traci/+simulation/getCurrentTime.m | 12 +
.../traci4matlab/+traci/+simulation/getDeltaT.m | 11 +
.../+traci/+simulation/getDepartedIDList.m | 13 +
.../+traci/+simulation/getDepartedNumber.m | 12 +
.../+traci/+simulation/getDistance2D.m | 46 +
.../+traci/+simulation/getDistanceRoad.m | 36 +
.../+traci/+simulation/getEndingTeleportIDList.m | 13 +
.../+traci/+simulation/getEndingTeleportNumber.m | 12 +
.../+traci/+simulation/getLoadedIDList.m | 12 +
.../+traci/+simulation/getLoadedNumber.m | 12 +
.../+traci/+simulation/getMinExpectedNumber.m | 17 +
.../+traci/+simulation/getNetBoundary.m | 13 +
.../+traci/+simulation/getStartingTeleportIDList.m | 13 +
.../+traci/+simulation/getStartingTeleportNumber.m | 12 +
.../+traci/+simulation/getSubscriptionResults.m | 19 +
.../traci4matlab/+traci/+simulation/getUniversal.m | 25 +
.../traci4matlab/+traci/+simulation/subscribe.m | 36 +
.../traci4matlab/+traci/+trafficlights/Logic.m | 43 +
.../traci4matlab/+traci/+trafficlights/Phase.m | 38 +
.../getCompleteRedYellowGreenDefinition.m | 14 +
.../+trafficlights/getContextSubscriptionResults.m | 26 +
.../+traci/+trafficlights/getControlledLanes.m | 13 +
.../+traci/+trafficlights/getControlledLinks.m | 14 +
.../traci4matlab/+traci/+trafficlights/getIDList.m | 12 +
.../+traci/+trafficlights/getNextSwitch.m | 13 +
.../traci4matlab/+traci/+trafficlights/getPhase.m | 12 +
.../+traci/+trafficlights/getProgram.m | 11 +
.../+traci/+trafficlights/getRedYellowGreenState.m | 14 +
.../+traci/+trafficlights/getSubscriptionResults.m | 27 +
.../+traci/+trafficlights/getUniversal.m | 25 +
.../traci4matlab/+traci/+trafficlights/readLinks.m | 22 +
.../+traci/+trafficlights/readLogics.m | 38 +
.../setCompleteRedYellowGreenDefinition.m | 44 +
.../traci4matlab/+traci/+trafficlights/setPhase.m | 14 +
.../+traci/+trafficlights/setPhaseDuration.m | 14 +
.../+traci/+trafficlights/setProgram.m | 12 +
.../+traci/+trafficlights/setRedYellowGreenState.m | 14 +
.../traci4matlab/+traci/+trafficlights/subscribe.m | 38 +
.../+traci/+trafficlights/subscribeContext.m | 46 +
.../contributed/traci4matlab/+traci/+vehicle/add.m | 57 +
.../traci4matlab/+traci/+vehicle/changeLane.m | 20 +
.../traci4matlab/+traci/+vehicle/changeTarget.m | 12 +
.../traci4matlab/+traci/+vehicle/getAccel.m | 12 +
.../+traci/+vehicle/getAdaptedTraveltime.m | 21 +
.../traci4matlab/+traci/+vehicle/getAngle.m | 12 +
.../traci4matlab/+traci/+vehicle/getBestLanes.m | 14 +
.../traci4matlab/+traci/+vehicle/getCO2Emission.m | 12 +
.../traci4matlab/+traci/+vehicle/getCOEmission.m | 12 +
.../traci4matlab/+traci/+vehicle/getColor.m | 11 +
.../+vehicle/getContextSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+vehicle/getDecel.m | 12 +
.../+traci/+vehicle/getDrivingDistance.m | 24 +
.../+traci/+vehicle/getDrivingDistance2D.m | 19 +
.../traci4matlab/+traci/+vehicle/getEffort.m | 21 +
.../+traci/+vehicle/getEmissionClass.m | 12 +
.../+traci/+vehicle/getFuelConsumption.m | 12 +
.../traci4matlab/+traci/+vehicle/getHCEmission.m | 12 +
.../traci4matlab/+traci/+vehicle/getIDList.m | 12 +
.../traci4matlab/+traci/+vehicle/getImperfection.m | 12 +
.../traci4matlab/+traci/+vehicle/getLaneID.m | 15 +
.../traci4matlab/+traci/+vehicle/getLaneIndex.m | 12 +
.../traci4matlab/+traci/+vehicle/getLanePosition.m | 12 +
.../traci4matlab/+traci/+vehicle/getLeader.m | 31 +
.../traci4matlab/+traci/+vehicle/getLength.m | 11 +
.../traci4matlab/+traci/+vehicle/getMaxSpeed.m | 12 +
.../traci4matlab/+traci/+vehicle/getMinGap.m | 12 +
.../traci4matlab/+traci/+vehicle/getNOxEmission.m | 12 +
.../+traci/+vehicle/getNoiseEmission.m | 12 +
.../traci4matlab/+traci/+vehicle/getPMxEmission.m | 12 +
.../traci4matlab/+traci/+vehicle/getPosition.m | 12 +
.../traci4matlab/+traci/+vehicle/getRoadID.m | 12 +
.../traci4matlab/+traci/+vehicle/getRoute.m | 12 +
.../traci4matlab/+traci/+vehicle/getRouteID.m | 12 +
.../traci4matlab/+traci/+vehicle/getShapeClass.m | 12 +
.../traci4matlab/+traci/+vehicle/getSignals.m | 30 +
.../traci4matlab/+traci/+vehicle/getSpeed.m | 12 +
.../+traci/+vehicle/getSpeedDeviation.m | 12 +
.../traci4matlab/+traci/+vehicle/getSpeedFactor.m | 12 +
.../+traci/+vehicle/getSpeedWithoutTraCI.m | 8 +
.../+traci/+vehicle/getSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+vehicle/getTau.m | 12 +
.../traci4matlab/+traci/+vehicle/getTypeID.m | 12 +
.../traci4matlab/+traci/+vehicle/getUniversal.m | 25 +
.../traci4matlab/+traci/+vehicle/getVehicleClass.m | 12 +
.../traci4matlab/+traci/+vehicle/getWidth.m | 11 +
.../traci4matlab/+traci/+vehicle/isRouteValid.m | 12 +
.../traci4matlab/+traci/+vehicle/moveTo.m | 21 +
.../traci4matlab/+traci/+vehicle/moveToVTD.m | 24 +
.../traci4matlab/+traci/+vehicle/readBestLanes.m | 31 +
.../traci4matlab/+traci/+vehicle/remove.m | 17 +
.../traci4matlab/+traci/+vehicle/rerouteEffort.m | 19 +
.../+traci/+vehicle/rerouteTraveltime.m | 19 +
.../traci4matlab/+traci/+vehicle/setAccel.m | 12 +
.../+traci/+vehicle/setAdaptedTraveltime.m | 24 +
.../traci4matlab/+traci/+vehicle/setColor.m | 16 +
.../traci4matlab/+traci/+vehicle/setDecel.m | 12 +
.../traci4matlab/+traci/+vehicle/setEffort.m | 24 +
.../+traci/+vehicle/setEmissionClass.m | 11 +
.../traci4matlab/+traci/+vehicle/setImperfection.m | 13 +
.../+traci/+vehicle/setLaneChangeMode.m | 18 +
.../traci4matlab/+traci/+vehicle/setLength.m | 11 +
.../traci4matlab/+traci/+vehicle/setMaxSpeed.m | 11 +
.../traci4matlab/+traci/+vehicle/setMinGap.m | 12 +
.../traci4matlab/+traci/+vehicle/setRoute.m | 28 +
.../traci4matlab/+traci/+vehicle/setRouteID.m | 12 +
.../traci4matlab/+traci/+vehicle/setShapeClass.m | 11 +
.../traci4matlab/+traci/+vehicle/setSignals.m | 29 +
.../traci4matlab/+traci/+vehicle/setSpeed.m | 12 +
.../+traci/+vehicle/setSpeedDeviation.m | 12 +
.../traci4matlab/+traci/+vehicle/setSpeedFactor.m | 12 +
.../traci4matlab/+traci/+vehicle/setSpeedMode.m | 19 +
.../traci4matlab/+traci/+vehicle/setStop.m | 38 +
.../traci4matlab/+traci/+vehicle/setTau.m | 11 +
.../traci4matlab/+traci/+vehicle/setVehicleClass.m | 12 +
.../traci4matlab/+traci/+vehicle/setWidth.m | 11 +
.../traci4matlab/+traci/+vehicle/slowDown.m | 19 +
.../traci4matlab/+traci/+vehicle/subscribe.m | 38 +
.../+traci/+vehicle/subscribeContext.m | 46 +
.../traci4matlab/+traci/+vehicletype/getAccel.m | 12 +
.../traci4matlab/+traci/+vehicletype/getColor.m | 11 +
.../+vehicletype/getContextSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+vehicletype/getDecel.m | 12 +
.../+traci/+vehicletype/getEmissionClass.m | 12 +
.../traci4matlab/+traci/+vehicletype/getIDList.m | 12 +
.../+traci/+vehicletype/getImperfection.m | 12 +
.../traci4matlab/+traci/+vehicletype/getLength.m | 12 +
.../traci4matlab/+traci/+vehicletype/getMaxSpeed.m | 12 +
.../traci4matlab/+traci/+vehicletype/getMinGap.m | 12 +
.../+traci/+vehicletype/getShapeClass.m | 12 +
.../+traci/+vehicletype/getSpeedDeviation.m | 12 +
.../+traci/+vehicletype/getSpeedFactor.m | 12 +
.../+traci/+vehicletype/getSubscriptionResults.m | 26 +
.../traci4matlab/+traci/+vehicletype/getTau.m | 12 +
.../+traci/+vehicletype/getUniversal.m | 25 +
.../+traci/+vehicletype/getVehicleClass.m | 12 +
.../traci4matlab/+traci/+vehicletype/getWidth.m | 12 +
.../traci4matlab/+traci/+vehicletype/setAccel.m | 12 +
.../traci4matlab/+traci/+vehicletype/setColor.m | 16 +
.../traci4matlab/+traci/+vehicletype/setDecel.m | 12 +
.../+traci/+vehicletype/setEmissionClass.m | 12 +
.../+traci/+vehicletype/setImperfection.m | 13 +
.../traci4matlab/+traci/+vehicletype/setLength.m | 12 +
.../traci4matlab/+traci/+vehicletype/setMaxSpeed.m | 12 +
.../traci4matlab/+traci/+vehicletype/setMinGap.m | 12 +
.../+traci/+vehicletype/setShapeClass.m | 12 +
.../+traci/+vehicletype/setSpeedDeviation.m | 12 +
.../+traci/+vehicletype/setSpeedFactor.m | 12 +
.../traci4matlab/+traci/+vehicletype/setTau.m | 12 +
.../+traci/+vehicletype/setVehicleClass.m | 11 +
.../traci4matlab/+traci/+vehicletype/setWidth.m | 11 +
.../traci4matlab/+traci/+vehicletype/subscribe.m | 38 +
.../+traci/+vehicletype/subscribeContext.m | 46 +
tools/contributed/traci4matlab/+traci/Message.m | 13 +
.../traci4matlab/+traci/RETURN_VALUE_FUNC.m | 243 +
tools/contributed/traci4matlab/+traci/Socket.m | 35 +
tools/contributed/traci4matlab/+traci/Storage.m | 70 +
.../traci4matlab/+traci/SubscriptionResults.m | 87 +
.../contributed/traci4matlab/+traci/beginMessage.m | 29 +
.../contributed/traci4matlab/+traci/checkResult.m | 33 +
tools/contributed/traci4matlab/+traci/close.m | 28 +
tools/contributed/traci4matlab/+traci/constants.m | 746 +++
tools/contributed/traci4matlab/+traci/getVersion.m | 33 +
tools/contributed/traci4matlab/+traci/init.m | 70 +
tools/contributed/traci4matlab/+traci/packInt32.m | 14 +
tools/contributed/traci4matlab/+traci/packInt64.m | 10 +
.../traci4matlab/+traci/readSubscription.m | 138 +
tools/contributed/traci4matlab/+traci/recvExact.m | 52 +
.../contributed/traci4matlab/+traci/sendByteCmd.m | 13 +
.../traci4matlab/+traci/sendDoubleCmd.m | 14 +
tools/contributed/traci4matlab/+traci/sendExact.m | 62 +
tools/contributed/traci4matlab/+traci/sendIntCmd.m | 14 +
.../traci4matlab/+traci/sendReadOneStringCmd.m | 11 +
.../traci4matlab/+traci/sendStringCmd.m | 18 +
.../traci4matlab/+traci/simulationStep.m | 58 +
tools/contributed/traci4matlab/+traci/subscribe.m | 36 +
.../traci4matlab/+traci/subscribeContext.m | 51 +
.../traci4matlab/+traci/switchConnection.m | 13 +
tools/contributed/traci4matlab/+traci/time2steps.m | 10 +
.../examples/inter_palmas/inter_palmas.poly.xml | 39 +
.../inter_palmas/inter_palmas_bus_stops.add.xml | 4 +
.../inter_palmas/inter_palmas_buses.rou.alt.xml | 127 +
.../inter_palmas/inter_palmas_buses.rou.xml | 95 +
.../inter_palmas/inter_palmas_buses.trips.xml | 9 +
.../inter_palmas/inter_palmas_demand.rou.xml | 6332 ++++++++++++++++++++
.../inter_palmas/inter_palmas_pedestrians.trip.xml | 366 ++
.../tls_actuated/checkWaitingPersons.m | 25 +
.../inter_palmas/tls_actuated/inter_palmas.net.xml | 323 +
.../tls_actuated/inter_palmas_actuated.m | 165 +
.../tls_actuated/inter_palmas_actuated.sumocfg | 29 +
.../examples/inter_palmas/viewsettings.xml | 488 ++
.../contributed/traci4matlab/examples/traci_test.m | 19 +
.../traci4matlab/examples/traci_test2.m | 634 ++
.../{TraCI4Matlab => traci4matlab}/license.txt | 0
.../gaunal/traci4matlab/utils/DataReader.java | 0
tools/district/edgesInDistricts.py | 235 -
tools/districts2poly.py | 77 +
tools/edgesInDistricts.py | 159 +
tools/extractTest.py | 226 +
tools/game/bs3Dosm.sumocfg | 1 +
tools/game/bs3d.sumocfg | 1 +
tools/game/bs3d/bs3d.rou.xml | 12 +-
tools/game/bs3d/bs3d.settings.xml | 109 +
tools/game/bs3d/view_B.xml | 6 +-
tools/game/cross.sumocfg | 1 +
tools/game/cross_demo.sumocfg | 1 +
tools/game/dlr_lndw_15_ts_4.gif | Bin 0 -> 4694 bytes
tools/game/grid6.sumocfg | 18 +
tools/game/grid6/dlr.gif | Bin 0 -> 9701 bytes
tools/game/grid6/grid6.con.xml | 171 +
tools/game/grid6/grid6.edg.xml | 87 +
tools/game/grid6/grid6.net.xml | 840 +++
tools/game/grid6/grid6.netgcfg | 26 +
tools/game/grid6/grid6.nod.xml | 51 +
tools/game/grid6/grid6.rou.xml | 17 +
tools/game/grid6/grid6.tll.xml | 134 +
tools/game/grid6/settings.xml | 89 +
tools/game/ramp.sumocfg | 8 +-
tools/game/ramp/ramp.net.xml | 64 +-
tools/game/ramp/ramp.rou.xml | 16 +-
tools/game/ramp/ramp_settings.xml | 2 +-
tools/game/runner.py | 229 +-
tools/game/setup.py | 16 +-
tools/game/square.sumocfg | 1 +
tools/generateBidiDistricts.py | 86 +
tools/import/osm/SimpleWebSocketServer.py | 742 +++
tools/import/osm/images/bicycle.png | Bin 0 -> 1657 bytes
tools/import/osm/images/bus.png | Bin 0 -> 1370 bytes
tools/import/osm/images/generate.png | Bin 0 -> 1248 bytes
tools/import/osm/images/map.png | Bin 0 -> 1089 bytes
tools/import/osm/images/motorcycle.png | Bin 0 -> 4194 bytes
tools/import/osm/images/passenger.png | Bin 0 -> 864 bytes
tools/import/osm/images/pedestrian.png | Bin 0 -> 774 bytes
tools/import/osm/images/rail.png | Bin 0 -> 1267 bytes
tools/import/osm/images/rail_urban.png | Bin 0 -> 1223 bytes
tools/import/osm/images/ship.png | Bin 0 -> 1360 bytes
tools/import/osm/images/tram.png | Bin 0 -> 1071 bytes
tools/import/osm/images/truck.png | Bin 0 -> 862 bytes
tools/import/osm/index.html | 119 +-
tools/import/osm/lib.js | 82 +-
tools/import/osm/osmBuild.py | 4 +-
tools/import/osm/script.js | 351 +-
tools/import/osm/server.py | 601 +-
tools/import/osm/style.css | 157 +-
tools/import/osm/typemap_example.xml | 40 -
tools/import/vissim/convert_detectors2SUMO.py | 331 +
.../vissim/convert_vissimXML_flows_statRoutes.py | 399 ++
.../import/vissim/tls_vissimXML2SUMOnet_update.py | 609 ++
tools/import/vissim/vissim_parseRoutes.py | 4 +-
tools/net/netcheck.py | 137 +-
tools/output/edgeDataDiff.py | 65 +
tools/pedestrianFlow.py | 93 +
tools/purgatory/generateTripsXml.py | 410 ++
tools/{trip => purgatory}/removeGeometryInTrips.pl | 0
.../removeTripsIfNotInInterval.pl | 0
tools/{trip => purgatory}/splitTripsByHours.pl | 0
tools/randomTrips.py | 364 ++
tools/route/cutRoutes.py | 4 +-
tools/route/route2poly.py | 4 +-
tools/route/routeDiffStats.py | 90 +
tools/route2sel.py | 50 +
tools/route2trips.py | 106 +
tools/sumolib/geomhelper.py | 30 +-
tools/sumolib/miscutils.py | 17 +-
tools/sumolib/net/__init__.py | 13 +-
tools/sumolib/net/edge.py | 8 +-
tools/sumolib/net/lane.py | 3 +-
tools/sumolib/output/__init__.py | 10 +-
tools/sumolib/output/convert/gpsdat.py | 4 +-
tools/sumolib/shapes/polygon.py | 43 +-
tools/tls/tls_csv2SUMO.py | 62 +-
tools/traceExporter.py | 24 +-
tools/traci/__init__.py | 6 +-
tools/traci/areal.py | 38 +-
tools/traci/constants.py | 62 +-
tools/traci/edge.py | 14 +-
tools/traci/person.py | 20 +-
tools/traci/vehicle.py | 114 +-
tools/trip/generateTripsXml.py | 410 --
tools/trip/randomTrips.py | 316 -
tools/trip/route2trips.py | 106 -
tools/xml/schemaCheck.py | 6 +-
tools_filelist | Bin 115516 -> 118874 bytes
unittest/src/Makefile.am | 2 +-
unittest/src/Makefile.in | 4 +-
1281 files changed, 39292 insertions(+), 17704 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index 9d986d8..e157e93 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -50,3 +50,9 @@ Eric Melde <> melde
Evamarie Wiessner
Andreas Kendziorra <> kend-an
Robert Hilbrich <> rhilbrich
+Thomas Lockhart <Thomas.G.Lockhart at jpl.nasa.gov>
+Gerald Richter
+Lukas Grohmann
+Tamas Kurczveil
+Pablo Alvarez Lopez
+
diff --git a/INSTALL b/INSTALL
index 7d1c323..007e939 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,8 +1,8 @@
Installation Instructions
*************************
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
+Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
@@ -226,6 +226,11 @@ order to use an ANSI C compiler:
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+ HP-UX `make' updates targets which have the same time stamps as
+their prerequisites, which makes it generally unusable when shipped
+generated files such as `configure' are involved. Use GNU `make'
+instead.
+
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
@@ -304,9 +309,10 @@ causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
-an Autoconf bug. Until the bug is fixed you can use this workaround:
+an Autoconf limitation. Until the limitation is lifted, you can use
+this workaround:
- CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+ CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
@@ -362,4 +368,3 @@ operates.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
-
diff --git a/Makefile.am b/Makefile.am
index baa984d..a455083 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,6 +27,7 @@ man:
help2man -N -n "Builds vehicle routes for SUMO using detector values" bin/dfrouter > docs/man/dfrouter.1
help2man -N -n "Shortest path router and DUE computer for the microscopic road traffic simulation SUMO" bin/duarouter > docs/man/duarouter.1
help2man -N -n "Router for the microscopic road traffic simulation SUMO based on junction turning ratios" bin/jtrrouter > docs/man/jtrrouter.1
+ help2man -N -n "Import O/D-matrices for macroscopic traffic assignment" bin/marouter > docs/man/marouter.1
help2man -N -n "Generates routes of persons throughout a day for the microscopic road traffic simulation SUMO" bin/activitygen > docs/man/activitygen.1
help2man -N -n "Importer of O/D-matrices for the road traffic simulation SUMO" bin/od2trips > docs/man/od2trips.1
help2man -N -n "Road network importer / builder for the road traffic simulation SUMO" bin/netconvert > docs/man/netconvert.1
@@ -43,11 +44,11 @@ dist-hook:
find tests/complex/tutorial -regex ".*\.\(xml\|txt\|sumocfg\|netccfg\|py\)" -print0 | xargs -0 cp -v --parents --target-directory $(abs_distdir) ; \
mv -v ${abs_distdir}/tests/complex/tutorial $(abs_distdir)/docs ; \
rm -rf $(abs_distdir)/tests ; \
- tests/extractTest.py -i -f tests/examples.txt -o $(abs_distdir)/docs ; \
+ tools/extractTest.py -i -f tests/examples.txt -o $(abs_distdir)/docs ; \
find build -regex ".*\.\(vcxproj\|vcxproj\.filters\|props\|sln\|spec\)" -print0 | xargs -0 cp --parents --target-directory $(abs_distdir) ; \
find data -regex ".*\.\(xsd\|xml\|csv\|veh\)" -print0 | xargs -0 cp --parents --target-directory $(abs_distdir) ; \
- ( svn export --force tools $(distdir)/tools && cd $(distdir) && find tools -type f > ../tools_filelist; true ) ; \
- xargs cp --parents --target-directory $(abs_distdir) < tools_filelist ; \
+ ( svn export --force tools $(distdir)/tools && cd $(distdir) && find tools -type f -print0 > ../tools_filelist; true ) ; \
+ xargs -0 cp --parents --target-directory $(abs_distdir) < tools_filelist ; \
find $(abs_distdir)/tools -name "*.jar" | xargs rm ; \
cp tools_filelist $(abs_distdir) ; \
fi;
@@ -61,7 +62,7 @@ dist-doc: doc
rmdir $(distdir)/tests/complex
rmdir $(distdir)/tests
cp -r docs/pydoc docs/doxygen docs/userdoc $(distdir)/docs
- tests/extractTest.py -i -f tests/examples.txt -o $(distdir)/docs
+ tools/extractTest.py -i -f tests/examples.txt -o $(distdir)/docs
tar -czf $(PACKAGE)-doc-$(VERSION).tar.gz $(distdir)
rm -f $(PACKAGE)-doc-$(VERSION).zip
zip -r $(PACKAGE)-doc-$(VERSION).zip $(distdir)
@@ -88,7 +89,7 @@ dist-complete: dist dist-doc dist-tests traas traci4j trafficmodeler
$(am__remove_distdir)
examples:
- tests/extractTest.py -x -f tests/examples.txt
+ tools/extractTest.py -x -f tests/examples.txt
traas:
ant -f tools/contributed/traas/build.xml clean release
diff --git a/Makefile.in b/Makefile.in
index e1e7fbe..e768b11 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -82,7 +82,7 @@ subdir = .
DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) COPYING \
- config.guess config.sub depcomp install-sh missing ltmain.sh
+ config.guess config.sub install-sh missing ltmain.sh
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -821,6 +821,7 @@ man:
help2man -N -n "Builds vehicle routes for SUMO using detector values" bin/dfrouter > docs/man/dfrouter.1
help2man -N -n "Shortest path router and DUE computer for the microscopic road traffic simulation SUMO" bin/duarouter > docs/man/duarouter.1
help2man -N -n "Router for the microscopic road traffic simulation SUMO based on junction turning ratios" bin/jtrrouter > docs/man/jtrrouter.1
+ help2man -N -n "Import O/D-matrices for macroscopic traffic assignment" bin/marouter > docs/man/marouter.1
help2man -N -n "Generates routes of persons throughout a day for the microscopic road traffic simulation SUMO" bin/activitygen > docs/man/activitygen.1
help2man -N -n "Importer of O/D-matrices for the road traffic simulation SUMO" bin/od2trips > docs/man/od2trips.1
help2man -N -n "Road network importer / builder for the road traffic simulation SUMO" bin/netconvert > docs/man/netconvert.1
@@ -837,11 +838,11 @@ dist-hook:
find tests/complex/tutorial -regex ".*\.\(xml\|txt\|sumocfg\|netccfg\|py\)" -print0 | xargs -0 cp -v --parents --target-directory $(abs_distdir) ; \
mv -v ${abs_distdir}/tests/complex/tutorial $(abs_distdir)/docs ; \
rm -rf $(abs_distdir)/tests ; \
- tests/extractTest.py -i -f tests/examples.txt -o $(abs_distdir)/docs ; \
+ tools/extractTest.py -i -f tests/examples.txt -o $(abs_distdir)/docs ; \
find build -regex ".*\.\(vcxproj\|vcxproj\.filters\|props\|sln\|spec\)" -print0 | xargs -0 cp --parents --target-directory $(abs_distdir) ; \
find data -regex ".*\.\(xsd\|xml\|csv\|veh\)" -print0 | xargs -0 cp --parents --target-directory $(abs_distdir) ; \
- ( svn export --force tools $(distdir)/tools && cd $(distdir) && find tools -type f > ../tools_filelist; true ) ; \
- xargs cp --parents --target-directory $(abs_distdir) < tools_filelist ; \
+ ( svn export --force tools $(distdir)/tools && cd $(distdir) && find tools -type f -print0 > ../tools_filelist; true ) ; \
+ xargs -0 cp --parents --target-directory $(abs_distdir) < tools_filelist ; \
find $(abs_distdir)/tools -name "*.jar" | xargs rm ; \
cp tools_filelist $(abs_distdir) ; \
fi;
@@ -855,7 +856,7 @@ dist-doc: doc
rmdir $(distdir)/tests/complex
rmdir $(distdir)/tests
cp -r docs/pydoc docs/doxygen docs/userdoc $(distdir)/docs
- tests/extractTest.py -i -f tests/examples.txt -o $(distdir)/docs
+ tools/extractTest.py -i -f tests/examples.txt -o $(distdir)/docs
tar -czf $(PACKAGE)-doc-$(VERSION).tar.gz $(distdir)
rm -f $(PACKAGE)-doc-$(VERSION).zip
zip -r $(PACKAGE)-doc-$(VERSION).zip $(distdir)
@@ -882,7 +883,7 @@ dist-complete: dist dist-doc dist-tests traas traci4j trafficmodeler
$(am__remove_distdir)
examples:
- tests/extractTest.py -x -f tests/examples.txt
+ tools/extractTest.py -x -f tests/examples.txt
traas:
ant -f tools/contributed/traas/build.xml clean release
diff --git a/README b/README
index 94169ce..49c67f1 100644
--- a/README
+++ b/README
@@ -10,7 +10,7 @@ What is SUMO?
road traffic simulation package designed to handle large road networks. The project
homepage can be found at
- http://sumo-sim.org/
+ http://sumo.dlr.de/
It is mainly developed by employees of the Institute of Transportation Systems
at the German Aerospace Center (http://www.dlr.de/ts).
@@ -22,7 +22,7 @@ Where to get it?
You can download SUMO from SourceForge via our downloads site:
- http://sumo-sim.org/wiki/Downloads
+ http://sumo.dlr.de/wiki/Downloads
As the program is still under development and is extended continuously, we advice you to
@@ -58,7 +58,7 @@ If configure does not find the libraries or includes needed, please check
For detailed build instructions have a look at our wiki:
- http://sumo-sim.org/wiki/Developer/Main#Build_instructions
+ http://sumo.dlr.de/wiki/Developer/Main#Build_instructions
@@ -77,7 +77,7 @@ Bugs.
Please use for bugs and requests our bug tracking tool which provides OpenID access
- http://sumo-sim.org/trac/
+ http://sumo.dlr.de/trac/
or file them to the list sumo-users at lists.sourceforge.net. Before
filing a bug, please consider to check with a current subversion checkout
diff --git a/bin/Makefile.am b/bin/Makefile.am
index f701e8d..a97ef12 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -99,7 +99,7 @@ marouter: ../src/marouter/marouter
if [ ! -e marouter -a -e marouterInt ]; then ln -s marouterInt marouter; fi
if [ ! -e marouterD -a -e marouterIntD ]; then ln -s marouterIntD marouterD; fi
if [ ! -e marouter -a -e marouterD ]; then ln -s marouterD marouter; fi
- if [ ! -e marouter -a -e marouterIntD ]; then ln -s marouterIntD marouterInt; fi
+ if [ ! -e marouterInt -a -e marouterIntD ]; then ln -s marouterIntD marouterInt; fi
$(GUI_APP): ../src/$(GUI_APP)
cp ../src/$(GUI_APP) ./`echo $(GUI_APP) | sed '$(transform)'`
if [ ! -e $(GUI_APP) -a -e meso-gui ]; then ln -s meso-gui $(GUI_APP); fi
diff --git a/bin/Makefile.in b/bin/Makefile.in
index 9be9121..c77f9ca 100644
--- a/bin/Makefile.in
+++ b/bin/Makefile.in
@@ -535,7 +535,7 @@ marouter: ../src/marouter/marouter
if [ ! -e marouter -a -e marouterInt ]; then ln -s marouterInt marouter; fi
if [ ! -e marouterD -a -e marouterIntD ]; then ln -s marouterIntD marouterD; fi
if [ ! -e marouter -a -e marouterD ]; then ln -s marouterD marouter; fi
- if [ ! -e marouter -a -e marouterIntD ]; then ln -s marouterIntD marouterInt; fi
+ if [ ! -e marouterInt -a -e marouterIntD ]; then ln -s marouterIntD marouterInt; fi
$(GUI_APP): ../src/$(GUI_APP)
cp ../src/$(GUI_APP) ./`echo $(GUI_APP) | sed '$(transform)'`
if [ ! -e $(GUI_APP) -a -e meso-gui ]; then ln -s meso-gui $(GUI_APP); fi
diff --git a/config.guess b/config.guess
index 666c5ad..c6fad2f 100755
--- a/config.guess
+++ b/config.guess
@@ -1,14 +1,12 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-# Free Software Foundation, Inc.
+# Copyright 1992-2013 Free Software Foundation, Inc.
-timestamp='2009-11-20'
+timestamp='2013-06-10'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@@ -17,26 +15,22 @@ timestamp='2009-11-20'
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner. Please send patches (context
-# diff format) to <config-patches at gnu.org> and include a ChangeLog
-# entry.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
+# Originally written by Per Bothner.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches with a ChangeLog entry to config-patches at gnu.org.
+
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -56,8 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -139,14 +132,35 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-case "${UNAME_MACHINE}" in
- i?86)
- test -z "$VENDOR" && VENDOR=pc
- ;;
- *)
- test -z "$VENDOR" && VENDOR=unknown
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
+ eval $set_cc_for_build
+ cat <<-EOF > $dummy.c
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #else
+ LIBC=gnu
+ #endif
+ EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
;;
esac
+
+case "${UNAME_MACHINE}" in
+ i?86)
+ test -z "$VENDOR" && VENDOR=pc
+ ;;
+ *)
+ test -z "$VENDOR" && VENDOR=unknown
+ ;;
+esac
test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
# Note: order is significant - the case branches are not exclusive.
@@ -154,7 +168,7 @@ test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
@@ -190,7 +204,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
fi
;;
*)
- os=netbsd
+ os=netbsd
;;
esac
# The OS release
@@ -211,6 +225,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo ${UNAME_MACHINE_ARCH}-${VENDOR}-bitrig${UNAME_RELEASE}
+ exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-${VENDOR}-openbsd${UNAME_RELEASE}
@@ -233,7 +251,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
@@ -279,7 +297,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit ;;
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
@@ -305,12 +326,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
- echo powerpc-ibm-os400
+ echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-${VENDOR}-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -404,23 +425,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-${VENDOR}-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-${VENDOR}-mint${UNAME_RELEASE}
+ exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
@@ -490,8 +511,8 @@ EOF
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -504,7 +525,7 @@ EOF
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
- exit ;;
+ exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
@@ -561,7 +582,7 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit ;;
- *:AIX:*:[456])
+ *:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
@@ -604,52 +625,52 @@ EOF
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
+ esac ;;
+ esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ sed 's/^ //' << EOF >$dummy.c
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -740,22 +761,22 @@ EOF
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
- exit ;;
+ exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit ;;
+ exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
- exit ;;
+ exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
- exit ;;
+ exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
- exit ;;
+ exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
@@ -779,14 +800,14 @@ EOF
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@@ -798,30 +819,35 @@ EOF
echo ${UNAME_MACHINE}-${VENDOR}-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
- echo ${UNAME_MACHINE}-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ echo ${UNAME_PROCESSOR}-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
+ *:MINGW64*:*)
+ echo ${UNAME_MACHINE}-pc-mingw64
+ exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
+ i*:MSYS*:*)
+ echo ${UNAME_MACHINE}-pc-msys
+ exit ;;
i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
*:Interix*:*)
- case ${UNAME_MACHINE} in
+ case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
@@ -858,15 +884,22 @@ EOF
exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-${VENDOR}-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-${VENDOR}-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-${VENDOR}-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ echo ${UNAME_MACHINE}-${VENDOR}-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
+ aarch64:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
+ exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
@@ -876,52 +909,56 @@ EOF
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
+ esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC}
+ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
else
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabi
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}eabi
+ else
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}eabihf
+ fi
fi
exit ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
exit ;;
cris:Linux:*:*)
- echo cris-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
crisv32:Linux:*:*)
- echo crisv32-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
frv:Linux:*:*)
- echo frv-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
+ exit ;;
+ hexagon:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
exit ;;
i*86:Linux:*:*)
- LIBC=gnu
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
- echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}"
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
@@ -940,51 +977,63 @@ EOF
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
+ test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-${LIBC}"; exit; }
;;
+ or1k:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
+ exit ;;
or32:Linux:*:*)
- echo or32-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
exit ;;
padre:Linux:*:*)
- echo sparc-${VENDOR}-linux-gnu
+ echo sparc-${VENDOR}-linux-${LIBC}
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-${VENDOR}-linux-gnu
+ echo hppa64-${VENDOR}-linux-${LIBC}
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;;
- PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;;
- *) echo hppa-${VENDOR}-linux-gnu ;;
+ PA7*) echo hppa1.1-${VENDOR}-linux-${LIBC} ;;
+ PA8*) echo hppa2.0-${VENDOR}-linux-${LIBC} ;;
+ *) echo hppa-${VENDOR}-linux-${LIBC} ;;
esac
exit ;;
ppc64:Linux:*:*)
- echo powerpc64-${VENDOR}-linux-gnu
+ echo powerpc64-${VENDOR}-linux-${LIBC}
exit ;;
ppc:Linux:*:*)
- echo powerpc-${VENDOR}-linux-gnu
+ echo powerpc-${VENDOR}-linux-${LIBC}
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-${VENDOR}-linux-${LIBC}
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-${VENDOR}-linux-${LIBC}
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
+ exit ;;
+ tile*:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
exit ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
- echo x86_64-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
+ echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -993,11 +1042,11 @@ EOF
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
+ # Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
@@ -1015,7 +1064,7 @@ EOF
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-${VENDOR}-lynxos${UNAME_RELEASE}
+ echo i386-${VENODR}-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
@@ -1029,7 +1078,7 @@ EOF
fi
exit ;;
i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
@@ -1057,13 +1106,13 @@ EOF
exit ;;
pc:*:*:*)
# Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i586.
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
- exit ;;
+ exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
@@ -1074,7 +1123,7 @@ EOF
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-${VENDOR}-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ echo i860-${VENODR}-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
@@ -1098,8 +1147,8 @@ EOF
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
@@ -1142,10 +1191,10 @@ EOF
echo ns32k-sni-sysv
fi
exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel at ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel at ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes at openmarket.com>.
# How about differentiating between stratus architectures? -djm
@@ -1171,11 +1220,11 @@ EOF
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ echo mips-nec-sysv${UNAME_RELEASE}
else
- echo mips-${VENDOR}-sysv${UNAME_RELEASE}
+ echo mips-${VENDOR}-sysv${UNAME_RELEASE}
fi
- exit ;;
+ exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
@@ -1188,6 +1237,9 @@ EOF
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-${VENDOR}-haiku
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
@@ -1214,19 +1266,21 @@ EOF
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in
- i386)
- eval $set_cc_for_build
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- UNAME_PROCESSOR="x86_64"
- fi
- fi ;;
- unknown) UNAME_PROCESSOR=powerpc ;;
- esac
+ eval $set_cc_for_build
+ if test "$UNAME_PROCESSOR" = unknown ; then
+ UNAME_PROCESSOR=powerpc
+ fi
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
@@ -1240,7 +1294,10 @@ EOF
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
@@ -1285,13 +1342,13 @@ EOF
echo pdp10-${VENDOR}-its
exit ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
+ echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-${VENDOR}-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
@@ -1309,11 +1366,11 @@ EOF
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
exit ;;
+ x86_64:VMkernel:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-esx
+ exit ;;
esac
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
@@ -1331,11 +1388,11 @@ main ()
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
- "4"
+ "4"
#else
- ""
+ ""
#endif
- ); exit (0);
+ ); exit (0);
#endif
#endif
diff --git a/config.sub b/config.sub
index 2a55a50..8b612ab 100755
--- a/config.sub
+++ b/config.sub
@@ -1,38 +1,31 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-# Free Software Foundation, Inc.
+# Copyright 1992-2013 Free Software Foundation, Inc.
-timestamp='2009-11-20'
+timestamp='2013-04-24'
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
-# Please send patches to <config-patches at gnu.org>. Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
+# Please send patches with a ChangeLog entry to config-patches at gnu.org.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -75,8 +68,7 @@ Report bugs and patches to <config-patches at gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -123,13 +115,18 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
+ android-linux)
+ os=-linux-android
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
@@ -152,12 +149,12 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze)
+ -apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
- -bluegene*)
- os=-cnk
+ -bluegene*)
+ os=-cnk
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
@@ -173,10 +170,10 @@ case $os in
os=-chorusos
basic_machine=$1
;;
- -chorusrdb)
- os=-chorusrdb
+ -chorusrdb)
+ os=-chorusrdb
basic_machine=$1
- ;;
+ ;;
-hiux*)
os=-hiuxwe2
;;
@@ -221,6 +218,12 @@ case $os in
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
+ -lynx*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
+ ;;
-lynx*)
os=-lynxos
;;
@@ -245,20 +248,27 @@ case $basic_machine in
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
+ | aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | arc | arceb \
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+ | avr | avr32 \
+ | be32 | be64 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
+ | epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
+ | le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep | metag \
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -276,34 +286,45 @@ case $basic_machine in
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
- | nios | nios2 \
+ | nds32 | nds32le | nds32be \
+ | nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
- | or32 \
+ | open8 \
+ | or1k | or32 \
| pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
- | rx \
+ | rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
- | v850 | v850e \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| we32k \
- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
- m6811 | m68hc11 | m6812 | m68hc12 | picochip)
- # Motorola 68HC11/12.
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
@@ -313,6 +334,21 @@ case $basic_machine in
basic_machine=mt-unknown
;;
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+ xgate)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
@@ -327,25 +363,30 @@ case $basic_machine in
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
+ | aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
+ | be32-* | be64-* \
| bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
+ | le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@@ -363,29 +404,34 @@ case $basic_machine in
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
- | nios-* | nios2-* \
+ | nds32-* | nds32le-* | nds32be-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
- | romp-* | rs6000-* | rx-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+ | tahoe-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile*-* \
| tron-* \
| ubicom32-* \
- | v850-* | v850e-* | vax-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
| we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-* | z80-*)
@@ -410,7 +456,7 @@ case $basic_machine in
basic_machine=a29k-amd
os=-udi
;;
- abacus)
+ abacus)
basic_machine=abacus-unknown
;;
adobe68k)
@@ -480,11 +526,20 @@ case $basic_machine in
basic_machine=powerpc-ibm
os=-cnk
;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
c90)
basic_machine=c90-cray
os=-unicos
;;
- cegcc)
+ cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
@@ -516,7 +571,7 @@ case $basic_machine in
basic_machine=craynv-cray
os=-unicosmp
;;
- cr16)
+ cr16 | cr16-*)
basic_machine=cr16-unknown
os=-elf
;;
@@ -674,7 +729,6 @@ case $basic_machine in
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
@@ -732,9 +786,13 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
- microblaze)
+ microblaze*)
basic_machine=microblaze-xilinx
;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=-mingw64
+ ;;
mingw32)
basic_machine=i386-pc
os=-mingw32
@@ -771,10 +829,18 @@ case $basic_machine in
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
+ msys)
+ basic_machine=i386-pc
+ os=-msys
+ ;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
@@ -839,6 +905,12 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -921,9 +993,10 @@ case $basic_machine in
;;
power) basic_machine=power-ibm
;;
- ppc) basic_machine=powerpc-unknown
+ ppc | ppcbe) basic_machine=powerpc-unknown
;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
@@ -948,7 +1021,11 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
- rdos)
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ os=-rdos
+ ;;
+ rdos32)
basic_machine=i386-pc
os=-rdos
;;
@@ -1017,6 +1094,9 @@ case $basic_machine in
basic_machine=i860-stratus
os=-sysv4
;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
sun2)
basic_machine=m68000-sun
;;
@@ -1073,20 +1153,8 @@ case $basic_machine in
basic_machine=t90-cray
os=-unicos
;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
tile*)
- basic_machine=tile-unknown
+ basic_machine=$basic_machine-unknown
os=-linux-gnu
;;
tx39)
@@ -1156,6 +1224,9 @@ case $basic_machine in
xps | xps100)
basic_machine=xps100-honeywell
;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ;;
ymp)
basic_machine=ymp-cray
os=-unicos
@@ -1253,11 +1324,11 @@ esac
if [ x"$os" != x"" ]
then
case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
+ # First match some system type aliases
+ # that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
- -auroraux)
- os=-auroraux
+ -auroraux)
+ os=-auroraux
;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
@@ -1281,20 +1352,21 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* \
+ | -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1341,7 +1413,7 @@ case $os in
-opened*)
os=-openedition
;;
- -os400*)
+ -os400*)
os=-os400
;;
-wince*)
@@ -1390,7 +1462,7 @@ case $os in
-sinix*)
os=-sysv4
;;
- -tpf*)
+ -tpf*)
os=-tpf
;;
-triton*)
@@ -1426,15 +1498,14 @@ case $os in
-aros*)
os=-aros
;;
- -kaos*)
- os=-kaos
- ;;
-zvmoe)
os=-zvmoe
;;
-dicos*)
os=-dicos
;;
+ -nacl*)
+ ;;
-none)
;;
*)
@@ -1457,10 +1528,10 @@ else
# system, and we'll never get to this point.
case $basic_machine in
- score-*)
+ score-*)
os=-elf
;;
- spu-*)
+ spu-*)
os=-elf
;;
*-acorn)
@@ -1472,8 +1543,20 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
- c4x-* | tic4x-*)
- os=-coff
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ hexagon-*)
+ os=-elf
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
@@ -1493,14 +1576,11 @@ case $basic_machine in
;;
m68000-sun)
os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
;;
m68*-cisco)
os=-aout
;;
- mep-*)
+ mep-*)
os=-elf
;;
mips*-cisco)
@@ -1509,6 +1589,9 @@ case $basic_machine in
mips*-*)
os=-elf
;;
+ or1k-*)
+ os=-elf
+ ;;
or32-*)
os=-coff
;;
@@ -1527,7 +1610,7 @@ case $basic_machine in
*-ibm)
os=-aix
;;
- *-knuth)
+ *-knuth)
os=-mmixware
;;
*-wec)
diff --git a/configure b/configure
index 3a904b7..e0fdea8 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sumo 0.23.0.
+# Generated by GNU Autoconf 2.69 for sumo 0.24.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='sumo'
PACKAGE_TARNAME='sumo'
-PACKAGE_VERSION='0.23.0'
-PACKAGE_STRING='sumo 0.23.0'
+PACKAGE_VERSION='0.24.0'
+PACKAGE_STRING='sumo 0.24.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1377,7 +1377,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures sumo 0.23.0 to adapt to many kinds of systems.
+\`configure' configures sumo 0.24.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1448,7 +1448,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of sumo 0.23.0:";;
+ short | recursive ) echo "Configuration of sumo 0.24.0:";;
esac
cat <<\_ACEOF
@@ -1595,7 +1595,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-sumo configure 0.23.0
+sumo configure 0.24.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2244,7 +2244,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by sumo $as_me 0.23.0, which was
+It was created by sumo $as_me 0.24.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3223,7 +3223,7 @@ fi
# Define the identity of the package.
PACKAGE='sumo'
- VERSION='0.23.0'
+ VERSION='0.24.0'
cat >>confdefs.h <<_ACEOF
@@ -15691,9 +15691,6 @@ $as_echo "#define SUMOReal float" >>confdefs.h
ac_disabled="$ac_disabled DoublePrecision"
fi
-$as_echo "#define SUMOLong long long int" >>confdefs.h
-
-
# Check whether --enable-subsecond was given.
if test "${enable_subsecond+set}" = set; then :
enableval=$enable_subsecond;
@@ -15721,9 +15718,6 @@ $as_echo "#define OUTPUT_ACCURACY 2" >>confdefs.h
$as_echo "#define GEO_OUTPUT_ACCURACY 6" >>confdefs.h
-$as_echo "#define SUMOLong long long int" >>confdefs.h
-
-
@@ -15964,7 +15958,7 @@ else
WITH_VERSION_H_FALSE=
fi
-if test -d .svn; then
+if test -d .svn || test x$PACKAGE_VERSION == xsvn -a -f src/version.h; then
$as_echo "#define HAVE_VERSION_H 1" >>confdefs.h
@@ -18184,7 +18178,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by sumo $as_me 0.23.0, which was
+This file was extended by sumo $as_me 0.24.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -18250,7 +18244,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-sumo config.status 0.23.0
+sumo config.status 0.24.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index e1551bc..b37a9ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(sumo, 0.23.0)
+AC_INIT(sumo, 0.24.0)
AC_CONFIG_SRCDIR(src/sumo_main.cpp)
AC_CANONICAL_SYSTEM
@@ -84,7 +84,6 @@ else
AC_DEFINE([SUMOReal], [float], [defines the precision of floats])
ac_disabled="$ac_disabled DoublePrecision"
fi
-AC_DEFINE([SUMOLong], [long long int], [defines a long])
AC_ARG_ENABLE([subsecond], [AS_HELP_STRING([--disable-subsecond],[Disable subsecond timesteps.])])
if test x$enable_subsecond != xno; then
@@ -98,7 +97,6 @@ AC_DEFINE([POSITION_EPS], [(SUMOReal)0.1], [defines the epsilon to use on positi
AC_DEFINE([NUMERICAL_EPS], [(SUMOReal)0.001], [defines the epsilon to use on general floating point comparison])
AC_DEFINE([OUTPUT_ACCURACY], [2], [defines the number of digits after the comma in output])
AC_DEFINE([GEO_OUTPUT_ACCURACY], [6], [defines the number of digits after the comma in geo-coordinates output])
-AC_DEFINE([SUMOLong], [long long int], [defines the type for very long integers])
dnl ... for xerces 3.0
PKG_CHECK_MODULES([XERCES], [xerces-c >= 3.0],
@@ -129,7 +127,7 @@ else
fi
AM_CONDITIONAL([WITH_VERSION_H], test -d .svn)
-if test -d .svn; then
+if test -d .svn || test x$PACKAGE_VERSION == xsvn -a -f src/version.h; then
AC_DEFINE([HAVE_VERSION_H], [1], [Define if auto-generated version.h should be used.])
else
AC_DEFINE_UNQUOTED(VERSION_STRING, "$PACKAGE_VERSION", [Defined if auto-generated version.h is unavailable.])
diff --git a/data/typemap/opendriveNetconvert.typ.xml b/data/typemap/opendriveNetconvert.typ.xml
new file mode 100644
index 0000000..a35d192
--- /dev/null
+++ b/data/typemap/opendriveNetconvert.typ.xml
@@ -0,0 +1,8 @@
+<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/types_file.xsd">
+ <type id="driving" priority="1" speed="22.22" disallow="pedestrian" width="3.65"/>
+ <type id="mwyEntry" priority="1" speed="22.22" disallow="pedestrian" width="3.65"/>
+ <type id="mwyExit" priority="1" speed="22.22" disallow="pedestrian" width="3.65"/>
+ <type id="parking" priority="1" speed="1.39" disallow="pedestrian" width="3.65"/>
+ <type id="special1" priority="1" speed="22.22" disallow="pedestrian" width="3.65"/>
+ <type id="stop" priority="1" speed="22.22" disallow="pedestrian" width="3.65"/>
+</types>
diff --git a/data/typemap/opendriveNetconvertBicycle.typ.xml b/data/typemap/opendriveNetconvertBicycle.typ.xml
new file mode 100644
index 0000000..734f46f
--- /dev/null
+++ b/data/typemap/opendriveNetconvertBicycle.typ.xml
@@ -0,0 +1,3 @@
+<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/types_file.xsd">
+ <type id="biking" priority="1" speed="22.22" allow="bicycle" width="1.5"/>
+</types>
diff --git a/data/typemap/opendriveNetconvertPedestrians.typ.xml b/data/typemap/opendriveNetconvertPedestrians.typ.xml
new file mode 100644
index 0000000..be2389f
--- /dev/null
+++ b/data/typemap/opendriveNetconvertPedestrians.typ.xml
@@ -0,0 +1,3 @@
+<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/types_file.xsd">
+ <type id="sidewalk" priority="1" speed="22.22" allow="pedestrian" width="2.5"/>
+</types>
diff --git a/data/typemap/osmBidiRailNetconvert.typ.xml b/data/typemap/osmBidiRailNetconvert.typ.xml
new file mode 100644
index 0000000..1754364
--- /dev/null
+++ b/data/typemap/osmBidiRailNetconvert.typ.xml
@@ -0,0 +1,7 @@
+<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/types_file.xsd">
+ <type id="railway.rail" oneway="false"/>
+ <type id="railway.tram" oneway="false"/>
+ <type id="railway.light_rail" oneway="false"/>
+ <type id="railway.subway" oneway="false"/>
+ <type id="railway.preserved" oneway="false"/>
+</types>
diff --git a/data/typemap/osmNetconvert.typ.xml b/data/typemap/osmNetconvert.typ.xml
index 3fdcca6..c47b6eb 100644
--- a/data/typemap/osmNetconvert.typ.xml
+++ b/data/typemap/osmNetconvert.typ.xml
@@ -1,39 +1,40 @@
-<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo-sim.org/xsd/types_file.xsd">
- <type id="highway.motorway" numLanes="2" speed="44.44" priority="13" oneway="true" disallow="pedestrian bicycle moped rail rail_urban rail_electric"/>
- <type id="highway.motorway_link" numLanes="1" speed="22.22" priority="12" oneway="true" disallow="pedestrian bicycle moped rail rail_urban rail_electric"/>
- <type id="highway.trunk" numLanes="2" speed="27.78" priority="11" disallow="pedestrian bicycle rail rail_urban rail_electric"/>
- <type id="highway.trunk_link" numLanes="1" speed="22.22" priority="10" disallow="pedestrian bicycle rail rail_urban rail_electric"/>
- <type id="highway.primary" numLanes="2" speed="27.78" priority="9" disallow="rail rail_urban rail_electric"/>
- <type id="highway.primary_link" numLanes="1" speed="22.22" priority="8" disallow="rail rail_urban rail_electric"/>
- <type id="highway.secondary" numLanes="2" speed="27.78" priority="7" disallow="rail rail_urban rail_electric"/>
- <type id="highway.secondary_link" numLanes="1" speed="22.22" priority="6" disallow="rail rail_urban rail_electric"/>
- <type id="highway.tertiary" numLanes="1" speed="22.22" priority="6" disallow="rail rail_urban rail_electric"/>
- <type id="highway.tertiary_link" numLanes="1" speed="22.22" priority="5" disallow="rail rail_urban rail_electric"/>
- <type id="highway.unclassified" numLanes="1" speed="13.89" priority="5" disallow="rail rail_urban rail_electric"/>
- <type id="highway.residential" numLanes="1" speed="13.89" priority="4" disallow="rail rail_urban rail_electric"/>
- <type id="highway.living_street" numLanes="1" speed="2.78" priority="3" disallow="rail rail_urban rail_electric"/>
- <type id="highway.service" numLanes="1" speed="5.56" priority="2" allow="delivery pedestrian bicycle"/>
- <type id="highway.track" numLanes="1" speed="5.56" priority="1" disallow="rail rail_urban rail_electric"/>
- <type id="highway.services" numLanes="1" speed="8.33" priority="1" disallow="rail rail_urban rail_electric"/>
- <type id="highway.unsurfaced" numLanes="1" speed="8.33" priority="1" disallow="rail rail_urban rail_electric"/>
-
- <type id="highway.footway" numLanes="1" speed="8.33" priority="1" oneway="true" allow="pedestrian"/>
- <type id="highway.pedestrian" numLanes="1" speed="8.33" priority="1" oneway="true" allow="pedestrian"/>
- <type id="highway.path" numLanes="1" speed="2.78" priority="1" oneway="true" allow="pedestrian bicycle"/>
- <type id="highway.bridleway" numLanes="1" speed="2.78" priority="1" oneway="true" allow="pedestrian"/>
- <type id="highway.cycleway" numLanes="1" speed="5.56" priority="1" oneway="true" allow="bicycle"/>
- <type id="highway.step" numLanes="1" speed="1.39" priority="1" oneway="true" allow="pedestrian"/>
- <type id="highway.steps" numLanes="1" speed="1.39" priority="1" oneway="true" allow="pedestrian"/>
- <type id="highway.stairs" numLanes="1" speed="1.39" priority="1" oneway="true" allow="pedestrian"/>
-
- <type id="highway.bus_guideway" numLanes="1" speed="8.33" priority="1" oneway="true" allow="bus"/>
- <type id="highway.raceway" numLanes="2" speed="83.33" priority="14" allow="vip"/>
- <type id="highway.ford" numLanes="1" speed="2.78" priority="1" allow="army"/>
-
- <type id="railway.rail" numLanes="1" speed="83.33" priority="15" oneway="true" allow="rail rail_electric"/>
- <type id="railway.tram" numLanes="1" speed="13.89" priority="15" oneway="true" allow="tram"/>
- <type id="railway.light_rail" numLanes="1" speed="27.78" priority="15" oneway="true" allow="rail_urban"/>
- <type id="railway.subway" numLanes="1" speed="27.78" priority="15" oneway="true" allow="rail_urban"/>
- <type id="railway.preserved" numLanes="1" speed="27.78" priority="15" oneway="true" allow="rail"/>
+<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/types_file.xsd">
+ <type id="highway.motorway" numLanes="2" speed="44.44" priority="13" oneway="true" disallow="pedestrian bicycle moped rail rail_urban rail_electric tram ship"/>
+ <type id="highway.motorway_link" numLanes="1" speed="22.22" priority="12" oneway="true" disallow="pedestrian bicycle moped rail rail_urban rail_electric tram ship"/>
+ <type id="highway.trunk" numLanes="2" speed="27.78" priority="11" oneway="false" disallow="pedestrian bicycle rail rail_urban rail_electric tram ship"/>
+ <type id="highway.trunk_link" numLanes="1" speed="22.22" priority="10" oneway="false" disallow="pedestrian bicycle rail rail_urban rail_electric tram ship"/>
+ <type id="highway.primary" numLanes="2" speed="27.78" priority="9" oneway="false" disallow="rail rail_urban rail_electric tram ship"/>
+ <type id="highway.primary_link" numLanes="1" speed="22.22" priority="8" oneway="false" disallow="rail rail_urban rail_electric tram ship"/>
+ <type id="highway.secondary" numLanes="2" speed="27.78" priority="7" oneway="false" disallow="rail rail_urban rail_electric tram ship"/>
+ <type id="highway.secondary_link" numLanes="1" speed="22.22" priority="6" oneway="false" disallow="rail rail_urban rail_electric tram ship"/>
+ <type id="highway.tertiary" numLanes="1" speed="22.22" priority="6" oneway="false" disallow="rail rail_urban rail_electric tram ship"/>
+ <type id="highway.tertiary_link" numLanes="1" speed="22.22" priority="5" oneway="false" disallow="rail rail_urban rail_electric tram ship"/>
+ <type id="highway.unclassified" numLanes="1" speed="13.89" priority="5" oneway="false" disallow="rail rail_urban rail_electric tram ship"/>
+ <type id="highway.residential" numLanes="1" speed="13.89" priority="4" oneway="false" disallow="rail rail_urban rail_electric tram ship"/>
+ <type id="highway.living_street" numLanes="1" speed="2.78" priority="3" oneway="false" disallow="rail rail_urban rail_electric tram ship"/>
+ <type id="highway.service" numLanes="1" speed="5.56" priority="2" oneway="false" allow="delivery pedestrian bicycle"/>
+ <type id="highway.track" numLanes="1" speed="5.56" priority="1" oneway="false" disallow="rail rail_urban rail_electric tram ship"/>
+ <type id="highway.services" numLanes="1" speed="8.33" priority="1" oneway="false" disallow="rail rail_urban rail_electric tram ship"/>
+ <type id="highway.unsurfaced" numLanes="1" speed="8.33" priority="1" oneway="false" disallow="rail rail_urban rail_electric tram ship"/>
+
+ <!-- everything which serves mainly pedestrians is oneway because all current pedestrian models do not care about direction -->
+ <type id="highway.footway" numLanes="1" speed="8.33" priority="1" oneway="true" width="2" allow="pedestrian"/>
+ <type id="highway.pedestrian" numLanes="1" speed="8.33" priority="1" oneway="true" width="2" allow="pedestrian"/>
+ <type id="highway.path" numLanes="1" speed="2.78" priority="1" oneway="true" width="2" allow="pedestrian bicycle"/>
+ <type id="highway.bridleway" numLanes="1" speed="2.78" priority="1" oneway="true" width="2" allow="pedestrian"/>
+ <type id="highway.cycleway" numLanes="1" speed="5.56" priority="1" oneway="false" width="1" allow="bicycle"/>
+ <type id="highway.step" numLanes="1" speed="1.39" priority="1" oneway="true" width="2" allow="pedestrian"/>
+ <type id="highway.steps" numLanes="1" speed="1.39" priority="1" oneway="true" width="2" allow="pedestrian"/>
+ <type id="highway.stairs" numLanes="1" speed="1.39" priority="1" oneway="true" width="2" allow="pedestrian"/>
+
+ <type id="highway.bus_guideway" numLanes="1" speed="8.33" priority="1" oneway="true" allow="bus"/>
+ <type id="highway.raceway" numLanes="2" speed="83.33" priority="14" oneway="false" allow="vip"/>
+ <type id="highway.ford" numLanes="1" speed="2.78" priority="1" oneway="false" allow="army"/>
+
+ <type id="railway.rail" numLanes="1" speed="83.33" priority="15" oneway="true" allow="rail rail_electric"/>
+ <type id="railway.tram" numLanes="1" speed="13.89" priority="15" oneway="true" allow="tram"/>
+ <type id="railway.light_rail" numLanes="1" speed="27.78" priority="15" oneway="true" allow="rail_urban"/>
+ <type id="railway.subway" numLanes="1" speed="27.78" priority="15" oneway="true" allow="rail_urban"/>
+ <type id="railway.preserved" numLanes="1" speed="27.78" priority="15" oneway="true" allow="rail"/>
</types>
diff --git a/data/typemap/osmNetconvertBicycle.typ.xml b/data/typemap/osmNetconvertBicycle.typ.xml
new file mode 100644
index 0000000..a292c0e
--- /dev/null
+++ b/data/typemap/osmNetconvertBicycle.typ.xml
@@ -0,0 +1,6 @@
+<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/types_file.xsd">
+ <type id="cycleway.lane" bikeLaneWidth="1"/>
+ <type id="cycleway.opposite_lane" bikeLaneWidth="1"/>
+ <type id="cycleway.track" bikeLaneWidth="1.5"/>
+ <type id="cycleway.opposite_track" bikeLaneWidth="1.5"/>
+</types>
diff --git a/data/typemap/osmNetconvertPedestrians.typ.xml b/data/typemap/osmNetconvertPedestrians.typ.xml
index 8c23100..be25373 100644
--- a/data/typemap/osmNetconvertPedestrians.typ.xml
+++ b/data/typemap/osmNetconvertPedestrians.typ.xml
@@ -1,39 +1,10 @@
-<types>
- <type id="highway.motorway" numLanes="2" speed="27.78" priority="13" oneway="true" disallow="pedestrian bicycle moped rail rail_urban rail_electric"/>
- <type id="highway.motorway_link" numLanes="1" speed="16.67" priority="12" oneway="true" disallow="pedestrian bicycle moped rail rail_urban rail_electric"/>
- <type id="highway.trunk" numLanes="2" speed="13.89" priority="11" disallow="pedestrian bicycle rail rail_urban rail_electric"/>
- <type id="highway.trunk_link" numLanes="1" speed="13.89" priority="10" disallow="pedestrian bicycle rail rail_urban rail_electric"/>
- <type id="highway.primary" numLanes="2" speed="13.89" priority="9" sidewalkWidth="3" disallow="pedestrian rail rail_urban rail_electric"/>
- <type id="highway.primary_link" numLanes="1" speed="13.89" priority="8" sidewalkWidth="3" disallow="pedestrian rail rail_urban rail_electric"/>
- <type id="highway.secondary" numLanes="2" speed="13.89" priority="7" sidewalkWidth="3" disallow="pedestrian rail rail_urban rail_electric"/>
- <type id="highway.secondary_link" numLanes="1" speed="13.89" priority="6" sidewalkWidth="3" disallow="pedestrian rail rail_urban rail_electric"/>
- <type id="highway.tertiary" numLanes="1" speed="13.89" priority="6" sidewalkWidth="3" disallow="pedestrian rail rail_urban rail_electric"/>
- <type id="highway.tertiary_link" numLanes="1" speed="13.89" priority="5" sidewalkWidth="2" disallow="pedestrian rail rail_urban rail_electric"/>
- <type id="highway.unclassified" numLanes="1" speed="13.89" priority="5" sidewalkWidth="2" disallow="pedestrian rail rail_urban rail_electric"/>
- <type id="highway.residential" numLanes="1" speed="13.89" priority="4" sidewalkWidth="2" disallow="pedestrian rail rail_urban rail_electric"/>
- <type id="highway.living_street" numLanes="1" speed="2.78" priority="3" disallow="rail rail_urban rail_electric"/>
- <type id="highway.service" numLanes="1" speed="5.56" priority="2" allow="delivery pedestrian bicycle"/>
- <type id="highway.track" numLanes="1" speed="5.56" priority="1" disallow="rail rail_urban rail_electric"/>/>
- <type id="highway.services" numLanes="1" speed="8.33" priority="1" disallow="rail rail_urban rail_electric"/>/>
- <type id="highway.unsurfaced" numLanes="1" speed="8.33" priority="1" disallow="rail rail_urban rail_electric"/>/>
-
- <type id="highway.footway" numLanes="1" speed="8.33" priority="1" oneway="true" allow="pedestrian"/>
- <type id="highway.pedestrian" numLanes="1" speed="8.33" priority="1" oneway="true" allow="pedestrian"/>
- <type id="highway.path" numLanes="1" speed="2.78" priority="1" oneway="true" allow="pedestrian bicycle"/>
- <type id="highway.bridleway" numLanes="1" speed="2.78" priority="1" oneway="true" allow="pedestrian"/>
- <type id="highway.cycleway" numLanes="1" speed="5.56" priority="1" oneway="true" allow="bicycle"/>
- <type id="highway.step" numLanes="1" speed="1.39" priority="1" oneway="true" allow="pedestrian"/>
- <type id="highway.steps" numLanes="1" speed="1.39" priority="1" oneway="true" allow="pedestrian"/>
- <type id="highway.stairs" numLanes="1" speed="1.39" priority="1" oneway="true" allow="pedestrian"/>
-
- <type id="highway.bus_guideway" numLanes="1" speed="8.33" priority="1" oneway="true" allow="bus"/>
- <type id="highway.raceway" numLanes="2" speed="83.33" priority="14" allow="vip"/>
- <type id="highway.ford" numLanes="1" speed="2.78" priority="1" allow="army"/>
-
- <type id="railway.rail" numLanes="1" speed="83.33" priority="15" oneway="true" allow="rail rail_electric"/>
- <type id="railway.tram" numLanes="1" speed="13.89" priority="15" oneway="true" allow="tram"/>
- <type id="railway.light_rail" numLanes="1" speed="27.78" priority="15" oneway="true" allow="rail_urban"/>
- <type id="railway.subway" numLanes="1" speed="27.78" priority="15" oneway="true" allow="rail_urban"/>
- <type id="railway.preserved" numLanes="1" speed="27.78" priority="15" oneway="true" allow="rail"/>
-
+<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/types_file.xsd">
+ <type id="highway.primary" sidewalkWidth="3" disallow="pedestrian rail rail_urban rail_electric tram ship"/>
+ <type id="highway.primary_link" sidewalkWidth="3" disallow="pedestrian rail rail_urban rail_electric tram ship"/>
+ <type id="highway.secondary" sidewalkWidth="3" disallow="pedestrian rail rail_urban rail_electric tram ship"/>
+ <type id="highway.secondary_link" sidewalkWidth="3" disallow="pedestrian rail rail_urban rail_electric tram ship"/>
+ <type id="highway.tertiary" sidewalkWidth="3" disallow="pedestrian rail rail_urban rail_electric tram ship"/>
+ <type id="highway.tertiary_link" sidewalkWidth="2" disallow="pedestrian rail rail_urban rail_electric tram ship"/>
+ <type id="highway.unclassified" sidewalkWidth="2" disallow="pedestrian rail rail_urban rail_electric tram ship"/>
+ <type id="highway.residential" sidewalkWidth="2" disallow="pedestrian rail rail_urban rail_electric tram ship"/>
</types>
diff --git a/data/typemap/osmNetconvertShips.typ.xml b/data/typemap/osmNetconvertShips.typ.xml
index 594c629..46ef015 100644
--- a/data/typemap/osmNetconvertShips.typ.xml
+++ b/data/typemap/osmNetconvertShips.typ.xml
@@ -1,4 +1,4 @@
-<types>
- <type id="waterway.river" width="7" numLanes="1" speed="10" priority="13" allow="ship"/>
- <type id="waterway.canal" width="5" numLanes="1" speed="10" priority="13" allow="ship"/>
+<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/types_file.xsd">
+ <type id="waterway.river" width="7" numLanes="1" speed="10" priority="13" oneway="false" allow="ship"/>
+ <type id="waterway.canal" width="5" numLanes="1" speed="10" priority="13" oneway="false" allow="ship"/>
</types>
diff --git a/data/typemap/osmNetconvertUrbanDe.typ.xml b/data/typemap/osmNetconvertUrbanDe.typ.xml
index efb4fc7..2895c05 100644
--- a/data/typemap/osmNetconvertUrbanDe.typ.xml
+++ b/data/typemap/osmNetconvertUrbanDe.typ.xml
@@ -1,39 +1,12 @@
-<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo-sim.org/xsd/types_file.xsd">
- <type id="highway.motorway" numLanes="2" speed="27.78" priority="13" oneway="true" disallow="pedestrian bicycle moped rail rail_urban rail_electric"/>
- <type id="highway.motorway_link" numLanes="1" speed="16.67" priority="12" oneway="true" disallow="pedestrian bicycle moped rail rail_urban rail_electric"/>
- <type id="highway.trunk" numLanes="2" speed="13.89" priority="11" disallow="pedestrian bicycle rail rail_urban rail_electric"/>
- <type id="highway.trunk_link" numLanes="1" speed="13.89" priority="10" disallow="pedestrian bicycle rail rail_urban rail_electric"/>
- <type id="highway.primary" numLanes="2" speed="13.89" priority="9" disallow="rail rail_urban rail_electric"/>
- <type id="highway.primary_link" numLanes="1" speed="13.89" priority="8" disallow="rail rail_urban rail_electric"/>
- <type id="highway.secondary" numLanes="2" speed="13.89" priority="7" disallow="rail rail_urban rail_electric"/>
- <type id="highway.secondary_link" numLanes="1" speed="13.89" priority="6" disallow="rail rail_urban rail_electric"/>
- <type id="highway.tertiary" numLanes="1" speed="13.89" priority="6" disallow="rail rail_urban rail_electric"/>
- <type id="highway.tertiary_link" numLanes="1" speed="13.89" priority="5" disallow="rail rail_urban rail_electric"/>
- <type id="highway.unclassified" numLanes="1" speed="13.89" priority="5" disallow="rail rail_urban rail_electric"/>
- <type id="highway.residential" numLanes="1" speed="13.89" priority="4" disallow="rail rail_urban rail_electric"/>
- <type id="highway.living_street" numLanes="1" speed="2.78" priority="3" disallow="rail rail_urban rail_electric"/>
- <type id="highway.service" numLanes="1" speed="5.56" priority="2" allow="delivery pedestrian bicycle"/>
- <type id="highway.track" numLanes="1" speed="5.56" priority="1" disallow="rail rail_urban rail_electric"/>
- <type id="highway.services" numLanes="1" speed="8.33" priority="1" disallow="rail rail_urban rail_electric"/>
- <type id="highway.unsurfaced" numLanes="1" speed="8.33" priority="1" disallow="rail rail_urban rail_electric"/>
-
- <type id="highway.footway" numLanes="1" speed="8.33" priority="1" oneway="true" allow="pedestrian"/>
- <type id="highway.pedestrian" numLanes="1" speed="8.33" priority="1" oneway="true" allow="pedestrian"/>
- <type id="highway.path" numLanes="1" speed="2.78" priority="1" oneway="true" allow="pedestrian bicycle"/>
- <type id="highway.bridleway" numLanes="1" speed="2.78" priority="1" oneway="true" allow="pedestrian"/>
- <type id="highway.cycleway" numLanes="1" speed="5.56" priority="1" oneway="true" allow="bicycle"/>
- <type id="highway.step" numLanes="1" speed="1.39" priority="1" oneway="true" allow="pedestrian"/>
- <type id="highway.steps" numLanes="1" speed="1.39" priority="1" oneway="true" allow="pedestrian"/>
- <type id="highway.stairs" numLanes="1" speed="1.39" priority="1" oneway="true" allow="pedestrian"/>
-
- <type id="highway.bus_guideway" numLanes="1" speed="8.33" priority="1" oneway="true" allow="bus"/>
- <type id="highway.raceway" numLanes="2" speed="83.33" priority="14" allow="vip"/>
- <type id="highway.ford" numLanes="1" speed="2.78" priority="1" allow="army"/>
-
- <type id="railway.rail" numLanes="1" speed="83.33" priority="15" oneway="true" allow="rail rail_electric"/>
- <type id="railway.tram" numLanes="1" speed="13.89" priority="15" oneway="true" allow="tram"/>
- <type id="railway.light_rail" numLanes="1" speed="27.78" priority="15" oneway="true" allow="rail_urban"/>
- <type id="railway.subway" numLanes="1" speed="27.78" priority="15" oneway="true" allow="rail_urban"/>
- <type id="railway.preserved" numLanes="1" speed="27.78" priority="15" oneway="true" allow="rail"/>
-
+<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/types_file.xsd">
+ <type id="highway.motorway" speed="27.78"/>
+ <type id="highway.motorway_link" speed="16.67"/>
+ <type id="highway.trunk" speed="13.89"/>
+ <type id="highway.trunk_link" speed="13.89"/>
+ <type id="highway.primary" speed="13.89"/>
+ <type id="highway.primary_link" speed="13.89"/>
+ <type id="highway.secondary" speed="13.89"/>
+ <type id="highway.secondary_link" speed="13.89"/>
+ <type id="highway.tertiary" speed="13.89"/>
+ <type id="highway.tertiary_link" speed="13.89"/>
</types>
diff --git a/data/typemap/osmPolyconvert.typ.xml b/data/typemap/osmPolyconvert.typ.xml
index db223cc..bc99144 100644
--- a/data/typemap/osmPolyconvert.typ.xml
+++ b/data/typemap/osmPolyconvert.typ.xml
@@ -36,4 +36,5 @@
<polygonType id="boundary" name="boundary" color="1.0,.33,.33" layer="0" fill="false" discard="true"/>
<polygonType id="admin_level" name="admin_level" color="1.0,.33,.33" layer="0" fill="false" discard="true"/>
+ <polygonType id="place" name="admin_level" color="1.0,.33,.33" layer="0" fill="false" discard="true"/>
</polygonTypes>
diff --git a/data/xsd/activitygenConfiguration.xsd b/data/xsd/activitygenConfiguration.xsd
index 6bede0a..200401c 100644
--- a/data/xsd/activitygenConfiguration.xsd
+++ b/data/xsd/activitygenConfiguration.xsd
@@ -25,7 +25,7 @@
<xsd:complexType name="outputType">
<xsd:all>
- <xsd:element name="output-prefix" type="fileOptionType" minOccurs="0"/>
+ <xsd:element name="output-prefix" type="strOptionType" minOccurs="0"/>
<xsd:element name="output-file" type="fileOptionType" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
diff --git a/data/xsd/additional_file.xsd b/data/xsd/additional_file.xsd
index 9514c84..fe11c4f 100644
--- a/data/xsd/additional_file.xsd
+++ b/data/xsd/additional_file.xsd
@@ -287,6 +287,7 @@
<xsd:attribute name="type" type="xsd:string" use="optional"/>
<xsd:attribute name="color" type="colorType" use="required"/>
<xsd:attribute name="fill" type="boolType" use="optional"/>
+ <xsd:attribute name="geo" type="boolType" use="optional"/>
<xsd:attribute name="layer" type="xsd:float" use="optional"/>
<xsd:attribute name="shape" type="shapeType" use="required"/>
<xsd:attribute name="angle" type="xsd:float" use="optional"/>
diff --git a/data/xsd/baseTypes.xsd b/data/xsd/baseTypes.xsd
index 30f94ff..e0e5f11 100644
--- a/data/xsd/baseTypes.xsd
+++ b/data/xsd/baseTypes.xsd
@@ -214,4 +214,40 @@
<xsd:attribute name="value" type="xsd:string" use="required"/>
</xsd:complexType>
+ <xsd:complexType name="typeType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="restriction" type="restrictionType"/>
+ </xsd:choice>
+ <xsd:attribute name="id" type="xsd:string" use="required"/>
+ <xsd:attribute name="allow" type="xsd:string"/>
+ <xsd:attribute name="disallow" type="xsd:string"/>
+ <xsd:attribute name="priority" type="xsd:int"/>
+ <xsd:attribute name="numLanes" type="xsd:int"/>
+ <xsd:attribute name="speed" type="xsd:float"/>
+ <xsd:attribute name="discard" type="boolType"/>
+ <xsd:attribute name="oneway" type="boolType"/>
+ <xsd:attribute name="width" type="xsd:float"/>
+ <xsd:attribute name="sidewalkWidth" type="xsd:float"/>
+ <xsd:attribute name="bikeLaneWidth" type="xsd:float"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="restrictionType">
+ <xsd:attribute name="vClass" type="xsd:string" use="required"/>
+ <xsd:attribute name="speed" type="xsd:float" use="required"/>
+ </xsd:complexType>
+
+ <xsd:simpleType name="nodeTypeType">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="traffic_light"/>
+ <xsd:enumeration value="right_before_left"/>
+ <xsd:enumeration value="priority"/>
+ <xsd:enumeration value="dead_end"/>
+ <xsd:enumeration value="unregulated"/>
+ <xsd:enumeration value="traffic_light_unregulated"/>
+ <xsd:enumeration value="rail_signal"/>
+ <xsd:enumeration value="allway_stop"/>
+ <xsd:enumeration value="priority_stop"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
</xsd:schema>
diff --git a/data/xsd/connections_file.xsd b/data/xsd/connections_file.xsd
index e23f2ff..4395d2b 100644
--- a/data/xsd/connections_file.xsd
+++ b/data/xsd/connections_file.xsd
@@ -29,6 +29,7 @@
<xsd:attribute name="toLane" type="xsd:nonNegativeInteger" use="optional"/>
<xsd:attribute name="pass" type="boolType" use="optional"/>
<xsd:attribute name="uncontrolled" type="boolType" use="optional"/>
+ <xsd:attribute name="keepClear" type="boolType" use="optional"/>
</xsd:complexType>
<xsd:complexType name="prohibitionType">
@@ -57,9 +58,10 @@
<xsd:complexType name="crossingType">
<xsd:attribute name="node" type="xsd:string" use="required"/>
- <xsd:attribute name="edges" type="xsd:string" use="required"/>
+ <xsd:attribute name="edges" type="xsd:string" use="optional"/>
<xsd:attribute name="priority" type="xsd:int" use="optional"/>
<xsd:attribute name="width" type="positiveFloatType" use="optional"/>
+ <xsd:attribute name="discard" type="boolType" use="optional"/>
</xsd:complexType>
<xsd:complexType name="customShapeType">
diff --git a/data/xsd/dfrouterConfiguration.xsd b/data/xsd/dfrouterConfiguration.xsd
index 08122b8..be13451 100644
--- a/data/xsd/dfrouterConfiguration.xsd
+++ b/data/xsd/dfrouterConfiguration.xsd
@@ -27,7 +27,7 @@
<xsd:complexType name="outputType">
<xsd:all>
- <xsd:element name="output-prefix" type="fileOptionType" minOccurs="0"/>
+ <xsd:element name="output-prefix" type="strOptionType" minOccurs="0"/>
<xsd:element name="routes-output" type="fileOptionType" minOccurs="0"/>
<xsd:element name="routes-for-all" type="boolOptionType" minOccurs="0"/>
<xsd:element name="detector-output" type="fileOptionType" minOccurs="0"/>
diff --git a/data/xsd/duarouterConfiguration.xsd b/data/xsd/duarouterConfiguration.xsd
index 29d9266..461df6a 100644
--- a/data/xsd/duarouterConfiguration.xsd
+++ b/data/xsd/duarouterConfiguration.xsd
@@ -34,7 +34,7 @@
<xsd:complexType name="outputType">
<xsd:all>
- <xsd:element name="output-prefix" type="fileOptionType" minOccurs="0"/>
+ <xsd:element name="output-prefix" type="strOptionType" minOccurs="0"/>
<xsd:element name="output-file" type="fileOptionType" minOccurs="0"/>
<xsd:element name="vtype-output" type="fileOptionType" minOccurs="0"/>
<xsd:element name="exit-times" type="boolOptionType" minOccurs="0"/>
@@ -50,10 +50,13 @@
<xsd:element name="max-alternatives" type="intOptionType" minOccurs="0"/>
<xsd:element name="remove-loops" type="boolOptionType" minOccurs="0"/>
<xsd:element name="repair" type="boolOptionType" minOccurs="0"/>
+ <xsd:element name="repair.from" type="boolOptionType" minOccurs="0"/>
+ <xsd:element name="repair.to" type="boolOptionType" minOccurs="0"/>
<xsd:element name="weights.interpolate" type="boolOptionType" minOccurs="0"/>
<xsd:element name="with-taz" type="boolOptionType" minOccurs="0"/>
<xsd:element name="routing-algorithm" type="strOptionType" minOccurs="0"/>
<xsd:element name="weight-period" type="timeOptionType" minOccurs="0"/>
+ <xsd:element name="bulk-routing" type="boolOptionType" minOccurs="0"/>
<xsd:element name="routing-threads" type="intOptionType" minOccurs="0"/>
<xsd:element name="weights.expand" type="boolOptionType" minOccurs="0"/>
<xsd:element name="gawron.beta" type="floatOptionType" minOccurs="0"/>
diff --git a/data/xsd/edgediff_file.xsd b/data/xsd/edgediff_file.xsd
index 07682db..295311f 100644
--- a/data/xsd/edgediff_file.xsd
+++ b/data/xsd/edgediff_file.xsd
@@ -47,6 +47,7 @@
<xsd:attribute name="width" type="positiveFloatType" use="optional"/>
<xsd:attribute name="shape" type="shapeType" use="optional"/>
<xsd:attribute name="sidewalkWidth" type="positiveFloatType"/>
+ <xsd:attribute name="bikeLaneWidth" type="positiveFloatType"/>
<xsd:attribute name="spreadType" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
diff --git a/data/xsd/edges_file.xsd b/data/xsd/edges_file.xsd
index 0f93569..806b184 100644
--- a/data/xsd/edges_file.xsd
+++ b/data/xsd/edges_file.xsd
@@ -46,6 +46,7 @@
<xsd:attribute name="width" type="positiveFloatType" use="optional"/>
<xsd:attribute name="shape" type="shapeType" use="optional"/>
<xsd:attribute name="sidewalkWidth" type="positiveFloatType"/>
+ <xsd:attribute name="bikeLaneWidth" type="positiveFloatType"/>
<xsd:attribute name="spreadType" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
@@ -79,6 +80,12 @@
</xsd:attribute>
<xsd:attribute name="pos" type="xsd:float" use="required"/>
<xsd:attribute name="speed" type="positiveFloatType" use="optional"/>
+ <xsd:attribute name="type" type="nodeTypeType" use="optional"/>
+ <xsd:attribute name="tl" type="xsd:string" use="optional"/>
+ <xsd:attribute name="tlType" type="tlTypeType" use="optional"/>
+ <xsd:attribute name="shape" type="shapeType" use="optional"/>
+ <xsd:attribute name="radius" type="positiveFloatType" use="optional"/>
+ <xsd:attribute name="keepClear" type="boolType" use="optional"/>
</xsd:complexType>
<xsd:complexType name="roundaboutType">
diff --git a/data/xsd/jtrrouterConfiguration.xsd b/data/xsd/jtrrouterConfiguration.xsd
index 41156b5..8b60ceb 100644
--- a/data/xsd/jtrrouterConfiguration.xsd
+++ b/data/xsd/jtrrouterConfiguration.xsd
@@ -29,7 +29,7 @@
<xsd:complexType name="outputType">
<xsd:all>
- <xsd:element name="output-prefix" type="fileOptionType" minOccurs="0"/>
+ <xsd:element name="output-prefix" type="strOptionType" minOccurs="0"/>
<xsd:element name="output-file" type="fileOptionType" minOccurs="0"/>
<xsd:element name="vtype-output" type="fileOptionType" minOccurs="0"/>
<xsd:element name="exit-times" type="boolOptionType" minOccurs="0"/>
@@ -45,8 +45,11 @@
<xsd:element name="max-alternatives" type="intOptionType" minOccurs="0"/>
<xsd:element name="remove-loops" type="boolOptionType" minOccurs="0"/>
<xsd:element name="repair" type="boolOptionType" minOccurs="0"/>
+ <xsd:element name="repair.from" type="boolOptionType" minOccurs="0"/>
+ <xsd:element name="repair.to" type="boolOptionType" minOccurs="0"/>
<xsd:element name="weights.interpolate" type="boolOptionType" minOccurs="0"/>
<xsd:element name="with-taz" type="boolOptionType" minOccurs="0"/>
+ <xsd:element name="bulk-routing" type="boolOptionType" minOccurs="0"/>
<xsd:element name="routing-threads" type="intOptionType" minOccurs="0"/>
<xsd:element name="max-edges-factor" type="floatOptionType" minOccurs="0"/>
<xsd:element name="turn-defaults" type="strOptionType" minOccurs="0"/>
diff --git a/data/xsd/marouterConfiguration.xsd b/data/xsd/marouterConfiguration.xsd
index 5e51d54..d6166a5 100644
--- a/data/xsd/marouterConfiguration.xsd
+++ b/data/xsd/marouterConfiguration.xsd
@@ -23,6 +23,7 @@
<xsd:element name="additional-files" type="fileOptionType" minOccurs="0"/>
<xsd:element name="od-matrix-files" type="fileOptionType" minOccurs="0"/>
<xsd:element name="od-amitran-files" type="fileOptionType" minOccurs="0"/>
+ <xsd:element name="route-files" type="fileOptionType" minOccurs="0"/>
<xsd:element name="weight-files" type="fileOptionType" minOccurs="0"/>
<xsd:element name="lane-weight-files" type="fileOptionType" minOccurs="0"/>
<xsd:element name="weight-attribute" type="strOptionType" minOccurs="0"/>
@@ -31,7 +32,7 @@
<xsd:complexType name="outputType">
<xsd:all>
- <xsd:element name="output-prefix" type="fileOptionType" minOccurs="0"/>
+ <xsd:element name="output-prefix" type="strOptionType" minOccurs="0"/>
<xsd:element name="output-file" type="fileOptionType" minOccurs="0"/>
<xsd:element name="flow-output" type="fileOptionType" minOccurs="0"/>
<xsd:element name="ignore-vehicle-type" type="boolOptionType" minOccurs="0"/>
@@ -43,6 +44,7 @@
<xsd:complexType name="processingType">
<xsd:all>
+ <xsd:element name="aggregation-interval" type="timeOptionType" minOccurs="0"/>
<xsd:element name="ignore-errors" type="boolOptionType" minOccurs="0"/>
<xsd:element name="max-alternatives" type="intOptionType" minOccurs="0"/>
<xsd:element name="weights.interpolate" type="boolOptionType" minOccurs="0"/>
@@ -54,6 +56,7 @@
<xsd:element name="prefix" type="strOptionType" minOccurs="0"/>
<xsd:element name="timeline" type="strOptionType" minOccurs="0"/>
<xsd:element name="timeline.day-in-hours" type="boolOptionType" minOccurs="0"/>
+ <xsd:element name="timesplit" type="boolOptionType" minOccurs="0"/>
<xsd:element name="assignment-method" type="strOptionType" minOccurs="0"/>
<xsd:element name="tolerance" type="floatOptionType" minOccurs="0"/>
<xsd:element name="left-turn-penalty" type="floatOptionType" minOccurs="0"/>
diff --git a/data/xsd/meandataTypes.xsd b/data/xsd/meandataTypes.xsd
index c1cc637..6dfda8d 100644
--- a/data/xsd/meandataTypes.xsd
+++ b/data/xsd/meandataTypes.xsd
@@ -33,7 +33,7 @@
<xsd:attribute name="speed" use="optional" type="nonNegativeFloatType"/>
<xsd:attribute name="departed" use="optional" type="xsd:integer"/>
<xsd:attribute name="arrived" use="optional" type="xsd:integer"/>
- <xsd:attribute name="entered" use="optional" type="xsd:integer"/>
+ <xsd:attribute name="entered" use="optional" type="nonNegativeFloatType"/>
<xsd:attribute name="left" use="optional" type="xsd:integer"/>
<xsd:attribute name="laneChangedFrom" use="optional" type="xsd:integer"/>
<xsd:attribute name="laneChangedTo" use="optional" type="xsd:integer"/>
diff --git a/data/xsd/net_file.xsd b/data/xsd/net_file.xsd
index 68dd430..36fc9d1 100644
--- a/data/xsd/net_file.xsd
+++ b/data/xsd/net_file.xsd
@@ -21,6 +21,7 @@
<xsd:complexType name="netType">
<xsd:sequence>
<xsd:element name="location" type="locationType" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="type" type="typeType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="edge" type="edgeType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="tlLogic" type="tlLogicType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="junction" type="junctionType" minOccurs="0" maxOccurs="unbounded"/>
@@ -150,6 +151,7 @@
<xsd:attribute name="fromLane" type="xsd:nonNegativeInteger" use="required"/>
<xsd:attribute name="toLane" type="xsd:nonNegativeInteger" use="required"/>
<xsd:attribute name="pass" type="boolType" use="optional"/>
+ <xsd:attribute name="keepClear" type="boolType" use="optional"/>
<xsd:attribute name="via" type="xsd:string" use="optional"/>
<xsd:attribute name="tl" type="xsd:string" use="optional"/>
<xsd:attribute name="linkIndex" type="xsd:nonNegativeInteger" use="optional"/>
diff --git a/data/xsd/netconvertConfiguration.xsd b/data/xsd/netconvertConfiguration.xsd
index 10590f0..d46d8f1 100644
--- a/data/xsd/netconvertConfiguration.xsd
+++ b/data/xsd/netconvertConfiguration.xsd
@@ -45,7 +45,7 @@
<xsd:complexType name="outputType">
<xsd:all>
- <xsd:element name="output-prefix" type="fileOptionType" minOccurs="0"/>
+ <xsd:element name="output-prefix" type="strOptionType" minOccurs="0"/>
<xsd:element name="output-file" type="fileOptionType" minOccurs="0"/>
<xsd:element name="plain-output-prefix" type="fileOptionType" minOccurs="0"/>
<xsd:element name="junctions.join-output" type="fileOptionType" minOccurs="0"/>
@@ -82,6 +82,9 @@
<xsd:element name="tls.taz-nodes" type="boolOptionType" minOccurs="0"/>
<xsd:element name="tls-guess.joining" type="boolOptionType" minOccurs="0"/>
<xsd:element name="tls.join" type="boolOptionType" minOccurs="0"/>
+ <xsd:element name="tls.join-dist" type="floatOptionType" minOccurs="0"/>
+ <xsd:element name="tls.guess-signals" type="boolOptionType" minOccurs="0"/>
+ <xsd:element name="tls.guess-signals.dist" type="floatOptionType" minOccurs="0"/>
<xsd:element name="tls.green.time" type="intOptionType" minOccurs="0"/>
<xsd:element name="tls.yellow.min-decel" type="floatOptionType" minOccurs="0"/>
<xsd:element name="tls.yellow.patch-small" type="boolOptionType" minOccurs="0"/>
@@ -99,6 +102,7 @@
<xsd:element name="ramps.min-highway-speed" type="floatOptionType" minOccurs="0"/>
<xsd:element name="ramps.ramp-length" type="floatOptionType" minOccurs="0"/>
<xsd:element name="ramps.set" type="strOptionType" minOccurs="0"/>
+ <xsd:element name="ramps.unset" type="strOptionType" minOccurs="0"/>
<xsd:element name="ramps.no-split" type="boolOptionType" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
@@ -109,6 +113,7 @@
<xsd:element name="remove-edges.explicit" type="strOptionType" minOccurs="0"/>
<xsd:element name="keep-edges.explicit" type="strOptionType" minOccurs="0"/>
<xsd:element name="keep-edges.input-file" type="fileOptionType" minOccurs="0"/>
+ <xsd:element name="remove-edges.input-file" type="fileOptionType" minOccurs="0"/>
<xsd:element name="keep-edges.postload" type="boolOptionType" minOccurs="0"/>
<xsd:element name="keep-edges.in-boundary" type="strOptionType" minOccurs="0"/>
<xsd:element name="keep-edges.in-geo-boundary" type="strOptionType" minOccurs="0"/>
@@ -159,7 +164,6 @@
<xsd:element name="visum.recompute-lane-number" type="boolOptionType" minOccurs="0"/>
<xsd:element name="visum.verbose-warnings" type="boolOptionType" minOccurs="0"/>
<xsd:element name="osm.skip-duplicates-check" type="boolOptionType" minOccurs="0"/>
- <xsd:element name="osm.railway.oneway-default" type="boolOptionType" minOccurs="0"/>
<xsd:element name="osm.elevation" type="boolOptionType" minOccurs="0"/>
<xsd:element name="opendrive.import-all-lanes" type="boolOptionType" minOccurs="0"/>
<xsd:element name="opendrive.ignore-widths" type="boolOptionType" minOccurs="0"/>
@@ -195,9 +199,6 @@
<xsd:element name="sidewalks.guess.min-speed" type="floatOptionType" minOccurs="0"/>
<xsd:element name="sidewalks.guess.from-permissions" type="boolOptionType" minOccurs="0"/>
<xsd:element name="crossings.guess" type="boolOptionType" minOccurs="0"/>
- <xsd:element name="tls.join-dist" type="floatOptionType" minOccurs="0"/>
- <xsd:element name="tls.guess-signals" type="boolOptionType" minOccurs="0"/>
- <xsd:element name="tls.guess-signals.dist" type="floatOptionType" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
@@ -207,6 +208,7 @@
<xsd:element name="default.speed" type="floatOptionType" minOccurs="0"/>
<xsd:element name="default.priority" type="intOptionType" minOccurs="0"/>
<xsd:element name="default.sidewalk-width" type="floatOptionType" minOccurs="0"/>
+ <xsd:element name="default.junctions.keep-clear" type="boolOptionType" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
diff --git a/data/xsd/netgenerateConfiguration.xsd b/data/xsd/netgenerateConfiguration.xsd
index a378d3c..9f9bef5 100644
--- a/data/xsd/netgenerateConfiguration.xsd
+++ b/data/xsd/netgenerateConfiguration.xsd
@@ -65,7 +65,7 @@
<xsd:complexType name="outputType">
<xsd:all>
- <xsd:element name="output-prefix" type="fileOptionType" minOccurs="0"/>
+ <xsd:element name="output-prefix" type="strOptionType" minOccurs="0"/>
<xsd:element name="output-file" type="fileOptionType" minOccurs="0"/>
<xsd:element name="plain-output-prefix" type="fileOptionType" minOccurs="0"/>
<xsd:element name="junctions.join-output" type="fileOptionType" minOccurs="0"/>
@@ -86,6 +86,7 @@
<xsd:element name="tls.guess" type="boolOptionType" minOccurs="0"/>
<xsd:element name="tls-guess.joining" type="boolOptionType" minOccurs="0"/>
<xsd:element name="tls.join" type="boolOptionType" minOccurs="0"/>
+ <xsd:element name="tls.join-dist" type="floatOptionType" minOccurs="0"/>
<xsd:element name="tls.green.time" type="intOptionType" minOccurs="0"/>
<xsd:element name="tls.yellow.min-decel" type="floatOptionType" minOccurs="0"/>
<xsd:element name="tls.yellow.patch-small" type="boolOptionType" minOccurs="0"/>
@@ -102,6 +103,7 @@
<xsd:element name="remove-edges.explicit" type="strOptionType" minOccurs="0"/>
<xsd:element name="keep-edges.explicit" type="strOptionType" minOccurs="0"/>
<xsd:element name="keep-edges.input-file" type="fileOptionType" minOccurs="0"/>
+ <xsd:element name="remove-edges.input-file" type="fileOptionType" minOccurs="0"/>
<xsd:element name="keep-edges.in-boundary" type="strOptionType" minOccurs="0"/>
<xsd:element name="keep-edges.in-geo-boundary" type="strOptionType" minOccurs="0"/>
</xsd:all>
@@ -137,7 +139,6 @@
<xsd:element name="sidewalks.guess.min-speed" type="floatOptionType" minOccurs="0"/>
<xsd:element name="sidewalks.guess.from-permissions" type="boolOptionType" minOccurs="0"/>
<xsd:element name="crossings.guess" type="boolOptionType" minOccurs="0"/>
- <xsd:element name="tls.join-dist" type="floatOptionType" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
@@ -147,6 +148,7 @@
<xsd:element name="default.speed" type="floatOptionType" minOccurs="0"/>
<xsd:element name="default.priority" type="intOptionType" minOccurs="0"/>
<xsd:element name="default.sidewalk-width" type="floatOptionType" minOccurs="0"/>
+ <xsd:element name="default.junctions.keep-clear" type="boolOptionType" minOccurs="0"/>
<xsd:element name="default-junction-type" type="strOptionType" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
diff --git a/data/xsd/nodes_file.xsd b/data/xsd/nodes_file.xsd
index b88cfa5..6c0b30a 100644
--- a/data/xsd/nodes_file.xsd
+++ b/data/xsd/nodes_file.xsd
@@ -34,26 +34,13 @@
<xsd:attribute name="x" type="xsd:float" use="optional"/>
<xsd:attribute name="y" type="xsd:float" use="optional"/>
<xsd:attribute name="z" type="xsd:float" use="optional"/>
- <xsd:attribute name="type" use="optional">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="traffic_light"/>
- <xsd:enumeration value="right_before_left"/>
- <xsd:enumeration value="priority"/>
- <xsd:enumeration value="dead_end"/>
- <xsd:enumeration value="unregulated"/>
- <xsd:enumeration value="traffic_light_unregulated"/>
- <xsd:enumeration value="rail_signal"/>
- <xsd:enumeration value="allway_stop"/>
- <xsd:enumeration value="priority_stop"/>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
+ <xsd:attribute name="type" type="nodeTypeType" use="optional"/>
<xsd:attribute name="tl" type="xsd:string" use="optional"/>
<xsd:attribute name="tlType" type="tlTypeType" use="optional"/>
<xsd:attribute name="controlledInner" type="xsd:string" use="optional"/>
<xsd:attribute name="shape" type="shapeType" use="optional"/>
<xsd:attribute name="radius" type="positiveFloatType" use="optional"/>
+ <xsd:attribute name="keepClear" type="boolType" use="optional"/>
</xsd:complexType>
<xsd:complexType name="deleteType">
diff --git a/data/xsd/od2tripsConfiguration.xsd b/data/xsd/od2tripsConfiguration.xsd
index 52fd40a..62dfc06 100644
--- a/data/xsd/od2tripsConfiguration.xsd
+++ b/data/xsd/od2tripsConfiguration.xsd
@@ -19,7 +19,7 @@
<xsd:complexType name="inputType">
<xsd:all>
- <xsd:element name="net-file" type="fileOptionType" minOccurs="0"/>
+ <xsd:element name="taz-files" type="fileOptionType" minOccurs="0"/>
<xsd:element name="od-matrix-files" type="fileOptionType" minOccurs="0"/>
<xsd:element name="od-amitran-files" type="fileOptionType" minOccurs="0"/>
</xsd:all>
@@ -27,7 +27,7 @@
<xsd:complexType name="outputType">
<xsd:all>
- <xsd:element name="output-prefix" type="fileOptionType" minOccurs="0"/>
+ <xsd:element name="output-prefix" type="strOptionType" minOccurs="0"/>
<xsd:element name="output-file" type="fileOptionType" minOccurs="0"/>
<xsd:element name="flow-output" type="fileOptionType" minOccurs="0"/>
<xsd:element name="ignore-vehicle-type" type="boolOptionType" minOccurs="0"/>
@@ -45,6 +45,7 @@
<xsd:all>
<xsd:element name="scale" type="floatOptionType" minOccurs="0"/>
<xsd:element name="spread.uniform" type="boolOptionType" minOccurs="0"/>
+ <xsd:element name="different-source-sink" type="boolOptionType" minOccurs="0"/>
<xsd:element name="vtype" type="strOptionType" minOccurs="0"/>
<xsd:element name="prefix" type="strOptionType" minOccurs="0"/>
<xsd:element name="timeline" type="strOptionType" minOccurs="0"/>
diff --git a/data/xsd/polyconvertConfiguration.xsd b/data/xsd/polyconvertConfiguration.xsd
index 06ec714..29ea0d3 100644
--- a/data/xsd/polyconvertConfiguration.xsd
+++ b/data/xsd/polyconvertConfiguration.xsd
@@ -38,7 +38,7 @@
<xsd:complexType name="outputType">
<xsd:all>
- <xsd:element name="output-prefix" type="fileOptionType" minOccurs="0"/>
+ <xsd:element name="output-prefix" type="strOptionType" minOccurs="0"/>
<xsd:element name="output-file" type="fileOptionType" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
@@ -72,6 +72,7 @@
<xsd:element name="offset.y" type="floatOptionType" minOccurs="0"/>
<xsd:element name="all-attributes" type="boolOptionType" minOccurs="0"/>
<xsd:element name="ignore-errors" type="boolOptionType" minOccurs="0"/>
+ <xsd:element name="poi-layer-offset" type="floatOptionType" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
diff --git a/data/xsd/routeTypes.xsd b/data/xsd/routeTypes.xsd
index a2a16ed..8d280cd 100644
--- a/data/xsd/routeTypes.xsd
+++ b/data/xsd/routeTypes.xsd
@@ -8,11 +8,15 @@
<xsd:element name="param" type="paramType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:sequence minOccurs="0">
<xsd:choice>
+ <xsd:element name="carFollowing-IDM" type="cfIDMType"/>
+ <xsd:element name="carFollowing-IDMM" type="cfIDMMType"/>
<xsd:element name="carFollowing-Krauss" type="cfKraussType"/>
<xsd:element name="carFollowing-KraussPS" type="cfKraussType"/>
+ <xsd:element name="carFollowing-KraussAB" type="cfKraussType"/>
<xsd:element name="carFollowing-KraussOrig1" type="cfKraussType"/>
- <xsd:element name="carFollowing-IDM" type="cfIDMType"/>
- <xsd:element name="carFollowing-IDMM" type="cfIDMMType"/>
+ <xsd:element name="carFollowing-SmartSK" type="cfSmartType"/>
+ <xsd:element name="carFollowing-Daniel1" type="cfSmartType"/>
+ <xsd:element name="carFollowing-PWagner2009" type="cfPWagType"/>
<xsd:element name="carFollowing-BKerner" type="cfBKernerType"/>
<xsd:element name="carFollowing-Wiedemann" type="cfWiedemannType"/>
</xsd:choice>
@@ -35,9 +39,7 @@
<xsd:attribute name="accel" type="positiveFloatType"/>
<xsd:attribute name="decel" type="positiveFloatType"/>
<xsd:attribute name="personCapacity" type="xsd:nonNegativeInteger"/>
- <xsd:attribute name="personNumber" type="xsd:nonNegativeInteger"/>
<xsd:attribute name="containerCapacity" type="xsd:nonNegativeInteger"/>
- <xsd:attribute name="containerNumber" type="xsd:nonNegativeInteger"/>
<xsd:attribute name="boardingDuration" type="nonNegativeFloatType"/>
<xsd:attribute name="loadingDuration" type="nonNegativeFloatType"/>
<xsd:attribute name="sigma">
@@ -60,6 +62,17 @@
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="tau" type="positiveFloatType"/>
+ <xsd:attribute name="tmp1" type="xsd:float"/>
+ <xsd:attribute name="tmp2" type="xsd:float"/>
+ <xsd:attribute name="tmp3" type="xsd:float"/>
+ <xsd:attribute name="tmp4" type="xsd:float"/>
+ <xsd:attribute name="tmp5" type="xsd:float"/>
+ <xsd:attribute name="tauLast" type="xsd:float"/>
+ <xsd:attribute name="apProb" type="xsd:float"/>
+ <xsd:attribute name="k" type="xsd:float"/>
+ <xsd:attribute name="phi" type="xsd:float"/>
+ <xsd:attribute name="security" type="xsd:float"/>
+ <xsd:attribute name="estimation" type="xsd:float"/>
<xsd:attribute name="carFollowModel" type="xsd:string"/>
<xsd:attribute name="laneChangeModel">
<xsd:simpleType>
@@ -74,7 +87,7 @@
<xsd:attribute name="osgFile" type="xsd:string"/>
</xsd:complexType>
- <xsd:complexType name="cfKraussType">
+ <xsd:complexType name="cfIDMType">
<xsd:attribute name="accel" type="positiveFloatType"/>
<xsd:attribute name="decel" type="positiveFloatType"/>
<xsd:attribute name="sigma">
@@ -90,7 +103,7 @@
<xsd:attribute name="stepping" type="positiveIntType"/>
</xsd:complexType>
- <xsd:complexType name="cfIDMType">
+ <xsd:complexType name="cfIDMMType">
<xsd:attribute name="accel" type="positiveFloatType"/>
<xsd:attribute name="decel" type="positiveFloatType"/>
<xsd:attribute name="sigma">
@@ -102,11 +115,12 @@
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="tau" type="positiveFloatType"/>
- <xsd:attribute name="delta" type="xsd:float"/>
+ <xsd:attribute name="adaptTime" type="xsd:float"/>
+ <xsd:attribute name="adaptFactor" type="xsd:float"/>
<xsd:attribute name="stepping" type="positiveIntType"/>
</xsd:complexType>
- <xsd:complexType name="cfIDMMType">
+ <xsd:complexType name="cfKraussType">
<xsd:attribute name="accel" type="positiveFloatType"/>
<xsd:attribute name="decel" type="positiveFloatType"/>
<xsd:attribute name="sigma">
@@ -118,9 +132,41 @@
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="tau" type="positiveFloatType"/>
- <xsd:attribute name="adaptTime" type="xsd:float"/>
- <xsd:attribute name="adaptFactor" type="xsd:float"/>
- <xsd:attribute name="stepping" type="positiveIntType"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="cfSmartType">
+ <xsd:attribute name="accel" type="positiveFloatType"/>
+ <xsd:attribute name="decel" type="positiveFloatType"/>
+ <xsd:attribute name="sigma">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:float">
+ <xsd:maxInclusive value="1"/>
+ <xsd:minInclusive value="0"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="tau" type="positiveFloatType"/>
+ <xsd:attribute name="tmp1" type="xsd:float"/>
+ <xsd:attribute name="tmp2" type="xsd:float"/>
+ <xsd:attribute name="tmp3" type="xsd:float"/>
+ <xsd:attribute name="tmp4" type="xsd:float"/>
+ <xsd:attribute name="tmp5" type="xsd:float"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="cfPWagType">
+ <xsd:attribute name="accel" type="positiveFloatType"/>
+ <xsd:attribute name="decel" type="positiveFloatType"/>
+ <xsd:attribute name="sigma">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:float">
+ <xsd:maxInclusive value="1"/>
+ <xsd:minInclusive value="0"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="tau" type="positiveFloatType"/>
+ <xsd:attribute name="tauLast" type="xsd:float"/>
+ <xsd:attribute name="apProb" type="xsd:float"/>
</xsd:complexType>
<xsd:complexType name="cfBKernerType">
@@ -184,8 +230,8 @@
<xsd:attribute name="arrivalPos" type="arrivalPosType"/>
<xsd:attribute name="arrivalSpeed" type="arrivalSpeedType"/>
<xsd:attribute name="arrival" type="nonNegativeFloatType"/>
+ <xsd:attribute name="routeLength" type="nonNegativeFloatType"/>
<xsd:attribute name="line" type="xsd:string"/>
- <xsd:attribute name="personCapacity" type="xsd:nonNegativeInteger"/>
<xsd:attribute name="personNumber" type="xsd:nonNegativeInteger"/>
</xsd:complexType>
@@ -217,7 +263,6 @@
<xsd:attribute name="arrivalPos" type="arrivalPosType"/>
<xsd:attribute name="arrivalSpeed" type="arrivalSpeedType"/>
<xsd:attribute name="line" type="xsd:string"/>
- <xsd:attribute name="personCapacity" type="xsd:nonNegativeInteger"/>
<xsd:attribute name="personNumber" type="xsd:nonNegativeInteger"/>
</xsd:complexType>
@@ -430,8 +475,8 @@
<xsd:attribute name="to" type="xsd:string"/>
<xsd:attribute name="speed" type="positiveFloatType"/>
<xsd:attribute name="duration" type="positiveFloatType"/>
- <xsd:attribute name="departPos" type="xsd:float"/>
- <xsd:attribute name="arrivalPos" type="xsd:float"/>
+ <xsd:attribute name="departPos" type="arrivalPosType"/>
+ <xsd:attribute name="arrivalPos" type="arrivalPosType"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="stop" type="stopType"/>
diff --git a/data/xsd/sumoConfiguration.xsd b/data/xsd/sumoConfiguration.xsd
index 7fb8841..f7b8211 100644
--- a/data/xsd/sumoConfiguration.xsd
+++ b/data/xsd/sumoConfiguration.xsd
@@ -15,6 +15,7 @@
<xsd:element name="report" type="reportType" minOccurs="0"/>
<xsd:element name="emissions" type="emissionsType" minOccurs="0"/>
<xsd:element name="communication" type="communicationType" minOccurs="0"/>
+ <xsd:element name="battery" type="batteryType" minOccurs="0"/>
<xsd:element name="example_device" type="example_deviceType" minOccurs="0"/>
<xsd:element name="traci_server" type="traci_serverType" minOccurs="0"/>
<xsd:element name="mesoscopic" type="mesoscopicType" minOccurs="0"/>
@@ -37,11 +38,13 @@
<xsd:complexType name="outputType">
<xsd:all>
- <xsd:element name="output-prefix" type="fileOptionType" minOccurs="0"/>
+ <xsd:element name="output-prefix" type="strOptionType" minOccurs="0"/>
<xsd:element name="netstate-dump" type="fileOptionType" minOccurs="0"/>
<xsd:element name="netstate-dump.empty-edges" type="boolOptionType" minOccurs="0"/>
<xsd:element name="netstate-dump.precision" type="intOptionType" minOccurs="0"/>
<xsd:element name="emission-output" type="fileOptionType" minOccurs="0"/>
+ <xsd:element name="battery-output" type="fileOptionType" minOccurs="0"/>
+ <xsd:element name="battery-output.precision" type="intOptionType" minOccurs="0"/>
<xsd:element name="fcd-output" type="fileOptionType" minOccurs="0"/>
<xsd:element name="fcd-output.geo" type="boolOptionType" minOccurs="0"/>
<xsd:element name="fcd-output.signals" type="boolOptionType" minOccurs="0"/>
@@ -58,6 +61,7 @@
<xsd:element name="vehroute-output.sorted" type="boolOptionType" minOccurs="0"/>
<xsd:element name="vehroute-output.dua" type="boolOptionType" minOccurs="0"/>
<xsd:element name="vehroute-output.intended-depart" type="boolOptionType" minOccurs="0"/>
+ <xsd:element name="vehroute-output.route-length" type="boolOptionType" minOccurs="0"/>
<xsd:element name="vehroute-output.write-unfinished" type="boolOptionType" minOccurs="0"/>
<xsd:element name="link-output" type="fileOptionType" minOccurs="0"/>
<xsd:element name="bt-output" type="fileOptionType" minOccurs="0"/>
@@ -159,9 +163,19 @@
</xsd:all>
</xsd:complexType>
+ <xsd:complexType name="batteryType">
+ <xsd:all>
+ <xsd:element name="device.battery.probability" type="floatOptionType" minOccurs="0"/>
+ <xsd:element name="device.battery.explicit" type="strOptionType" minOccurs="0"/>
+ <xsd:element name="device.battery.deterministic" type="boolOptionType" minOccurs="0"/>
+ </xsd:all>
+ </xsd:complexType>
+
<xsd:complexType name="example_deviceType">
<xsd:all>
+ <xsd:element name="device.example.probability" type="floatOptionType" minOccurs="0"/>
<xsd:element name="device.example.explicit" type="strOptionType" minOccurs="0"/>
+ <xsd:element name="device.example.deterministic" type="boolOptionType" minOccurs="0"/>
<xsd:element name="device.example.parameter" type="floatOptionType" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
diff --git a/data/xsd/types_file.xsd b/data/xsd/types_file.xsd
index 1e53fb9..0b32eb6 100644
--- a/data/xsd/types_file.xsd
+++ b/data/xsd/types_file.xsd
@@ -3,23 +3,24 @@
<xsd:include schemaLocation="baseTypes.xsd" />
- <xsd:element name="types" type="typesType"></xsd:element>
+ <xsd:element name="types" type="typesType">
+ <xsd:key name="typeKey">
+ <xsd:selector xpath="type"/>
+ <xsd:field xpath="@id"/>
+ </xsd:key>
+ </xsd:element>
<xsd:complexType name="typesType">
<xsd:sequence>
- <xsd:element name="type" type="typeType" minOccurs="0" maxOccurs="unbounded"></xsd:element>
+ <xsd:element name="type" type="typeType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
+ <xsd:attribute name="version" use="optional">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:pattern value="\d+.\d+"></xsd:pattern>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
</xsd:complexType>
- <xsd:complexType name="typeType">
- <xsd:attribute name="id" type="xsd:string" use="required"/>
- <xsd:attribute name="allow" type="xsd:string"/>
- <xsd:attribute name="disallow" type="xsd:string"/>
- <xsd:attribute name="priority" type="xsd:int"/>
- <xsd:attribute name="numLanes" type="xsd:int"/>
- <xsd:attribute name="speed" type="xsd:float"/>
- <xsd:attribute name="discard" type="boolType"/>
- <xsd:attribute name="oneway" type="boolType"/>
- <xsd:attribute name="sidewalkWidth" type="xsd:float"/>
- </xsd:complexType>
</xsd:schema>
diff --git a/depcomp b/depcomp
index df8eea7..4ebd5b3 100755
--- a/depcomp
+++ b/depcomp
@@ -1,10 +1,9 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2013-05-30.07; # UTC
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
-# Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -28,9 +27,9 @@ scriptversion=2009-04-28.21; # UTC
case $1 in
'')
- echo "$0: No command. Try \`$0 --help' for more information." 1>&2
- exit 1;
- ;;
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
@@ -40,11 +39,11 @@ as side-effects.
Environment variables:
depmode Dependency tracking mode.
- source Source file read by `PROGRAMS ARGS'.
- object Object file output by `PROGRAMS ARGS'.
+ source Source file read by 'PROGRAMS ARGS'.
+ object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
- tmpdepfile Temporary file to use when outputing dependencies.
+ tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake at gnu.org>.
@@ -57,6 +56,66 @@ EOF
;;
esac
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'. Note that this directory component will
+# be either empty or ending with a '/' character. This is deliberate.
+set_dir_from ()
+{
+ case $1 in
+ */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+ *) dir=;;
+ esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+ base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+ echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+ # If the compiler actually managed to produce a dependency file,
+ # post-process it.
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form 'foo.o: dependency.h'.
+ # Do two passes, one to just change these to
+ # $object: dependency.h
+ # and one to simply output
+ # dependency.h:
+ # which is needed to avoid the deleted-header problem.
+ { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+ sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+ } > "$depfile"
+ rm -f "$tmpdepfile"
+ else
+ make_dummy_depfile
+ fi
+}
+
+# A tabulation character.
+tab=' '
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
@@ -69,6 +128,9 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
@@ -80,18 +142,32 @@ if test "$depmode" = hp; then
fi
if test "$depmode" = dashXmstdout; then
- # This is just like dashmstdout with a different argument.
- dashmflag=-xM
- depmode=dashmstdout
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
- # This is just like msvisualcpp but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u="sed s,\\\\\\\\,/,g"
- depmode=msvisualcpp
+ # This is just like msvisualcpp but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+ # This is just like msvc7 but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+ # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+ gccflag=-qmakedep=gcc,-MF
+ depmode=gcc
fi
case "$depmode" in
@@ -114,8 +190,7 @@ gcc3)
done
"$@"
stat=$?
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
@@ -123,13 +198,17 @@ gcc3)
;;
gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-## -MM, not -M (despite what the docs say).
+## -MM, not -M (despite what the docs say). Also, it might not be
+## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
@@ -137,31 +216,31 @@ gcc)
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
- alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
+ # The second -e expression handles DOS-style file names with drive
+ # letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
+## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
- tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'. On the theory
+## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
-## well.
+## well. hp depmode also adds that space, but also prefixes the VPATH
+## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
@@ -179,8 +258,7 @@ sgi)
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
@@ -188,43 +266,41 @@ sgi)
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
-
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
- # the IRIX cc adds comments like `#:fec' to the end of the
+ # the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
- tr ' ' '
-' < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
- tr '
-' ' ' >> "$depfile"
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+ | tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
-
# The second pass generates a dummy entry for each header file.
- tr ' ' '
-' < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> "$depfile"
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
+ make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
+xlc)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
- # current directory. Also, the AIX compiler puts `$object:' at the
+ # current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ set_dir_from "$object"
+ set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
@@ -237,9 +313,7 @@ aix)
"$@" -M
fi
stat=$?
-
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
@@ -248,44 +322,100 @@ aix)
do
test -f "$tmpdepfile" && break
done
- if test -f "$tmpdepfile"; then
- # Each line is of the form `foo.o: dependent.h'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- # That's a tab and a space in the [].
- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
+ aix_post_process_depfile
+ ;;
+
+tcc)
+ # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+ # FIXME: That version still under development at the moment of writing.
+ # Make that this statement remains true also for stable, released
+ # versions.
+ # It will wrap lines (doesn't matter whether long or short) with a
+ # trailing '\', as in:
+ #
+ # foo.o : \
+ # foo.c \
+ # foo.h \
+ #
+ # It will put a trailing '\' even on the last line, and will use leading
+ # spaces rather than leading tabs (at least since its commit 0394caf7
+ # "Emit spaces for -MD").
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
fi
+ rm -f "$depfile"
+ # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+ # We have to change lines of the first kind to '$object: \'.
+ sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+ # And for each line of the second kind, we have to emit a 'dep.h:'
+ # dummy dependency, to avoid the deleted-header problem.
+ sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
-icc)
- # Intel's C compiler understands `-MD -MF file'. However on
- # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
- # ICC 7.0 will fill foo.d with something like
- # foo.o: sub/foo.c
- # foo.o: sub/foo.h
- # which is wrong. We want:
- # sub/foo.o: sub/foo.c
- # sub/foo.o: sub/foo.h
- # sub/foo.c:
- # sub/foo.h:
- # ICC 7.1 will output
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file. A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+ # Portland's C compiler understands '-MD'.
+ # Will always output deps to 'file.d' where file is the root name of the
+ # source file under compilation, even if file resides in a subdirectory.
+ # The object file name does not affect the name of the '.d' file.
+ # pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
- # and will wrap long lines using \ :
+ # and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
+ set_dir_from "$object"
+ # Use the source, not the object, to determine the base name, since
+ # that's sadly what pgcc will do too.
+ set_base_from "$source"
+ tmpdepfile=$base.d
+
+ # For projects that build the same source file twice into different object
+ # files, the pgcc approach of using the *source* file root name can cause
+ # problems in parallel builds. Use a locking strategy to avoid stomping on
+ # the same $tmpdepfile.
+ lockdir=$base.d-lock
+ trap "
+ echo '$0: caught signal, cleaning up...' >&2
+ rmdir '$lockdir'
+ exit 1
+ " 1 2 13 15
+ numtries=100
+ i=$numtries
+ while test $i -gt 0; do
+ # mkdir is a portable test-and-set.
+ if mkdir "$lockdir" 2>/dev/null; then
+ # This process acquired the lock.
+ "$@" -MD
+ stat=$?
+ # Release the lock.
+ rmdir "$lockdir"
+ break
+ else
+ # If the lock is being held by a different process, wait
+ # until the winning process is done or we timeout.
+ while test -d "$lockdir" && test $i -gt 0; do
+ sleep 1
+ i=`expr $i - 1`
+ done
+ fi
+ i=`expr $i - 1`
+ done
+ trap - 1 2 13 15
+ if test $i -le 0; then
+ echo "$0: failed to acquire lock after $numtries attempts" >&2
+ echo "$0: check lockdir '$lockdir'" >&2
+ exit 1
+ fi
- "$@" -MD -MF "$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
@@ -297,8 +427,8 @@ icc)
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
- sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
- sed -e 's/$/ :/' >> "$depfile"
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+ | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
@@ -309,9 +439,8 @@ hp2)
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ set_dir_from "$object"
+ set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
@@ -322,8 +451,7 @@ hp2)
"$@" +Maked
fi
stat=$?
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
@@ -333,77 +461,107 @@ hp2)
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
- # Add `dependent.h:' lines.
+ sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add 'dependent.h:' lines.
sed -ne '2,${
- s/^ *//
- s/ \\*$//
- s/$/:/
- p
- }' "$tmpdepfile" >> "$depfile"
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
else
- echo "#dummy" > "$depfile"
+ make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
- # The Tru64 compiler uses -MD to generate dependencies as a side
- # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
- # dependencies in `foo.d' instead, so we check for that too.
- # Subdirectories are respected.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
- if test "$libtool" = yes; then
- # With Tru64 cc, shared objects can also be used to make a
- # static library. This mechanism is used in libtool 1.4 series to
- # handle both shared and static libraries in a single compilation.
- # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
- #
- # With libtool 1.5 this exception was removed, and libtool now
- # generates 2 separate objects for the 2 libraries. These two
- # compilations output dependencies in $dir.libs/$base.o.d and
- # in $dir$base.o.d. We have to check for both files, because
- # one of the two compilations can be disabled. We should prefer
- # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
- # automatically cleaned when .libs/ is deleted, while ignoring
- # the former would cause a distcleancheck panic.
- tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
- tmpdepfile2=$dir$base.o.d # libtool 1.5
- tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
- tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
- "$@" -Wc,-MD
- else
- tmpdepfile1=$dir$base.o.d
- tmpdepfile2=$dir$base.d
- tmpdepfile3=$dir$base.d
- tmpdepfile4=$dir$base.d
- "$@" -MD
- fi
-
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- # That's a tab and a space in the [].
- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
- else
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in 'foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ set_dir_from "$object"
+ set_base_from "$object"
+
+ if test "$libtool" = yes; then
+ # Libtool generates 2 separate objects for the 2 libraries. These
+ # two compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir$base.o.d # libtool 1.5
+ tmpdepfile2=$dir.libs/$base.o.d # Likewise.
+ tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ # Same post-processing that is required for AIX mode.
+ aix_post_process_depfile
+ ;;
+
+msvc7)
+ if test "$libtool" = yes; then
+ showIncludes=-Wc,-showIncludes
+ else
+ showIncludes=-showIncludes
+ fi
+ "$@" $showIncludes > "$tmpdepfile"
+ stat=$?
+ grep -v '^Note: including file: ' "$tmpdepfile"
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The first sed program below extracts the file names and escapes
+ # backslashes for cygpath. The second sed program outputs the file
+ # name when reading, but also accumulates all include files in the
+ # hold buffer in order to output them again at the end. This only
+ # works with sed implementations that can handle large buffers.
+ sed < "$tmpdepfile" -n '
+/^Note: including file: *\(.*\)/ {
+ s//\1/
+ s/\\/\\\\/g
+ p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+ s/.*/'"$tab"'/
+ G
+ p
+}' >> "$depfile"
+ echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+ rm -f "$tmpdepfile"
+ ;;
+
+msvc7msys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
@@ -422,7 +580,7 @@ dashmstdout)
shift
fi
- # Remove `-o $object'.
+ # Remove '-o $object'.
IFS=" "
for arg
do
@@ -442,18 +600,18 @@ dashmstdout)
done
test -z "$dashmflag" && dashmflag=-M
- # Require at least two characters before searching for `:'
+ # Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
- # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
- sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
- tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this sed invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
@@ -503,12 +661,15 @@ makedepend)
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ # makedepend may prepend the VPATH from the source file name to the object.
+ # No need to regex-escape $object, excess matching of '.' is harmless.
+ sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process the last invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed '1,2d' "$tmpdepfile" \
+ | tr ' ' "$nl" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
@@ -525,7 +686,7 @@ cpp)
shift
fi
- # Remove `-o $object'.
+ # Remove '-o $object'.
IFS=" "
for arg
do
@@ -544,10 +705,10 @@ cpp)
esac
done
- "$@" -E |
- sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
- sed '$ s: \\$::' > "$tmpdepfile"
+ "$@" -E \
+ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ | sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
@@ -579,23 +740,23 @@ msvisualcpp)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
- set fnord "$@"
- shift
- shift
- ;;
+ set fnord "$@"
+ shift
+ shift
+ ;;
*)
- set fnord "$@" "$arg"
- shift
- shift
- ;;
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
- sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
- echo " " >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+ echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
diff --git a/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.con.xml b/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.con.xml
new file mode 100644
index 0000000..bf73e26
--- /dev/null
+++ b/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.con.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<connections version="0.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/connections_file.xsd">
+ <crossing node="C" edges="CE EC" width="6"/>
+</connections>
diff --git a/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.edg.xml b/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.edg.xml
new file mode 100644
index 0000000..12211e8
--- /dev/null
+++ b/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.edg.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- generated on Wed 19 Feb 2014 10:46:52 AM CET by Netedit Version dev-SVN-r15634
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netedit.exeConfiguration.xsd">
+
+ <input>
+ <sumo-net-file value="net.net.xml"/>
+ </input>
+
+ <output>
+ <output-file value="/scr1/erdm_ja/sip-svn-trunk/projects/colombo/debug/path_across_street/input_net.net.xml"/>
+ <plain-output-prefix value="/scr1/erdm_ja/sip-svn-trunk/projects/colombo/debug/path_across_street/input_plain"/>
+ </output>
+
+ <processing>
+ <no-turnarounds value="true"/>
+ <offset.disable-normalization value="true"/>
+ </processing>
+
+</configuration>
+-->
+
+<edges version="0.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/edges_file.xsd">
+ <edge id="CE" from="C" to="E" priority="1" numLanes="2" disallow="pedestrian" speed="13.89"/>
+ <edge id="CW" from="C" to="W" priority="1" numLanes="2" disallow="pedestrian" speed="13.89"/>
+ <edge id="EC" from="E" to="C" priority="1" numLanes="2" disallow="pedestrian" speed="13.89"/>
+ <edge id="WC" from="W" to="C" priority="1" numLanes="2" disallow="pedestrian" speed="13.89"/>
+
+ <edge id="NC" from="N" to="C" priority="1" numLanes="1" allow="pedestrian" speed="5.00" spreadType="center" width="3.00"/>
+ <edge id="CS" from="C" to="S" priority="1" numLanes="1" allow="pedestrian" speed="5.00" spreadType="center" width="3.00"/>
+</edges>
diff --git a/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.netccfg b/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.netccfg
new file mode 100644
index 0000000..72710dc
--- /dev/null
+++ b/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.netccfg
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netconvertConfiguration.xsd">
+
+ <input>
+ <node-files value="pedcrossing.nod.xml"/>
+ <edge-files value="pedcrossing.edg.xml"/>
+ <connection-files value="pedcrossing.con.xml"/>
+ </input>
+
+ <output>
+ <output-file value="pedcrossing.net.xml"/>
+ </output>
+
+ <processing>
+ <no-turnarounds value="true"/>
+ </processing>
+
+</configuration>
diff --git a/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.nod.xml b/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.nod.xml
new file mode 100644
index 0000000..252a123
--- /dev/null
+++ b/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.nod.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- generated on Wed 19 Feb 2014 10:46:52 AM CET by Netedit Version dev-SVN-r15634
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netedit.exeConfiguration.xsd">
+
+ <input>
+ <sumo-net-file value="net.net.xml"/>
+ </input>
+
+ <output>
+ <output-file value="/scr1/erdm_ja/sip-svn-trunk/projects/colombo/debug/path_across_street/input_net.net.xml"/>
+ <plain-output-prefix value="/scr1/erdm_ja/sip-svn-trunk/projects/colombo/debug/path_across_street/input_plain"/>
+ </output>
+
+ <processing>
+ <no-turnarounds value="true"/>
+ <offset.disable-normalization value="true"/>
+ </processing>
+
+</configuration>
+-->
+
+<nodes version="0.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/nodes_file.xsd">
+ <location netOffset="0.00,0.00" convBoundary="-100.00,-50.00,100.00,50.00" origBoundary="-10000000000.00,-10000000000.00,10000000000.00,10000000000.00" projParameter="!"/>
+
+ <node id="C" x="0.00" y="0.00" type="traffic_light"/>
+ <node id="E" x="100.00" y="0.00" type="unregulated"/>
+ <node id="N" x="0.00" y="50.00" type="unregulated"/>
+ <node id="S" x="0.00" y="-50.00" type="unregulated"/>
+ <node id="W" x="-100.00" y="0.00" type="unregulated"/>
+</nodes>
diff --git a/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.rou.xml b/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.rou.xml
new file mode 100644
index 0000000..af1133b
--- /dev/null
+++ b/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.rou.xml
@@ -0,0 +1,4 @@
+<routes>
+ <flow id="EW" begin="0" end="3600" probability="0.1" from="EC" to="CW"/>
+ <flow id="WE" begin="0" end="3600" probability="0.1" from="WC" to="CE"/>
+</routes>
diff --git a/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.tll.xml b/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.tll.xml
new file mode 100644
index 0000000..5f57f65
--- /dev/null
+++ b/docs/tutorial/traci_pedestrian_crossing/data/pedcrossing.tll.xml
@@ -0,0 +1,9 @@
+<tlLogics version="0.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/tllogic_file.xsd">
+
+ <tlLogic id="C" type="static" programID="custom" offset="0">
+ <phase duration="100000" state="GGGGr"/> <!-- do not switch vehicle phase automatically -->
+ <phase duration="4" state="yyyyr"/>
+ <phase duration="10" state="rrrrG"/>
+ <phase duration="10" state="rrrrr"/> <!-- give pedestrians time to clear the intersection -->
+ </tlLogic>
+</tlLogics>
diff --git a/docs/tutorial/traci_pedestrian_crossing/data/run.sumocfg b/docs/tutorial/traci_pedestrian_crossing/data/run.sumocfg
new file mode 100644
index 0000000..73942a8
--- /dev/null
+++ b/docs/tutorial/traci_pedestrian_crossing/data/run.sumocfg
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">
+
+ <input>
+ <net-file value="../pedcrossing.net.xml"/>
+ <route-files value="pedcrossing.rou.xml,../pedestrians.trip.xml"/>
+ <additional-files value="pedcrossing.tll.xml"/>
+ </input>
+
+ <report>
+ <verbose value="true"/>
+ <no-step-log value="true"/>
+ </report>
+
+ <gui_only>
+ <gui-settings-file value="viewsettings.xml"/>
+ </gui_only>
+
+</configuration>
diff --git a/docs/tutorial/traci_pedestrian_crossing/data/viewsettings.xml b/docs/tutorial/traci_pedestrian_crossing/data/viewsettings.xml
new file mode 100644
index 0000000..dbeed14
--- /dev/null
+++ b/docs/tutorial/traci_pedestrian_crossing/data/viewsettings.xml
@@ -0,0 +1,551 @@
+<viewsettings>
+ <scheme name="custom_2">
+ <opengl antialiase="0" dither="0"/>
+ <background backgroundColor="51,128,51" showGrid="0" gridXSize="100.00" gridYSize="100.00"/>
+ <edges laneEdgeMode="0" scaleMode="0" laneShowBorders="1" showLinkDecals="1" showRails="1" hideConnectors="1" widthExaggeration="1.00"
+ edgeName_show="0" edgeName_size="50.00" edgeName_color="orange"
+ internalEdgeName_show="0" internalEdgeName_size="40.00" internalEdgeName_color="128,64,0"
+ cwaEdgeName_show="0" cwaEdgeName_size="50.00" cwaEdgeName_color="magenta"
+ streetName_show="0" streetName_size="55.00" streetName_color="yellow">
+ <colorScheme name="uniform">
+ <entry color="black" name="road"/>
+ <entry color="grey" name="sidewalk"/>
+ <entry color="192,66,44" name="bike lane"/>
+ <entry color="0,0,0,0" name="green verge"/>
+ <entry color="150,200,200" name="waterway"/>
+ </colorScheme>
+ <colorScheme name="by selection (lane-/streetwise)">
+ <entry color="grey" name="unselected"/>
+ <entry color="0,80,180" name="selected"/>
+ </colorScheme>
+ <colorScheme name="by permission code" interpolated="1">
+ <entry color="240,240,240" threshold="0.00"/>
+ <entry color="10,10,10" threshold="32.00"/>
+ <entry color="166,147,26" threshold="128.00"/>
+ <entry color="40,100,40" threshold="256.00"/>
+ <entry color="192,66,44" threshold="524288.00"/>
+ <entry color="grey" threshold="1048576.00"/>
+ <entry color="80,80,80" threshold="1049600.00"/>
+ <entry color="150,200,200" threshold="4194304.00"/>
+ <entry color="64,0,86" threshold="31719423.00"/>
+ <entry color="black" threshold="32505855.00"/>
+ <entry color="green" threshold="33554431.00"/>
+ </colorScheme>
+ <colorScheme name="by allowed speed (lanewise)" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="8.33"/>
+ <entry color="green" threshold="15.28"/>
+ <entry color="cyan" threshold="22.22"/>
+ <entry color="blue" threshold="33.33"/>
+ <entry color="magenta" threshold="41.67"/>
+ </colorScheme>
+ <colorScheme name="by current occupancy (lanewise, brutto)" interpolated="1">
+ <entry color="blue" threshold="0.00"/>
+ <entry color="red" threshold="0.95"/>
+ </colorScheme>
+ <colorScheme name="by current occupancy (lanewise, netto)" interpolated="1">
+ <entry color="blue" threshold="0.00"/>
+ <entry color="red" threshold="0.95"/>
+ </colorScheme>
+ <colorScheme name="by first vehicle waiting time (lanewise)" interpolated="1">
+ <entry color="blue" threshold="0.00"/>
+ <entry color="cyan" threshold="30.00"/>
+ <entry color="green" threshold="100.00"/>
+ <entry color="yellow" threshold="200.00"/>
+ <entry color="red" threshold="300.00"/>
+ </colorScheme>
+ <colorScheme name="by lane number (streetwise)" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="blue" threshold="5.00"/>
+ </colorScheme>
+ <colorScheme name="by CO2 emissions" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.27"/>
+ </colorScheme>
+ <colorScheme name="by CO emissions" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="green" threshold="0.00"/>
+ </colorScheme>
+ <colorScheme name="by PMx emissions" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="green" threshold="0.00"/>
+ </colorScheme>
+ <colorScheme name="by NOx emissions" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="green" threshold="0.00"/>
+ </colorScheme>
+ <colorScheme name="by HC emissions" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="green" threshold="0.00"/>
+ </colorScheme>
+ <colorScheme name="by fuel consumption" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.07"/>
+ </colorScheme>
+ <colorScheme name="by noise emissions (Harmonoise)" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="100.00"/>
+ </colorScheme>
+ <colorScheme name="by global travel time" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="100.00"/>
+ </colorScheme>
+ <colorScheme name="by global speed percentage" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="50.00"/>
+ <entry color="green" threshold="100.00"/>
+ </colorScheme>
+ <colorScheme name="by given length/geometrical length" interpolated="1">
+ <entry color="black" threshold="0.00"/>
+ <entry color="red" threshold="0.25"/>
+ <entry color="yellow" threshold="0.50"/>
+ <entry color="179,179,179" threshold="1.00"/>
+ <entry color="green" threshold="2.00"/>
+ <entry color="blue" threshold="4.00"/>
+ </colorScheme>
+ <colorScheme name="by angle">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="by loaded weight" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="100.00"/>
+ </colorScheme>
+ <colorScheme name="by priority" interpolated="1">
+ <entry color="red" threshold="-20.00"/>
+ <entry color="yellow" threshold="0.00"/>
+ <entry color="green" threshold="20.00"/>
+ </colorScheme>
+ <colorScheme name="by height at start" interpolated="1">
+ <entry color="blue" threshold="-10.00"/>
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="50.00"/>
+ <entry color="green" threshold="100.00"/>
+ <entry color="magenta" threshold="200.00"/>
+ </colorScheme>
+ <colorScheme name="by height at segment start" interpolated="1">
+ <entry color="blue" threshold="-10.00"/>
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="50.00"/>
+ <entry color="green" threshold="100.00"/>
+ <entry color="magenta" threshold="200.00"/>
+ </colorScheme>
+ <colorScheme name="by inclination" interpolated="1">
+ <entry color="blue" threshold="-0.30"/>
+ <entry color="green" threshold="-0.10"/>
+ <entry color="grey" threshold="0.00"/>
+ <entry color="yellow" threshold="0.10"/>
+ <entry color="red" threshold="0.30"/>
+ </colorScheme>
+ <colorScheme name="by inclination at segment start" interpolated="1">
+ <entry color="blue" threshold="-0.30"/>
+ <entry color="green" threshold="-0.10"/>
+ <entry color="grey" threshold="0.00"/>
+ <entry color="yellow" threshold="0.10"/>
+ <entry color="red" threshold="0.30"/>
+ </colorScheme>
+ <colorScheme name="by average speed" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="8.33"/>
+ <entry color="green" threshold="15.28"/>
+ <entry color="cyan" threshold="22.22"/>
+ <entry color="blue" threshold="33.33"/>
+ <entry color="magenta" threshold="41.67"/>
+ </colorScheme>
+ <colorScheme name="by average relative speed " interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="0.25"/>
+ <entry color="green" threshold="0.50"/>
+ <entry color="cyan" threshold="0.75"/>
+ <entry color="blue" threshold="1.00"/>
+ <entry color="magenta" threshold="1.25"/>
+ </colorScheme>
+ <scalingScheme name="default">
+ <entry color="1.00" name="uniform"/>
+ </scalingScheme>
+ <scalingScheme name="by selection (lane-/streetwise)">
+ <entry color="0.50" name="unselected"/>
+ <entry color="5.00" name="selected"/>
+ </scalingScheme>
+ <scalingScheme name="by allowed speed (lanewise)" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="41.67"/>
+ </scalingScheme>
+ <scalingScheme name="by current occupancy (lanewise, brutto)" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="0.95"/>
+ </scalingScheme>
+ <scalingScheme name="by current occupancy (lanewise, netto)" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="0.95"/>
+ </scalingScheme>
+ <scalingScheme name="by first vehicle waiting time (lanewise)" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="300.00"/>
+ </scalingScheme>
+ <scalingScheme name="by lane number (streetwise)" interpolated="1">
+ <entry color="1.00" threshold="0.00"/>
+ <entry color="10.00" threshold="5.00"/>
+ </scalingScheme>
+ <scalingScheme name="by CO2 emissions" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="0.27"/>
+ </scalingScheme>
+ <scalingScheme name="by CO emissions" interpolated="1">
+ <entry color="10.00" threshold="0.00"/>
+ <entry color="0.00" threshold="0.00"/>
+ </scalingScheme>
+ <scalingScheme name="by PMx emissions" interpolated="1">
+ <entry color="10.00" threshold="0.00"/>
+ <entry color="0.00" threshold="0.00"/>
+ </scalingScheme>
+ <scalingScheme name="by NOx emissions" interpolated="1">
+ <entry color="10.00" threshold="0.00"/>
+ <entry color="0.00" threshold="0.00"/>
+ </scalingScheme>
+ <scalingScheme name="by HC emissions" interpolated="1">
+ <entry color="10.00" threshold="0.00"/>
+ <entry color="0.00" threshold="0.00"/>
+ </scalingScheme>
+ <scalingScheme name="by fuel consumption" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="0.07"/>
+ </scalingScheme>
+ <scalingScheme name="by noise emissions (Harmonoise)" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="100.00"/>
+ </scalingScheme>
+ <scalingScheme name="by global travel time" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="100.00"/>
+ </scalingScheme>
+ <scalingScheme name="by global speed percentage" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="100.00"/>
+ </scalingScheme>
+ <scalingScheme name="by given length/geometrical length" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="10.00"/>
+ </scalingScheme>
+ <scalingScheme name="by loaded weight" interpolated="1">
+ <entry color="-1000.00" threshold="-1000.00"/>
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="1000.00" threshold="1000.00"/>
+ </scalingScheme>
+ <scalingScheme name="by priority" interpolated="1">
+ <entry color="0.50" threshold="-20.00"/>
+ <entry color="1.00" threshold="0.00"/>
+ <entry color="5.00" threshold="20.00"/>
+ </scalingScheme>
+ <scalingScheme name="by average speed" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="41.67"/>
+ </scalingScheme>
+ <scalingScheme name="by average relative speed" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="0.50" threshold="0.50"/>
+ <entry color="2.00" threshold="1.00"/>
+ <entry color="10.00" threshold="2.00"/>
+ </scalingScheme>
+ <colorScheme name="uniform (streetwise)">
+ <entry color="black"/>
+ </colorScheme>
+ <colorScheme name="by selection (streetwise)">
+ <entry color="grey" name="unselected"/>
+ <entry color="0,80,180" name="selected"/>
+ </colorScheme>
+ <colorScheme name="by purpose (streetwise)">
+ <entry color="0,0,0,0" name="normal"/>
+ <entry color="128,0,128" name="connector"/>
+ <entry color="blue" name="internal"/>
+ </colorScheme>
+ <colorScheme name="by allowed speed (streetwise)" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="8.33"/>
+ <entry color="green" threshold="15.28"/>
+ <entry color="cyan" threshold="22.22"/>
+ <entry color="blue" threshold="33.33"/>
+ <entry color="magenta" threshold="41.67"/>
+ </colorScheme>
+ <colorScheme name="by current occupancy (streetwise)" interpolated="1">
+ <entry color="blue" threshold="0.00"/>
+ <entry color="red" threshold="0.95"/>
+ </colorScheme>
+ <colorScheme name="by current speed (streetwise)" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="blue" threshold="41.67"/>
+ </colorScheme>
+ <colorScheme name="by current flow (streetwise)" interpolated="1">
+ <entry color="blue" threshold="0.00"/>
+ <entry color="red" threshold="5000.00"/>
+ </colorScheme>
+ <colorScheme name="by relative speed (streetwise)" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="blue" threshold="1.00"/>
+ </colorScheme>
+ <scalingScheme name="uniform">
+ <entry color="1.00"/>
+ </scalingScheme>
+ <scalingScheme name="by selection (streetwise)">
+ <entry color="0.50" name="unselected"/>
+ <entry color="5.00" name="selected"/>
+ </scalingScheme>
+ <scalingScheme name="by allowed speed (streetwise)" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="41.67"/>
+ </scalingScheme>
+ <scalingScheme name="by current occupancy (streetwise)" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="0.95"/>
+ </scalingScheme>
+ <scalingScheme name="by current speed (streetwise)" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="41.67"/>
+ </scalingScheme>
+ <scalingScheme name="by current flow (streetwise)" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="20.00" threshold="5000.00"/>
+ </scalingScheme>
+ <scalingScheme name="by relative speed (streetwise)" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="20.00" threshold="1.00"/>
+ </scalingScheme>
+ </edges>
+ <vehicles vehicleMode="8" vehicleQuality="2" vehicle_minSize="0.00" vehicle_exaggeration="1.00" vehicle_constantSize="0" showBlinker="1"
+ vehicleName_show="0" vehicleName_size="50.00" vehicleName_color="204,153,0">
+ <colorScheme name="given vehicle/type/route color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="uniform">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="given/assigned vehicle color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="given/assigned type color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="given/assigned route color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="depart position as HSV">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="arrival position as HSV">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="direction/distance as HSV">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="by speed" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="8.33"/>
+ <entry color="green" threshold="15.28"/>
+ <entry color="cyan" threshold="22.22"/>
+ <entry color="blue" threshold="33.33"/>
+ <entry color="magenta" threshold="41.67"/>
+ </colorScheme>
+ <colorScheme name="by waiting time" interpolated="1">
+ <entry color="blue" threshold="0.00"/>
+ <entry color="cyan" threshold="30.00"/>
+ <entry color="green" threshold="100.00"/>
+ <entry color="yellow" threshold="200.00"/>
+ <entry color="red" threshold="300.00"/>
+ </colorScheme>
+ <colorScheme name="by time since lane change" interpolated="1">
+ <entry color="189,189,179" threshold="-180.00"/>
+ <entry color="yellow" threshold="-20.00"/>
+ <entry color="red" threshold="-1.00"/>
+ <entry color="179,179,179" threshold="0.00"/>
+ <entry color="blue" threshold="1.00"/>
+ <entry color="cyan" threshold="20.00"/>
+ <entry color="179,189,189" threshold="180.00"/>
+ </colorScheme>
+ <colorScheme name="by max speed" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="8.33"/>
+ <entry color="green" threshold="15.28"/>
+ <entry color="cyan" threshold="22.22"/>
+ <entry color="blue" threshold="33.33"/>
+ <entry color="magenta" threshold="41.67"/>
+ </colorScheme>
+ <colorScheme name="by CO2 emissions" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="5.00"/>
+ </colorScheme>
+ <colorScheme name="by CO emissions" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.05"/>
+ </colorScheme>
+ <colorScheme name="by PMx emissions" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.01"/>
+ </colorScheme>
+ <colorScheme name="by NOx emissions" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.12"/>
+ </colorScheme>
+ <colorScheme name="by HC emissions" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.02"/>
+ </colorScheme>
+ <colorScheme name="by fuel consumption" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.01"/>
+ </colorScheme>
+ <colorScheme name="by noise emissions (Harmonoise)" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="100.00"/>
+ </colorScheme>
+ <colorScheme name="by reroute number" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="1.00"/>
+ <entry color="white" threshold="10.00"/>
+ </colorScheme>
+ <colorScheme name="by selection">
+ <entry color="179,179,179" name="unselected"/>
+ <entry color="0,102,204" name="selected"/>
+ </colorScheme>
+ <colorScheme name="by offset from best lane" interpolated="1">
+ <entry color="red" threshold="-3.00"/>
+ <entry color="yellow" threshold="-1.00"/>
+ <entry color="179,179,179" threshold="0.00"/>
+ <entry color="cyan" threshold="1.00"/>
+ <entry color="blue" threshold="3.00"/>
+ </colorScheme>
+ <colorScheme name="by acceleration" interpolated="1">
+ <entry color="red" threshold="-4.50"/>
+ <entry color="yellow" threshold="-0.10"/>
+ <entry color="179,179,179" threshold="0.00"/>
+ <entry color="cyan" threshold="0.10"/>
+ <entry color="blue" threshold="2.60"/>
+ </colorScheme>
+ <colorScheme name="by time gap" interpolated="1">
+ <entry color="179,179,179" threshold="-1.00"/>
+ <entry color="yellow" threshold="0.00"/>
+ <entry color="cyan" threshold="1.00"/>
+ <entry color="blue" threshold="2.00"/>
+ </colorScheme>
+ <colorScheme name="random">
+ <entry color="yellow"/>
+ </colorScheme>
+ </vehicles>
+ <persons personMode="4" personQuality="2" person_minSize="1.00" person_exaggeration="1.00" person_constantSize="0"
+ personName_show="1" personName_size="70.00" personName_color="yellow">
+ <colorScheme name="given person/type color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="uniform">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="given/assigned person color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="given/assigned type color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="by speed" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="0.69"/>
+ <entry color="green" threshold="1.39"/>
+ <entry color="blue" threshold="2.78"/>
+ </colorScheme>
+ <colorScheme name="by mode" interpolated="1">
+ <entry color="yellow" threshold="0.00"/>
+ <entry color="blue" threshold="1.00"/>
+ <entry color="red" threshold="2.00"/>
+ <entry color="green" threshold="3.00"/>
+ </colorScheme>
+ <colorScheme name="by waiting time" interpolated="1">
+ <entry color="blue" threshold="0.00"/>
+ <entry color="cyan" threshold="30.00"/>
+ <entry color="green" threshold="100.00"/>
+ <entry color="yellow" threshold="200.00"/>
+ <entry color="red" threshold="300.00"/>
+ </colorScheme>
+ <colorScheme name="by selection">
+ <entry color="179,179,179" name="unselected"/>
+ <entry color="0,102,204" name="selected"/>
+ </colorScheme>
+ <colorScheme name="by angle">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="random">
+ <entry color="yellow"/>
+ </colorScheme>
+ </persons>
+ <containers containerMode="0" containerQuality="2" container_minSize="1.00" container_exaggeration="1.00" container_constantSize="0"
+ containerName_show="1" containerName_size="70.00" containerName_color="yellow">
+ <colorScheme name="given person/type color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="uniform">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="given/assigned person color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="given/assigned type color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="by speed" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="0.69"/>
+ <entry color="green" threshold="1.39"/>
+ <entry color="blue" threshold="2.78"/>
+ </colorScheme>
+ <colorScheme name="by mode" interpolated="1">
+ <entry color="yellow" threshold="0.00"/>
+ <entry color="blue" threshold="1.00"/>
+ <entry color="red" threshold="2.00"/>
+ <entry color="green" threshold="3.00"/>
+ </colorScheme>
+ <colorScheme name="by waiting time" interpolated="1">
+ <entry color="blue" threshold="0.00"/>
+ <entry color="cyan" threshold="30.00"/>
+ <entry color="green" threshold="100.00"/>
+ <entry color="yellow" threshold="200.00"/>
+ <entry color="red" threshold="300.00"/>
+ </colorScheme>
+ <colorScheme name="by selection">
+ <entry color="179,179,179" name="unselected"/>
+ <entry color="0,102,204" name="selected"/>
+ </colorScheme>
+ <colorScheme name="by angle">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="random">
+ <entry color="yellow"/>
+ </colorScheme>
+ </containers>
+ <junctions junctionMode="0" drawLinkTLIndex="0" drawLinkJunctionIndex="0"
+ junctionName_show="0" junctionName_size="50.00" junctionName_color="0,255,128"
+ internalJunctionName_show="0" internalJunctionName_size="50.00" internalJunctionName_color="0,204,128"
+ showLane2Lane="0" drawShape="1">
+ <colorScheme name="uniform">
+ <entry color="black"/>
+ <entry color="150,200,200" name="waterway"/>
+ </colorScheme>
+ <colorScheme name="by selection">
+ <entry color="grey" name="unselected"/>
+ <entry color="0,80,180" name="selected"/>
+ </colorScheme>
+ <colorScheme name="by type">
+ <entry color="green" name="traffic_light"/>
+ <entry color="0,128,0" name="traffic_light_unregulated"/>
+ <entry color="yellow" name="priority"/>
+ <entry color="red" name="priority_stop"/>
+ <entry color="blue" name="right_before_left"/>
+ <entry color="cyan" name="allway_stop"/>
+ <entry color="grey" name="district"/>
+ <entry color="magenta" name="unregulated"/>
+ <entry color="black" name="dead_end"/>
+ <entry color="orange" name="rail_signal"/>
+ </colorScheme>
+ </junctions>
+ <additionals addMode="0" add_minSize="1.00" add_exaggeration="1.00" add_constantSize="0" addName_show="0" addName_size="50.00" addName_color="255,0,128"/>
+ <pois poi_minSize="0.00" poi_exaggeration="1.00" poi_constantSize="0" poiName_show="0" poiName_size="50.00" poiName_color="255,0,128"/>
+ <polys poly_minSize="0.00" poly_exaggeration="1.00" poly_constantSize="0" polyName_show="0" polyName_size="50.00" polyName_color="255,0,128"/>
+ <legend showSizeLegend="1"/>
+ </scheme>
+ <delay value="50.00"/>
+</viewsettings>
diff --git a/docs/tutorial/traci_pedestrian_crossing/runner.py b/docs/tutorial/traci_pedestrian_crossing/runner.py
new file mode 100755
index 0000000..081f7e9
--- /dev/null
+++ b/docs/tutorial/traci_pedestrian_crossing/runner.py
@@ -0,0 +1,169 @@
+#!/usr/bin/env python
+"""
+ at file runner.py
+ at author Lena Kalleske
+ at author Daniel Krajzewicz
+ at author Michael Behrisch
+ at author Jakob Erdmann
+ at date 2009-03-26
+ at version $Id: runner.py 18756 2015-08-31 19:16:33Z behrisch $
+
+Tutorial for traffic light control via the TraCI interface.
+This scenario models a pedestrian crossing which switches on demand.
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2009-2015 DLR/TS, Germany
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+
+import os
+import sys
+import optparse
+import subprocess
+import random
+
+
+# the directory in which this script resides
+THISDIR = os.path.dirname(__file__)
+
+
+# we need to import python modules from the $SUMO_HOME/tools directory
+# If the the environment variable SUMO_HOME is not set, try to locate the python
+# modules relative to this script
+try:
+ # tutorial in tests
+ sys.path.append(os.path.join(THISDIR, '..', '..', '..', '..', "tools"))
+ sys.path.append(os.path.join(os.environ.get("SUMO_HOME", os.path.join(
+ THISDIR, "..", "..", "..")), "tools")) # tutorial in docs
+
+ import traci
+ from sumolib import checkBinary
+ import randomTrips
+except ImportError:
+ sys.exit(
+ "please declare environment variable 'SUMO_HOME' as the root directory of your sumo installation (it should contain folders 'bin', 'tools' and 'docs')")
+
+# the port used for communicating with your sumo instance
+PORT = 8874
+
+# minimum green time for the vehicles
+MIN_GREEN_TIME = 15
+# the first phase in tls plan. see 'pedcrossing.tll.xml'
+VEHICLE_GREEN_PHASE = 0
+# the id of the traffic light (there is only one). This is identical to the
+# id of the controlled intersection (by default)
+TLSID = 'C'
+
+# pedestrian edges at the controlled intersection
+WALKINGAREAS = [':C_w0', ':C_w1']
+CROSSINGS = [':C_c0']
+
+
+def run():
+ """execute the TraCI control loop"""
+ traci.init(PORT)
+
+ # track the duration for which the green phase of the vehicles has been
+ # active
+ greenTimeSoFar = 0
+
+ # whether the pedestrian button has been pressed
+ activeRequest = False
+
+ # main loop. do something every simulation step until no more vehicles are
+ # loaded or running
+ while traci.simulation.getMinExpectedNumber() > 0:
+ traci.simulationStep()
+
+ # decide wether there is a waiting pedestrian and switch if the green
+ # phase for the vehicles exceeds its minimum duration
+ if not activeRequest:
+ activeRequest = checkWaitingPersons()
+ if traci.trafficlights.getPhase(TLSID) == VEHICLE_GREEN_PHASE:
+ greenTimeSoFar += 1
+ if greenTimeSoFar > MIN_GREEN_TIME:
+ # check whether someone has pushed the button
+
+ if activeRequest:
+ # switch to the next phase
+ traci.trafficlights.setPhase(
+ TLSID, VEHICLE_GREEN_PHASE + 1)
+ # reset state
+ activeRequest = False
+ greenTimeSoFar = 0
+
+ sys.stdout.flush()
+ traci.close()
+
+
+def checkWaitingPersons():
+ """check whether a person has requested to cross the street"""
+
+ # check both sides of the crossing
+ for edge in WALKINGAREAS:
+ peds = traci.edge.getLastStepPersonIDs(edge)
+ # check who is waiting at the crossing
+ # we assume that pedestrians push the button upon
+ # standing still for 1s
+ for ped in peds:
+ if (traci.person.getWaitingTime(ped) == 1 and
+ traci.person.getNextEdge(ped) in CROSSINGS):
+ print "%s pushes the button" % ped
+ return True
+ return False
+
+
+def get_options():
+ """define options for this script and interpret the command line"""
+ optParser = optparse.OptionParser()
+ optParser.add_option("--nogui", action="store_true",
+ default=False, help="run the commandline version of sumo")
+ options, args = optParser.parse_args()
+ return options
+
+
+# this is the main entry point of this script
+if __name__ == "__main__":
+ # load whether to run with or without GUI
+ options = get_options()
+
+ # this script has been called from the command line. It will start sumo as a
+ # server, then connect and run
+ if options.nogui:
+ sumoBinary = checkBinary('sumo')
+ else:
+ sumoBinary = checkBinary('sumo-gui')
+
+ net = 'pedcrossing.net.xml'
+ # build the multi-modal network from plain xml inputs
+ subprocess.call([checkBinary('netconvert'),
+ '-c', os.path.join('data', 'pedcrossing.netccfg'),
+ '--output-file', net],
+ stdout=sys.stdout, stderr=sys.stderr)
+
+ # generate the pedestrians for this simulation
+ randomTrips.main(randomTrips.get_options([
+ '--net-file', net,
+ '--output-trip-file', 'pedestrians.trip.xml',
+ '--seed', '42', # make runs reproducible
+ '--pedestrians',
+ '--prefix', 'ped',
+ # prevent trips that start and end on the same edge
+ '--min-distance', '1',
+ '--trip-attributes', 'departPos="random" arrivalPos="random"',
+ '--binomial', '4',
+ '--period', '35']))
+
+ # this is the normal way of using traci. sumo is started as a
+ # subprocess and then the python script connects and runs
+ sumoProcess = subprocess.Popen([sumoBinary,
+ '-c', os.path.join('data', 'run.sumocfg'),
+ '--remote-port', str(PORT)],
+ stdout=sys.stdout, stderr=sys.stderr)
+ run()
+ sumoProcess.wait()
diff --git a/install-sh b/install-sh
index 6781b98..377bb86 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-11-20.07; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,7 +35,7 @@ scriptversion=2009-04-28.21; # UTC
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
@@ -156,6 +156,10 @@ while test $# -ne 0; do
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
shift;;
-T) no_target_directory=true;;
@@ -186,6 +190,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
fi
shift # arg
dst_arg=$arg
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
done
fi
@@ -194,13 +202,17 @@ if test $# -eq 0; then
echo "$0: no input file specified." >&2
exit 1
fi
- # It's OK to call `install-sh -d' without argument.
+ # It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
- trap '(exit $?); exit' 1 2 13 15
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
@@ -228,9 +240,9 @@ fi
for src
do
- # Protect names starting with `-'.
+ # Protect names problematic for 'test' and other utilities.
case $src in
- -*) src=./$src;;
+ -* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
@@ -252,12 +264,7 @@ do
echo "$0: no destination specified." >&2
exit 1
fi
-
dst=$dst_arg
- # Protect names starting with `-'.
- case $dst in
- -*) dst=./$dst;;
- esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
@@ -347,7 +354,7 @@ do
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writeable bit of parent directory when it shouldn't.
+ # other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
@@ -385,7 +392,7 @@ do
case $dstdir in
/*) prefix='/';;
- -*) prefix='./';;
+ [-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
@@ -403,7 +410,7 @@ do
for d
do
- test -z "$d" && continue
+ test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
diff --git a/missing b/missing
index 28055d2..cdea514 100755
--- a/missing
+++ b/missing
@@ -1,11 +1,10 @@
#! /bin/sh
-# Common stub for a few missing GNU programs while installing.
+# Common wrapper for a few potentially missing GNU programs.
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-06-26.16; # UTC
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -26,69 +25,40 @@ scriptversion=2009-04-28.21; # UTC
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
- echo 1>&2 "Try \`$0 --help' for more information"
+ echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
-run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
-
-# In the cases where this matters, `missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
- configure_ac=configure.ac
-else
- configure_ac=configure.in
-fi
+case $1 in
-msg="missing on your system"
+ --is-lightweight)
+ # Used by our autoconf macros to check whether the available missing
+ # script is modern enough.
+ exit 0
+ ;;
-case $1 in
---run)
- # Try to run requested program, and just exit if it succeeds.
- run=
- shift
- "$@" && exit 0
- # Exit code 63 means version mismatch. This often happens
- # when the user try to use an ancient version of a tool on
- # a file that requires a minimum version. In this case we
- # we should proceed has if the program had been absent, or
- # if --run hadn't been passed.
- if test $? = 63; then
- run=:
- msg="probably too old"
- fi
- ;;
+ --run)
+ # Back-compat with the calling convention used by older automake.
+ shift
+ ;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
- --run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
- aclocal touch file \`aclocal.m4'
- autoconf touch file \`configure'
- autoheader touch file \`config.h.in'
- autom4te touch the output file, or create a stub one
- automake touch all \`Makefile.in' files
- bison create \`y.tab.[ch]', if possible, from existing .[ch]
- flex create \`lex.yy.c', if possible, from existing .c
- help2man touch the output file
- lex create \`lex.yy.c', if possible, from existing .c
- makeinfo touch the output file
- tar try tar, gnutar, gtar, then tar without non-portable flags
- yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+ aclocal autoconf autoheader autom4te automake makeinfo
+ bison yacc flex lex help2man
-Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
-\`g' are ignored when checking the name.
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
Send bug reports to <bug-automake at gnu.org>."
exit $?
@@ -100,272 +70,141 @@ Send bug reports to <bug-automake at gnu.org>."
;;
-*)
- echo 1>&2 "$0: Unknown \`$1' option"
- echo 1>&2 "Try \`$0 --help' for more information"
+ echo 1>&2 "$0: unknown '$1' option"
+ echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
-# normalize program name to check for.
-program=`echo "$1" | sed '
- s/^gnu-//; t
- s/^gnu//; t
- s/^g//; t'`
-
-# Now exit if we have it, but it failed. Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program). This is about non-GNU programs, so use $1 not
-# $program.
-case $1 in
- lex*|yacc*)
- # Not GNU programs, they don't have --version.
- ;;
-
- tar*)
- if test -n "$run"; then
- echo 1>&2 "ERROR: \`tar' requires --run"
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- exit 1
- fi
- ;;
-
- *)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- # Could not run --version or --help. This is probably someone
- # running `$TOOL --version' or `$TOOL --help' to check whether
- # $TOOL exists and not knowing $TOOL uses missing.
- exit 1
- fi
- ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case $program in
- aclocal*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`acinclude.m4' or \`${configure_ac}'. You might want
- to install the \`Automake' and \`Perl' packages. Grab them from
- any GNU archive site."
- touch aclocal.m4
- ;;
-
- autoconf*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`${configure_ac}'. You might want to install the
- \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
- archive site."
- touch configure
- ;;
-
- autoheader*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`acconfig.h' or \`${configure_ac}'. You might want
- to install the \`Autoconf' and \`GNU m4' packages. Grab them
- from any GNU archive site."
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
- test -z "$files" && files="config.h"
- touch_files=
- for f in $files; do
- case $f in
- *:*) touch_files="$touch_files "`echo "$f" |
- sed -e 's/^[^:]*://' -e 's/:.*//'`;;
- *) touch_files="$touch_files $f.in";;
- esac
- done
- touch $touch_files
- ;;
-
- automake*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
- You might want to install the \`Automake' and \`Perl' packages.
- Grab them from any GNU archive site."
- find . -type f -name Makefile.am -print |
- sed 's/\.am$/.in/' |
- while read f; do touch "$f"; done
- ;;
-
- autom4te*)
- echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
- You might have modified some files without having the
- proper tools for further handling them.
- You can get \`$1' as part of \`Autoconf' from any GNU
- archive site."
-
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -f "$file"; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo "#! /bin/sh"
- echo "# Created by GNU Automake missing as a replacement of"
- echo "# $ $@"
- echo "exit 0"
- chmod +x $file
- exit 1
- fi
- ;;
-
- bison*|yacc*)
- echo 1>&2 "\
-WARNING: \`$1' $msg. You should only need it if
- you modified a \`.y' file. You may need the \`Bison' package
- in order for those modifications to take effect. You can get
- \`Bison' from any GNU archive site."
- rm -f y.tab.c y.tab.h
- if test $# -ne 1; then
- eval LASTARG="\${$#}"
- case $LASTARG in
- *.y)
- SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" y.tab.c
- fi
- SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" y.tab.h
- fi
- ;;
- esac
- fi
- if test ! -f y.tab.h; then
- echo >y.tab.h
- fi
- if test ! -f y.tab.c; then
- echo 'main() { return 0; }' >y.tab.c
- fi
- ;;
-
- lex*|flex*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a \`.l' file. You may need the \`Flex' package
- in order for those modifications to take effect. You can get
- \`Flex' from any GNU archive site."
- rm -f lex.yy.c
- if test $# -ne 1; then
- eval LASTARG="\${$#}"
- case $LASTARG in
- *.l)
- SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" lex.yy.c
- fi
- ;;
- esac
- fi
- if test ! -f lex.yy.c; then
- echo 'main() { return 0; }' >lex.yy.c
- fi
- ;;
-
- help2man*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a dependency of a manual page. You may need the
- \`Help2man' package in order for those modifications to take
- effect. You can get \`Help2man' from any GNU archive site."
-
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -f "$file"; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo ".ab help2man is required to generate this page"
- exit $?
- fi
- ;;
-
- makeinfo*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a \`.texi' or \`.texinfo' file, or any other file
- indirectly affecting the aspect of the manual. The spurious
- call might also be the consequence of using a buggy \`make' (AIX,
- DU, IRIX). You might want to install the \`Texinfo' package or
- the \`GNU make' package. Grab either from any GNU archive site."
- # The file to touch is that specified with -o ...
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -z "$file"; then
- # ... or it is the one specified with @setfilename ...
- infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '
- /^@setfilename/{
- s/.* \([^ ]*\) *$/\1/
- p
- q
- }' $infile`
- # ... or it is derived from the source name (dir/f.texi becomes f.info)
- test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
- fi
- # If the file does not exist, the user really needs makeinfo;
- # let's fail without touching anything.
- test -f $file || exit 1
- touch $file
- ;;
-
- tar*)
- shift
-
- # We have already tried tar in the generic part.
- # Look for gnutar/gtar before invocation to avoid ugly error
- # messages.
- if (gnutar --version > /dev/null 2>&1); then
- gnutar "$@" && exit 0
- fi
- if (gtar --version > /dev/null 2>&1); then
- gtar "$@" && exit 0
- fi
- firstarg="$1"
- if shift; then
- case $firstarg in
- *o*)
- firstarg=`echo "$firstarg" | sed s/o//`
- tar "$firstarg" "$@" && exit 0
- ;;
- esac
- case $firstarg in
- *h*)
- firstarg=`echo "$firstarg" | sed s/h//`
- tar "$firstarg" "$@" && exit 0
- ;;
- esac
- fi
-
- echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
- You may want to install GNU tar or Free paxutils, or check the
- command line arguments."
- exit 1
- ;;
-
- *)
- echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
- You might have modified some files without having the
- proper tools for further handling them. Check the \`README' file,
- it often tells you about the needed prerequisites for installing
- this package. You may also peek at any GNU archive site, in case
- some other package would contain this missing \`$1' program."
- exit 1
- ;;
-esac
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch. This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+ msg="probably too old"
+elif test $st -eq 127; then
+ # Program was missing.
+ msg="missing on your system"
+else
+ # Program was found and executed, but failed. Give up.
+ exit $st
+fi
-exit 0
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+ case $1 in
+ aclocal|automake)
+ echo "The '$1' program is part of the GNU Automake package:"
+ echo "<$gnu_software_URL/automake>"
+ echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/autoconf>"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ autoconf|autom4te|autoheader)
+ echo "The '$1' program is part of the GNU Autoconf package:"
+ echo "<$gnu_software_URL/autoconf/>"
+ echo "It also requires GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ esac
+}
+
+give_advice ()
+{
+ # Normalize program name to check for.
+ normalized_program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+ printf '%s\n' "'$1' is $msg."
+
+ configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+ case $normalized_program in
+ autoconf*)
+ echo "You should only need it if you modified 'configure.ac',"
+ echo "or m4 files included by it."
+ program_details 'autoconf'
+ ;;
+ autoheader*)
+ echo "You should only need it if you modified 'acconfig.h' or"
+ echo "$configure_deps."
+ program_details 'autoheader'
+ ;;
+ automake*)
+ echo "You should only need it if you modified 'Makefile.am' or"
+ echo "$configure_deps."
+ program_details 'automake'
+ ;;
+ aclocal*)
+ echo "You should only need it if you modified 'acinclude.m4' or"
+ echo "$configure_deps."
+ program_details 'aclocal'
+ ;;
+ autom4te*)
+ echo "You might have modified some maintainer files that require"
+ echo "the 'automa4te' program to be rebuilt."
+ program_details 'autom4te'
+ ;;
+ bison*|yacc*)
+ echo "You should only need it if you modified a '.y' file."
+ echo "You may want to install the GNU Bison package:"
+ echo "<$gnu_software_URL/bison/>"
+ ;;
+ lex*|flex*)
+ echo "You should only need it if you modified a '.l' file."
+ echo "You may want to install the Fast Lexical Analyzer package:"
+ echo "<$flex_URL>"
+ ;;
+ help2man*)
+ echo "You should only need it if you modified a dependency" \
+ "of a man page."
+ echo "You may want to install the GNU Help2man package:"
+ echo "<$gnu_software_URL/help2man/>"
+ ;;
+ makeinfo*)
+ echo "You should only need it if you modified a '.texi' file, or"
+ echo "any other file indirectly affecting the aspect of the manual."
+ echo "You might want to install the Texinfo package:"
+ echo "<$gnu_software_URL/texinfo/>"
+ echo "The spurious makeinfo call might also be the consequence of"
+ echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+ echo "want to install GNU make:"
+ echo "<$gnu_software_URL/make/>"
+ ;;
+ *)
+ echo "You might have modified some files without having the proper"
+ echo "tools for further handling them. Check the 'README' file, it"
+ echo "often tells you about the needed prerequisites for installing"
+ echo "this package. You may also peek at any GNU archive site, in"
+ echo "case some other package contains this missing '$1' program."
+ ;;
+ esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+ -e '2,$s/^/ /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/src/Makefile.am b/src/Makefile.am
index 3bb801d..87b0e9c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -111,12 +111,13 @@ netbuild netwrite netgen netimport netload \
polyconvert dfrouter duarouter jtrrouter activitygen tools \
$(TRACI_DIRS) $(GUI_DIRS)
-EXTRA_DIST = config.h config.h.in \
-guisim.rc \
-windows_config.h
-
if WITH_VERSION_H
-all: version.h
-version.h: ../.svn
+VERSION_H = version.h
+all: $(VERSION_H)
+$(VERSION_H): ../.svn
../tools/build/version.py $(CURDIR)
endif
+
+EXTRA_DIST = config.h config.h.in \
+$(VERSION_H) guisim.rc \
+windows_config.h
diff --git a/src/Makefile.in b/src/Makefile.in
index 47fd7e4..3714700 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -511,8 +511,9 @@ netbuild netwrite netgen netimport netload \
polyconvert dfrouter duarouter jtrrouter activitygen tools \
$(TRACI_DIRS) $(GUI_DIRS)
+ at WITH_VERSION_H_TRUE@VERSION_H = version.h
EXTRA_DIST = config.h config.h.in \
-guisim.rc \
+$(VERSION_H) guisim.rc \
windows_config.h
all: config.h
@@ -948,9 +949,8 @@ uninstall-am: uninstall-binPROGRAMS
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
-
- at WITH_VERSION_H_TRUE@all: version.h
- at WITH_VERSION_H_TRUE@version.h: ../.svn
+ at WITH_VERSION_H_TRUE@all: $(VERSION_H)
+ at WITH_VERSION_H_TRUE@$(VERSION_H): ../.svn
@WITH_VERSION_H_TRUE@ ../tools/build/version.py $(CURDIR)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/src/activitygen/activitygen_main.cpp b/src/activitygen/activitygen_main.cpp
index e7cb9c9..b9d1dac 100644
--- a/src/activitygen/activitygen_main.cpp
+++ b/src/activitygen/activitygen_main.cpp
@@ -6,7 +6,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 20 Jul 2010
-/// @version $Id: activitygen_main.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: activitygen_main.cpp 18486 2015-06-11 11:10:09Z behrisch $
///
// Main object of the ActivityGen application
/****************************************************************************/
@@ -44,7 +44,6 @@
#include <router/RONet.h>
#include <router/ROLoader.h>
#include <router/RONetHandler.h>
-#include <duarouter/RODUAEdgeBuilder.h>
#include <utils/options/OptionsIO.h>
#include <utils/common/MsgHandler.h>
#include <utils/common/ToString.h>
@@ -110,7 +109,8 @@ main(int argc, char* argv[]) {
// Initialise subsystems and process options
XMLSubSys::init();
AGFrame::fillOptions();
- OptionsIO::getOptions(true, argc, argv);
+ OptionsIO::setArgs(argc, argv);
+ OptionsIO::getOptions();
if (oc.processMetaOptions(argc < 2)) {
SystemFrame::close();
return 0;
diff --git a/src/activitygen/city/AGCity.cpp b/src/activitygen/city/AGCity.cpp
index e9db64e..067135e 100644
--- a/src/activitygen/city/AGCity.cpp
+++ b/src/activitygen/city/AGCity.cpp
@@ -6,7 +6,7 @@
/// @author Walter Bamberger
/// @author Jakob Erdmann
/// @date July 2010
-/// @version $Id: AGCity.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: AGCity.cpp 18467 2015-05-29 03:50:41Z behrisch $
///
// City class that contains all other objects of the city: in particular
// streets, households, bus lines, work positions and school
@@ -95,7 +95,7 @@ AGCity::completeStreets() {
}
}
//if this edge isn't represented by a street
- if (itS == streets.end() && itE->second->getType() != ROEdge::ET_INTERNAL) {
+ if (itS == streets.end() && itE->second->getFunc() != ROEdge::ET_INTERNAL) {
streets.push_back(static_cast<AGStreet*>(itE->second));
}
}
diff --git a/src/activitygen/city/AGPosition.cpp b/src/activitygen/city/AGPosition.cpp
index b64d506..134e8dc 100644
--- a/src/activitygen/city/AGPosition.cpp
+++ b/src/activitygen/city/AGPosition.cpp
@@ -5,7 +5,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date July 2010
-/// @version $Id: AGPosition.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: AGPosition.cpp 18627 2015-08-13 08:58:59Z namdre $
///
// References a street of the city and defines a position in this street
/****************************************************************************/
@@ -125,8 +125,8 @@ AGPosition::randomPositionInStreet(const AGStreet& s) {
Position
AGPosition::compute2dPosition() const {
// P = From + pos*(To - From) = pos*To + (1-pos)*From
- Position From = street->getFromNode()->getPosition();
- Position To = street->getToNode()->getPosition();
+ Position From = street->getFromJunction()->getPosition();
+ Position To = street->getToJunction()->getPosition();
Position position2d(To);
position2d.sub(From);
diff --git a/src/config.h b/src/config.h
index 0767e05..0b57889 100644
--- a/src/config.h
+++ b/src/config.h
@@ -81,7 +81,7 @@
#define HAVE_PROJ 1
/* defined if python is available */
-#define HAVE_PYTHON 1
+/* #undef HAVE_PYTHON */
/* Define to 1 if you have the `select' function. */
#define HAVE_SELECT 1
@@ -174,7 +174,7 @@
#define PACKAGE_NAME "sumo"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "sumo 0.23.0"
+#define PACKAGE_STRING "sumo 0.24.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "sumo"
@@ -183,7 +183,7 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "0.23.0"
+#define PACKAGE_VERSION "0.24.0"
/* defines the epsilon to use on position comparison */
#define POSITION_EPS (SUMOReal)0.1
@@ -211,9 +211,6 @@
/* Define to 1 if you have the ANSI C header files. */
/* #undef STDC_HEADERS */
-/* defines the type for very long integers */
-#define SUMOLong long long int
-
/* defines the precision of floats */
#define SUMOReal double
@@ -224,7 +221,7 @@
/* #undef TM_IN_SYS_TIME */
/* Version number of package */
-#define VERSION "0.23.0"
+#define VERSION "0.24.0"
/* Defined if auto-generated version.h is unavailable. */
/* #undef VERSION_STRING */
diff --git a/src/config.h.in b/src/config.h.in
index ec673f0..a919d74 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -210,9 +210,6 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
-/* defines the type for very long integers */
-#undef SUMOLong
-
/* defines the precision of floats */
#undef SUMOReal
diff --git a/src/dfrouter/RODFDetFlowLoader.h b/src/dfrouter/RODFDetFlowLoader.h
index 9c8b462..2f50983 100644
--- a/src/dfrouter/RODFDetFlowLoader.h
+++ b/src/dfrouter/RODFDetFlowLoader.h
@@ -4,7 +4,7 @@
/// @author Eric Nicolay
/// @author Michael Behrisch
/// @date Thu, 16.03.2006
-/// @version $Id: RODFDetFlowLoader.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: RODFDetFlowLoader.h 18213 2015-04-16 11:55:42Z behrisch $
///
// A loader for detector flows
/****************************************************************************/
@@ -59,7 +59,7 @@ public:
*/
RODFDetFlowLoader(const RODFDetectorCon& dets, RODFDetectorFlows& into,
SUMOTime startTime, SUMOTime endTime,
- SUMOTime timeOffset, int timeScale);
+ SUMOTime timeOffset, SUMOTime timeScale);
/// @brief Destructor
diff --git a/src/dfrouter/RODFDetector.cpp b/src/dfrouter/RODFDetector.cpp
index d859e10..ce41205 100644
--- a/src/dfrouter/RODFDetector.cpp
+++ b/src/dfrouter/RODFDetector.cpp
@@ -8,7 +8,7 @@
/// @author Laura Bieker
/// @author Melanie Knocke
/// @date Thu, 16.03.2006
-/// @version $Id: RODFDetector.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: RODFDetector.cpp 18627 2015-08-13 08:58:59Z namdre $
///
// Class representing a detector within the DFROUTER
/****************************************************************************/
@@ -89,7 +89,7 @@ RODFDetector::setType(RODFDetectorType type) {
SUMOReal
RODFDetector::computeDistanceFactor(const RODFRouteDesc& rd) const {
- SUMOReal distance = rd.edges2Pass[0]->getFromNode()->getPosition().distanceTo(rd.edges2Pass.back()->getToNode()->getPosition());
+ SUMOReal distance = rd.edges2Pass[0]->getFromJunction()->getPosition().distanceTo(rd.edges2Pass.back()->getToJunction()->getPosition());
SUMOReal length = 0;
for (ROEdgeVector::const_iterator i = rd.edges2Pass.begin(); i != rd.edges2Pass.end(); ++i) {
length += (*i)->getLength();
diff --git a/src/dfrouter/RODFDetectorFlow.cpp b/src/dfrouter/RODFDetectorFlow.cpp
index 9f586b3..1459334 100644
--- a/src/dfrouter/RODFDetectorFlow.cpp
+++ b/src/dfrouter/RODFDetectorFlow.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Melanie Knocke
/// @date Thu, 16.03.2006
-/// @version $Id: RODFDetectorFlow.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: RODFDetectorFlow.cpp 18213 2015-04-16 11:55:42Z behrisch $
///
// Storage for flows within the DFROUTER
/****************************************************************************/
@@ -69,8 +69,9 @@ RODFDetectorFlows::addFlow(const std::string& id, SUMOTime t, const FlowDef& fd)
(*i).firstSet = true;
}
}
- assert((t - myBeginTime) / myStepOffset < (int) myFastAccessFlows[id].size());
- FlowDef& ofd = myFastAccessFlows[id][(t - myBeginTime) / myStepOffset];
+ const int index = (int)((t - myBeginTime) / myStepOffset);
+ assert(index < (int) myFastAccessFlows[id].size());
+ FlowDef& ofd = myFastAccessFlows[id][index];
if (ofd.firstSet) {
ofd = fd;
ofd.firstSet = false;
diff --git a/src/dfrouter/RODFNet.cpp b/src/dfrouter/RODFNet.cpp
index 8fd0674..aea2c8a 100644
--- a/src/dfrouter/RODFNet.cpp
+++ b/src/dfrouter/RODFNet.cpp
@@ -5,7 +5,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Thu, 16.03.2006
-/// @version $Id: RODFNet.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: RODFNet.cpp 18627 2015-08-13 08:58:59Z namdre $
///
// A DFROUTER-network
/****************************************************************************/
@@ -77,7 +77,7 @@ RODFNet::buildApproachList() {
// edges in sinks will not be used
continue;
}
- if (!myKeepTurnarounds && help->getToNode() == ce->getFromNode()) {
+ if (!myKeepTurnarounds && help->getToJunction() == ce->getFromJunction()) {
// do not use turnarounds
continue;
}
@@ -223,7 +223,7 @@ RODFNet::computeRoutesFor(ROEdge* edge, RODFRouteDesc& base, int /*no*/,
if (!hasApproached(last)) {
// ok, no further connections to follow
current.factor = 1.;
- SUMOReal cdist = current.edges2Pass[0]->getFromNode()->getPosition().distanceTo(current.edges2Pass.back()->getToNode()->getPosition());
+ SUMOReal cdist = current.edges2Pass[0]->getFromJunction()->getPosition().distanceTo(current.edges2Pass.back()->getToJunction()->getPosition());
if (minDist < cdist) {
into.addRouteDesc(current);
}
@@ -247,7 +247,7 @@ RODFNet::computeRoutesFor(ROEdge* edge, RODFRouteDesc& base, int /*no*/,
///!!! //toDiscard.push_back(current);
}
current.factor = 1.;
- SUMOReal cdist = current.edges2Pass[0]->getFromNode()->getPosition().distanceTo(current.edges2Pass.back()->getToNode()->getPosition());
+ SUMOReal cdist = current.edges2Pass[0]->getFromJunction()->getPosition().distanceTo(current.edges2Pass.back()->getToJunction()->getPosition());
if (minDist < cdist) {
into.addRouteDesc(current);
}
@@ -283,7 +283,7 @@ RODFNet::computeRoutesFor(ROEdge* edge, RODFRouteDesc& base, int /*no*/,
WRITE_WARNING("Could not close route for '" + det.getID() + "'");
unfoundEnds.push_back(current);
current.factor = 1.;
- SUMOReal cdist = current.edges2Pass[0]->getFromNode()->getPosition().distanceTo(current.edges2Pass.back()->getToNode()->getPosition());
+ SUMOReal cdist = current.edges2Pass[0]->getFromJunction()->getPosition().distanceTo(current.edges2Pass.back()->getToJunction()->getPosition());
if (minDist < cdist) {
into.addRouteDesc(current);
}
@@ -308,7 +308,7 @@ RODFNet::computeRoutesFor(ROEdge* edge, RODFRouteDesc& base, int /*no*/,
} else {
if (!hadOne) {
t.factor = (SUMOReal) 1. / (SUMOReal) appr.size();
- SUMOReal cdist = current.edges2Pass[0]->getFromNode()->getPosition().distanceTo(current.edges2Pass.back()->getToNode()->getPosition());
+ SUMOReal cdist = current.edges2Pass[0]->getFromJunction()->getPosition().distanceTo(current.edges2Pass.back()->getToJunction()->getPosition());
if (minDist < cdist) {
into.addRouteDesc(t);
}
diff --git a/src/dfrouter/dfrouter_main.cpp b/src/dfrouter/dfrouter_main.cpp
index 8050d75..c81426d 100644
--- a/src/dfrouter/dfrouter_main.cpp
+++ b/src/dfrouter/dfrouter_main.cpp
@@ -7,7 +7,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Thu, 16.03.2006
-/// @version $Id: dfrouter_main.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: dfrouter_main.cpp 18486 2015-06-11 11:10:09Z behrisch $
///
// Main for the DFROUTER
/****************************************************************************/
@@ -273,7 +273,8 @@ main(int argc, char** argv) {
// initialise the application system (messaging, xml, options)
XMLSubSys::init();
RODFFrame::fillOptions();
- OptionsIO::getOptions(true, argc, argv);
+ OptionsIO::setArgs(argc, argv);
+ OptionsIO::getOptions();
if (oc.processMetaOptions(argc < 2)) {
SystemFrame::close();
return 0;
diff --git a/src/duarouter/RODUAEdgeBuilder.cpp b/src/duarouter/RODUAEdgeBuilder.cpp
index f4b8dd6..089801c 100644
--- a/src/duarouter/RODUAEdgeBuilder.cpp
+++ b/src/duarouter/RODUAEdgeBuilder.cpp
@@ -5,7 +5,7 @@
/// @author Jakob Erdmann
/// @author Yun-Pang Floetteroed
/// @date Tue, 20 Jan 2004
-/// @version $Id: RODUAEdgeBuilder.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: RODUAEdgeBuilder.cpp 18394 2015-05-18 13:26:24Z behrisch $
///
// Interface for building instances of duarouter-edges
/****************************************************************************/
@@ -42,8 +42,7 @@
// ===========================================================================
// method definitions
// ===========================================================================
-RODUAEdgeBuilder::RODUAEdgeBuilder(bool useBoundariesOnOverride, bool interpolate) {
- ROEdge::setTimeLineOptions(useBoundariesOnOverride, useBoundariesOnOverride, interpolate);
+RODUAEdgeBuilder::RODUAEdgeBuilder() {
}
diff --git a/src/duarouter/RODUAEdgeBuilder.h b/src/duarouter/RODUAEdgeBuilder.h
index dbfba56..8f4b590 100644
--- a/src/duarouter/RODUAEdgeBuilder.h
+++ b/src/duarouter/RODUAEdgeBuilder.h
@@ -5,7 +5,7 @@
/// @author Jakob Erdmann
/// @author Yun-Pang Floetteroed
/// @date Tue, 20 Jan 2004
-/// @version $Id: RODUAEdgeBuilder.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: RODUAEdgeBuilder.h 18394 2015-05-18 13:26:24Z behrisch $
///
// Interface for building instances of duarouter-edges
/****************************************************************************/
@@ -58,12 +58,8 @@ class RONode;
class RODUAEdgeBuilder : public ROAbstractEdgeBuilder {
public:
/** @brief Constructor
- *
- * @param[in] useBoundariesOnOverride Whether edges shall use a boundary value if the requested is beyond known time scale
- * @param[in] interpolate Whether edges shall interpolate at interval boundaries
- * @todo useBoundariesOnOverride should not be a member of the edges
*/
- RODUAEdgeBuilder(bool useBoundariesOnOverride, bool interpolate);
+ RODUAEdgeBuilder();
/// @brief Destructor
diff --git a/src/duarouter/RODUAFrame.cpp b/src/duarouter/RODUAFrame.cpp
index d7c9541..9418c23 100644
--- a/src/duarouter/RODUAFrame.cpp
+++ b/src/duarouter/RODUAFrame.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: RODUAFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: RODUAFrame.cpp 18553 2015-07-08 15:58:13Z behrisch $
///
// Sets and checks options for dua-routing
/****************************************************************************/
@@ -176,6 +176,11 @@ RODUAFrame::checkOptions() {
return false;
}
+ if (oc.getBool("bulk-routing") && (oc.getString("routing-algorithm") == "CH" || oc.getString("routing-algorithm") == "CHWrapper")) {
+ WRITE_ERROR("Routing algorithm '" + oc.getString("routing-algorithm") + "' does not support bulk routing.");
+ return false;
+ }
+
if (oc.getString("route-choice-method") != "gawron" && oc.getString("route-choice-method") != "logit") {
WRITE_ERROR("Invalid route choice method '" + oc.getString("route-choice-method") + "'.");
return false;
diff --git a/src/duarouter/duarouter_main.cpp b/src/duarouter/duarouter_main.cpp
index 23ee4f4..f1e50b3 100644
--- a/src/duarouter/duarouter_main.cpp
+++ b/src/duarouter/duarouter_main.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Thu, 06 Jun 2002
-/// @version $Id: duarouter_main.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: duarouter_main.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Main for DUAROUTER
/****************************************************************************/
@@ -47,7 +47,6 @@
#include <utils/vehicle/DijkstraRouterTT.h>
#include <utils/vehicle/DijkstraRouterEffort.h>
#include <utils/vehicle/AStarRouter.h>
-#include <utils/vehicle/BulkStarRouter.h>
#include <utils/vehicle/CHRouter.h>
#include <utils/vehicle/CHRouterWrapper.h>
#include "RODUAEdgeBuilder.h"
@@ -83,7 +82,8 @@
void
initNet(RONet& net, ROLoader& loader, OptionsCont& oc) {
// load the net
- RODUAEdgeBuilder builder(oc.getBool("weights.expand"), oc.getBool("weights.interpolate"));
+ RODUAEdgeBuilder builder;
+ ROEdge::setGlobalOptions(oc.getBool("weights.expand"), oc.getBool("weights.expand"), oc.getBool("weights.interpolate"), oc.getInt("routing-threads") > 1);
loader.loadNet(net, builder);
// load the weights when wished/available
if (oc.isSet("weight-files")) {
@@ -118,38 +118,30 @@ computeRoutes(RONet& net, ROLoader& loader, OptionsCont& oc) {
const std::string routingAlgorithm = oc.getString("routing-algorithm");
if (measure == "traveltime") {
if (routingAlgorithm == "dijkstra") {
- if (net.hasRestrictions()) {
- router = new DijkstraRouterTT<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
+ if (net.hasPermissions()) {
+ router = new DijkstraRouterTT<ROEdge, ROVehicle, prohibited_withPermissions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
} else {
- router = new DijkstraRouterTT<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
+ router = new DijkstraRouterTT<ROEdge, ROVehicle, noProhibitions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
}
} else if (routingAlgorithm == "astar") {
- if (net.hasRestrictions()) {
- router = new AStarRouter<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
+ if (net.hasPermissions()) {
+ router = new AStarRouter<ROEdge, ROVehicle, prohibited_withPermissions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
} else {
- router = new AStarRouter<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
+ router = new AStarRouter<ROEdge, ROVehicle, noProhibitions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
}
- } else if (routingAlgorithm == "bulkstar") {
- if (net.hasRestrictions()) {
- router = new BulkStarRouter<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
- net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, &ROEdge::getMinimumTravelTime);
- } else {
- router = new BulkStarRouter<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
- net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, &ROEdge::getMinimumTravelTime);
- }
} else if (routingAlgorithm == "CH") {
const SUMOTime weightPeriod = (oc.isSet("weight-files") ?
string2time(oc.getString("weight-period")) :
std::numeric_limits<int>::max());
- if (net.hasRestrictions()) {
- router = new CHRouter<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
+ if (net.hasPermissions()) {
+ router = new CHRouter<ROEdge, ROVehicle, prohibited_withPermissions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, SVC_IGNORING, weightPeriod, true);
} else {
- router = new CHRouter<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
+ router = new CHRouter<ROEdge, ROVehicle, noProhibitions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, SVC_IGNORING, weightPeriod, false);
}
} else if (routingAlgorithm == "CHWrapper") {
@@ -158,13 +150,13 @@ computeRoutes(RONet& net, ROLoader& loader, OptionsCont& oc) {
string2time(oc.getString("weight-period")) :
std::numeric_limits<int>::max());
- router = new CHRouterWrapper<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
+ router = new CHRouterWrapper<ROEdge, ROVehicle, prohibited_withPermissions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, begin, weightPeriod);
} else {
throw ProcessError("Unknown routing Algorithm '" + routingAlgorithm + "'!");
}
} else {
- DijkstraRouterEffort<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >::Operation op;
+ DijkstraRouterEffort<ROEdge, ROVehicle, prohibited_withPermissions<ROEdge, ROVehicle> >::Operation op;
if (measure == "CO") {
op = &ROEdge::getEmissionEffort<PollutantsInterface::CO>;
} else if (measure == "CO2") {
@@ -182,24 +174,19 @@ computeRoutes(RONet& net, ROLoader& loader, OptionsCont& oc) {
} else {
throw ProcessError("Unknown measure (weight attribute '" + measure + "')!");
}
- if (net.hasRestrictions()) {
- router = new DijkstraRouterEffort<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
+ if (net.hasPermissions()) {
+ router = new DijkstraRouterEffort<ROEdge, ROVehicle, prohibited_withPermissions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), op, &ROEdge::getTravelTimeStatic);
} else {
- router = new DijkstraRouterEffort<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
+ router = new DijkstraRouterEffort<ROEdge, ROVehicle, noProhibitions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), op, &ROEdge::getTravelTimeStatic);
}
}
net.openOutput(filename, altFilename, oc.getString("vtype-output"));
// process route definitions
try {
- if (routingAlgorithm == "bulkstar") {
- // need to load all routes for spatial aggregation
- loader.processAllRoutesWithBulkRouter(string2time(oc.getString("begin")), string2time(oc.getString("end")), net, *router);
- } else {
- loader.processRoutes(string2time(oc.getString("begin")), string2time(oc.getString("end")),
- string2time(oc.getString("route-steps")), net, *router);
- }
+ loader.processRoutes(string2time(oc.getString("begin")), string2time(oc.getString("end")),
+ string2time(oc.getString("route-steps")), net, *router);
// end the processing
net.cleanup(router);
} catch (ProcessError&) {
@@ -223,7 +210,8 @@ main(int argc, char** argv) {
try {
XMLSubSys::init();
RODUAFrame::fillOptions();
- OptionsIO::getOptions(true, argc, argv);
+ OptionsIO::setArgs(argc, argv);
+ OptionsIO::getOptions();
if (oc.processMetaOptions(argc < 2)) {
SystemFrame::close();
return 0;
diff --git a/src/foreign/additional.txt b/src/foreign/additional.txt
index 43f3494..e129ce6 100644
--- a/src/foreign/additional.txt
+++ b/src/foreign/additional.txt
@@ -2,20 +2,20 @@ The subfolders contain additional libraries used by SUMO:
- nvwa
Memory checks library
- Used Version: 0.8.2
- Modifications: unused files removed, added compile guard to debug_new.cpp
+ Used Version: 1.0
+ Modifications: unused files removed, added compile guard to debug_new.cpp, fixed throw declarations
Original Page: http://sourceforge.net/projects/nvwa
- Mersenne Twister Random Number Generator
Random number generator
Used Version: 1.0
- Modifications: none
+ Modifications: fixed compiler warnings, added 64bit version of randInt
Original Page: http://www-personal.engin.umich.edu/~wagnerr/MersenneTwister.html
- tcpip
Simple TCP/IP Socket Class to communicate with other programs
- Used Version: always the most recent one (included via svn:externals)
- Modifications: none
+ Used Version: https://github.com/itm/shawn/tree/master/src/apps/tcpip from 2012-09-28
+ Modifications: fixed invalid buffer length calculation, fixed compiler warnings, removed "using namespace std"
Original Page: http://shawn.sf.net
- Polyfonts
@@ -33,7 +33,7 @@ The subfolders contain additional libraries used by SUMO:
- EulerSpiral
Approximating curves
Used version: unknown
- Modifications: fixing warnings (removing unused variables, initializing variables); relicensed under LGPL, see license file
+ Modifications: fixing warnings (removing unused variables, initializing variables), adding missing includes for cygwin; relicensed under LGPL, see license file
Original page: http://www.lems.brown.edu/vision/researchAreas/EulerSpiral/
- gl2ps
diff --git a/src/foreign/eulerspiral/BiArc.cpp b/src/foreign/eulerspiral/BiArc.cpp
index 80bbefd..0689f99 100644
--- a/src/foreign/eulerspiral/BiArc.cpp
+++ b/src/foreign/eulerspiral/BiArc.cpp
@@ -1,5 +1,6 @@
#include "BiArc.h"
#include <cassert>
+#include <cmath> // added for cygwin build 2015-06-10 MB
void BiArc::compute_biarc_params(void)
{
diff --git a/src/foreign/mersenne/MersenneTwister.h b/src/foreign/mersenne/MersenneTwister.h
index a7d947e..994a7d6 100644
--- a/src/foreign/mersenne/MersenneTwister.h
+++ b/src/foreign/mersenne/MersenneTwister.h
@@ -67,6 +67,7 @@
#include <iostream>
#include <limits.h>
+#include <stdint.h>
#include <stdio.h>
#include <time.h>
#include <math.h>
@@ -75,6 +76,7 @@ class MTRand {
// Data
public:
typedef unsigned long uint32; // unsigned integer type, at least 32 bits
+ typedef unsigned long long int uint64; // unsigned integer type, at least 64 bits
enum { N = 624 }; // length of state vector
enum { SAVE = N + 1 }; // length of array for save()
@@ -106,6 +108,8 @@ public:
double randDblExc( const double& n ); // real number in (0,n)
uint32 randInt(); // integer in [0,2^32-1]
uint32 randInt( const uint32& n ); // integer in [0,n] for n < 2^32
+
+ uint64 randInt64( const uint64& n ); // integer in [0,n] for n < 2^64
double operator()() { return rand(); } // same as rand()
// Access to 53-bit random numbers (capacity of IEEE double precision)
@@ -218,6 +222,30 @@ inline MTRand::uint32 MTRand::randInt( const uint32& n )
}
+inline MTRand::uint64 MTRand::randInt64( const uint64& n )
+{
+ if (n <= INT_MAX) {
+ return randInt((uint32)n);
+ }
+ // Find which bits are used in n
+ // Optimized by Magnus Jonsson (magnus at smartelectronix.com)
+ uint64 used = n;
+ used |= used >> 1;
+ used |= used >> 2;
+ used |= used >> 4;
+ used |= used >> 8;
+ used |= used >> 16;
+ used |= used >> 32;
+
+ // Draw numbers until one is found in [0,n]
+ uint64 i;
+ do
+ i = (((uint64)randInt() << 32) | randInt()) & used; // toss unused bits to shorten search
+ while( i > n );
+ return i;
+}
+
+
inline void MTRand::seed( const uint32 oneSeed )
{
// Seed the generator with a simple uint32
diff --git a/src/foreign/nvwa/debug_new.cpp b/src/foreign/nvwa/debug_new.cpp
index 815e5fb..1a98d3c 100644
--- a/src/foreign/nvwa/debug_new.cpp
+++ b/src/foreign/nvwa/debug_new.cpp
@@ -8,7 +8,7 @@
#ifdef CHECK_MEMORY_LEAKS
/*
- * Copyright (C) 2004-2011 Wu Yongwei <adah at users dot sourceforge dot net>
+ * Copyright (C) 2004-2013 Wu Yongwei <adah at users dot sourceforge dot net>
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
@@ -33,29 +33,29 @@
*/
/**
- * @file debug_new.cpp
+ * @file debug_new.cpp
*
* Implementation of debug versions of new and delete to check leakage.
*
- * @version 4.22, 2011/07/12
- * @author Wu Yongwei
- *
+ * @date 2013-12-31
*/
-#include <new>
-#include <assert.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef __unix__
-#include <alloca.h>
+#include <new> // std::bad_alloc/nothrow_t
+#include <assert.h> // assert
+#include <stdio.h> // fprintf/stderr
+#include <stdlib.h> // abort
+#include <string.h> // strcpy/strncpy/sprintf
+#if defined(__unix__) || defined(__unix) || \
+ (defined(__APPLE__) && defined(__MACH__))
+#include <alloca.h> // alloca
#endif
#ifdef _WIN32
-#include <malloc.h>
+#include <malloc.h> // alloca
#endif
-#include "fast_mutex.h"
-#include "static_assert.h"
+#include "_nvwa.h" // NVWA_NAMESPACE_*
+#include "c++11.h" // _NOEXCEPT
+#include "fast_mutex.h" // nvwa::fast_mutex
+#include "static_assert.h" // STATIC_ASSERT
#if !_FAST_MUTEX_CHECK_INITIALIZATION && !defined(_NOTHREADS)
#error "_FAST_MUTEX_CHECK_INITIALIZATION not set: check_leaks may not work"
@@ -74,7 +74,7 @@
/**
* @def _DEBUG_NEW_CALLER_ADDRESS
*
- * The expression to return the caller address. #print_position will
+ * The expression to return the caller address. nvwa#print_position will
* later on use this address to print the position information of memory
* operation points.
*/
@@ -127,12 +127,12 @@
* @def _DEBUG_NEW_PROGNAME
*
* The program (executable) name to be set at compile time. It is
- * better to assign the full program path to #new_progname in \e main
+ * better to assign the full program path to nvwa#new_progname in \e main
* (at run time) than to use this (compile-time) macro, but this macro
* serves well as a quick hack. Note also that double quotation marks
* need to be used around the program name, i.e., one should specify a
- * command-line option like <code>-D_DEBUG_NEW_PROGNAME=\"a.out\"</code>
- * in \e bash, or <code>-D_DEBUG_NEW_PROGNAME=\"a.exe\"</code> in the
+ * command-line option like <code>-D_DEBUG_NEW_PROGNAME=\\"a.out\"</code>
+ * in \e bash, or <code>-D_DEBUG_NEW_PROGNAME=\\"a.exe\"</code> in the
* Windows command prompt.
*/
#ifndef _DEBUG_NEW_PROGNAME
@@ -210,12 +210,14 @@
#define ALIGN(s) \
(((s) + _DEBUG_NEW_ALIGNMENT - 1) & ~(_DEBUG_NEW_ALIGNMENT - 1))
+NVWA_NAMESPACE_BEGIN
+
/**
* The platform memory alignment. The current value works well in
* platforms I have tested: Windows XP, Windows 7 x64, and Mac OS X
* Leopard. It may be smaller than the real alignment, but must be
- * bigger than \c sizeof(size_t) for it work. __debug_new_recorder uses
- * it to detect misaligned pointer returned by `<code>new
+ * bigger than \c sizeof(size_t) for it work. nvwa#debug_new_recorder
+ * uses it to detect misaligned pointer returned by `<code>new
* NonPODType[size]</code>'.
*/
const size_t PLATFORM_MEM_ALIGNMENT = sizeof(size_t) * 2;
@@ -245,12 +247,12 @@ struct new_ptr_list_t
/**
* Definition of the constant magic number used for error detection.
*/
-const unsigned MAGIC = 0x4442474E;
+static const unsigned DEBUG_NEW_MAGIC = 0x4442474E;
/**
* The extra memory allocated by <code>operator new</code>.
*/
-const int ALIGNED_LIST_ITEM_SIZE = ALIGN(sizeof(new_ptr_list_t));
+static const int ALIGNED_LIST_ITEM_SIZE = ALIGN(sizeof(new_ptr_list_t));
/**
* List of all new'd pointers.
@@ -268,7 +270,7 @@ static new_ptr_list_t new_ptr_list = {
},
0,
0,
- MAGIC
+ DEBUG_NEW_MAGIC
};
/**
@@ -337,13 +339,19 @@ static bool print_position_from_addr(const void* addr)
}
if (new_progname)
{
+#if defined(__APPLE__) && defined(__MACH__)
+ const char addr2line_cmd[] = "atos -o ";
+#else
const char addr2line_cmd[] = "addr2line -e ";
+#endif
#if defined(__CYGWIN__) || defined(_WIN32)
const int exeext_len = 4;
#else
const int exeext_len = 0;
#endif
-#if !defined(__CYGWIN__) && defined(__unix__)
+#if !defined(__CYGWIN__) && \
+ (defined(__unix__) || defined(__unix) || \
+ (defined(__APPLE__) && defined(__MACH__)))
const char ignore_err[] = " 2>/dev/null";
#elif defined(__CYGWIN__) || \
(defined(_WIN32) && defined(WINVER) && WINVER >= 0x0500)
@@ -448,16 +456,16 @@ static void print_position(const void* ptr, int line)
* Checks whether the padding bytes at the end of a memory block is
* tampered with.
*
- * @param ptr pointer to a new_ptr_list_t struct
- * @return \c true if the padding bytes are untouched; \c false
- * otherwise
+ * @param ptr pointer to a new_ptr_list_t struct
+ * @return \c true if the padding bytes are untouched; \c false
+ * otherwise
*/
static bool check_tail(new_ptr_list_t* ptr)
{
- const unsigned char* const pointer = (unsigned char*)ptr +
+ const unsigned char* const tail_ptr = (unsigned char*)ptr +
ALIGNED_LIST_ITEM_SIZE + ptr->size;
for (int i = 0; i < _DEBUG_NEW_TAILCHECK; ++i)
- if (pointer[i] != _DEBUG_NEW_TAILCHECK_CHAR)
+ if (tail_ptr[i] != _DEBUG_NEW_TAILCHECK_CHAR)
return false;
return true;
}
@@ -498,7 +506,7 @@ static void* alloc_mem(size_t size, const char* file, int line, bool is_array)
_DEBUG_NEW_ERROR_ACTION;
#endif
}
- void* pointer = (char*)ptr + ALIGNED_LIST_ITEM_SIZE;
+ void* usr_ptr = (char*)ptr + ALIGNED_LIST_ITEM_SIZE;
#if _DEBUG_NEW_FILENAME_LEN == 0
ptr->file = file;
#else
@@ -511,7 +519,7 @@ static void* alloc_mem(size_t size, const char* file, int line, bool is_array)
ptr->line = line;
ptr->is_array = is_array;
ptr->size = size;
- ptr->magic = MAGIC;
+ ptr->magic = DEBUG_NEW_MAGIC;
{
fast_mutex_autolock lock(new_ptr_lock);
ptr->prev = new_ptr_list.prev;
@@ -520,7 +528,7 @@ static void* alloc_mem(size_t size, const char* file, int line, bool is_array)
new_ptr_list.prev = ptr;
}
#if _DEBUG_NEW_TAILCHECK
- memset((char*)pointer + size, _DEBUG_NEW_TAILCHECK_CHAR,
+ memset((char*)usr_ptr + size, _DEBUG_NEW_TAILCHECK_CHAR,
_DEBUG_NEW_TAILCHECK);
#endif
if (new_verbose_flag)
@@ -529,7 +537,7 @@ static void* alloc_mem(size_t size, const char* file, int line, bool is_array)
fprintf(new_output_fp,
"new%s: allocated %p (size %lu, ",
is_array ? "[]" : "",
- pointer, (unsigned long)size);
+ usr_ptr, (unsigned long)size);
if (line != 0)
print_position(ptr->file, ptr->line);
else
@@ -537,29 +545,29 @@ static void* alloc_mem(size_t size, const char* file, int line, bool is_array)
fprintf(new_output_fp, ")\n");
}
total_mem_alloc += size;
- return pointer;
+ return usr_ptr;
}
/**
* Frees memory and adjusts pointers.
*
- * @param pointer pointer to the previously allocated memory
+ * @param usr_ptr pointer to the previously allocated memory
* @param addr pointer to the caller
* @param is_array flag indicating whether it is invoked by a
* <code>delete[]</code> call
*/
-static void free_pointer(void* pointer, void* addr, bool is_array)
+static void free_pointer(void* usr_ptr, void* addr, bool is_array)
{
- if (pointer == NULL)
+ if (usr_ptr == NULL)
return;
new_ptr_list_t* ptr =
- (new_ptr_list_t*)((char*)pointer - ALIGNED_LIST_ITEM_SIZE);
- if (ptr->magic != MAGIC)
+ (new_ptr_list_t*)((char*)usr_ptr - ALIGNED_LIST_ITEM_SIZE);
+ if (ptr->magic != DEBUG_NEW_MAGIC)
{
{
fast_mutex_autolock lock(new_output_lock);
fprintf(new_output_fp, "delete%s: invalid pointer %p (",
- is_array ? "[]" : "", pointer);
+ is_array ? "[]" : "", usr_ptr);
print_position(addr, 0);
fprintf(new_output_fp, ")\n");
}
@@ -631,24 +639,24 @@ int check_leaks()
new_ptr_list_t* ptr = new_ptr_list.next;
while (ptr != &new_ptr_list)
{
- const char* const pointer = (char*)ptr + ALIGNED_LIST_ITEM_SIZE;
- if (ptr->magic != MAGIC)
+ const char* const usr_ptr = (char*)ptr + ALIGNED_LIST_ITEM_SIZE;
+ if (ptr->magic != DEBUG_NEW_MAGIC)
{
fprintf(new_output_fp,
"warning: heap data corrupt near %p\n",
- pointer);
+ usr_ptr);
}
#if _DEBUG_NEW_TAILCHECK
if (!check_tail(ptr))
{
fprintf(new_output_fp,
"warning: overwritten past end of object at %p\n",
- pointer);
+ usr_ptr);
}
#endif
fprintf(new_output_fp,
"Leaked object at %p (size %lu, ",
- pointer,
+ usr_ptr,
(unsigned long)ptr->size);
if (ptr->line != 0)
print_position(ptr->file, ptr->line);
@@ -679,20 +687,20 @@ int check_mem_corruption()
ptr != &new_ptr_list;
ptr = ptr->next)
{
- const char* const pointer = (char*)ptr + ALIGNED_LIST_ITEM_SIZE;
- if (ptr->magic == MAGIC
+ const char* const usr_ptr = (char*)ptr + ALIGNED_LIST_ITEM_SIZE;
+ if (ptr->magic == DEBUG_NEW_MAGIC
#if _DEBUG_NEW_TAILCHECK
&& check_tail(ptr)
#endif
)
continue;
#if _DEBUG_NEW_TAILCHECK
- if (ptr->magic != MAGIC)
+ if (ptr->magic != DEBUG_NEW_MAGIC)
{
#endif
fprintf(new_output_fp,
"Heap data corrupt near %p (size %lu, ",
- pointer,
+ usr_ptr,
(unsigned long)ptr->size);
#if _DEBUG_NEW_TAILCHECK
}
@@ -700,7 +708,7 @@ int check_mem_corruption()
{
fprintf(new_output_fp,
"Overwritten past end of object at %p (size %lu, ",
- pointer,
+ usr_ptr,
(unsigned long)ptr->size);
}
#endif
@@ -721,28 +729,32 @@ int check_mem_corruption()
* It will only be done when it can ensure the memory is allocated by
* one of our operator new variants.
*
- * @param pointer pointer returned by a new-expression
+ * @param usr_ptr pointer returned by a new-expression
*/
-void __debug_new_recorder::_M_process(void* pointer)
+void debug_new_recorder::_M_process(void* usr_ptr)
{
- if (pointer == NULL)
+ if (usr_ptr == NULL)
return;
// In an expression `new NonPODType[size]', the pointer returned is
// not the pointer returned by operator new[], but offset by size_t
// to leave room for the size. It needs to be compensated here.
- size_t offset = (char*)pointer - (char*)NULL;
+ size_t offset = (char*)usr_ptr - (char*)NULL;
if (offset % PLATFORM_MEM_ALIGNMENT != 0) {
offset -= sizeof(size_t);
if (offset % PLATFORM_MEM_ALIGNMENT != 0) {
+ fast_mutex_autolock lock(new_output_lock);
+ fprintf(new_output_fp,
+ "warning: memory unaligned; skipping processing (%s:%d)\n",
+ _M_file, _M_line);
return;
}
- pointer = (char*)pointer - sizeof(size_t);
+ usr_ptr = (char*)usr_ptr - sizeof(size_t);
}
new_ptr_list_t* ptr =
- (new_ptr_list_t*)((char*)pointer - ALIGNED_LIST_ITEM_SIZE);
- if (ptr->magic != MAGIC || ptr->line != 0)
+ (new_ptr_list_t*)((char*)usr_ptr - ALIGNED_LIST_ITEM_SIZE);
+ if (ptr->magic != DEBUG_NEW_MAGIC || ptr->line != 0)
{
fast_mutex_autolock lock(new_output_lock);
fprintf(new_output_fp,
@@ -754,7 +766,7 @@ void __debug_new_recorder::_M_process(void* pointer)
fast_mutex_autolock lock(new_output_lock);
fprintf(new_output_fp,
"info: pointer %p allocated from %s:%d\n",
- pointer, _M_file, _M_line);
+ usr_ptr, _M_file, _M_line);
}
#if _DEBUG_NEW_FILENAME_LEN == 0
ptr->file = _M_file;
@@ -766,6 +778,45 @@ void __debug_new_recorder::_M_process(void* pointer)
}
/**
+ * Count of source files that use debug_new.
+ */
+int debug_new_counter::_S_count = 0;
+
+/**
+ * Constructor to increment the count.
+ */
+debug_new_counter::debug_new_counter()
+{
+ ++_S_count;
+}
+
+/**
+ * Destructor to decrement the count. When the count is zero,
+ * #check_leaks will be called.
+ */
+debug_new_counter::~debug_new_counter()
+{
+ if (--_S_count == 0 && new_autocheck_flag)
+ if (check_leaks())
+ {
+ new_verbose_flag = true;
+#if defined(__GNUC__) && __GNUC__ == 3
+ if (!getenv("GLIBCPP_FORCE_NEW") && !getenv("GLIBCXX_FORCE_NEW"))
+ fprintf(new_output_fp,
+"*** WARNING: GCC 3 is detected, please make sure the environment\n"
+" variable GLIBCPP_FORCE_NEW (GCC 3.2 and 3.3) or GLIBCXX_FORCE_NEW\n"
+" (GCC 3.4) is defined. Check the README file for details.\n");
+#endif
+ }
+}
+
+NVWA_NAMESPACE_END
+
+#if NVWA_USE_NAMESPACE
+using namespace nvwa;
+#endif // NVWA_USE_NAMESPACE
+
+/**
* Allocates memory with file/line information.
*
* @param size size of the required memory block
@@ -819,7 +870,7 @@ void* operator new[](size_t size, const char* file, int line)
* insufficient (#_DEBUG_NEW_STD_OPER_NEW is 0)
* @throw bad_alloc memory is insufficient (#_DEBUG_NEW_STD_OPER_NEW is 1)
*/
-void* operator new(size_t size) throw(std::bad_alloc)
+void* operator new(size_t size) _GLIBCXX_THROW (std::bad_alloc) // modified to let it compile with c++11, MB 2015-04-17
{
return operator new(size, (char*)_DEBUG_NEW_CALLER_ADDRESS, 0);
}
@@ -832,7 +883,7 @@ void* operator new(size_t size) throw(std::bad_alloc)
* insufficient (#_DEBUG_NEW_STD_OPER_NEW is 0)
* @throw bad_alloc memory is insufficient (#_DEBUG_NEW_STD_OPER_NEW is 1)
*/
-void* operator new[](size_t size) throw(std::bad_alloc)
+void* operator new[](size_t size) _GLIBCXX_THROW (std::bad_alloc) // modified to let it compile with c++11, MB 2015-04-17
{
return operator new[](size, (char*)_DEBUG_NEW_CALLER_ADDRESS, 0);
}
@@ -844,7 +895,7 @@ void* operator new[](size_t size) throw(std::bad_alloc)
* @return pointer to the memory allocated; or \c NULL if memory is
* insufficient
*/
-void* operator new(size_t size, const std::nothrow_t&) throw()
+void* operator new(size_t size, const std::nothrow_t&) _NOEXCEPT
{
return alloc_mem(size, (char*)_DEBUG_NEW_CALLER_ADDRESS, 0, false);
}
@@ -856,7 +907,7 @@ void* operator new(size_t size, const std::nothrow_t&) throw()
* @return pointer to the memory allocated; or \c NULL if memory is
* insufficient
*/
-void* operator new[](size_t size, const std::nothrow_t&) throw()
+void* operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT
{
return alloc_mem(size, (char*)_DEBUG_NEW_CALLER_ADDRESS, 0, true);
}
@@ -864,124 +915,90 @@ void* operator new[](size_t size, const std::nothrow_t&) throw()
/**
* Deallocates memory.
*
- * @param pointer pointer to the previously allocated memory
+ * @param ptr pointer to the previously allocated memory
*/
-void operator delete(void* pointer) throw()
+void operator delete(void* ptr) _NOEXCEPT
{
- free_pointer(pointer, _DEBUG_NEW_CALLER_ADDRESS, false);
+ free_pointer(ptr, _DEBUG_NEW_CALLER_ADDRESS, false);
}
/**
* Deallocates array memory.
*
- * @param pointer pointer to the previously allocated memory
+ * @param ptr pointer to the previously allocated memory
*/
-void operator delete[](void* pointer) throw()
+void operator delete[](void* ptr) _NOEXCEPT
{
- free_pointer(pointer, _DEBUG_NEW_CALLER_ADDRESS, true);
+ free_pointer(ptr, _DEBUG_NEW_CALLER_ADDRESS, true);
}
/**
* Placement deallocation function. For details, please check Section
- * 5.3.4 of the C++ 1998 Standard.
+ * 5.3.4 of the C++ 1998 or 2011 Standard.
*
- * @param pointer pointer to the previously allocated memory
- * @param file null-terminated string of the file name
- * @param line line number
+ * @param ptr pointer to the previously allocated memory
+ * @param file null-terminated string of the file name
+ * @param line line number
*
* @see http://www.csci.csusb.edu/dick/c++std/cd2/expr.html#expr.new
* @see http://wyw.dcweb.cn/leakage.htm
*/
-void operator delete(void* pointer, const char* file, int line) throw()
+void operator delete(void* ptr, const char* file, int line) _NOEXCEPT
{
if (new_verbose_flag)
{
fast_mutex_autolock lock(new_output_lock);
fprintf(new_output_fp,
"info: exception thrown on initializing object at %p (",
- pointer);
+ ptr);
print_position(file, line);
fprintf(new_output_fp, ")\n");
}
- operator delete(pointer);
+ operator delete(ptr);
}
/**
* Placement deallocation function. For details, please check Section
- * 5.3.4 of the C++ 1998 Standard.
+ * 5.3.4 of the C++ 1998 or 2011 Standard.
*
- * @param pointer pointer to the previously allocated memory
- * @param file null-terminated string of the file name
- * @param line line number
+ * @param ptr pointer to the previously allocated memory
+ * @param file null-terminated string of the file name
+ * @param line line number
*/
-void operator delete[](void* pointer, const char* file, int line) throw()
+void operator delete[](void* ptr, const char* file, int line) _NOEXCEPT
{
if (new_verbose_flag)
{
fast_mutex_autolock lock(new_output_lock);
fprintf(new_output_fp,
"info: exception thrown on initializing objects at %p (",
- pointer);
+ ptr);
print_position(file, line);
fprintf(new_output_fp, ")\n");
}
- operator delete[](pointer);
+ operator delete[](ptr);
}
/**
* Placement deallocation function. For details, please check Section
- * 5.3.4 of the C++ 1998 Standard.
+ * 5.3.4 of the C++ 1998 or 2011 Standard.
*
- * @param pointer pointer to the previously allocated memory
+ * @param ptr pointer to the previously allocated memory
*/
-void operator delete(void* pointer, const std::nothrow_t&) throw()
+void operator delete(void* ptr, const std::nothrow_t&) _NOEXCEPT
{
- operator delete(pointer, (char*)_DEBUG_NEW_CALLER_ADDRESS, 0);
+ operator delete(ptr, (char*)_DEBUG_NEW_CALLER_ADDRESS, 0);
}
/**
* Placement deallocation function. For details, please check Section
- * 5.3.4 of the C++ 1998 Standard.
+ * 5.3.4 of the C++ 1998 or 2011 Standard.
*
- * @param pointer pointer to the previously allocated memory
- */
-void operator delete[](void* pointer, const std::nothrow_t&) throw()
-{
- operator delete[](pointer, (char*)_DEBUG_NEW_CALLER_ADDRESS, 0);
-}
-
-/**
- * Count of source files that use debug_new.
- */
-int __debug_new_counter::_S_count = 0;
-
-/**
- * Constructor to increment the count.
- */
-__debug_new_counter::__debug_new_counter()
-{
- ++_S_count;
-}
-
-/**
- * Destructor to decrement the count. When the count is zero,
- * #check_leaks will be called.
+ * @param ptr pointer to the previously allocated memory
*/
-__debug_new_counter::~__debug_new_counter()
+void operator delete[](void* ptr, const std::nothrow_t&) _NOEXCEPT
{
- if (--_S_count == 0 && new_autocheck_flag)
- if (check_leaks())
- {
- new_verbose_flag = true;
-#if defined(__GNUC__) && __GNUC__ >= 3
- if (!getenv("GLIBCPP_FORCE_NEW") && !getenv("GLIBCXX_FORCE_NEW"))
- fprintf(new_output_fp,
-"*** WARNING: GCC 3 or later is detected, please make sure the\n"
-" environment variable GLIBCPP_FORCE_NEW (GCC 3.2 and 3.3) or\n"
-" GLIBCXX_FORCE_NEW (GCC 3.4 and later) is defined. Check the\n"
-" README file for details.\n");
-#endif
- }
+ operator delete[](ptr, (char*)_DEBUG_NEW_CALLER_ADDRESS, 0);
}
#endif
diff --git a/src/foreign/nvwa/debug_new.h b/src/foreign/nvwa/debug_new.h
index ec8b59d..7fbc2fc 100644
--- a/src/foreign/nvwa/debug_new.h
+++ b/src/foreign/nvwa/debug_new.h
@@ -2,7 +2,7 @@
// vim:tabstop=4:shiftwidth=4:expandtab:
/*
- * Copyright (C) 2004-2010 Wu Yongwei <adah at users dot sourceforge dot net>
+ * Copyright (C) 2004-2013 Wu Yongwei <adah at users dot sourceforge dot net>
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
@@ -27,20 +27,28 @@
*/
/**
- * @file debug_new.h
+ * @file debug_new.h
*
* Header file for checking leaks caused by unmatched new/delete.
*
- * @version 4.7, 2010/01/08
- * @author Wu Yongwei
- *
+ * @date 2013-10-06
*/
-#ifndef _DEBUG_NEW_H
-#define _DEBUG_NEW_H
+#ifndef NVWA_DEBUG_NEW_H
+#define NVWA_DEBUG_NEW_H
+
+#include <new> // size_t/std::bad_alloc
+#include <stdio.h> // FILE
+#include "_nvwa.h" // NVWA_NAMESPACE_*
+#include "c++11.h" // _NOEXCEPT
+
+/* Special allocation/deallocation functions in the global scope */
+void* operator new(size_t size, const char* file, int line);
+void* operator new[](size_t size, const char* file, int line);
+void operator delete(void* ptr, const char* file, int line) _NOEXCEPT;
+void operator delete[](void* ptr, const char* file, int line) _NOEXCEPT;
-#include <new>
-#include <stdio.h>
+NVWA_NAMESPACE_BEGIN
/**
* @def _DEBUG_NEW_REDEFINE_NEW
@@ -73,10 +81,10 @@
/**
* @def _DEBUG_NEW_TYPE
*
- * Macro to indicate which variant of \c #DEBUG_NEW is wanted. The
+ * Macro to indicate which variant of #DEBUG_NEW is wanted. The
* default value \c 1 allows the use of placement new (like
* <code>%new(std::nothrow)</code>), but the verbose output (when
- * \c #new_verbose_flag is \c true) looks worse than some older
+ * nvwa#new_verbose_flag is \c true) looks worse than some older
* versions (no file/line information for allocations). Define it
* to \c 2 to revert to the old behaviour that records file and line
* information directly on the call to <code>operator new</code>.
@@ -88,16 +96,6 @@
/* Prototypes */
int check_leaks();
int check_mem_corruption();
-void* operator new(size_t size, const char* file, int line);
-void* operator new[](size_t size, const char* file, int line);
-void operator delete(void* pointer, const char* file, int line) throw();
-void operator delete[](void* pointer, const char* file, int line) throw();
-#if defined(_MSC_VER) && _MSC_VER < 1300
-// MSVC 6 requires the following declarations; or the non-placement
-// new[]/delete[] will not compile.
-void* operator new[](size_t) throw(std::bad_alloc);
-void operator delete[](void*) throw();
-#endif
/* Control variables */
extern bool new_autocheck_flag; // default to true: call check_leaks() on exit
@@ -113,11 +111,11 @@ extern const char* new_progname;// default to NULL; should be assigned argv[0]
* otherwise \c new will be defined to it, and one must use \c new
* instead.
*/
-#if _DEBUG_NEW_TYPE == 1
-#define DEBUG_NEW __debug_new_recorder(__FILE__, __LINE__) ->* new
-#else
-#define DEBUG_NEW new(__FILE__, __LINE__)
-#endif
+# if _DEBUG_NEW_TYPE == 1
+# define DEBUG_NEW NVWA::debug_new_recorder(__FILE__, __LINE__) ->* new
+# else
+# define DEBUG_NEW new(__FILE__, __LINE__)
+# endif
# if _DEBUG_NEW_REDEFINE_NEW
# define new DEBUG_NEW
@@ -137,17 +135,17 @@ extern const char* new_progname;// default to NULL; should be assigned argv[0]
*
* The idea comes from <a href="http://groups.google.com/group/comp.lang.c++.moderated/browse_thread/thread/7089382e3bc1c489/85f9107a1dc79ee9?#85f9107a1dc79ee9">Greg Herlihy's post</a> in comp.lang.c++.moderated.
*/
-class __debug_new_recorder
+class debug_new_recorder
{
const char* _M_file;
const int _M_line;
- void _M_process(void* pointer);
+ void _M_process(void* ptr);
public:
/**
* Constructor to remember the call context. The information will
- * be used in __debug_new_recorder::operator->*.
+ * be used in debug_new_recorder::operator->*.
*/
- __debug_new_recorder(const char* file, int line)
+ debug_new_recorder(const char* file, int line)
: _M_file(file), _M_line(line) {}
/**
* Operator to write the context information to memory.
@@ -155,11 +153,11 @@ public:
* precedence, it is rarely used, and it looks good: so people can
* tell the special usage more quickly.
*/
- template <class _Tp> _Tp* operator->*(_Tp* pointer)
- { _M_process(pointer); return pointer; }
+ template <class _Tp> _Tp* operator->*(_Tp* ptr)
+ { _M_process(ptr); return ptr; }
private:
- __debug_new_recorder(const __debug_new_recorder&);
- __debug_new_recorder& operator=(const __debug_new_recorder&);
+ debug_new_recorder(const debug_new_recorder&);
+ debug_new_recorder& operator=(const debug_new_recorder&);
};
/**
@@ -168,14 +166,16 @@ private:
* This technique is learnt from <em>The C++ Programming Language</em> by
* Bjarne Stroustup.
*/
-class __debug_new_counter
+class debug_new_counter
{
static int _S_count;
public:
- __debug_new_counter();
- ~__debug_new_counter();
+ debug_new_counter();
+ ~debug_new_counter();
};
/** Counting object for each file including debug_new.h. */
-static __debug_new_counter __debug_new_count;
+static debug_new_counter __debug_new_count;
+
+NVWA_NAMESPACE_END
-#endif // _DEBUG_NEW_H
+#endif // NVWA_DEBUG_NEW_H
diff --git a/src/foreign/nvwa/fast_mutex.h b/src/foreign/nvwa/fast_mutex.h
index 8b16220..4bbd44c 100644
--- a/src/foreign/nvwa/fast_mutex.h
+++ b/src/foreign/nvwa/fast_mutex.h
@@ -2,7 +2,7 @@
// vim:tabstop=4:shiftwidth=4:expandtab:
/*
- * Copyright (C) 2004-2010 Wu Yongwei <adah at users dot sourceforge dot net>
+ * Copyright (C) 2004-2013 Wu Yongwei <adah at users dot sourceforge dot net>
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
@@ -27,19 +27,35 @@
*/
/**
- * @file fast_mutex.h
+ * @file fast_mutex.h
*
* A fast mutex implementation for POSIX and Win32.
*
- * @version 1.20, 2010/05/16
- * @author Wu Yongwei
- *
+ * @date 2013-08-02
*/
-#ifndef _FAST_MUTEX_H
-#define _FAST_MUTEX_H
+#ifndef NVWA_FAST_MUTEX_H
+#define NVWA_FAST_MUTEX_H
+
+#include "_nvwa.h" // NVWA_NAMESPACE_*
+#include "c++11.h" // HAVE_CXX11_MUTEX
# if !defined(_NOTHREADS)
+# if !defined(NVWA_USE_CXX11_MUTEX) && HAVE_CXX11_MUTEX != 0 && \
+ !defined(_WIN32THREADS) && defined(_WIN32) && defined(_MT) && \
+ (!defined(_MSC_VER) || defined(_DLL))
+// Prefer using std::mutex on Windows to avoid the namespace
+// pollution caused by <windows.h>. However, MSVC has a re-entry
+// issue with its std::mutex implementation, and std::mutex should
+// not be used unless /MD or /MDd is used. For more information,
+// check out:
+//
+// https://connect.microsoft.com/VisualStudio/feedback/details/776596/std-mutex-not-a-constexpr-with-mtd-compiler-flag
+// http://stackoverflow.com/questions/14319344/stdmutex-lock-hangs-when-overriding-the-new-operator
+//
+# define NVWA_USE_CXX11_MUTEX 1
+# endif
+
# if !defined(_WIN32THREADS) && \
(defined(_WIN32) && defined(_MT))
// Automatically use _WIN32THREADS when specifying -MT/-MD in MSVC,
@@ -47,27 +63,32 @@
# define _WIN32THREADS
# elif !defined(_PTHREADS) && \
defined(_REENTRANT)
-// Automatically use _PTHREADS when specifying -pthread in GCC.
-// N.B. I do not detect on _PTHREAD_H since libstdc++-v3 under
-// Linux will silently include <pthread.h> anyway.
+// Automatically use _PTHREADS when specifying -pthread in GCC or Clang.
# define _PTHREADS
# endif
# endif
-# if !defined(_PTHREADS) && !defined(_WIN32THREADS) && !defined(_NOTHREADS)
+# ifndef NVWA_USE_CXX11_MUTEX
+# define NVWA_USE_CXX11_MUTEX 0
+# endif
+
+# if !defined(_PTHREADS) && !defined(_WIN32THREADS) && \
+ !defined(_NOTHREADS) && NVWA_USE_CXX11_MUTEX == 0
# define _NOTHREADS
# endif
# if defined(_NOTHREADS)
-# if defined(_PTHREADS) || defined(_WIN32THREADS)
+# if defined(_PTHREADS) || defined(_WIN32THREADS) || \
+ NVWA_USE_CXX11_MUTEX != 0
# undef _NOTHREADS
# error "Cannot define multi-threaded mode with -D_NOTHREADS"
-# if defined(__MINGW32__) && defined(_WIN32THREADS) && !defined(_MT)
-# error "Be sure to specify -mthreads with -D_WIN32THREADS"
-# endif
# endif
# endif
+# if defined(__MINGW32__) && defined(_WIN32THREADS) && !defined(_MT)
+# error "Be sure to specify -mthreads with -D_WIN32THREADS"
+# endif
+
# ifndef _FAST_MUTEX_CHECK_INITIALIZATION
/**
* Macro to control whether to check for initialization status for each
@@ -101,8 +122,78 @@
((void)0)
# endif
-# ifdef _PTHREADS
+# if NVWA_USE_CXX11_MUTEX != 0
+# include <mutex>
+NVWA_NAMESPACE_BEGIN
+/**
+ * Macro alias to `volatile' semantics. Here it is truly volatile since
+ * it is in a multi-threaded (C++11) environment.
+ */
+# define __VOLATILE volatile
+ /**
+ * Class for non-reentrant fast mutexes. This is the implementation
+ * using the C++11 mutex.
+ */
+ class fast_mutex
+ {
+ std::mutex _M_mtx_impl;
+# if _FAST_MUTEX_CHECK_INITIALIZATION
+ bool _M_initialized;
+# endif
+# ifdef _DEBUG
+ bool _M_locked;
+# endif
+ public:
+ fast_mutex()
+# ifdef _DEBUG
+ : _M_locked(false)
+# endif
+ {
+# if _FAST_MUTEX_CHECK_INITIALIZATION
+ _M_initialized = true;
+# endif
+ }
+ ~fast_mutex()
+ {
+ _FAST_MUTEX_ASSERT(!_M_locked, "~fast_mutex(): still locked");
+# if _FAST_MUTEX_CHECK_INITIALIZATION
+ _M_initialized = false;
+# endif
+ }
+ void lock()
+ {
+# if _FAST_MUTEX_CHECK_INITIALIZATION
+ if (!_M_initialized)
+ return;
+# endif
+ _M_mtx_impl.lock();
+# ifdef _DEBUG
+ _FAST_MUTEX_ASSERT(!_M_locked, "lock(): already locked");
+ _M_locked = true;
+# endif
+ }
+ void unlock()
+ {
+# if _FAST_MUTEX_CHECK_INITIALIZATION
+ if (!_M_initialized)
+ return;
+# endif
+# ifdef _DEBUG
+ _FAST_MUTEX_ASSERT(_M_locked, "unlock(): not locked");
+ _M_locked = false;
+# endif
+ _M_mtx_impl.unlock();
+ }
+ private:
+ fast_mutex(const fast_mutex&);
+ fast_mutex& operator=(const fast_mutex&);
+ };
+NVWA_NAMESPACE_END
+# endif // NVWA_USE_CXX11_MUTEX != 0
+
+# if defined(_PTHREADS) && NVWA_USE_CXX11_MUTEX == 0
# include <pthread.h>
+NVWA_NAMESPACE_BEGIN
/**
* Macro alias to `volatile' semantics. Here it is truly volatile since
* it is in a multi-threaded (POSIX threads) environment.
@@ -173,13 +264,15 @@
fast_mutex(const fast_mutex&);
fast_mutex& operator=(const fast_mutex&);
};
+NVWA_NAMESPACE_END
# endif // _PTHREADS
-# ifdef _WIN32THREADS
+# if defined(_WIN32THREADS) && NVWA_USE_CXX11_MUTEX == 0
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif /* WIN32_LEAN_AND_MEAN */
# include <windows.h>
+NVWA_NAMESPACE_BEGIN
/**
* Macro alias to `volatile' semantics. Here it is truly volatile since
* it is in a multi-threaded (Win32 threads) environment.
@@ -245,9 +338,11 @@
fast_mutex(const fast_mutex&);
fast_mutex& operator=(const fast_mutex&);
};
+NVWA_NAMESPACE_END
# endif // _WIN32THREADS
# ifdef _NOTHREADS
+NVWA_NAMESPACE_BEGIN
/**
* Macro alias to `volatile' semantics. Here it is not truly volatile
* since it is in a single-threaded environment.
@@ -291,8 +386,10 @@
fast_mutex(const fast_mutex&);
fast_mutex& operator=(const fast_mutex&);
};
+NVWA_NAMESPACE_END
# endif // _NOTHREADS
+NVWA_NAMESPACE_BEGIN
/** An acquistion-on-initialization lock class based on fast_mutex. */
class fast_mutex_autolock
{
@@ -310,5 +407,6 @@ private:
fast_mutex_autolock(const fast_mutex_autolock&);
fast_mutex_autolock& operator=(const fast_mutex_autolock&);
};
+NVWA_NAMESPACE_END
-#endif // _FAST_MUTEX_H
+#endif // NVWA_FAST_MUTEX_H
diff --git a/src/foreign/nvwa/static_assert.h b/src/foreign/nvwa/static_assert.h
index a4a2650..72a6d42 100644
--- a/src/foreign/nvwa/static_assert.h
+++ b/src/foreign/nvwa/static_assert.h
@@ -2,7 +2,7 @@
// vim:tabstop=4:shiftwidth=4:expandtab:
/*
- * Copyright (C) 2004-2010 Wu Yongwei <adah at users dot sourceforge dot net>
+ * Copyright (C) 2004-2013 Wu Yongwei <adah at users dot sourceforge dot net>
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
@@ -27,24 +27,36 @@
*/
/**
- * @file static_assert.h
+ * @file static_assert.h
*
* Template class to check validity duing compile time (adapted from Loki).
*
- * @version 1.2, 2005/11/22
- * @author Wu Yongwei
- *
+ * @date 2013-09-07
*/
#ifndef STATIC_ASSERT
-template <bool> struct __nvwa_compile_time_error;
-template <> struct __nvwa_compile_time_error<true> {};
+#include "c++11.h"
+
+#if HAVE_CXX11_STATIC_ASSERT
+
+#define STATIC_ASSERT(_Expr, _Msg) static_assert(_Expr, #_Msg)
+
+#else
+
+namespace nvwa {
+
+template <bool> struct compile_time_error;
+template <> struct compile_time_error<true> {};
#define STATIC_ASSERT(_Expr, _Msg) \
{ \
- __nvwa_compile_time_error<((_Expr) != 0)> ERROR_##_Msg; \
+ nvwa::compile_time_error<((_Expr) != 0)> ERROR_##_Msg; \
(void)ERROR_##_Msg; \
}
+}
+
+#endif // HAVE_CXX11_STATIC_ASSERT
+
#endif // STATIC_ASSERT
diff --git a/src/foreign/tcpip/socket.cpp b/src/foreign/tcpip/socket.cpp
index 3e5ba38..4ef1f0a 100644
--- a/src/foreign/tcpip/socket.cpp
+++ b/src/foreign/tcpip/socket.cpp
@@ -49,8 +49,6 @@
#include <algorithm>
#include <string.h>
-using namespace std;
-
#ifdef SHAWN
extern "C" void init_tcpip( shawn::SimulationController& sc )
@@ -174,7 +172,7 @@ namespace tcpip
{
fd_set fds;
FD_ZERO( &fds );
- FD_SET( sock, &fds );
+ FD_SET( (unsigned int)sock, &fds );
struct timeval tv;
tv.tv_sec = 0;
@@ -244,12 +242,12 @@ namespace tcpip
//"Address already in use" error protection
{
- int reuseaddr = 1;
#ifdef WIN32
//setsockopt(server_socket_, SOL_SOCKET, SO_REUSEADDR, (const char*)&reuseaddr, sizeof(reuseaddr));
// No address reuse in Windows!!!
#else
+ int reuseaddr = 1;
setsockopt(server_socket_, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr));
#endif
}
@@ -257,7 +255,7 @@ namespace tcpip
// Initialize address/port structure
memset(&self, 0, sizeof(self));
self.sin_family = AF_INET;
- self.sin_port = htons(port_);
+ self.sin_port = htons((unsigned short)port_);
self.sin_addr.s_addr = htonl(INADDR_ANY);
// Assign a port number to the socket
@@ -323,7 +321,7 @@ namespace tcpip
sockaddr_in address;
memset( (char*)&address, 0, sizeof(address) );
address.sin_family = AF_INET;
- address.sin_port = htons( port_ );
+ address.sin_port = htons((unsigned short)port_);
address.sin_addr.s_addr = addr.s_addr;
socket_ = static_cast<int>(socket( PF_INET, SOCK_STREAM, 0 ));
@@ -403,7 +401,7 @@ namespace tcpip
// Sending length_storage and b independently would probably be possible and
// avoid some copying here, but both parts would have to go through the
// TCP/IP stack on their own which probably would cost more performance.
- vector<unsigned char> msg;
+ std::vector<unsigned char> msg;
msg.insert(msg.end(), length_storage.begin(), length_storage.end());
msg.insert(msg.end(), b.begin(), b.end());
send(msg);
@@ -453,23 +451,23 @@ namespace tcpip
{
if (verbose_)
{
- cerr << label << " " << buffer.size() << " bytes via tcpip::Socket: [";
+ std::cerr << label << " " << buffer.size() << " bytes via tcpip::Socket: [";
// cache end iterator for performance
- const vector<unsigned char>::const_iterator end = buffer.end();
- for (vector<unsigned char>::const_iterator it = buffer.begin(); end != it; ++it)
- cerr << " " << static_cast<int>(*it) << " ";
- cerr << "]" << endl;
+ const std::vector<unsigned char>::const_iterator end = buffer.end();
+ for (std::vector<unsigned char>::const_iterator it = buffer.begin(); end != it; ++it)
+ std::cerr << " " << static_cast<int>(*it) << " ";
+ std::cerr << "]" << std::endl;
}
}
// ----------------------------------------------------------------------
- vector<unsigned char>
+ std::vector<unsigned char>
Socket::
receive(int bufSize)
throw( SocketException )
{
- vector<unsigned char> buffer;
+ std::vector<unsigned char> buffer;
if( socket_ < 0 )
connect();
@@ -498,7 +496,7 @@ namespace tcpip
// buffer for received bytes
// According to the C++ standard elements of a std::vector are stored
// contiguously. Explicitly &buffer[n] == &buffer[0] + n for 0 <= n < buffer.size().
- vector<unsigned char> buffer(lengthLen);
+ std::vector<unsigned char> buffer(lengthLen);
// receive length of TraCI message
receiveComplete(&buffer[0], lengthLen);
diff --git a/src/foreign/tcpip/storage.cpp b/src/foreign/tcpip/storage.cpp
index 5770f55..42de743 100644
--- a/src/foreign/tcpip/storage.cpp
+++ b/src/foreign/tcpip/storage.cpp
@@ -23,8 +23,6 @@
#include <iomanip>
-using namespace std;
-
//#define NULLITER static_cast<list<unsigned char>::iterator>(0)
namespace tcpip
@@ -40,8 +38,7 @@ namespace tcpip
// ----------------------------------------------------------------------
Storage::Storage(const unsigned char packet[], int length)
{
- // Length is calculated, if -1, or given
- if (length == -1) length = sizeof(packet) / sizeof(unsigned char);
+ assert(length >= 0); // fixed MB, 2015-04-21
store.reserve(length);
// Get the content
@@ -181,7 +178,7 @@ namespace tcpip
checkReadSafe(len);
StorageType::const_iterator end = iter_;
std::advance(end, len);
- const string tmp(iter_, end);
+ const std::string tmp(iter_, end);
iter_ = end;
return tmp;
}
diff --git a/src/gui/GUIApplicationWindow.cpp b/src/gui/GUIApplicationWindow.cpp
index 329eca8..35f2d06 100644
--- a/src/gui/GUIApplicationWindow.cpp
+++ b/src/gui/GUIApplicationWindow.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Andreas Gaubatz
/// @date Sept 2002
-/// @version $Id: GUIApplicationWindow.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIApplicationWindow.cpp 18761 2015-09-01 14:15:44Z behrisch $
///
// The main window of the SUMO-gui.
/****************************************************************************/
@@ -52,6 +52,7 @@
#include "GUIApplicationWindow.h"
#include "GUIEvent_SimulationLoaded.h"
#include "GUIEvent_SimulationEnded.h"
+#include "GUIEvent_Screenshot.h"
#include <utils/common/ToString.h>
#include <utils/common/RandHelper.h>
@@ -152,6 +153,8 @@ FXDEFMAP(GUIApplicationWindow) GUIApplicationWindowMap[] = {
FXMAPFUNC(SEL_UPDATE, MID_LOCATEADD, GUIApplicationWindow::onUpdNeedsSimulation),
FXMAPFUNC(SEL_UPDATE, MID_LOCATEPOI, GUIApplicationWindow::onUpdNeedsSimulation),
FXMAPFUNC(SEL_UPDATE, MID_LOCATEPOLY, GUIApplicationWindow::onUpdNeedsSimulation),
+ FXMAPFUNC(SEL_KEYPRESS, 0, GUIApplicationWindow::onKeyPress),
+ FXMAPFUNC(SEL_KEYRELEASE, 0, GUIApplicationWindow::onKeyRelease),
FXMAPFUNC(SEL_CLIPBOARD_REQUEST, 0, GUIApplicationWindow::onClipboardRequest),
@@ -192,8 +195,8 @@ GUIApplicationWindow::GUIApplicationWindow(FXApp* a,
void
-GUIApplicationWindow::dependentBuild(bool game) {
- // do this not twice
+GUIApplicationWindow::dependentBuild() {
+ // don't do this twice
if (hadDependentBuild) {
return;
}
@@ -247,12 +250,8 @@ GUIApplicationWindow::dependentBuild(bool game) {
myMessageWindow = new GUIMessageWindow(myMainSplitter);
// fill menu and tool bar
fillMenuBar();
- if (game) {
- onCmdGaming(0, 0, 0);
- } else {
- myToolBar6->hide();
- myToolBar7->hide();
- }
+ myToolBar6->hide();
+ myToolBar7->hide();
// build additional threads
myLoadThread = new GUILoadThread(getApp(), this, myEvents, myLoadThreadEvent);
myRunThread = new GUIRunThread(getApp(), this, *mySimDelayTarget, myEvents,
@@ -366,7 +365,7 @@ GUIApplicationWindow::fillMenuBar() {
GUIIconSubSys::getIcon(ICON_RELOAD), this, MID_RELOAD);
new FXMenuSeparator(myFileMenu);
new FXMenuCommand(myFileMenu,
- "&Close\tCtl-W\tClose the simulation.",
+ "Close\tCtl-W\tClose the simulation.",
GUIIconSubSys::getIcon(ICON_CLOSE), this, MID_CLOSE);
// Recent files
FXMenuSeparator* sep1 = new FXMenuSeparator(myFileMenu);
@@ -770,6 +769,7 @@ GUIApplicationWindow::onCmdOpenShapes(FXObject*, FXSelector, void*) {
if (!XMLSubSys::runParser(handler, file, false)) {
WRITE_MESSAGE("Loading of " + file + " failed.");
}
+ update();
}
return 1;
}
@@ -777,7 +777,12 @@ GUIApplicationWindow::onCmdOpenShapes(FXObject*, FXSelector, void*) {
long
GUIApplicationWindow::onCmdReload(FXObject*, FXSelector, void*) {
- loadConfigOrNet("", false, true);
+ getApp()->beginWaitCursor();
+ myAmLoading = true;
+ closeAllWindows();
+ myLoadThread->start();
+ setStatusBarText("Reloading.");
+ update();
return 1;
}
@@ -813,7 +818,7 @@ GUIApplicationWindow::onUpdOpen(FXObject* sender, FXSelector, void* ptr) {
long
GUIApplicationWindow::onUpdReload(FXObject* sender, FXSelector, void* ptr) {
sender->handle(this,
- myAmLoading || !myRunThread->simulationAvailable()
+ myAmLoading || myLoadThread->getFileName() == ""
? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
ptr);
return 1;
@@ -852,6 +857,7 @@ GUIApplicationWindow::onCmdStart(FXObject*, FXSelector, void*) {
myWasStarted = true;
}
myRunThread->resume();
+ getApp()->forceRefresh(); // only callking myToolBar2->forceRefresh somehow loses keyboard focus
return 1;
}
@@ -859,6 +865,7 @@ GUIApplicationWindow::onCmdStart(FXObject*, FXSelector, void*) {
long
GUIApplicationWindow::onCmdStop(FXObject*, FXSelector, void*) {
myRunThread->stop();
+ getApp()->forceRefresh(); // only callking myToolBar2->forceRefresh somehow loses keyboard focus
return 1;
}
@@ -1130,6 +1137,9 @@ GUIApplicationWindow::eventOccured() {
case EVENT_SIMULATION_ENDED:
handleEvent_SimulationEnded(e);
break;
+ case EVENT_SCREENSHOT:
+ handleEvent_Screenshot(e);
+ break;
default:
break;
}
@@ -1230,6 +1240,9 @@ GUIApplicationWindow::handleEvent_SimulationStep(GUIEvent*) {
if (myAmGaming) {
checkGamingEvents();
}
+ if (myRunThread->simulationIsStartable()) {
+ getApp()->forceRefresh(); // restores keyboard focus
+ }
update();
}
@@ -1251,14 +1264,31 @@ GUIApplicationWindow::handleEvent_SimulationEnded(GUIEvent* e) {
} else if (!myHaveNotifiedAboutSimEnd) {
// build the text
const std::string text = "Simulation ended at time: " + time2string(ec->getTimeStep()) +
- ".\nReason: " + MSNet::getStateMessage(ec->getReason());
- FXMessageBox::warning(this, MBOX_OK, "Simulation ended", "%s", text.c_str());
+ ".\nReason: " + MSNet::getStateMessage(ec->getReason()) +
+ "\nDo you want to close all open files and views?";
+ FXuint answer = FXMessageBox::question(this, MBOX_YES_NO, "Simulation ended", "%s", text.c_str());
+ if (answer == 1) { //1:yes, 2:no, 4:esc
+ closeAllWindows();
+ }
myHaveNotifiedAboutSimEnd = true;
}
}
void
+GUIApplicationWindow::handleEvent_Screenshot(GUIEvent* e) {
+ GUIEvent_Screenshot* ec = static_cast<GUIEvent_Screenshot*>(e);
+ myEventMutex.lock();
+ const std::string error = ec->myView->makeSnapshot(ec->myFile);
+ if (error != "") {
+ WRITE_WARNING(error);
+ }
+ myEventCondition.signal();
+ myEventMutex.unlock();
+}
+
+
+void
GUIApplicationWindow::checkGamingEvents() {
MSVehicleControl& vc = MSNet::getInstance()->getVehicleControl();
MSVehicleControl::constVehIt it = vc.loadedVehBegin();
@@ -1280,36 +1310,32 @@ GUIApplicationWindow::checkGamingEvents() {
}
}
#endif
- // updated peformance indicators
+ // update performance indicators
for (it = vc.loadedVehBegin(); it != end; ++it) {
const MSVehicle* veh = dynamic_cast<MSVehicle*>(it->second);
assert(veh != 0);
- const SUMOReal vmax = MIN2(veh->getVehicleType().getMaxSpeed(), veh->getEdge()->getSpeedLimit());
- if (veh->isOnRoad() && veh->getSpeed() < SUMO_const_haltingSpeed) {
- myWaitingTime += DELTA_T;
+ if (veh->isOnRoad()) {
+ const SUMOReal vmax = MIN2(veh->getVehicleType().getMaxSpeed(), veh->getEdge()->getSpeedLimit());
+ if (veh->getSpeed() < SUMO_const_haltingSpeed) {
+ myWaitingTime += DELTA_T;
+ }
+ myTimeLoss += TS * TIME2STEPS(vmax - veh->getSpeed()) / vmax; // may be negative with speedFactor > 1
}
- myTimeLoss += TS * TIME2STEPS(vmax - veh->getSpeed()) / vmax; // may be negative with speedFactor > 1
- myWaitingTimeLabel->setText(time2string(myWaitingTime).c_str());
- myTimeLossLabel->setText(time2string(myTimeLoss).c_str());
}
-
+ myWaitingTimeLabel->setText(time2string(myWaitingTime).c_str());
+ myTimeLossLabel->setText(time2string(myTimeLoss).c_str());
}
void
-GUIApplicationWindow::loadConfigOrNet(const std::string& file, bool isNet, bool isReload) {
+GUIApplicationWindow::loadConfigOrNet(const std::string& file, bool isNet) {
getApp()->beginWaitCursor();
myAmLoading = true;
closeAllWindows();
- if (isReload) {
- myLoadThread->reloadConfigOrNet();
- setStatusBarText("Reloading.");
- } else {
- gSchemeStorage.saveViewport(0, 0, -1); // recenter view
- myLoadThread->loadConfigOrNet(file, isNet);
- setStatusBarText("Loading '" + file + "'.");
- }
+ gSchemeStorage.saveViewport(0, 0, -1); // recenter view
+ myLoadThread->loadConfigOrNet(file, isNet);
+ setStatusBarText("Loading '" + file + "'.");
update();
}
@@ -1436,5 +1462,41 @@ GUIApplicationWindow::updateTimeLCD(SUMOTime time) {
myLCDLabel->setText(buffer);
}
-/****************************************************************************/
+long
+GUIApplicationWindow::onKeyPress(FXObject* o, FXSelector sel, void* data) {
+ const long handled = FXMainWindow::onKeyPress(o, sel, data);
+ if (handled == 0 && myMDIClient->numChildren() > 0) {
+ GUISUMOViewParent* w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
+ if (w != 0) {
+ w->onKeyPress(0, sel, data);
+ }
+ }
+ return 0;
+}
+
+
+long
+GUIApplicationWindow::onKeyRelease(FXObject* o, FXSelector sel, void* data) {
+ const long handled = FXMainWindow::onKeyRelease(o, sel, data);
+ if (handled == 0 && myMDIClient->numChildren() > 0) {
+ GUISUMOViewParent* w = dynamic_cast<GUISUMOViewParent*>(myMDIClient->getActiveChild());
+ if (w != 0) {
+ w->onKeyRelease(0, sel, data);
+ }
+ }
+ return 0;
+}
+
+
+void
+GUIApplicationWindow::sendBlockingEvent(GUIEvent* event) {
+ myEventMutex.lock();
+ myEvents.add(event);
+ myRunThreadEvent.signal();
+ myEventCondition.wait(myEventMutex);
+ myEventMutex.unlock();
+}
+
+
+/****************************************************************************/
diff --git a/src/gui/GUIApplicationWindow.h b/src/gui/GUIApplicationWindow.h
index e8be2b2..b8758fd 100644
--- a/src/gui/GUIApplicationWindow.h
+++ b/src/gui/GUIApplicationWindow.h
@@ -5,7 +5,7 @@
/// @author Christian Roessel
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: GUIApplicationWindow.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUIApplicationWindow.h 18761 2015-09-01 14:15:44Z behrisch $
///
// The main window of the SUMO-gui.
/****************************************************************************/
@@ -101,7 +101,7 @@ public:
void loadOnStartup();
- void dependentBuild(bool game);
+ void dependentBuild();
void setStatusBarText(const std::string&);
@@ -121,6 +121,7 @@ public:
void handleEvent_SimulationStep(GUIEvent* e);
void handleEvent_Message(GUIEvent* e);
void handleEvent_SimulationEnded(GUIEvent* e);
+ void handleEvent_Screenshot(GUIEvent* e);
/// @}
@@ -233,6 +234,10 @@ public:
/// @brief Somebody wants our clipped text
long onClipboardRequest(FXObject* sender, FXSelector sel, void* ptr);
+
+ /// @brief handle keys
+ long onKeyPress(FXObject* o, FXSelector sel, void* data);
+ long onKeyRelease(FXObject* o, FXSelector sel, void* data);
/// @}
@@ -243,12 +248,17 @@ public:
return mySimDelayTarget->getValue();
}
+ /** @brief Sends an event from the application thread to the GUI and waits until it is handled
+ * @param event the event to send
+ */
+ virtual void sendBlockingEvent(GUIEvent* event);
+
protected:
virtual void addToWindowsMenu(FXMenuPane*) { }
private:
/** starts to load a simulation */
- void loadConfigOrNet(const std::string& file, bool isNet, bool isReload = false);
+ void loadConfigOrNet(const std::string& file, bool isNet);
/** this method closes all windows and deletes the current simulation */
void closeAllWindows();
@@ -354,6 +364,12 @@ protected:
/// @brief whether the simulation end was already announced
bool myHaveNotifiedAboutSimEnd;
+ /// @brief the mutex for the waiting semaphore
+ FXMutex myEventMutex;
+
+ /// @brief the semaphore when waiting for event completion
+ FXCondition myEventCondition;
+
/// @name game related things
/// {
RandomDistributor<std::string> myJamSounds;
diff --git a/src/gui/GUIEvent_Screenshot.h b/src/gui/GUIEvent_Screenshot.h
new file mode 100644
index 0000000..8a6b3f2
--- /dev/null
+++ b/src/gui/GUIEvent_Screenshot.h
@@ -0,0 +1,80 @@
+/****************************************************************************/
+/// @file GUIEvent_Screenshot.h
+/// @author Michael Behrisch
+/// @date 2015-08-25
+/// @version $Id: GUIEvent_Screenshot.h 18761 2015-09-01 14:15:44Z behrisch $
+///
+// Event send when a screenshot should be made
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+#ifndef GUIEvent_Screenshot_h
+#define GUIEvent_Screenshot_h
+
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+#include <string>
+#include <iostream>
+#include <utils/gui/events/GUIEvent.h>
+
+
+// ===========================================================================
+// class declarations
+// ===========================================================================
+class GUISUMOAbstractView;
+
+
+// ===========================================================================
+// class definitions
+// ===========================================================================
+/**
+ * @class GUIEvent_Screenshot
+ *
+ * Throw to GUIApplicationWindow from GUIRunThread to trigger a screenshot
+ */
+class GUIEvent_Screenshot : public GUIEvent {
+public:
+ /// constructor
+ GUIEvent_Screenshot(GUISUMOAbstractView* view,
+ const std::string& file)
+ : GUIEvent(EVENT_SCREENSHOT),
+ myView(view), myFile(file)
+ { }
+
+ /// destructor
+ ~GUIEvent_Screenshot() { }
+
+public:
+ /// @brief the view to save
+ GUISUMOAbstractView* const myView;
+
+ /// @brief the name of the file to save to
+ const std::string myFile;
+
+private:
+ /// @brief Invalidated assignment operator
+ GUIEvent_Screenshot& operator=(const GUIEvent_Screenshot& s);
+};
+
+
+#endif
+
+/****************************************************************************/
+
diff --git a/src/gui/GUILoadThread.cpp b/src/gui/GUILoadThread.cpp
index 3565c34..ea33e62 100644
--- a/src/gui/GUILoadThread.cpp
+++ b/src/gui/GUILoadThread.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: GUILoadThread.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUILoadThread.cpp 18498 2015-06-22 05:59:25Z behrisch $
///
// Class describing the thread that performs the loading of a simulation
/****************************************************************************/
@@ -80,7 +80,7 @@
// ===========================================================================
// member method definitions
// ===========================================================================
-GUILoadThread::GUILoadThread(FXApp* app, MFXInterThreadEventClient* mw,
+GUILoadThread::GUILoadThread(FXApp* app, GUIApplicationWindow* mw,
MFXEventQue<GUIEvent*>& eq, FXEX::FXThreadEvent& ev)
: FXSingleEventThread(app, mw), myParent(mw), myEventQue(eq),
myEventThrow(ev) {
@@ -100,42 +100,35 @@ GUILoadThread::~GUILoadThread() {
FXint
GUILoadThread::run() {
- GUINet* net = 0;
- int simStartTime = 0;
- int simEndTime = 0;
- std::vector<std::string> guiSettingsFiles;
- bool osgView = false;
- OptionsCont& oc = OptionsCont::getOptions();
-
// register message callbacks
MsgHandler::getMessageInstance()->addRetriever(myMessageRetriever);
MsgHandler::getErrorInstance()->addRetriever(myErrorRetriever);
- if (!OptionsCont::getOptions().getBool("no-warnings")) {
- MsgHandler::getWarningInstance()->addRetriever(myWarningRetriever);
- }
+ MsgHandler::getWarningInstance()->addRetriever(myWarningRetriever);
// try to load the given configuration
+ OptionsCont& oc = OptionsCont::getOptions();
try {
oc.clear();
MSFrame::fillOptions();
if (myFile != "") {
- myTitle = myFile;
- // triggered by menu option
+ // triggered by menu option or reload
if (myLoadNet) {
oc.set("net-file", myFile);
} else {
oc.set("configuration-file", myFile);
}
- OptionsIO::getOptions(true, 1, 0);
+ oc.resetWritable(); // there may be command line options
+ OptionsIO::getOptions();
} else {
- // triggered at application start or reload
- OptionsIO::getOptions(true);
+ // triggered at application start
+ OptionsIO::getOptions();
if (oc.isSet("configuration-file")) {
- myTitle = oc.getString("configuration-file");
+ myFile = oc.getString("configuration-file");
} else if (oc.isSet("net-file")) {
- myTitle = oc.getString("net-file");
+ myFile = oc.getString("net-file");
}
}
+ myTitle = myFile;
// within gui-based applications, nothing is reported to the console
MsgHandler::getMessageInstance()->removeRetriever(&OutputDevice::getDevice("stdout"));
MsgHandler::getWarningInstance()->removeRetriever(&OutputDevice::getDevice("stderr"));
@@ -155,7 +148,7 @@ GUILoadThread::run() {
// the options are not valid but maybe we want to quit
GUIGlobals::gQuitOnEnd = oc.getBool("quit-on-end");
MsgHandler::getErrorInstance()->inform("Quitting (on error).", false);
- submitEndAndCleanup(net, simStartTime, simEndTime);
+ submitEndAndCleanup(0, 0, 0);
return 0;
}
@@ -164,6 +157,9 @@ GUILoadThread::run() {
RandHelper::initRandGlobal(MSRouteHandler::getParsingRNG());
MSFrame::setMSGlobals(oc);
GUITexturesHelper::allowTextures(!oc.getBool("disable-textures"));
+ if (oc.getBool("game")) {
+ myParent->onCmdGaming(0, 0, 0);
+ }
MSVehicleControl* vehControl = 0;
#ifdef HAVE_INTERNAL
GUIVisualizationSettings::UseMesoSim = MSGlobals::gUseMesoSim;
@@ -173,6 +169,11 @@ GUILoadThread::run() {
#endif
vehControl = new GUIVehicleControl();
+ GUINet* net = 0;
+ int simStartTime = 0;
+ int simEndTime = 0;
+ std::vector<std::string> guiSettingsFiles;
+ bool osgView = false;
GUIEdgeControlBuilder* eb = 0;
try {
net = new GUINet(
@@ -232,7 +233,6 @@ GUILoadThread::run() {
}
-
void
GUILoadThread::submitEndAndCleanup(GUINet* net,
const SUMOTime simStartTime,
@@ -251,14 +251,12 @@ GUILoadThread::submitEndAndCleanup(GUINet* net,
void
-GUILoadThread::reloadConfigOrNet() {
- start();
-}
-
-void
GUILoadThread::loadConfigOrNet(const std::string& file, bool isNet) {
myFile = file;
myLoadNet = isNet;
+ if (myFile != "") {
+ OptionsIO::setArgs(0, 0);
+ }
start();
}
@@ -277,6 +275,4 @@ GUILoadThread::getFileName() const {
}
-
/****************************************************************************/
-
diff --git a/src/gui/GUILoadThread.h b/src/gui/GUILoadThread.h
index bd09058..306d15d 100644
--- a/src/gui/GUILoadThread.h
+++ b/src/gui/GUILoadThread.h
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Sept 2002
-/// @version $Id: GUILoadThread.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUILoadThread.h 18498 2015-06-22 05:59:25Z behrisch $
///
// Class describing the thread that performs the loading of a simulation
/****************************************************************************/
@@ -43,7 +43,7 @@
// ===========================================================================
// class declarations
// ===========================================================================
-class MFXInterThreadEventClient;
+class GUIApplicationWindow;
class GUINet;
class GUIEvent;
@@ -57,7 +57,7 @@ class GUIEvent;
class GUILoadThread : public FXSingleEventThread {
public:
/// constructor
- GUILoadThread(FXApp* app, MFXInterThreadEventClient* mw, MFXEventQue<GUIEvent*>& eq,
+ GUILoadThread(FXApp* app, GUIApplicationWindow* mw, MFXEventQue<GUIEvent*>& eq,
FXEX::FXThreadEvent& ev);
/// destructor
@@ -67,9 +67,6 @@ public:
the thread ends after the net has been loaded */
FXint run();
- /// reloads according to the given input options
- void reloadConfigOrNet();
-
/// begins the loading of the given file
void loadConfigOrNet(const std::string& file, bool isNet);
@@ -90,7 +87,7 @@ protected:
protected:
/// the parent window to inform about the loading
- MFXInterThreadEventClient* myParent;
+ GUIApplicationWindow* myParent;
/// the path to load the simulation from
std::string myFile;
diff --git a/src/gui/GUISUMOViewParent.cpp b/src/gui/GUISUMOViewParent.cpp
index 521a362..8546124 100644
--- a/src/gui/GUISUMOViewParent.cpp
+++ b/src/gui/GUISUMOViewParent.cpp
@@ -6,7 +6,7 @@
/// @author Laura Bieker
/// @author Andreas Gaubatz
/// @date Sept 2002
-/// @version $Id: GUISUMOViewParent.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUISUMOViewParent.cpp 18294 2015-04-24 10:23:48Z namdre $
///
// A single child window which contains a view of the simulation area
/****************************************************************************/
@@ -34,6 +34,7 @@
#include <string>
#include <vector>
+#include <fxkeys.h>
#include <utils/common/UtilExceptions.h>
#include <utils/geom/Position.h>
#include <utils/geom/Boundary.h>
@@ -264,5 +265,19 @@ GUISUMOViewParent::isSelected(GUIGlObject* o) const {
}
+long
+GUISUMOViewParent::onKeyPress(FXObject* o, FXSelector sel, void* data) {
+ myView->onKeyPress(o, sel, data);
+ return 0;
+}
+
+
+long
+GUISUMOViewParent::onKeyRelease(FXObject* o, FXSelector sel, void* data) {
+ myView->onKeyRelease(o, sel, data);
+ return 0;
+}
+
+
/****************************************************************************/
diff --git a/src/gui/GUISUMOViewParent.h b/src/gui/GUISUMOViewParent.h
index c6f16d1..82b71e8 100644
--- a/src/gui/GUISUMOViewParent.h
+++ b/src/gui/GUISUMOViewParent.h
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Andreas Gaubatz
/// @date Sept 2002
-/// @version $Id: GUISUMOViewParent.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUISUMOViewParent.h 18294 2015-04-24 10:23:48Z namdre $
///
// A single child window which contains a view of the simulation area
/****************************************************************************/
@@ -116,6 +116,10 @@ public:
/// @brief locator-callback
long onCmdLocate(FXObject*, FXSelector, void*);
+ /// @brief handle keys
+ long onKeyPress(FXObject* o, FXSelector sel, void* data);
+ long onKeyRelease(FXObject* o, FXSelector sel, void* data);
+
/// @brief true if the object is selected (may include extra logic besides calling gSelected)
bool isSelected(GUIGlObject* o) const;
diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am
index 60fa8a0..e53a511 100644
--- a/src/gui/Makefile.am
+++ b/src/gui/Makefile.am
@@ -1,7 +1,7 @@
noinst_LIBRARIES = libgui.a
libgui_a_SOURCES = GUIApplicationWindow.cpp GUIApplicationWindow.h \
-GUIEvent_SimulationEnded.h GUIEvent_SimulationLoaded.h \
+GUIEvent_SimulationEnded.h GUIEvent_SimulationLoaded.h GUIEvent_Screenshot.h \
GUIGlobals.cpp GUIGlobals.h \
GUIManipulator.h GUIManipulator.cpp \
GUILoadThread.cpp GUILoadThread.h \
diff --git a/src/gui/Makefile.in b/src/gui/Makefile.in
index 5bc0edf..81609a5 100644
--- a/src/gui/Makefile.in
+++ b/src/gui/Makefile.in
@@ -374,7 +374,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LIBRARIES = libgui.a
libgui_a_SOURCES = GUIApplicationWindow.cpp GUIApplicationWindow.h \
-GUIEvent_SimulationEnded.h GUIEvent_SimulationLoaded.h \
+GUIEvent_SimulationEnded.h GUIEvent_SimulationLoaded.h GUIEvent_Screenshot.h \
GUIGlobals.cpp GUIGlobals.h \
GUIManipulator.h GUIManipulator.cpp \
GUILoadThread.cpp GUILoadThread.h \
diff --git a/src/gui/TraCIServerAPI_GUI.cpp b/src/gui/TraCIServerAPI_GUI.cpp
index b154af6..42fc7b5 100644
--- a/src/gui/TraCIServerAPI_GUI.cpp
+++ b/src/gui/TraCIServerAPI_GUI.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date 07.05.2009
-/// @version $Id: TraCIServerAPI_GUI.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: TraCIServerAPI_GUI.cpp 18761 2015-09-01 14:15:44Z behrisch $
///
// APIs for getting/setting GUI values via TraCI
/****************************************************************************/
@@ -41,6 +41,7 @@
#include <traci-server/TraCIConstants.h>
#include <guisim/GUINet.h>
#include <guisim/GUIVehicle.h>
+#include "GUIEvent_Screenshot.h"
#include "TraCIServerAPI_GUI.h"
#ifdef CHECK_MEMORY_LEAKS
@@ -70,7 +71,7 @@ TraCIServerAPI_GUI::processGet(TraCIServer& server, tcpip::Storage& inputStorage
tempMsg.writeString(id);
// process request
if (variable == ID_LIST) {
- std::vector<std::string> ids = getMainWindow()->getViewIDs();
+ std::vector<std::string> ids = GUIMainWindow::getInstance()->getViewIDs();
tempMsg.writeUnsignedByte(TYPE_STRINGLIST);
tempMsg.writeStringList(ids);
} else {
@@ -174,10 +175,7 @@ TraCIServerAPI_GUI::processSet(TraCIServer& server, tcpip::Storage& inputStorage
if (!server.readTypeCheckingString(inputStorage, filename)) {
return server.writeErrorStatusCmd(CMD_SET_GUI_VARIABLE, "Making a snapshot requires a file name.", outputStorage);
}
- std::string error = v->makeSnapshot(filename);
- if (error != "") {
- return server.writeErrorStatusCmd(CMD_SET_GUI_VARIABLE, error, outputStorage);
- }
+ GUIMainWindow::getInstance()->sendBlockingEvent(new GUIEvent_Screenshot(v, filename));
}
break;
case VAR_TRACK_VEHICLE: {
@@ -206,27 +204,13 @@ TraCIServerAPI_GUI::processSet(TraCIServer& server, tcpip::Storage& inputStorage
}
-GUIMainWindow*
-TraCIServerAPI_GUI::getMainWindow() {
- FXWindow* w = FXApp::instance()->getRootWindow()->getFirst();
- while (w != 0 && dynamic_cast<GUIMainWindow*>(w) == 0) {
- w = w->getNext();
- }
- if (w == 0) {
- // main window not found
- return 0;
- }
- return dynamic_cast<GUIMainWindow*>(w);
-}
-
-
GUISUMOAbstractView*
TraCIServerAPI_GUI::getNamedView(const std::string& id) {
- GUIMainWindow* mw = static_cast<GUIMainWindow*>(getMainWindow());
+ GUIMainWindow* const mw = GUIMainWindow::getInstance();
if (mw == 0) {
return 0;
}
- GUIGlChildWindow* c = static_cast<GUIGlChildWindow*>(mw->getViewByID(id));
+ GUIGlChildWindow* const c = static_cast<GUIGlChildWindow*>(mw->getViewByID(id));
if (c == 0) {
return 0;
}
diff --git a/src/gui/TraCIServerAPI_GUI.h b/src/gui/TraCIServerAPI_GUI.h
index 28f0336..d5d34e7 100644
--- a/src/gui/TraCIServerAPI_GUI.h
+++ b/src/gui/TraCIServerAPI_GUI.h
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date 07.05.2009
-/// @version $Id: TraCIServerAPI_GUI.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: TraCIServerAPI_GUI.h 18724 2015-08-25 21:00:09Z behrisch $
///
// APIs for getting/setting GUI values via TraCI
/****************************************************************************/
@@ -75,18 +75,13 @@ public:
protected:
- /** @brief Returns the main window
- * @return The main window (should exist)
- */
- static GUIMainWindow* getMainWindow();
-
-
/** @brief Returns the named view
* @param[in] viewName The name of the view
* @return The named view if existing, 0 otherwise
*/
static GUISUMOAbstractView* getNamedView(const std::string& id);
+
private:
/// @brief invalidated copy constructor
TraCIServerAPI_GUI(const TraCIServerAPI_GUI& s);
diff --git a/src/gui/dialogs/GUIDialog_Breakpoints.cpp b/src/gui/dialogs/GUIDialog_Breakpoints.cpp
index 36b04e1..88eb9c6 100644
--- a/src/gui/dialogs/GUIDialog_Breakpoints.cpp
+++ b/src/gui/dialogs/GUIDialog_Breakpoints.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Thu, 17 Jun 2004
-/// @version $Id: GUIDialog_Breakpoints.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIDialog_Breakpoints.cpp 18213 2015-04-16 11:55:42Z behrisch $
///
// Editor for simulation breakpoints
/****************************************************************************/
@@ -143,7 +143,7 @@ GUIDialog_Breakpoints::rebuildList() {
}
// insert into table
FXint row = 0;
- std::vector<int>::iterator j;
+ std::vector<SUMOTime>::iterator j;
for (j = myBreakpoints->begin(); j != myBreakpoints->end(); ++j) {
myTable->setItemText(row, 0, time2string(*j).c_str());
row++;
@@ -200,7 +200,7 @@ GUIDialog_Breakpoints::encode2TXT() {
myBreakpointLock->lock();
std::ostringstream strm;
std::sort(myBreakpoints->begin(), myBreakpoints->end());
- for (std::vector<int>::iterator j = myBreakpoints->begin(); j != myBreakpoints->end(); ++j) {
+ for (std::vector<SUMOTime>::iterator j = myBreakpoints->begin(); j != myBreakpoints->end(); ++j) {
if ((*j) != INVALID_VALUE) {
strm << time2string(*j) << std::endl;
}
diff --git a/src/guinetload/GUITriggerBuilder.cpp b/src/guinetload/GUITriggerBuilder.cpp
index 7e0968e..466666e 100644
--- a/src/guinetload/GUITriggerBuilder.cpp
+++ b/src/guinetload/GUITriggerBuilder.cpp
@@ -1,10 +1,10 @@
-/****************************************************************************/
+/****************************************************************************/
/// @file GUITriggerBuilder.cpp
/// @author Daniel Krajzewicz
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Mon, 26.04.2004
-/// @version $Id: GUITriggerBuilder.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUITriggerBuilder.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Builds trigger objects for guisim
/****************************************************************************/
@@ -38,8 +38,10 @@
#include <guisim/GUIBusStop.h>
#include <guisim/GUIContainerStop.h>
#include <guisim/GUICalibrator.h>
+#include <guisim/GUIChrgStn.h>
#include "GUITriggerBuilder.h"
+
#ifdef CHECK_MEMORY_LEAKS
#include <foreign/nvwa/debug_new.h>
#endif // CHECK_MEMORY_LEAKS
@@ -73,12 +75,12 @@ GUITriggerBuilder::buildRerouter(MSNet& net, const std::string& id,
return rr;
}
-
void
GUITriggerBuilder::buildBusStop(MSNet& net, const std::string& id,
const std::vector<std::string>& lines,
MSLane* lane,
SUMOReal frompos, SUMOReal topos) {
+
GUIBusStop* stop = new GUIBusStop(id, lines, *lane, frompos, topos);
if (!net.addBusStop(stop)) {
delete stop;
@@ -101,6 +103,21 @@ GUITriggerBuilder::buildContainerStop(MSNet& net, const std::string& id,
}
+void
+GUITriggerBuilder::buildChrgStn(MSNet& net, const std::string& id,
+ const std::vector<std::string>& lines,
+ MSLane* lane,
+ SUMOReal frompos, SUMOReal topos, SUMOReal chrgpower, SUMOReal efficiency, SUMOReal chargeInTransit, SUMOReal chargeDelay) {
+ GUIChrgStn* chrg = new GUIChrgStn(id, lines, *lane, frompos, topos, chrgpower, efficiency, chargeInTransit, chargeDelay);
+
+ if (!net.addChrgStn(chrg)) {
+ delete chrg;
+ throw InvalidArgument("Could not build charging station '" + id + "'; probably declared twice.");
+ }
+
+ static_cast<GUINet&>(net).getVisualisationSpeedUp().addAdditionalGLObject(chrg);
+}
+
MSCalibrator*
GUITriggerBuilder::buildCalibrator(MSNet& net, const std::string& id,
MSEdge* edge, SUMOReal pos,
diff --git a/src/guinetload/GUITriggerBuilder.h b/src/guinetload/GUITriggerBuilder.h
index e522008..37349f4 100644
--- a/src/guinetload/GUITriggerBuilder.h
+++ b/src/guinetload/GUITriggerBuilder.h
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Mon, 26.04.2004
-/// @version $Id: GUITriggerBuilder.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUITriggerBuilder.h 18756 2015-08-31 19:16:33Z behrisch $
///
// Builds trigger objects for guisim
/****************************************************************************/
@@ -136,6 +136,27 @@ protected:
SUMOReal frompos, SUMOReal topos);
+ /** @brief Builds a charging station
+ *
+ * Simply calls the ChrgSTN constructor.
+ *
+ * @param[in] net The net the charging station belongs to
+ * @param[in] id The id of the charging station
+ * @param[in] lines Names of the bus lines that halt on this charging station
+ * @param[in] lane The lane the charging station is placed on
+ * @param[in] frompos Begin position of the charging station on the lane
+ * @param[in] topos End position of the charging station on the lane
+ * @param[in]
+ * @param[in] FALTAN ARGUMENTOS DE LA LLAMADA A FUNCION
+ * @param[in]
+ * @param[in]
+ * @exception InvalidArgument If the charging station can not be added to the net (is duplicate)
+ */
+ virtual void buildChrgStn(MSNet& net, const std::string& id,
+ const std::vector<std::string>& lines, MSLane* lane,
+ SUMOReal frompos, SUMOReal topos, SUMOReal chrgpower, SUMOReal efficiency,
+ SUMOReal chargeInTransit, SUMOReal chargeDelay);
+
/** @brief builds a microscopic calibrator
*
* Simply calls the MSCalibrator constructor.
diff --git a/src/guisim/GUIBusStop.cpp b/src/guisim/GUIBusStop.cpp
index fb5728f..a23bb9c 100644
--- a/src/guisim/GUIBusStop.cpp
+++ b/src/guisim/GUIBusStop.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Wed, 07.12.2005
-/// @version $Id: GUIBusStop.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIBusStop.cpp 18258 2015-04-21 13:20:47Z behrisch $
///
// A lane area vehicles can halt at (gui-version)
/****************************************************************************/
@@ -66,7 +66,7 @@
// ===========================================================================
GUIBusStop::GUIBusStop(const std::string& id, const std::vector<std::string>& lines, MSLane& lane,
SUMOReal frompos, SUMOReal topos)
- : MSBusStop(id, lines, lane, frompos, topos),
+ : MSStoppingPlace(id, lines, lane, frompos, topos),
GUIGlObject_AbstractAdd("busStop", GLO_TRIGGER, id) {
myFGShape = lane.getShape();
myFGShape.move2side((SUMOReal) 1.65);
@@ -116,7 +116,7 @@ GUIBusStop::getParameterWindow(GUIMainWindow& app,
// add items
ret->mkItem("begin position [m]", false, myBegPos);
ret->mkItem("end position [m]", false, myEndPos);
- ret->mkItem("person number [#]", true, new FunctionBinding<GUIBusStop, unsigned int>(this, &MSBusStop::getPersonNumber));
+ ret->mkItem("person number [#]", true, new FunctionBinding<GUIBusStop, unsigned int>(this, &MSStoppingPlace::getTransportableNumber));
// close building
ret->closeBuilding();
return ret;
@@ -169,7 +169,7 @@ GUIBusStop::drawGL(const GUIVisualizationSettings& s) const {
glPopMatrix();
glPopName();
drawName(getCenteringBoundary().getCenter(), s.scale, s.addName);
- for (std::vector<MSPerson*>::const_iterator i = myWaitingPersons.begin(); i != myWaitingPersons.end(); ++i) {
+ for (std::vector<MSTransportable*>::const_iterator i = myWaitingTransportables.begin(); i != myWaitingTransportables.end(); ++i) {
glTranslated(0, 1, 0); // make multiple persons viewable
static_cast<GUIPerson*>(*i)->drawGL(s);
}
diff --git a/src/guisim/GUIBusStop.h b/src/guisim/GUIBusStop.h
index ea90281..234980a 100644
--- a/src/guisim/GUIBusStop.h
+++ b/src/guisim/GUIBusStop.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Wed, 07.12.2005
-/// @version $Id: GUIBusStop.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIBusStop.h 18258 2015-04-21 13:20:47Z behrisch $
///
// A lane area vehicles can halt at (gui-version)
/****************************************************************************/
@@ -37,7 +37,7 @@
#include <utils/common/Command.h>
#include <utils/common/VectorHelper.h>
#include <utils/geom/PositionVector.h>
-#include <microsim/trigger/MSBusStop.h>
+#include <microsim/MSStoppingPlace.h>
#include <utils/gui/globjects/GUIGlObject.h>
#include <utils/gui/globjects/GUIGlObject_AbstractAdd.h>
#include <utils/gui/globjects/GUIGLObjectPopupMenu.h>
@@ -61,14 +61,14 @@ class GUIManipulator;
* @class GUIBusStop
* @brief A lane area vehicles can halt at (gui-version)
*
- * This gui-version of a bus-stop extends MSBusStop by methods for displaying
+ * This gui-version of a bus-stop extends MSStoppingPlace by methods for displaying
* and interaction.
*
- * @see MSBusStop
+ * @see MSStoppingPlace
* @see GUIGlObject_AbstractAdd
* @see GUIGlObject
*/
-class GUIBusStop : public MSBusStop, public GUIGlObject_AbstractAdd {
+class GUIBusStop : public MSStoppingPlace, public GUIGlObject_AbstractAdd {
public:
/** @brief Constructor
* @param[in] idStorage The gl-id storage for giving this object an gl-id
diff --git a/src/guisim/GUIChrgStn.cpp b/src/guisim/GUIChrgStn.cpp
new file mode 100644
index 0000000..886f0e3
--- /dev/null
+++ b/src/guisim/GUIChrgStn.cpp
@@ -0,0 +1,242 @@
+/****************************************************************************/
+/// @file GUIChrgStn.cpp
+/// @author Daniel Krajzewicz
+/// @author Jakob Erdmann
+/// @author Michael Behrisch
+/// @author Tamas Kurczveil
+/// @author Pablo Alvarez L�pez
+/// @date 20-12-13
+/// @version $Id: GUIChrgStn.cpp 18762 2015-09-01 16:27:09Z behrisch $
+///
+// A lane area vehicles can halt at (gui-version)
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+#include <string>
+#include <utils/common/MsgHandler.h>
+#include <utils/geom/PositionVector.h>
+#include <utils/geom/Line.h>
+#include <utils/geom/Boundary.h>
+#include <utils/gui/div/GLHelper.h>
+#include <utils/common/ToString.h>
+#include <microsim/MSNet.h>
+#include <microsim/MSLane.h>
+#include <microsim/MSEdge.h>
+#include "GUINet.h"
+#include "GUIEdge.h"
+#include "GUIPerson.h"
+#include "GUIChrgStn.h"
+#include <utils/gui/globjects/GUIGLObjectPopupMenu.h>
+#include <utils/gui/windows/GUIAppEnum.h>
+#include <gui/GUIGlobals.h>
+#include <utils/gui/div/GUIParameterTableWindow.h>
+#include <gui/GUIApplicationWindow.h>
+#include <microsim/logging/FunctionBinding.h>
+#include <utils/gui/div/GUIGlobalSelection.h>
+#include <foreign/polyfonts/polyfonts.h>
+#include <utils/geom/GeomHelper.h>
+#include <utils/gui/globjects/GLIncludes.h>
+
+#ifdef CHECK_MEMORY_LEAKS
+#include <foreign/nvwa/debug_new.h>
+#endif // CHECK_MEMORY_LEAKS
+
+
+// ===========================================================================
+// method definitions
+// ===========================================================================
+GUIChrgStn::GUIChrgStn(const std::string& id, const std::vector<std::string>& lines, MSLane& lane,
+ SUMOReal frompos, SUMOReal topos, SUMOReal new_chrgpower, SUMOReal new_efficiency, SUMOReal new_ChargeInTransit, SUMOReal new_ChargeDelay)
+ : MSChrgStn(id, lines, lane, frompos, topos, new_chrgpower, new_efficiency, new_ChargeInTransit, new_ChargeDelay),
+ GUIGlObject_AbstractAdd("chargingStation", GLO_TRIGGER, id) {
+ myFGShape = lane.getShape();
+ myFGShape = myFGShape.getSubpart(frompos, topos);
+ myFGShapeRotations.reserve(myFGShape.size() - 1);
+ myFGShapeLengths.reserve(myFGShape.size() - 1);
+ int e = (int) myFGShape.size() - 1;
+ for (int i = 0; i < e; ++i) {
+ const Position& f = myFGShape[i];
+ const Position& s = myFGShape[i + 1];
+ myFGShapeLengths.push_back(f.distanceTo(s));
+ myFGShapeRotations.push_back((SUMOReal) atan2((s.x() - f.x()), (f.y() - s.y())) * (SUMOReal) 180.0 / (SUMOReal) PI);
+ }
+ PositionVector tmp = myFGShape;
+ tmp.move2side(1.5);
+ myFGSignPos = tmp.getLineCenter();
+ myFGSignRot = 0;
+ if (tmp.length() != 0) {
+ myFGSignRot = myFGShape.rotationDegreeAtOffset(SUMOReal((myFGShape.length() / 2.)));
+ myFGSignRot -= 90;
+ }
+
+ chrgpower = new_chrgpower;
+ efficiency = new_efficiency;
+ chargeInTransit = new_ChargeInTransit;
+ chargeDelay = new_ChargeDelay;
+}
+
+
+GUIChrgStn::~GUIChrgStn()
+{}
+
+
+GUIParameterTableWindow*
+GUIChrgStn::getParameterWindow(GUIMainWindow& app,
+ GUISUMOAbstractView&) {
+ GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this, 6);
+
+ // add items
+ ret->mkItem("begin position [m]", false, myBegPos);
+ ret->mkItem("end position [m]", false, myEndPos);
+ ret->mkItem("charging power [W]", false, chrgpower);
+ ret->mkItem("charging efficiency []", false, efficiency);
+ ret->mkItem("charge in transit [0/1]", false, chargeInTransit);
+ ret->mkItem("charge delay [s]", false, chargeDelay);
+
+ // close building
+ ret->closeBuilding();
+ return ret;
+}
+
+
+GUIGLObjectPopupMenu*
+GUIChrgStn::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) {
+ GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
+ buildPopupHeader(ret, app);
+ buildCenterPopupEntry(ret);
+ buildNameCopyPopupEntry(ret);
+ buildSelectionPopupEntry(ret);
+ buildShowParamsPopupEntry(ret);
+ buildPositionCopyEntry(ret, false);
+ return ret;
+}
+
+Boundary
+GUIChrgStn::getCenteringBoundary() const {
+ Boundary b = myFGShape.getBoxBoundary();
+ b.grow(20);
+ return b;
+}
+
+
+void
+GUIChrgStn::drawGL(const GUIVisualizationSettings& s) const {
+
+ glPushName(getGlID());
+ glPushMatrix();
+ RGBColor blue(114, 210, 252, 255);
+ RGBColor green(76, 170, 50, 255);
+ RGBColor yellow(255, 235, 0, 255);
+ // draw the area
+ glTranslated(0, 0, getType());
+ GLHelper::setColor(blue);
+ GLHelper::drawBoxLines(myFGShape, myFGShapeRotations, myFGShapeLengths, 1.0);
+
+ // draw details unless zoomed out to far
+ const SUMOReal exaggeration = s.addSize.getExaggeration(s);
+ if (s.scale * exaggeration >= 10) {
+ /**
+ size_t i;
+ // draw the lines
+ GLHelper::setColor(green);
+
+ for (i = 0; i != myLines.size(); ++i) {
+ glPushMatrix();
+ glTranslated(myFGSignPos.x(), myFGSignPos.y(), 0);
+ glRotated(180, 1, 0, 0);
+ glRotated(myFGSignRot, 0, 0, 1);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ pfSetPosition(0, 0);
+ pfSetScale(1.f);
+ glScaled(exaggeration, exaggeration, 1);
+ glTranslated(1.2, -(double)i, 0);
+ pfDrawString(myLines[i].c_str());
+ glPopMatrix();
+ }
+ */
+
+ // draw the sign
+ glTranslated(myFGSignPos.x(), myFGSignPos.y(), 0);
+ int noPoints = 9;
+ if (s.scale * exaggeration > 25) {
+ noPoints = MIN2((int)(9.0 + (s.scale * exaggeration) / 10.0), 36);
+ }
+
+ glScaled(exaggeration, exaggeration, 1);
+ GLHelper::setColor(blue);
+ GLHelper::drawFilledCircle((SUMOReal) 1.1, noPoints);
+ glTranslated(0, 0, .1);
+
+ GLHelper::setColor(yellow);
+ GLHelper::drawFilledCircle((SUMOReal) 0.9, noPoints);
+
+ if (s.scale * exaggeration >= 4.5) {
+ GLHelper::drawText("C", Position(), .1, 1.6 * exaggeration, green, myFGSignRot);
+ }
+
+ /** draw the Sen function IGNORED
+
+ //glTranslated(myFGSignPos.x(), myFGSignPos.y(), 0);
+
+ if (myFGSignRot == 0)
+ glTranslated(0, -1.5, 10);
+ else
+ glTranslated(0, 1.5, 10);
+ //glTranslated(0, (-1)*myFGSignPos.y(), .1);
+ RGBColor green(76, 170, 50, 255);
+
+
+
+ for (double X = 0; X < 5; X+=0.01)
+ {
+ double Y = sin((4*X)-(PI/2))*0.8;
+ glTranslated(0.01, Y, 0);
+ GLHelper::drawFilledCircle(0.05, 9);
+ glTranslated(0, Y*-1, 0);
+ }
+
+ glTranslated(-5, 0, 0);
+
+ for (double X = 0; X > -5; X-=0.01)
+ {
+ double Y = sin((4*X)-(PI/2))*0.8;
+ glTranslated(-0.01, Y, 0);
+ GLHelper::drawFilledCircle(0.05, 9);
+ glTranslated(0, Y*-1, 0);
+ }
+ */
+ glTranslated(5, 0, 0);
+
+ }
+ glPopMatrix();
+ glPopName();
+ drawName(getCenteringBoundary().getCenter(), s.scale, s.addName);
+ // there should be no persons on a chargingStation
+ //for (std::vector<MSPerson*>::const_iterator i = myWaitingPersons.begin(); i != myWaitingPersons.end(); ++i) {
+ // glTranslated(0, 1, 0); // make multiple persons viewable
+ // static_cast<GUIPerson*>(*i)->drawGL(s);
+ //}
+
+}
+
+/****************************************************************************/
diff --git a/src/guisim/GUIChrgStn.h b/src/guisim/GUIChrgStn.h
new file mode 100644
index 0000000..89fe43c
--- /dev/null
+++ b/src/guisim/GUIChrgStn.h
@@ -0,0 +1,168 @@
+/****************************************************************************/
+/// @file GUIChrgStn.h
+/// @author Daniel Krajzewicz
+/// @author Jakob Erdmann
+/// @author Michael Behrisch
+/// @author Tamas Kurczveil
+/// @author Pablo Alvarez L�pez
+/// @date 20-12-13
+/// @version $Id: GUIChrgStn.h 18762 2015-09-01 16:27:09Z behrisch $
+///
+// A lane area vehicles can halt at (gui-version)
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+#ifndef GUIChrgStn_h
+#define GUIChrgStn_h
+
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+#include <vector>
+#include <string>
+#include <utils/common/Command.h>
+#include <utils/common/VectorHelper.h>
+#include <utils/geom/PositionVector.h>
+#include <microsim/trigger/MSChrgStn.h>
+#include <guisim/GUIBusStop.h>
+#include <utils/gui/globjects/GUIGlObject.h>
+#include <utils/gui/globjects/GUIGlObject_AbstractAdd.h>
+#include <utils/gui/globjects/GUIGLObjectPopupMenu.h>
+#include <utils/geom/Position.h>
+#include <gui/GUIManipulator.h>
+#include <utils/foxtools/FXRealSpinDial.h>
+
+
+// ===========================================================================
+// class declarations
+// ===========================================================================
+class MSNet;
+class MSLane;
+class GUIManipulator;
+
+
+// ===========================================================================
+// class definitions
+// ===========================================================================
+/**
+ * @class GUIChrgStn
+ * @brief A lane area vehicles can halt at (gui-version)
+ *
+ * This gui-version of a bus-stop extends MSChrgStn by methods for displaying
+ * and interaction.
+ *
+ * @see MSChrgStn
+ * @see GUIGlObject_AbstractAdd
+ * @see GUIGlObject
+ */
+class GUIChrgStn : public MSChrgStn, public GUIGlObject_AbstractAdd {
+public:
+ /** @brief Constructor
+ * @param[in] idStorage The gl-id storage for giving this object an gl-id
+ * @param[in] id The id of the Charging Station
+ * @param[in] lines Names of the bus lines that halt on this bus stop
+ * @param[in] lane The lane the charging station is placed on
+ * @param[in] begPos Begin position of the charging station on the lane
+ * @param[in] endPos End position of the charging station on the lane
+ */
+ GUIChrgStn(const std::string& id,
+ const std::vector<std::string>& lines, MSLane& lane,
+ SUMOReal frompos, SUMOReal topos,
+ SUMOReal new_chrgpower, SUMOReal new_efficiency, SUMOReal new_ChargeInTransit, SUMOReal new_ChargeDelay);
+
+
+ /// @brief Destructor
+ ~GUIChrgStn();
+
+
+ /// @name inherited from GUIGlObject
+ //@{
+
+ /** @brief Returns an own popup-menu
+ *
+ * @param[in] app The application needed to build the popup-menu
+ * @param[in] parent The parent window needed to build the popup-menu
+ * @return The built popup-menu
+ * @see GUIGlObject::getPopUpMenu
+ */
+ GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app,
+ GUISUMOAbstractView& parent);
+
+
+ /** @brief Returns an own parameter window
+ *
+ * Bus stops have no parameter windows (yet).
+ *
+ * @param[in] app The application needed to build the parameter window
+ * @param[in] parent The parent window needed to build the parameter window
+ * @return The built parameter window (always 0 in this case)
+ * @see GUIGlObject::getParameterWindow
+ */
+ GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app,
+ GUISUMOAbstractView& parent);
+
+
+ /** @brief Returns the boundary to which the view shall be centered in order to show the object
+ *
+ * @return The boundary the object is within
+ * @see GUIGlObject::getCenteringBoundary
+ */
+ Boundary getCenteringBoundary() const;
+
+
+ /** @brief Draws the object
+ * @param[in] s The settings for the current view (may influence drawing)
+ * @see GUIGlObject::drawGL
+ */
+ void drawGL(const GUIVisualizationSettings& s) const;
+ //@}
+
+private:
+ /// @brief chrgpower of the Charging Station
+ SUMOReal chrgpower;
+
+ /// @brief efficiency of the Charging Station
+ SUMOReal efficiency;
+
+ /// @brief allow charge in transit
+ SUMOReal chargeInTransit;
+
+ /// @brief charge delay
+ SUMOReal chargeDelay;
+
+private:
+ /// @brief The rotations of the shape parts
+ std::vector<SUMOReal> myFGShapeRotations;
+
+ /// @brief The lengths of the shape parts
+ std::vector<SUMOReal> myFGShapeLengths;
+
+ /// @brief The shape
+ PositionVector myFGShape;
+
+ /// @brief The position of the sign
+ Position myFGSignPos;
+
+ /// @brief The rotation of the sign
+ SUMOReal myFGSignRot;
+};
+
+
+#endif
+
diff --git a/src/guisim/GUIContainer.cpp b/src/guisim/GUIContainer.cpp
index f9912f1..233970b 100644
--- a/src/guisim/GUIContainer.cpp
+++ b/src/guisim/GUIContainer.cpp
@@ -3,7 +3,7 @@
/// @author Melanie Weber
/// @author Andreas Kendziorra
/// @date Wed, 01.08.2014
-/// @version $Id: GUIContainer.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUIContainer.cpp 18274 2015-04-22 15:00:44Z behrisch $
///
// A MSContainer extended by some values for usage within the gui
/****************************************************************************/
@@ -107,7 +107,7 @@ GUIContainer::GUIContainerPopupMenu::~GUIContainerPopupMenu() {}
/* -------------------------------------------------------------------------
* GUIContainer - methods
* ----------------------------------------------------------------------- */
-GUIContainer::GUIContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSContainer::MSContainerPlan* plan) :
+GUIContainer::GUIContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan) :
MSContainer(pars, vtype, plan),
GUIGlObject(GLO_CONTAINER, pars->id)
{ }
diff --git a/src/guisim/GUIContainer.h b/src/guisim/GUIContainer.h
index e34dd4d..531fe2d 100644
--- a/src/guisim/GUIContainer.h
+++ b/src/guisim/GUIContainer.h
@@ -3,7 +3,7 @@
/// @author Melanie Weber
/// @author Andreas Kendziorra
/// @date Wed, 01.08.2014
-/// @version $Id: GUIContainer.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUIContainer.h 18274 2015-04-22 15:00:44Z behrisch $
///
// A MSVehicle extended by some values for usage within the gui
/****************************************************************************/
@@ -60,7 +60,7 @@ class GUIContainer : public MSContainer, public GUIGlObject {
public:
/** @brief Constructor
*/
- GUIContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSContainer::MSContainerPlan* plan);
+ GUIContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan);
/// @brief destructor
diff --git a/src/guisim/GUIContainerControl.cpp b/src/guisim/GUIContainerControl.cpp
index 73e597e..f014bc4 100644
--- a/src/guisim/GUIContainerControl.cpp
+++ b/src/guisim/GUIContainerControl.cpp
@@ -3,7 +3,7 @@
/// @author Melanie Weber
/// @author Andreas Kendziorra
/// @date Wed, 01.08.2014
-/// @version $Id: GUIContainerControl.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIContainerControl.cpp 18274 2015-04-22 15:00:44Z behrisch $
///
// GUI-version of the container control for building gui containers
/****************************************************************************/
@@ -51,7 +51,7 @@ GUIContainerControl::~GUIContainerControl() {
MSContainer*
-GUIContainerControl::buildContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSContainer::MSContainerPlan* plan) const {
+GUIContainerControl::buildContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan) const {
return new GUIContainer(pars, vtype, plan);
}
diff --git a/src/guisim/GUIContainerControl.h b/src/guisim/GUIContainerControl.h
index f50911b..8718bfd 100644
--- a/src/guisim/GUIContainerControl.h
+++ b/src/guisim/GUIContainerControl.h
@@ -3,7 +3,7 @@
/// @author Melanie Weber
/// @author Andreas Kendziorra
/// @date Wed, 01.08.2014
-/// @version $Id: GUIContainerControl.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIContainerControl.h 18274 2015-04-22 15:00:44Z behrisch $
///
// GUI-version of the container control for building gui containers
/****************************************************************************/
@@ -56,7 +56,7 @@ public:
* @param[in] vtype The type (reusing vehicle type container here)
* @param[in] plan This container's plan
*/
- virtual MSContainer* buildContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSContainer::MSContainerPlan* plan) const;
+ virtual MSContainer* buildContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan) const;
};
diff --git a/src/guisim/GUIContainerStop.cpp b/src/guisim/GUIContainerStop.cpp
index fef63ed..405176a 100644
--- a/src/guisim/GUIContainerStop.cpp
+++ b/src/guisim/GUIContainerStop.cpp
@@ -3,7 +3,7 @@
/// @author Melanie Weber
/// @author Andreas Kendziorra
/// @date Wed, 01.08.2014
-/// @version $Id: GUIContainerStop.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUIContainerStop.cpp 18258 2015-04-21 13:20:47Z behrisch $
///
// A lane area vehicles can halt at (gui-version)
/****************************************************************************/
@@ -65,7 +65,7 @@
// ===========================================================================
GUIContainerStop::GUIContainerStop(const std::string& id, const std::vector<std::string>& lines, MSLane& lane,
SUMOReal frompos, SUMOReal topos)
- : MSContainerStop(id, lines, lane, frompos, topos),
+ : MSStoppingPlace(id, lines, lane, frompos, topos),
GUIGlObject_AbstractAdd("containerStop", GLO_TRIGGER, id) {
myFGShape = lane.getShape();
myFGShape.move2side((SUMOReal) 1.65);
@@ -115,7 +115,7 @@ GUIContainerStop::getParameterWindow(GUIMainWindow& app,
// add items
ret->mkItem("begin position [m]", false, myBegPos);
ret->mkItem("end position [m]", false, myEndPos);
- ret->mkItem("container number [#]", true, new FunctionBinding<GUIContainerStop, unsigned int>(this, &MSContainerStop::getContainerNumber));
+ ret->mkItem("container number [#]", true, new FunctionBinding<GUIContainerStop, unsigned int>(this, &MSStoppingPlace::getTransportableNumber));
// close building
ret->closeBuilding();
return ret;
@@ -168,7 +168,7 @@ GUIContainerStop::drawGL(const GUIVisualizationSettings& s) const {
glPopMatrix();
glPopName();
drawName(getCenteringBoundary().getCenter(), s.scale, s.addName);
- for (std::vector<MSContainer*>::const_iterator i = myWaitingContainers.begin(); i != myWaitingContainers.end(); ++i) {
+ for (std::vector<MSTransportable*>::const_iterator i = myWaitingTransportables.begin(); i != myWaitingTransportables.end(); ++i) {
glTranslated(0, 1, 0); // make multiple containers viewable
static_cast<GUIContainer*>(*i)->drawGL(s);
}
diff --git a/src/guisim/GUIContainerStop.h b/src/guisim/GUIContainerStop.h
index 66b919a..4fdc289 100644
--- a/src/guisim/GUIContainerStop.h
+++ b/src/guisim/GUIContainerStop.h
@@ -3,7 +3,7 @@
/// @author Melanie Weber
/// @author Andreas Kendziorra
/// @date Wed, 01.08.2014
-/// @version $Id: GUIContainerStop.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUIContainerStop.h 18258 2015-04-21 13:20:47Z behrisch $
///
// A lane area vehicles can halt at (gui-version)
/****************************************************************************/
@@ -36,7 +36,7 @@
#include <utils/common/Command.h>
#include <utils/common/VectorHelper.h>
#include <utils/geom/PositionVector.h>
-#include <microsim/trigger/MSContainerStop.h>
+#include <microsim/MSStoppingPlace.h>
#include <utils/gui/globjects/GUIGlObject.h>
#include <utils/gui/globjects/GUIGlObject_AbstractAdd.h>
#include <utils/gui/globjects/GUIGLObjectPopupMenu.h>
@@ -60,14 +60,14 @@ class GUIManipulator;
* @class GUIContainerStop
* @brief A lane area vehicles can halt at (gui-version)
*
- * This gui-version of a container-stop extends MSContainerStop by methods for displaying
+ * This gui-version of a container-stop extends MSStoppingPlace by methods for displaying
* and interaction.
*
- * @see MSContainerStop
+ * @see MSStoppingPlace
* @see GUIGlObject_AbstractAdd
* @see GUIGlObject
*/
-class GUIContainerStop : public MSContainerStop, public GUIGlObject_AbstractAdd {
+class GUIContainerStop : public MSStoppingPlace, public GUIGlObject_AbstractAdd {
public:
/** @brief Constructor
* @param[in] idStorage The gl-id storage for giving this object an gl-id
diff --git a/src/guisim/GUIEdge.cpp b/src/guisim/GUIEdge.cpp
index f9a1a91..adb5d41 100644
--- a/src/guisim/GUIEdge.cpp
+++ b/src/guisim/GUIEdge.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Sept 2002
-/// @version $Id: GUIEdge.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUIEdge.cpp 18467 2015-05-29 03:50:41Z behrisch $
///
// A road/street connecting two junctions (gui-version)
/****************************************************************************/
@@ -268,7 +268,7 @@ GUIEdge::drawGL(const GUIVisualizationSettings& s) const {
}
if (s.scale * s.personSize.getExaggeration(s) > s.personSize.minSize) {
myLock.lock();
- for (std::set<MSPerson*>::const_iterator i = myPersons.begin(); i != myPersons.end(); ++i) {
+ for (std::set<MSTransportable*>::const_iterator i = myPersons.begin(); i != myPersons.end(); ++i) {
GUIPerson* person = dynamic_cast<GUIPerson*>(*i);
assert(person != 0);
person->drawGL(s);
@@ -277,7 +277,7 @@ GUIEdge::drawGL(const GUIVisualizationSettings& s) const {
}
if (s.scale * s.containerSize.getExaggeration(s) > s.containerSize.minSize) {
myLock.lock();
- for (std::set<MSContainer*>::const_iterator i = myContainers.begin(); i != myContainers.end(); ++i) {
+ for (std::set<MSTransportable*>::const_iterator i = myContainers.begin(); i != myContainers.end(); ++i) {
GUIContainer* container = dynamic_cast<GUIContainer*>(*i);
assert(container != 0);
container->drawGL(s);
@@ -509,7 +509,7 @@ GUIEdge::getVehicleColorValue(size_t activeScheme, MSBaseVehicle* veh) const {
case 10:
return 0; // invalid getLastLaneChangeOffset();
case 11:
- return MIN2(veh->getMaxSpeed(), getVehicleMaxSpeed(veh));
+ return getVehicleMaxSpeed(veh);
case 12:
return 0; // invalid getCO2Emissions();
case 13:
diff --git a/src/guisim/GUIEdge.h b/src/guisim/GUIEdge.h
index 8577ee0..6d50178 100644
--- a/src/guisim/GUIEdge.h
+++ b/src/guisim/GUIEdge.h
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: GUIEdge.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUIEdge.h 18274 2015-04-22 15:00:44Z behrisch $
///
// A road/street connecting two junctions (gui-version)
/****************************************************************************/
@@ -144,23 +144,23 @@ public:
//@}
- void addPerson(MSPerson* p) const {
+ void addPerson(MSTransportable* p) const {
AbstractMutex::ScopedLocker locker(myLock);
MSEdge::addPerson(p);
}
- void removePerson(MSPerson* p) const {
+ void removePerson(MSTransportable* p) const {
AbstractMutex::ScopedLocker locker(myLock);
MSEdge::removePerson(p);
}
- void addContainer(MSContainer* c) const {
+ void addContainer(MSTransportable* c) const {
AbstractMutex::ScopedLocker locker(myLock);
MSEdge::addContainer(c);
}
- void removeContainer(MSContainer* c) const {
+ void removeContainer(MSTransportable* c) const {
AbstractMutex::ScopedLocker locker(myLock);
MSEdge::removeContainer(c);
}
diff --git a/src/guisim/GUIJunctionWrapper.cpp b/src/guisim/GUIJunctionWrapper.cpp
index 445244d..2bf6424 100644
--- a/src/guisim/GUIJunctionWrapper.cpp
+++ b/src/guisim/GUIJunctionWrapper.cpp
@@ -6,7 +6,7 @@
/// @author Laura Bieker
/// @author Andreas Gaubatz
/// @date Mon, 1 Jul 2003
-/// @version $Id: GUIJunctionWrapper.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUIJunctionWrapper.cpp 18201 2015-04-15 10:23:04Z namdre $
///
// }
/****************************************************************************/
@@ -79,7 +79,7 @@ GUIJunctionWrapper::GUIJunctionWrapper(MSJunction& junction)
#else
myIsInner = false;
#endif
- myAmWaterway = true;
+ myAmWaterway = myJunction.getIncoming().size() + myJunction.getOutgoing().size() > 0;
for (ConstMSEdgeVector::const_iterator it = myJunction.getIncoming().begin(); it != myJunction.getIncoming().end(); ++it) {
if (!(*it)->isInternal() && !isWaterway((*it)->getPermissions())) {
myAmWaterway = false;
diff --git a/src/guisim/GUILane.cpp b/src/guisim/GUILane.cpp
index 9bd4741..5aeb040 100644
--- a/src/guisim/GUILane.cpp
+++ b/src/guisim/GUILane.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: GUILane.cpp 18114 2015-03-20 08:06:51Z namdre $
+/// @version $Id: GUILane.cpp 18639 2015-08-17 13:59:19Z namdre $
///
// Representation of a lane in the micro simulation (gui-version)
/****************************************************************************/
@@ -234,7 +234,7 @@ GUILane::drawTextAtEnd(const std::string& text, const PositionVector& shape, SUM
const SUMOReal rot = RAD2DEG(atan2((end.x() - f.x()), (f.y() - end.y())));
glTranslated(end.x(), end.y(), 0);
glRotated(rot, 0, 0, 1);
- GLHelper::drawText(text, Position(x, 0), 0, .6, RGBColor(128, 128, 255, 255), 180);
+ GLHelper::drawText(text, Position(x, 0.26), 0, .6, RGBColor(128, 128, 255, 255), 180);
glPopMatrix();
}
@@ -355,6 +355,12 @@ GUILane::drawArrows() const {
GLHelper::drawBoxLine(Position(0.5, 2.5), 180, 1, .05);
GLHelper::drawTriangleAtEnd(Line(Position(0.5, 2.5), Position(0.5, 4)), (SUMOReal) 1, (SUMOReal) .25);
break;
+ case LINKDIR_TURN_LEFTHAND:
+ GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
+ GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05);
+ GLHelper::drawBoxLine(Position(-0.5, 2.5), -180, 1, .05);
+ GLHelper::drawTriangleAtEnd(Line(Position(-0.5, 2.5), Position(-0.5, 4)), (SUMOReal) 1, (SUMOReal) .25);
+ break;
case LINKDIR_LEFT:
GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
GLHelper::drawBoxLine(Position(0, 2.5), 90, 1, .05);
@@ -583,7 +589,7 @@ GUILane::drawMarkings(const GUIVisualizationSettings& s, SUMOReal scale) const {
getShape(),
getShapeRotations(),
getShapeLengths(),
- (getHalfWidth() + SUMO_const_laneOffset) * scale);
+ (myHalfLaneWidth + SUMO_const_laneOffset) * scale);
glPopMatrix();
}
@@ -810,7 +816,12 @@ GUILane::getColorValue(size_t activeScheme) const {
case SVC_SHIP:
return 4;
default:
- return 0;
+ break;
+ }
+ if ((myPermissions & SVC_PASSENGER) != 0 || isRailway(myPermissions)) {
+ return 0;
+ } else {
+ return 5;
}
case 1:
return gSelected.isSelected(getType(), getGlID()) ||
diff --git a/src/guisim/GUILane.h b/src/guisim/GUILane.h
index 5516389..4dbdd09 100644
--- a/src/guisim/GUILane.h
+++ b/src/guisim/GUILane.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: GUILane.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUILane.h 18637 2015-08-17 10:15:18Z namdre $
///
// Representation of a lane in the micro simulation (gui-version)
/****************************************************************************/
@@ -203,11 +203,6 @@ public:
/// @brief draw crossties for railroads or pedestrian crossings
void drawCrossties(SUMOReal length, SUMOReal spacing, SUMOReal halfWidth) const;
- SUMOReal getHalfWidth() const {
- return myHalfLaneWidth;
- }
-
-
SUMOReal getEdgeLaneNumber() const;
/** @brief Returns the stored traveltime for the edge of this lane
diff --git a/src/guisim/GUIPerson.cpp b/src/guisim/GUIPerson.cpp
index 79f9f35..808445c 100644
--- a/src/guisim/GUIPerson.cpp
+++ b/src/guisim/GUIPerson.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: GUIPerson.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUIPerson.cpp 18274 2015-04-22 15:00:44Z behrisch $
///
// A MSPerson extended by some values for usage within the gui
/****************************************************************************/
@@ -114,7 +114,7 @@ GUIPerson::GUIPersonPopupMenu::onCmdHideWalkingareaPath(FXObject*, FXSelector, v
/* -------------------------------------------------------------------------
* GUIPerson - methods
* ----------------------------------------------------------------------- */
-GUIPerson::GUIPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPerson::MSPersonPlan* plan) :
+GUIPerson::GUIPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan) :
MSPerson(pars, vtype, plan),
GUIGlObject(GLO_PERSON, pars->id)
{ }
diff --git a/src/guisim/GUIPerson.h b/src/guisim/GUIPerson.h
index 9edda64..161d227 100644
--- a/src/guisim/GUIPerson.h
+++ b/src/guisim/GUIPerson.h
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: GUIPerson.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIPerson.h 18274 2015-04-22 15:00:44Z behrisch $
///
// A MSVehicle extended by some values for usage within the gui
/****************************************************************************/
@@ -62,7 +62,7 @@ class GUIPerson : public MSPerson, public GUIGlObject {
public:
/** @brief Constructor
*/
- GUIPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPerson::MSPersonPlan* plan);
+ GUIPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan);
/// @brief destructor
diff --git a/src/guisim/GUIPersonControl.cpp b/src/guisim/GUIPersonControl.cpp
index 74aa8ec..622387e 100644
--- a/src/guisim/GUIPersonControl.cpp
+++ b/src/guisim/GUIPersonControl.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Wed, 13.06.2012
-/// @version $Id: GUIPersonControl.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIPersonControl.cpp 18274 2015-04-22 15:00:44Z behrisch $
///
// GUI-version of the person control for building gui persons
/****************************************************************************/
@@ -52,7 +52,7 @@ GUIPersonControl::~GUIPersonControl() {
MSPerson*
-GUIPersonControl::buildPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPerson::MSPersonPlan* plan) const {
+GUIPersonControl::buildPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan) const {
return new GUIPerson(pars, vtype, plan);
}
@@ -60,7 +60,7 @@ GUIPersonControl::buildPerson(const SUMOVehicleParameter* pars, const MSVehicleT
void
GUIPersonControl::insertPersonIDs(std::vector<GUIGlID>& into) {
into.reserve(myPersons.size());
- for (std::map<std::string, MSPerson*>::const_iterator it = myPersons.begin(); it != myPersons.end(); ++it) {
+ for (std::map<std::string, MSTransportable*>::const_iterator it = myPersons.begin(); it != myPersons.end(); ++it) {
into.push_back(static_cast<const GUIPerson*>((*it).second)->getGlID());
}
}
diff --git a/src/guisim/GUIPersonControl.h b/src/guisim/GUIPersonControl.h
index 1d668b7..75461c0 100644
--- a/src/guisim/GUIPersonControl.h
+++ b/src/guisim/GUIPersonControl.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Wed, 13.06.2012
-/// @version $Id: GUIPersonControl.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIPersonControl.h 18274 2015-04-22 15:00:44Z behrisch $
///
// GUI-version of the person control for building gui persons
/****************************************************************************/
@@ -57,7 +57,7 @@ public:
* @param[in] vtype The type (reusing vehicle type container here)
* @param[in] plan This person's plan
*/
- virtual MSPerson* buildPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPerson::MSPersonPlan* plan) const;
+ virtual MSPerson* buildPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan) const;
/** @brief Returns the list of all known persons by gl-id
* @param[fill] into The list to fill with vehicle ids
diff --git a/src/guisim/GUIVehicle.cpp b/src/guisim/GUIVehicle.cpp
index bf2b13b..8dbf4ea 100644
--- a/src/guisim/GUIVehicle.cpp
+++ b/src/guisim/GUIVehicle.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: GUIVehicle.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUIVehicle.cpp 18702 2015-08-24 07:10:47Z namdre $
///
// A MSVehicle extended by some values for usage within the gui
/****************************************************************************/
@@ -322,7 +322,7 @@ GUIParameterTableWindow*
GUIVehicle::getParameterWindow(GUIMainWindow& app,
GUISUMOAbstractView&) {
GUIParameterTableWindow* ret =
- new GUIParameterTableWindow(app, *this, 36);
+ new GUIParameterTableWindow(app, *this, 40);
// add items
ret->mkItem("lane [id]", false, myLane->getID());
ret->mkItem("position [m]", true,
@@ -376,6 +376,11 @@ GUIVehicle::getParameterWindow(GUIMainWindow& app,
str << (*i)->getID().substr(0, (*i)->getID().find(getID()));
}
ret->mkItem("devices", false, str.str());
+ ret->mkItem("persons", true,
+ new FunctionBinding<GUIVehicle, unsigned int>(this, &GUIVehicle::getPersonNumber));
+ ret->mkItem("containers", true,
+ new FunctionBinding<GUIVehicle, unsigned int>(this, &GUIVehicle::getContainerNumber));
+
ret->mkItem("parameters [key:val]", false, toString(getParameter().getMap()));
ret->mkItem("", false, "");
ret->mkItem("Type Information:", false, "");
@@ -389,6 +394,9 @@ GUIVehicle::getParameterWindow(GUIMainWindow& app,
ret->mkItem("maximum deceleration [m/s^2]", false, getCarFollowModel().getMaxDecel());
ret->mkItem("imperfection (sigma)", false, getCarFollowModel().getImperfection());
ret->mkItem("reaction time (tau)", false, getCarFollowModel().getHeadwayTime());
+ ret->mkItem("person capacity", false, myType->getPersonCapacity());
+ ret->mkItem("container capacity", false, myType->getContainerCapacity());
+
ret->mkItem("type parameters [key:val]", false, toString(myType->getParameter().getMap()));
// close building
ret->closeBuilding();
@@ -1090,9 +1098,9 @@ GUIVehicle::drawGL(const GUIVisualizationSettings& s) const {
}
glPopName();
if (myPersonDevice != 0) {
- const std::vector<MSPerson*>& ps = myPersonDevice->getPersons();
+ const std::vector<MSTransportable*>& ps = myPersonDevice->getPersons();
size_t personIndex = 0;
- for (std::vector<MSPerson*>::const_iterator i = ps.begin(); i != ps.end(); ++i) {
+ for (std::vector<MSTransportable*>::const_iterator i = ps.begin(); i != ps.end(); ++i) {
GUIPerson* person = dynamic_cast<GUIPerson*>(*i);
assert(person != 0);
person->setPositionInVehicle(getSeatPosition(personIndex++));
@@ -1100,9 +1108,9 @@ GUIVehicle::drawGL(const GUIVisualizationSettings& s) const {
}
}
if (myContainerDevice != 0) {
- const std::vector<MSContainer*>& cs = myContainerDevice->getContainers();
+ const std::vector<MSTransportable*>& cs = myContainerDevice->getContainers();
size_t containerIndex = 0;
- for (std::vector<MSContainer*>::const_iterator i = cs.begin(); i != cs.end(); ++i) {
+ for (std::vector<MSTransportable*>::const_iterator i = cs.begin(); i != cs.end(); ++i) {
GUIContainer* container = dynamic_cast<GUIContainer*>(*i);
assert(container != 0);
container->setPositionInVehicle(getSeatPosition(containerIndex++));
@@ -1272,7 +1280,7 @@ GUIVehicle::getColorValue(size_t activeScheme) const {
case 10:
return getLastLaneChangeOffset();
case 11:
- return MIN2(getMaxSpeed(), getLane()->getVehicleMaxSpeed(this));
+ return getLane()->getVehicleMaxSpeed(this);
case 12:
return getCO2Emissions();
case 13:
diff --git a/src/guisim/Makefile.am b/src/guisim/Makefile.am
index 211f494..add2049 100644
--- a/src/guisim/Makefile.am
+++ b/src/guisim/Makefile.am
@@ -17,6 +17,7 @@ GUINet.cpp GUINet.h \
GUITrafficLightLogicWrapper.cpp GUITrafficLightLogicWrapper.h \
GUITriggeredRerouter.cpp GUITriggeredRerouter.h \
GUICalibrator.cpp GUICalibrator.h \
+GUIChrgStn.cpp GUIChrgStn.h \
GUIVehicle.cpp GUIVehicle.h GUIVehicleControl.cpp GUIVehicleControl.h \
GUI_E2_ZS_Collector.cpp GUI_E2_ZS_Collector.h \
GUI_E2_ZS_CollectorOverLanes.cpp GUI_E2_ZS_CollectorOverLanes.h
diff --git a/src/guisim/Makefile.in b/src/guisim/Makefile.in
index 037f9a7..8d0fa93 100644
--- a/src/guisim/Makefile.in
+++ b/src/guisim/Makefile.in
@@ -108,8 +108,8 @@ am_libguisim_a_OBJECTS = GUIBusStop.$(OBJEXT) GUIContainer.$(OBJEXT) \
GUIPersonControl.$(OBJEXT) GUINet.$(OBJEXT) \
GUITrafficLightLogicWrapper.$(OBJEXT) \
GUITriggeredRerouter.$(OBJEXT) GUICalibrator.$(OBJEXT) \
- GUIVehicle.$(OBJEXT) GUIVehicleControl.$(OBJEXT) \
- GUI_E2_ZS_Collector.$(OBJEXT) \
+ GUIChrgStn.$(OBJEXT) GUIVehicle.$(OBJEXT) \
+ GUIVehicleControl.$(OBJEXT) GUI_E2_ZS_Collector.$(OBJEXT) \
GUI_E2_ZS_CollectorOverLanes.$(OBJEXT)
libguisim_a_OBJECTS = $(am_libguisim_a_OBJECTS)
AM_V_P = $(am__v_P_ at AM_V@)
@@ -355,6 +355,7 @@ GUINet.cpp GUINet.h \
GUITrafficLightLogicWrapper.cpp GUITrafficLightLogicWrapper.h \
GUITriggeredRerouter.cpp GUITriggeredRerouter.h \
GUICalibrator.cpp GUICalibrator.h \
+GUIChrgStn.cpp GUIChrgStn.h \
GUIVehicle.cpp GUIVehicle.h GUIVehicleControl.cpp GUIVehicleControl.h \
GUI_E2_ZS_Collector.cpp GUI_E2_ZS_Collector.h \
GUI_E2_ZS_CollectorOverLanes.cpp GUI_E2_ZS_CollectorOverLanes.h
@@ -411,6 +412,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GUIBusStop.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GUICalibrator.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GUIChrgStn.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GUIContainer.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GUIContainerControl.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GUIContainerStop.Po at am__quote@
diff --git a/src/guisim_main.cpp b/src/guisim_main.cpp
index 54eff4c..6bad2af 100644
--- a/src/guisim_main.cpp
+++ b/src/guisim_main.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Felix Brack
/// @date Tue, 20 Nov 2001
-/// @version $Id: guisim_main.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: guisim_main.cpp 18512 2015-06-30 07:56:13Z behrisch $
///
// Main for GUISIM
/****************************************************************************/
@@ -77,13 +77,6 @@ main(int argc, char** argv) {
try {
// initialise subsystems
XMLSubSys::init();
- MSFrame::fillOptions();
- OptionsIO::getOptions(false, argc, argv);
- if (oc.processMetaOptions(false)) {
- SystemFrame::close();
- return 0;
- }
- XMLSubSys::setValidation(oc.getString("xml-validation"), oc.getString("xml-validation.net"));
// Make application
FXApp application("SUMO GUISimulation", "DLR");
// Open display
@@ -97,12 +90,13 @@ main(int argc, char** argv) {
GUIApplicationWindow* window =
new GUIApplicationWindow(&application, "*.sumo.cfg,*.sumocfg");
gSchemeStorage.init(&application);
- window->dependentBuild(oc.getBool("game"));
+ window->dependentBuild();
// Create app
application.addSignal(SIGINT, window, MID_QUIT);
application.create();
// Load configuration given on command line
- if (oc.isSet("configuration-file") || oc.isSet("net-file")) {
+ if (argc > 1) {
+ OptionsIO::setArgs(argc, argv);
window->loadOnStartup();
}
// Run
diff --git a/src/jtrrouter/ROJTRRouter.cpp b/src/jtrrouter/ROJTRRouter.cpp
index edf9cb1..1dc8bd9 100644
--- a/src/jtrrouter/ROJTRRouter.cpp
+++ b/src/jtrrouter/ROJTRRouter.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 20 Jan 2004
-/// @version $Id: ROJTRRouter.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ROJTRRouter.cpp 18467 2015-05-29 03:50:41Z behrisch $
///
// Computes routes using junction turning percentages
/****************************************************************************/
@@ -64,7 +64,7 @@ ROJTRRouter::compute(const ROEdge* from, const ROEdge* to,
std::set<const ROEdge*> avoidEdges;
// route until a sinks has been found
while (current != 0 && current != to &&
- current->getType() != ROEdge::ET_SINK &&
+ current->getFunc() != ROEdge::ET_SINK &&
(int)into.size() < myMaxEdges) {
into.push_back(current);
if (!myAllowLoops) {
diff --git a/src/jtrrouter/ROJTRTurnDefLoader.cpp b/src/jtrrouter/ROJTRTurnDefLoader.cpp
index bf12626..88e2e4a 100644
--- a/src/jtrrouter/ROJTRTurnDefLoader.cpp
+++ b/src/jtrrouter/ROJTRTurnDefLoader.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 20 Jan 2004
-/// @version $Id: ROJTRTurnDefLoader.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ROJTRTurnDefLoader.cpp 18467 2015-05-29 03:50:41Z behrisch $
///
// Loader for the of turning percentages and source/sink definitions
/****************************************************************************/
@@ -84,7 +84,7 @@ ROJTRTurnDefLoader::myStartElement(int element,
if (edge == 0) {
throw ProcessError("The edge '" + id + "' declared as a sink is not known.");
}
- edge->setType(ROEdge::ET_SINK);
+ edge->setFunc(ROEdge::ET_SINK);
}
}
break;
@@ -98,7 +98,7 @@ ROJTRTurnDefLoader::myStartElement(int element,
if (edge == 0) {
throw ProcessError("The edge '" + id + "' declared as a source is not known.");
}
- edge->setType(ROEdge::ET_SOURCE);
+ edge->setFunc(ROEdge::ET_SOURCE);
}
}
break;
diff --git a/src/jtrrouter/jtrrouter_main.cpp b/src/jtrrouter/jtrrouter_main.cpp
index b68a890..3e98894 100644
--- a/src/jtrrouter/jtrrouter_main.cpp
+++ b/src/jtrrouter/jtrrouter_main.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 20 Jan 2004
-/// @version $Id: jtrrouter_main.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: jtrrouter_main.cpp 18486 2015-06-11 11:10:09Z behrisch $
///
// Main for JTRROUTER
/****************************************************************************/
@@ -133,7 +133,7 @@ loadJTRDefinitions(RONet& net, OptionsCont& oc) {
if (edge == 0) {
throw ProcessError("The edge '" + *i + "' declared as a sink is not known.");
}
- edge->setType(ROEdge::ET_SINK);
+ edge->setFunc(ROEdge::ET_SINK);
}
}
}
@@ -174,7 +174,8 @@ main(int argc, char** argv) {
// initialise the application system (messaging, xml, options)
XMLSubSys::init();
ROJTRFrame::fillOptions();
- OptionsIO::getOptions(true, argc, argv);
+ OptionsIO::setArgs(argc, argv);
+ OptionsIO::getOptions();
if (oc.processMetaOptions(argc < 2)) {
SystemFrame::close();
return 0;
diff --git a/src/marouter/Makefile.am b/src/marouter/Makefile.am
index 11d15f3..b3435b4 100644
--- a/src/marouter/Makefile.am
+++ b/src/marouter/Makefile.am
@@ -8,7 +8,8 @@ marouter_SOURCES = marouter_main.cpp \
ROMAAssignments.cpp ROMAAssignments.h \
ROMAEdge.cpp ROMAEdge.h \
ROMAEdgeBuilder.cpp ROMAEdgeBuilder.h \
-ROMAFrame.cpp ROMAFrame.h
+ROMAFrame.cpp ROMAFrame.h \
+ROMARouteHandler.cpp ROMARouteHandler.h
marouter_LDFLAGS = $(XERCES_LDFLAGS)
diff --git a/src/marouter/Makefile.in b/src/marouter/Makefile.in
index ba563cb..0cb8c3b 100644
--- a/src/marouter/Makefile.in
+++ b/src/marouter/Makefile.in
@@ -95,7 +95,8 @@ am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am_marouter_OBJECTS = marouter_main.$(OBJEXT) \
ROMAAssignments.$(OBJEXT) ROMAEdge.$(OBJEXT) \
- ROMAEdgeBuilder.$(OBJEXT) ROMAFrame.$(OBJEXT)
+ ROMAEdgeBuilder.$(OBJEXT) ROMAFrame.$(OBJEXT) \
+ ROMARouteHandler.$(OBJEXT)
marouter_OBJECTS = $(am_marouter_OBJECTS)
am__DEPENDENCIES_1 =
marouter_DEPENDENCIES = ../router/librouter.a ../od/libod.a \
@@ -339,7 +340,8 @@ marouter_SOURCES = marouter_main.cpp \
ROMAAssignments.cpp ROMAAssignments.h \
ROMAEdge.cpp ROMAEdge.h \
ROMAEdgeBuilder.cpp ROMAEdgeBuilder.h \
-ROMAFrame.cpp ROMAFrame.h
+ROMAFrame.cpp ROMAFrame.h \
+ROMARouteHandler.cpp ROMARouteHandler.h
marouter_LDFLAGS = $(XERCES_LDFLAGS)
marouter_LDADD = ../router/librouter.a \
@@ -455,6 +457,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ROMAEdge.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ROMAEdgeBuilder.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ROMAFrame.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ROMARouteHandler.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/marouter_main.Po at am__quote@
.cpp.o:
diff --git a/src/marouter/ROMAAssignments.cpp b/src/marouter/ROMAAssignments.cpp
index ea8476d..f0e5ae0 100644
--- a/src/marouter/ROMAAssignments.cpp
+++ b/src/marouter/ROMAAssignments.cpp
@@ -4,7 +4,7 @@
/// @author Laura Bieker
/// @author Michael Behrisch
/// @date Feb 2013
-/// @version $Id: ROMAAssignments.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ROMAAssignments.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Assignment methods
/****************************************************************************/
@@ -51,16 +51,16 @@
// static member variables
// ===========================================================================
std::map<const ROEdge* const, SUMOReal> ROMAAssignments::myPenalties;
-ROVehicle* ROMAAssignments::myDefaultVehicle = 0;
// ===========================================================================
// method definitions
// ===========================================================================
-ROMAAssignments::ROMAAssignments(const SUMOTime begin, const SUMOTime end,
+ROMAAssignments::ROMAAssignments(const SUMOTime begin, const SUMOTime end, const bool timeSplit,
RONet& net, ODMatrix& matrix,
- SUMOAbstractRouter<ROEdge, ROVehicle>& router) : myBegin(begin), myEnd(end), myNet(net), myMatrix(matrix), myRouter(router) {
+ SUMOAbstractRouter<ROEdge, ROVehicle>& router)
+ : myBegin(begin), myEnd(end), myTimeSplit(timeSplit), myNet(net), myMatrix(matrix), myRouter(router) {
myDefaultVehicle = new ROVehicle(SUMOVehicleParameter(), 0, net.getVehicleTypeSecure(DEFAULT_VTYPE_ID), &net);
}
@@ -72,7 +72,7 @@ ROMAAssignments::~ROMAAssignments() {
// based on the definitions in PTV-Validate and in the VISUM-K�ln network
SUMOReal
ROMAAssignments::capacityConstraintFunction(const ROEdge* edge, const SUMOReal flow) const {
- if (edge->getType() == ROEdge::ET_DISTRICT) {
+ if (edge->getFunc() == ROEdge::ET_DISTRICT) {
return 0;
}
const int roadClass = -edge->getPriority();
@@ -158,19 +158,32 @@ ROMAAssignments::getKPaths(const int kPaths, const SUMOReal penalty) {
void
+ROMAAssignments::resetFlows() {
+ for (std::map<std::string, ROEdge*>::const_iterator i = myNet.getEdgeMap().begin(); i != myNet.getEdgeMap().end(); ++i) {
+ ROMAEdge* edge = static_cast<ROMAEdge*>(i->second);
+ edge->setFlow(STEPS2TIME(myBegin), STEPS2TIME(myEnd), 0.);
+ edge->setHelpFlow(STEPS2TIME(myBegin), STEPS2TIME(myEnd), 0.);
+ }
+}
+
+
+void
ROMAAssignments::incremental(const int numIter) {
for (int t = 0; t < numIter; t++) {
for (std::vector<ODCell*>::const_iterator i = myMatrix.getCells().begin(); i != myMatrix.getCells().end(); i++) {
ODCell* c = *i;
ConstROEdgeVector edges;
- SUMOReal linkFlow = c->vehicleNumber / numIter;
- myRouter.compute(myNet.getEdge(c->origin + "-source"), myNet.getEdge(c->destination + "-sink"), myDefaultVehicle, 0, edges);
+ const SUMOReal linkFlow = c->vehicleNumber / numIter;
+ const SUMOTime begin = myTimeSplit ? c->begin : myBegin;
+ const SUMOTime end = myTimeSplit ? c->end : myEnd;
+ myRouter.compute(myNet.getEdge(c->origin + "-source"), myNet.getEdge(c->destination + "-sink"), myDefaultVehicle, begin, edges);
SUMOReal costs = 0.;
for (ConstROEdgeVector::iterator e = edges.begin(); e != edges.end(); e++) {
- ROEdge* edge = myNet.getEdge((*e)->getID());
- edge->addEffort(linkFlow, STEPS2TIME(myBegin), STEPS2TIME(myEnd));
- const SUMOReal travelTime = capacityConstraintFunction(edge, linkFlow);
- edge->addTravelTime(travelTime, STEPS2TIME(myBegin), STEPS2TIME(myEnd));
+ ROMAEdge* edge = static_cast<ROMAEdge*>(myNet.getEdge((*e)->getID()));
+ const SUMOReal newFlow = edge->getFlow(STEPS2TIME(begin)) + linkFlow;
+ edge->setFlow(STEPS2TIME(begin), STEPS2TIME(end), newFlow);
+ const SUMOReal travelTime = capacityConstraintFunction(edge, newFlow);
+ edge->addTravelTime(travelTime, STEPS2TIME(begin), STEPS2TIME(end));
costs += travelTime;
}
addRoute(edges, c->pathsVector, c->origin + c->destination + toString(c->pathsVector.size()), costs, linkFlow);
@@ -201,7 +214,7 @@ ROMAAssignments::sue(const int maxOuterIteration, const int maxInnerIteration, c
// assign edge flow deltas
for (ConstROEdgeVector::const_iterator e = r->getEdgeVector().begin(); e != r->getEdgeVector().end(); e++) {
ROMAEdge* edge = static_cast<ROMAEdge*>(myNet.getEdge((*e)->getID()));
- edge->setHelpFlow(edge->getHelpFlow() + pathFlow);
+ edge->setHelpFlow(STEPS2TIME(myBegin), STEPS2TIME(myEnd), edge->getHelpFlow(STEPS2TIME(myBegin)) + pathFlow);
}
}
}
@@ -209,12 +222,12 @@ ROMAAssignments::sue(const int maxOuterIteration, const int maxInnerIteration, c
int unstableEdges = 0;
for (std::map<std::string, ROEdge*>::const_iterator i = myNet.getEdgeMap().begin(); i != myNet.getEdgeMap().end(); ++i) {
ROMAEdge* edge = static_cast<ROMAEdge*>((*i).second);
- const SUMOReal oldFlow = edge->getEffort(myDefaultVehicle, 0.);
+ const SUMOReal oldFlow = edge->getFlow(STEPS2TIME(myBegin));
SUMOReal newFlow = oldFlow;
if (inner == 0 && outer == 0) {
- newFlow += edge->getHelpFlow();
+ newFlow += edge->getHelpFlow(STEPS2TIME(myBegin));
} else {
- newFlow += (edge->getHelpFlow() - oldFlow) / (inner + 1);
+ newFlow += (edge->getHelpFlow(STEPS2TIME(myBegin)) - oldFlow) / (inner + 1);
}
// if not lohse:
if (newFlow > 0.) {
@@ -229,10 +242,10 @@ ROMAAssignments::sue(const int maxOuterIteration, const int maxInnerIteration, c
unstableEdges++;
newFlow = 0.;
}
- edge->addEffort(newFlow, STEPS2TIME(myBegin), STEPS2TIME(myEnd));
+ edge->setFlow(STEPS2TIME(myBegin), STEPS2TIME(myEnd), newFlow);
const SUMOReal travelTime = capacityConstraintFunction(edge, newFlow);
edge->addTravelTime(travelTime, STEPS2TIME(myBegin), STEPS2TIME(myEnd));
- edge->setHelpFlow(0.);
+ edge->setHelpFlow(STEPS2TIME(myBegin), STEPS2TIME(myEnd), 0.);
}
// if stable break
if (unstableEdges == 0) {
diff --git a/src/marouter/ROMAAssignments.h b/src/marouter/ROMAAssignments.h
index 9f3773e..b01d953 100644
--- a/src/marouter/ROMAAssignments.h
+++ b/src/marouter/ROMAAssignments.h
@@ -4,7 +4,7 @@
/// @author Laura Bieker
/// @author Michael Behrisch
/// @date Feb 2013
-/// @version $Id: ROMAAssignments.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ROMAAssignments.h 18675 2015-08-20 20:00:26Z behrisch $
///
// Assignment methods
/****************************************************************************/
@@ -58,14 +58,22 @@ class ROVehicle;
class ROMAAssignments {
public:
/// Constructor
- ROMAAssignments(const SUMOTime begin, const SUMOTime end, RONet& net, ODMatrix& matrix, SUMOAbstractRouter<ROEdge, ROVehicle>& router);
+ ROMAAssignments(const SUMOTime begin, const SUMOTime end, const bool timeSplit,
+ RONet& net, ODMatrix& matrix, SUMOAbstractRouter<ROEdge, ROVehicle>& router);
/// Destructor
~ROMAAssignments();
+ ROVehicle* getDefaultVehicle() {
+ return myDefaultVehicle;
+ }
+
// @brief calculate edge travel time with the given road class and max link speed
SUMOReal capacityConstraintFunction(const ROEdge* edge, const SUMOReal flow) const;
+ // @brief clear effort storage
+ void resetFlows();
+
// @brief incremental method
void incremental(const int numIter);
@@ -124,11 +132,12 @@ private:
private:
const SUMOTime myBegin;
const SUMOTime myEnd;
+ const bool myTimeSplit;
RONet& myNet;
ODMatrix& myMatrix;
SUMOAbstractRouter<ROEdge, ROVehicle>& myRouter;
static std::map<const ROEdge* const, SUMOReal> myPenalties;
- static ROVehicle* myDefaultVehicle;
+ ROVehicle* myDefaultVehicle;
private:
/// @brief Invalidated assignment operator
diff --git a/src/marouter/ROMAEdge.cpp b/src/marouter/ROMAEdge.cpp
index 24a8b9c..d06a9e9 100644
--- a/src/marouter/ROMAEdge.cpp
+++ b/src/marouter/ROMAEdge.cpp
@@ -6,7 +6,7 @@
/// @author Laura Bieker
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: ROMAEdge.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ROMAEdge.cpp 18675 2015-08-20 20:00:26Z behrisch $
///
// A basic edge for routing applications
/****************************************************************************/
@@ -43,7 +43,7 @@
// method definitions
// ===========================================================================
ROMAEdge::ROMAEdge(const std::string& id, RONode* from, RONode* to, unsigned int index, const int priority)
- : ROEdge(id, from, to, index, priority), myHelpFlow(0.) {
+ : ROEdge(id, from, to, index, priority) {
}
diff --git a/src/marouter/ROMAEdge.h b/src/marouter/ROMAEdge.h
index a00a13f..7d5b2ea 100644
--- a/src/marouter/ROMAEdge.h
+++ b/src/marouter/ROMAEdge.h
@@ -6,7 +6,7 @@
/// @author Laura Bieker
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: ROMAEdge.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ROMAEdge.h 18675 2015-08-20 20:00:26Z behrisch $
///
// A basic edge for routing applications
/****************************************************************************/
@@ -86,17 +86,26 @@ public:
*/
virtual void addSuccessor(ROEdge* s, std::string dir = "");
- void setHelpFlow(const SUMOReal flow) {
- myHelpFlow = flow;
+ void setFlow(const SUMOReal begin, const SUMOReal end, const SUMOReal flow) {
+ myFlow.add(begin, end, flow);
}
- SUMOReal getHelpFlow() const {
- return myHelpFlow;
+ SUMOReal getFlow(const SUMOReal time) const {
+ return myFlow.getValue(time);
+ }
+
+ void setHelpFlow(const SUMOReal begin, const SUMOReal end, const SUMOReal flow) {
+ myHelpFlow.add(begin, end, flow);
+ }
+
+ SUMOReal getHelpFlow(const SUMOReal time) const {
+ return myHelpFlow.getValue(time);
}
private:
std::set<ROMAEdge*> myLeftTurns;
- SUMOReal myHelpFlow;
+ ValueTimeLine<SUMOReal> myFlow;
+ ValueTimeLine<SUMOReal> myHelpFlow;
private:
/// @brief Invalidated copy constructor
diff --git a/src/marouter/ROMAEdgeBuilder.cpp b/src/marouter/ROMAEdgeBuilder.cpp
index b0de037..b52c3d7 100644
--- a/src/marouter/ROMAEdgeBuilder.cpp
+++ b/src/marouter/ROMAEdgeBuilder.cpp
@@ -4,7 +4,7 @@
/// @author Laura Bieker
/// @author Michael Behrisch
/// @date Tue, 20 Jan 2004
-/// @version $Id: ROMAEdgeBuilder.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ROMAEdgeBuilder.cpp 18394 2015-05-18 13:26:24Z behrisch $
///
// Interface for building instances of duarouter-edges
/****************************************************************************/
@@ -41,8 +41,7 @@
// ===========================================================================
// method definitions
// ===========================================================================
-ROMAEdgeBuilder::ROMAEdgeBuilder(bool useBoundariesOnOverride, bool interpolate) {
- ROEdge::setTimeLineOptions(useBoundariesOnOverride, useBoundariesOnOverride, interpolate);
+ROMAEdgeBuilder::ROMAEdgeBuilder() {
}
diff --git a/src/marouter/ROMAEdgeBuilder.h b/src/marouter/ROMAEdgeBuilder.h
index f695291..4a0a37c 100644
--- a/src/marouter/ROMAEdgeBuilder.h
+++ b/src/marouter/ROMAEdgeBuilder.h
@@ -4,7 +4,7 @@
/// @author Laura Bieker
/// @author Michael Behrisch
/// @date Tue, 20 Jan 2004
-/// @version $Id: ROMAEdgeBuilder.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ROMAEdgeBuilder.h 18394 2015-05-18 13:26:24Z behrisch $
///
// Interface for building instances of duarouter-edges
/****************************************************************************/
@@ -57,12 +57,8 @@ class RONode;
class ROMAEdgeBuilder : public ROAbstractEdgeBuilder {
public:
/** @brief Constructor
- *
- * @param[in] useBoundariesOnOverride Whether edges shall use a boundary value if the requested is beyond known time scale
- * @param[in] interpolate Whether edges shall interpolate at interval boundaries
- * @todo useBoundariesOnOverride should not be a member of the edges
*/
- ROMAEdgeBuilder(bool useBoundariesOnOverride, bool interpolate);
+ ROMAEdgeBuilder();
/// @brief Destructor
diff --git a/src/marouter/ROMAFrame.cpp b/src/marouter/ROMAFrame.cpp
index dd1ac93..79dea3a 100644
--- a/src/marouter/ROMAFrame.cpp
+++ b/src/marouter/ROMAFrame.cpp
@@ -5,9 +5,9 @@
/// @author Laura Bieker
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: ROMAFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ROMAFrame.cpp 18565 2015-07-14 10:06:34Z behrisch $
///
-// Sets and checks options for dua-routing
+// Sets and checks options for ma-routing
/****************************************************************************/
// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
@@ -115,6 +115,12 @@ ROMAFrame::addImportOptions() {
oc.addSynonyme("od-amitran-files", "amitran");
oc.addDescription("od-amitran-files", "Input", "Loads O/D-matrix in Amitran format from FILE(s)");
+ oc.doRegister("route-files", 'r', new Option_FileName());
+ oc.addSynonyme("route-files", "routes");
+ oc.addSynonyme("route-files", "trips");
+ oc.addSynonyme("route-files", "trip-files");
+ oc.addDescription("route-files", "Input", "Read sumo-routes or trips from FILE(s)");
+
oc.doRegister("weight-files", 'w', new Option_FileName());
oc.addSynonyme("weight-files", "weights");
oc.addDescription("weight-files", "Input", "Read network weights from FILE(s)");
@@ -134,6 +140,9 @@ ROMAFrame::addImportOptions() {
oc.addDescription("end", "Time", "Defines the end time; Later trips will be discarded; Defaults to the maximum time that SUMO can represent");
// register the processing options
+ oc.doRegister("aggregation-interval", new Option_String("3600", "TIME"));
+ oc.addDescription("aggregation-interval", "Processing", "Defines the time interval when aggregating single vehicle input; Defaults to one hour");
+
oc.doRegister("ignore-errors", new Option_Bool(false));
oc.addSynonyme("ignore-errors", "continue-on-unbuild", true);
oc.addSynonyme("ignore-errors", "dismiss-loading-errors", true);
@@ -151,7 +160,7 @@ ROMAFrame::addImportOptions() {
oc.addDescription("weights.expand", "Processing", "Expand weights behind the simulation's end");
oc.doRegister("routing-algorithm", new Option_String("dijkstra"));
- oc.addDescription("routing-algorithm", "Processing", "Select among routing algorithms ['dijkstra', 'astar', 'bulkstar', 'CH', 'CHWrapper']");
+ oc.addDescription("routing-algorithm", "Processing", "Select among routing algorithms ['dijkstra', 'astar', 'CH', 'CHWrapper']");
oc.doRegister("weight-period", new Option_String("3600", "TIME"));
oc.addDescription("weight-period", "Processing", "Aggregation period for the given weight files; triggers rebuilding of Contraction Hierarchy");
@@ -203,6 +212,9 @@ ROMAFrame::addAssignmentOptions() {
oc.doRegister("timeline.day-in-hours", new Option_Bool(false));
oc.addDescription("timeline.day-in-hours", "Processing", "Uses STR as a 24h-timeline definition");
+ oc.doRegister("timesplit", new Option_Bool(false));
+ oc.addDescription("timesplit", "Processing", "Do separate assignments for each time slot");
+
// register macroscopic SUE-settings
oc.doRegister("assignment-method", new Option_String("incremental"));
oc.addDescription("assignment-method", "Processing", "Choose a assignment method: incremental, UE or SUE");
diff --git a/src/marouter/ROMAFrame.h b/src/marouter/ROMAFrame.h
index cf37004..f8e02b3 100644
--- a/src/marouter/ROMAFrame.h
+++ b/src/marouter/ROMAFrame.h
@@ -4,9 +4,9 @@
/// @author Laura Bieker
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: ROMAFrame.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ROMAFrame.h 18507 2015-06-29 05:59:25Z behrisch $
///
-// Sets and checks options for dua-routing
+// Sets and checks options for ma-routing
/****************************************************************************/
// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
diff --git a/src/marouter/ROMARouteHandler.cpp b/src/marouter/ROMARouteHandler.cpp
new file mode 100644
index 0000000..2130d1b
--- /dev/null
+++ b/src/marouter/ROMARouteHandler.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************/
+/// @file ROMARouteHandler.cpp
+/// @author Daniel Krajzewicz
+/// @author Jakob Erdmann
+/// @author Sascha Krieg
+/// @author Michael Behrisch
+/// @date Mon, 9 Jul 2001
+/// @version $Id: ROMARouteHandler.cpp 18756 2015-08-31 19:16:33Z behrisch $
+///
+// Parser and container for routes during their loading
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+#include <utils/xml/SUMOVehicleParserHelper.h>
+#include <od/ODMatrix.h>
+#include "ROMARouteHandler.h"
+
+#ifdef CHECK_MEMORY_LEAKS
+#include <foreign/nvwa/debug_new.h>
+#endif // CHECK_MEMORY_LEAKS
+
+
+// ===========================================================================
+// method definitions
+// ===========================================================================
+ROMARouteHandler::ROMARouteHandler(ODMatrix& matrix) :
+ SUMOSAXHandler(""),
+ myMatrix(matrix) {
+}
+
+
+ROMARouteHandler::~ROMARouteHandler() {
+}
+
+
+void
+ROMARouteHandler::myStartElement(int element,
+ const SUMOSAXAttributes& attrs) {
+ if (element == SUMO_TAG_TRIP || element == SUMO_TAG_VEHICLE) {
+ SUMOVehicleParameter* parameter = SUMOVehicleParserHelper::parseVehicleAttributes(attrs);
+ myMatrix.add(parameter->id, parameter->depart, parameter->fromTaz, parameter->toTaz, parameter->vtypeid);
+ }
+}
+
+
+/****************************************************************************/
diff --git a/src/marouter/ROMARouteHandler.h b/src/marouter/ROMARouteHandler.h
new file mode 100644
index 0000000..fbd5a0b
--- /dev/null
+++ b/src/marouter/ROMARouteHandler.h
@@ -0,0 +1,94 @@
+/****************************************************************************/
+/// @file ROMARouteHandler.h
+/// @author Daniel Krajzewicz
+/// @author Jakob Erdmann
+/// @author Michael Behrisch
+/// @date Mon, 9 Jul 2001
+/// @version $Id: ROMARouteHandler.h 18530 2015-07-07 05:05:19Z behrisch $
+///
+// Parser and container for routes during their loading
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+#ifndef ROMARouteHandler_h
+#define ROMARouteHandler_h
+
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+#include <utils/xml/SUMOSAXHandler.h>
+
+
+// ===========================================================================
+// class declarations
+// ===========================================================================
+class ODMatrix;
+
+
+// ===========================================================================
+// class definitions
+// ===========================================================================
+/**
+ * @class ROMARouteHandler
+ * @brief Parser and container for routes during their loading
+ *
+ * ROMARouteHandler transforms vehicles, trips and flows into contributions
+ * to an ODMatrix.
+ */
+class ROMARouteHandler : public SUMOSAXHandler {
+public:
+ /// standard constructor
+ ROMARouteHandler(ODMatrix& matrix);
+
+ /// standard destructor
+ virtual ~ROMARouteHandler();
+
+protected:
+ /// @name inherited from GenericSAXHandler
+ //@{
+
+ /** @brief Called on the opening of a tag;
+ *
+ * @param[in] element ID of the currently opened element
+ * @param[in] attrs Attributes within the currently opened element
+ * @exception ProcessError If something fails
+ * @see GenericSAXHandler::myStartElement
+ */
+ void myStartElement(int element, const SUMOSAXAttributes& attrs);
+ //@}
+
+
+protected:
+ /// @brief The current route
+ ODMatrix& myMatrix;
+
+private:
+ /// @brief Invalidated copy constructor
+ ROMARouteHandler(const ROMARouteHandler& s);
+
+ /// @brief Invalidated assignment operator
+ ROMARouteHandler& operator=(const ROMARouteHandler& s);
+
+};
+
+
+#endif
+
+/****************************************************************************/
+
diff --git a/src/marouter/marouter_main.cpp b/src/marouter/marouter_main.cpp
index a76418a..5776fcd 100644
--- a/src/marouter/marouter_main.cpp
+++ b/src/marouter/marouter_main.cpp
@@ -5,7 +5,7 @@
/// @author Laura Bieker
/// @author Michael Behrisch
/// @date Thu, 06 Jun 2002
-/// @version $Id: marouter_main.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: marouter_main.cpp 18675 2015-08-20 20:00:26Z behrisch $
///
// Main for MAROUTER
/****************************************************************************/
@@ -50,10 +50,8 @@
#include <utils/vehicle/DijkstraRouterTT.h>
#include <utils/vehicle/DijkstraRouterEffort.h>
#include <utils/vehicle/AStarRouter.h>
-#include <utils/vehicle/BulkStarRouter.h>
#include <utils/vehicle/CHRouter.h>
#include <utils/vehicle/CHRouterWrapper.h>
-#include <router/ROFrame.h>
#include <utils/common/MsgHandler.h>
#include <utils/options/Option.h>
#include <utils/options/OptionsCont.h>
@@ -77,6 +75,8 @@
#include "ROMAFrame.h"
#include "ROMAAssignments.h"
#include "ROMAEdgeBuilder.h"
+#include "ROMARouteHandler.h"
+#include "ROMAEdge.h"
#ifdef CHECK_MEMORY_LEAKS
#include <foreign/nvwa/debug_new.h>
@@ -97,7 +97,8 @@
void
initNet(RONet& net, ROLoader& loader, OptionsCont& oc) {
// load the net
- ROMAEdgeBuilder builder(oc.getBool("weights.expand"), oc.getBool("weights.interpolate"));
+ ROMAEdgeBuilder builder;
+ ROEdge::setGlobalOptions(oc.getBool("weights.expand"), oc.getBool("weights.expand"), oc.getBool("weights.interpolate"), false);
loader.loadNet(net, builder);
// load the weights when wished/available
if (oc.isSet("weight-files")) {
@@ -121,14 +122,14 @@ void
computeAllPairs(RONet& net, OptionsCont& oc) {
std::ofstream outFile(oc.getString("all-pairs-output").c_str(), std::ios::binary);
// build the router
- typedef DijkstraRouterTT<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> > Dijkstra;
+ typedef DijkstraRouterTT<ROEdge, ROVehicle, noProhibitions<ROEdge, ROVehicle> > Dijkstra;
Dijkstra router(net.getEdgeNo(), oc.getBool("ignore-errors"), &getTravelTime);
ConstROEdgeVector into;
const int numInternalEdges = net.getInternalEdgeNumber();
const int numTotalEdges = (int)net.getEdgeNo();
for (int i = numInternalEdges; i < numTotalEdges; i++) {
const Dijkstra::EdgeInfo& ei = router.getEdgeInfo(i);
- if (ei.edge->getType() != ROEdge::ET_INTERNAL) {
+ if (ei.edge->getFunc() != ROEdge::ET_INTERNAL) {
router.compute(ei.edge, 0, 0, 0, into);
for (int j = numInternalEdges; j < numTotalEdges; j++) {
FileHelpers::writeFloat(outFile, router.getEdgeInfo(j).traveltime);
@@ -137,6 +138,25 @@ computeAllPairs(RONet& net, OptionsCont& oc) {
}
}
+
+/**
+ * Writes the travel times for a single interval
+ */
+void
+writeInterval(OutputDevice& dev, const SUMOTime begin, const SUMOTime end, const RONet& net, const ROVehicle* const veh) {
+ dev.openTag(SUMO_TAG_INTERVAL).writeAttr(SUMO_ATTR_BEGIN, time2string(begin)).writeAttr(SUMO_ATTR_END, time2string(end));
+ for (std::map<std::string, ROEdge*>::const_iterator i = net.getEdgeMap().begin(); i != net.getEdgeMap().end(); ++i) {
+ ROMAEdge* edge = static_cast<ROMAEdge*>(i->second);
+ if (edge->getFunc() == ROEdge::ET_NORMAL) {
+ dev.openTag(SUMO_TAG_EDGE).writeAttr(SUMO_ATTR_ID, edge->getID());
+ dev.writeAttr("traveltime", edge->getTravelTime(veh, STEPS2TIME(begin)));
+ dev.writeAttr("entered", edge->getFlow(STEPS2TIME(begin))).closeTag();
+ }
+ }
+ dev.closeTag();
+}
+
+
/**
* Computes the routes saving them
*/
@@ -146,76 +166,69 @@ computeRoutes(RONet& net, OptionsCont& oc, ODMatrix& matrix) {
SUMOAbstractRouter<ROEdge, ROVehicle>* router;
const std::string measure = oc.getString("weight-attribute");
const std::string routingAlgorithm = oc.getString("routing-algorithm");
+ const SUMOTime begin = string2time(oc.getString("begin"));
+ const SUMOTime end = string2time(oc.getString("end"));
if (measure == "traveltime") {
if (routingAlgorithm == "dijkstra") {
- if (net.hasRestrictions()) {
+ if (net.hasPermissions()) {
if (oc.getInt("paths") > 1) {
- router = new DijkstraRouterTT<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
+ router = new DijkstraRouterTT<ROEdge, ROVehicle, prohibited_withPermissions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROMAAssignments::getPenalizedTT);
} else {
- router = new DijkstraRouterTT<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
+ router = new DijkstraRouterTT<ROEdge, ROVehicle, prohibited_withPermissions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
}
} else {
if (oc.getInt("paths") > 1) {
- router = new DijkstraRouterTT<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
+ router = new DijkstraRouterTT<ROEdge, ROVehicle, noProhibitions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROMAAssignments::getPenalizedTT);
} else {
- router = new DijkstraRouterTT<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
+ router = new DijkstraRouterTT<ROEdge, ROVehicle, noProhibitions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
}
}
} else if (routingAlgorithm == "astar") {
- if (net.hasRestrictions()) {
+ if (net.hasPermissions()) {
if (oc.getInt("paths") > 1) {
- router = new AStarRouter<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
+ router = new AStarRouter<ROEdge, ROVehicle, prohibited_withPermissions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROMAAssignments::getPenalizedTT);
} else {
- router = new AStarRouter<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
+ router = new AStarRouter<ROEdge, ROVehicle, prohibited_withPermissions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
}
} else {
if (oc.getInt("paths") > 1) {
- router = new AStarRouter<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
+ router = new AStarRouter<ROEdge, ROVehicle, noProhibitions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROMAAssignments::getPenalizedTT);
} else {
- router = new AStarRouter<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
+ router = new AStarRouter<ROEdge, ROVehicle, noProhibitions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic);
}
}
- } else if (routingAlgorithm == "bulkstar") {
- if (net.hasRestrictions()) {
- router = new BulkStarRouter<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
- net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, &ROEdge::getMinimumTravelTime);
- } else {
- router = new BulkStarRouter<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
- net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, &ROEdge::getMinimumTravelTime);
- }
} else if (routingAlgorithm == "CH") {
const SUMOTime weightPeriod = (oc.isSet("weight-files") ?
string2time(oc.getString("weight-period")) :
std::numeric_limits<int>::max());
- if (net.hasRestrictions()) {
- router = new CHRouter<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
+ if (net.hasPermissions()) {
+ router = new CHRouter<ROEdge, ROVehicle, prohibited_withPermissions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, SVC_IGNORING, weightPeriod, true);
} else {
- router = new CHRouter<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
+ router = new CHRouter<ROEdge, ROVehicle, noProhibitions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, SVC_IGNORING, weightPeriod, false);
}
} else if (routingAlgorithm == "CHWrapper") {
- const SUMOTime begin = string2time(oc.getString("begin"));
const SUMOTime weightPeriod = (oc.isSet("weight-files") ?
string2time(oc.getString("weight-period")) :
std::numeric_limits<int>::max());
- router = new CHRouterWrapper<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
+ router = new CHRouterWrapper<ROEdge, ROVehicle, prohibited_withPermissions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, begin, weightPeriod);
} else {
throw ProcessError("Unknown routing Algorithm '" + routingAlgorithm + "'!");
}
} else {
- DijkstraRouterEffort<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >::Operation op;
+ DijkstraRouterEffort<ROEdge, ROVehicle, prohibited_withPermissions<ROEdge, ROVehicle> >::Operation op;
if (measure == "CO") {
op = &ROEdge::getEmissionEffort<PollutantsInterface::CO>;
} else if (measure == "CO2") {
@@ -233,20 +246,20 @@ computeRoutes(RONet& net, OptionsCont& oc, ODMatrix& matrix) {
} else {
throw ProcessError("Unknown measure (weight attribute '" + measure + "')!");
}
- if (net.hasRestrictions()) {
+ if (net.hasPermissions()) {
if (oc.getInt("paths") > 1) {
- router = new DijkstraRouterEffort<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
+ router = new DijkstraRouterEffort<ROEdge, ROVehicle, prohibited_withPermissions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROMAAssignments::getPenalizedEffort, &ROMAAssignments::getTravelTime);
} else {
- router = new DijkstraRouterEffort<ROEdge, ROVehicle, prohibited_withRestrictions<ROEdge, ROVehicle> >(
+ router = new DijkstraRouterEffort<ROEdge, ROVehicle, prohibited_withPermissions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), op, &ROEdge::getTravelTimeStatic);
}
} else {
if (oc.getInt("paths") > 1) {
- router = new DijkstraRouterEffort<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
+ router = new DijkstraRouterEffort<ROEdge, ROVehicle, noProhibitions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), &ROMAAssignments::getPenalizedEffort, &ROMAAssignments::getTravelTime);
} else {
- router = new DijkstraRouterEffort<ROEdge, ROVehicle, prohibited_noRestrictions<ROEdge, ROVehicle> >(
+ router = new DijkstraRouterEffort<ROEdge, ROVehicle, noProhibitions<ROEdge, ROVehicle> >(
net.getEdgeNo(), oc.getBool("ignore-errors"), op, &ROEdge::getTravelTimeStatic);
}
}
@@ -260,7 +273,8 @@ computeRoutes(RONet& net, OptionsCont& oc, ODMatrix& matrix) {
matrix.applyCurve(matrix.parseTimeLine(oc.getStringVector("timeline"), oc.getBool("timeline.day-in-hours")));
}
ROVehicle defaultVehicle(SUMOVehicleParameter(), 0, net.getVehicleTypeSecure(DEFAULT_VTYPE_ID), &net);
- ROMAAssignments a(string2time(oc.getString("begin")), string2time(oc.getString("end")), net, matrix, *router);
+ ROMAAssignments a(begin, end, oc.getBool("timesplit"), net, matrix, *router);
+ a.resetFlows();
const std::string assignMethod = oc.getString("assignment-method");
if (assignMethod == "incremental") {
a.incremental(oc.getInt("max-iterations"));
@@ -276,7 +290,7 @@ computeRoutes(RONet& net, OptionsCont& oc, ODMatrix& matrix) {
const ODCell* const c = *i;
dev->openTag(SUMO_TAG_ROUTE_DISTRIBUTION).writeAttr(SUMO_ATTR_ID, c->origin + "_" + c->destination + "_" + time2string(c->begin) + "_" + time2string(c->end));
for (std::vector<RORoute*>::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) {
- (*j)->setCosts(router->recomputeCosts((*j)->getEdgeVector(), &defaultVehicle, string2time(oc.getString("begin"))));
+ (*j)->setCosts(router->recomputeCosts((*j)->getEdgeVector(), &defaultVehicle, begin));
(*j)->writeXMLDefinition(*dev, 0, true, false);
}
dev->closeTag();
@@ -288,17 +302,51 @@ computeRoutes(RONet& net, OptionsCont& oc, ODMatrix& matrix) {
int num = 0;
for (std::vector<ODCell*>::const_iterator i = matrix.getCells().begin(); i != matrix.getCells().end(); ++i) {
const ODCell* const c = *i;
- dev->openTag(SUMO_TAG_FLOW).writeAttr(SUMO_ATTR_ID, oc.getString("prefix") + toString(num++));
- dev->writeAttr(SUMO_ATTR_BEGIN, time2string(c->begin)).writeAttr(SUMO_ATTR_END, time2string(c->end));
- dev->writeAttr(SUMO_ATTR_NUMBER, int(c->vehicleNumber));
- matrix.writeDefaultAttrs(*dev, oc.getBool("ignore-vehicle-type"), c);
- dev->openTag(SUMO_TAG_ROUTE_DISTRIBUTION);
- for (std::vector<RORoute*>::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) {
- (*j)->setCosts(router->recomputeCosts((*j)->getEdgeVector(), &defaultVehicle, string2time(oc.getString("begin"))));
- (*j)->writeXMLDefinition(*dev, 0, true, false);
+ if (c->departures.empty()) {
+ dev->openTag(SUMO_TAG_FLOW).writeAttr(SUMO_ATTR_ID, oc.getString("prefix") + toString(num++));
+ dev->writeAttr(SUMO_ATTR_BEGIN, time2string(c->begin)).writeAttr(SUMO_ATTR_END, time2string(c->end));
+ dev->writeAttr(SUMO_ATTR_NUMBER, int(c->vehicleNumber));
+ matrix.writeDefaultAttrs(*dev, oc.getBool("ignore-vehicle-type"), c);
+ dev->openTag(SUMO_TAG_ROUTE_DISTRIBUTION);
+ for (std::vector<RORoute*>::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) {
+ (*j)->setCosts(router->recomputeCosts((*j)->getEdgeVector(), &defaultVehicle, string2time(oc.getString("begin"))));
+ (*j)->writeXMLDefinition(*dev, 0, true, false);
+ }
+ dev->closeTag();
+ dev->closeTag();
+ } else {
+ for (std::map<SUMOTime, std::vector<std::string> >::const_iterator deps = c->departures.begin(); deps != c->departures.end(); ++deps) {
+ const std::string routeDistId = c->origin + "_" + c->destination + "_" + time2string(c->begin) + "_" + time2string(c->end);
+ for (std::vector<std::string>::const_iterator id = deps->second.begin(); id != deps->second.end(); ++id) {
+ dev->openTag(SUMO_TAG_VEHICLE).writeAttr(SUMO_ATTR_ID, *id).writeAttr(SUMO_ATTR_DEPART, time2string(deps->first));
+ matrix.writeDefaultAttrs(*dev, oc.getBool("ignore-vehicle-type"), c);
+ dev->openTag(SUMO_TAG_ROUTE_DISTRIBUTION);
+ for (std::vector<RORoute*>::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) {
+ (*j)->setCosts(router->recomputeCosts((*j)->getEdgeVector(), &defaultVehicle, string2time(oc.getString("begin"))));
+ (*j)->writeXMLDefinition(*dev, 0, true, false);
+ }
+ dev->closeTag();
+ dev->closeTag();
+ }
+ }
}
- dev->closeTag();
- dev->closeTag();
+ }
+ haveOutput = true;
+ }
+ if (OutputDevice::createDeviceByOption("netload-output", "meandata")) {
+ if (oc.getBool("timesplit")) {
+ SUMOTime lastCell = 0;
+ for (std::vector<ODCell*>::const_iterator i = matrix.getCells().begin(); i != matrix.getCells().end(); ++i) {
+ if ((*i)->end > lastCell) {
+ lastCell = (*i)->end;
+ }
+ }
+ const SUMOTime interval = string2time(OptionsCont::getOptions().getString("aggregation-interval"));
+ for (SUMOTime start = begin; start < MIN2(end, lastCell); start += interval) {
+ writeInterval(OutputDevice::getDeviceByOption("netload-output"), start, start + interval, net, a.getDefaultVehicle());
+ }
+ } else {
+ writeInterval(OutputDevice::getDeviceByOption("netload-output"), begin, end, net, a.getDefaultVehicle());
}
haveOutput = true;
}
@@ -327,7 +375,8 @@ main(int argc, char** argv) {
try {
XMLSubSys::init();
ROMAFrame::fillOptions();
- OptionsIO::getOptions(true, argc, argv);
+ OptionsIO::setArgs(argc, argv);
+ OptionsIO::getOptions();
if (oc.processMetaOptions(argc < 2)) {
SystemFrame::close();
return 0;
@@ -362,6 +411,8 @@ main(int argc, char** argv) {
// load the matrix
ODMatrix matrix(districts);
matrix.loadMatrix(oc);
+ ROMARouteHandler handler(matrix);
+ matrix.loadRoutes(oc, handler);
if (matrix.getNoLoaded() == 0) {
throw ProcessError("No vehicles loaded.");
}
diff --git a/src/microsim/MSBaseVehicle.cpp b/src/microsim/MSBaseVehicle.cpp
index 01a0731..d6af7b2 100644
--- a/src/microsim/MSBaseVehicle.cpp
+++ b/src/microsim/MSBaseVehicle.cpp
@@ -4,7 +4,7 @@
/// @author Daniel Krajzewicz
/// @author Jakob Erdmann
/// @date Mon, 8 Nov 2010
-/// @version $Id: MSBaseVehicle.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSBaseVehicle.cpp 18501 2015-06-24 10:03:39Z behrisch $
///
// A base class for vehicle implementations
/****************************************************************************/
@@ -169,7 +169,7 @@ MSBaseVehicle::reroute(SUMOTime t, SUMOAbstractRouter<MSEdge, SUMOVehicle>& rout
bool
MSBaseVehicle::replaceRouteEdges(ConstMSEdgeVector& edges, bool onInit) {
if (edges.empty()) {
- WRITE_WARNING("No route for vehicle '" + getID() + "' found.");
+ WRITE_WARNING("No route for vehicle '" + getID() + "' found" + (onInit ? " (skipping vehicle)." : "."));
return false;
}
// build a new id, first
@@ -182,13 +182,20 @@ MSBaseVehicle::replaceRouteEdges(ConstMSEdgeVector& edges, bool onInit) {
} else {
id = id + "!var#1";
}
- const MSEdge* const origin = getRerouteOrigin();
- if (origin != *myCurrEdge && edges.front() == origin) {
- edges.insert(edges.begin(), *myCurrEdge);
+ int oldSize = (int)edges.size();
+ if (!onInit) {
+ const MSEdge* const origin = getRerouteOrigin();
+ if (origin != *myCurrEdge && edges.front() == origin) {
+ edges.insert(edges.begin(), *myCurrEdge);
+ oldSize = (int)edges.size();
+ }
+ edges.insert(edges.begin(), myRoute->begin(), myCurrEdge);
}
- const int oldSize = (int)edges.size();
- edges.insert(edges.begin(), myRoute->begin(), myCurrEdge);
if (edges == myRoute->getEdges()) {
+ if (onInit) {
+ // if edges = 'from to' we still need to calculate the arrivalPos once
+ calculateArrivalPos();
+ }
return true;
}
const RGBColor& c = myRoute->getColor();
@@ -217,6 +224,7 @@ MSBaseVehicle::replaceRouteEdges(ConstMSEdgeVector& edges, bool onInit) {
#endif
return false;
}
+ calculateArrivalPos();
return true;
}
@@ -252,11 +260,11 @@ MSBaseVehicle::hasArrived() const {
}
void
-MSBaseVehicle::addPerson(MSPerson* /*person*/) {
+MSBaseVehicle::addPerson(MSTransportable* /*person*/) {
}
void
-MSBaseVehicle::addContainer(MSContainer* /*container*/) {
+MSBaseVehicle::addContainer(MSTransportable* /*container*/) {
}
bool
@@ -375,7 +383,7 @@ MSBaseVehicle::getDevice(const std::type_info& type) const {
void
MSBaseVehicle::saveState(OutputDevice& out) {
out.openTag(SUMO_TAG_VEHICLE).writeAttr(SUMO_ATTR_ID, myParameter->id);
- out.writeAttr(SUMO_ATTR_DEPART, myParameter->depart);
+ out.writeAttr(SUMO_ATTR_DEPART, time2string(myParameter->depart));
out.writeAttr(SUMO_ATTR_ROUTE, myRoute->getID());
out.writeAttr(SUMO_ATTR_TYPE, myType->getID());
// here starts the vehicle internal part (see loading)
diff --git a/src/microsim/MSBaseVehicle.h b/src/microsim/MSBaseVehicle.h
index bc080ff..1d6cec7 100644
--- a/src/microsim/MSBaseVehicle.h
+++ b/src/microsim/MSBaseVehicle.h
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Mon, 8 Nov 2010
-/// @version $Id: MSBaseVehicle.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSBaseVehicle.h 18663 2015-08-19 13:02:24Z namdre $
///
// A base class for vehicle implementations
/****************************************************************************/
@@ -208,6 +208,12 @@ public:
return myArrivalPos;
}
+ /** @brief Sets this vehicle's desired arrivalPos for its current route
+ */
+ virtual void setArrivalPos(SUMOReal arrivalPos) {
+ myArrivalPos = arrivalPos;
+ }
+
/** @brief Returns whether this vehicle has already departed
*/
bool hasDeparted() const;
@@ -241,16 +247,16 @@ public:
*
* @param[in] person The person to add
*/
- virtual void addPerson(MSPerson* person);
+ virtual void addPerson(MSTransportable* person);
/** @brief Adds a container to this vehicle
*
* The default implementation does nothing since containers are not supported by default
*
- * @param[in] container The person to add
+ * @param[in] container The container to add
*/
- virtual void addContainer(MSContainer* container);
+ virtual void addContainer(MSTransportable* container);
/** @brief Validates the current route
* @param[out] msg Description why the route is not valid (if it is the case)
diff --git a/src/microsim/MSBitSetLogic.h b/src/microsim/MSBitSetLogic.h
index 55d665b..4f545e3 100644
--- a/src/microsim/MSBitSetLogic.h
+++ b/src/microsim/MSBitSetLogic.h
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Wed, 12 Dez 2001
-/// @version $Id: MSBitSetLogic.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSBitSetLogic.h 18756 2015-08-31 19:16:33Z behrisch $
///
// Container for holding a right-of-way matrix
/****************************************************************************/
@@ -80,12 +80,13 @@ public:
}
- /// Returns the foes of the given link
- const MSLogicJunction::LinkFoes& getFoesFor(unsigned int linkIndex) const {
+ /// @brief Returns the response for the given link
+ const MSLogicJunction::LinkBits& getResponseFor(unsigned int linkIndex) const {
return (*myLogic)[linkIndex];
}
- const std::bitset<64>& getInternalFoesFor(unsigned int linkIndex) const {
+ /// @brief Returns the foes for the given link
+ const MSLogicJunction::LinkBits& getFoesFor(unsigned int linkIndex) const {
return (*myInternalLinksFoes)[linkIndex];
}
diff --git a/src/microsim/MSCModel_NonInteracting.cpp b/src/microsim/MSCModel_NonInteracting.cpp
index 9d38923..579bea9 100644
--- a/src/microsim/MSCModel_NonInteracting.cpp
+++ b/src/microsim/MSCModel_NonInteracting.cpp
@@ -3,7 +3,7 @@
/// @author Melanie Weber
/// @author Andreas Kendziorra
/// @date Tue, 29 July 2014
-/// @version $Id: MSCModel_NonInteracting.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSCModel_NonInteracting.cpp 18274 2015-04-22 15:00:44Z behrisch $
///
// The container following model for tranship (prototype)
/****************************************************************************/
@@ -73,7 +73,7 @@ MSCModel_NonInteracting::getModel() {
}
CState*
-MSCModel_NonInteracting::add(MSContainer* container, MSContainer::MSContainerStage_Tranship* stage, SUMOTime now) {
+MSCModel_NonInteracting::add(MSTransportable* container, MSContainer::MSContainerStage_Tranship* stage, SUMOTime now) {
CState* state = new CState();
const SUMOTime firstEdgeDuration = state->computeTranshipTime(0, *stage, now);
myNet->getBeginOfTimestepEvents()->addEvent(new MoveToNextEdge(container, *stage),
diff --git a/src/microsim/MSCModel_NonInteracting.h b/src/microsim/MSCModel_NonInteracting.h
index fdf97d6..ae53d38 100644
--- a/src/microsim/MSCModel_NonInteracting.h
+++ b/src/microsim/MSCModel_NonInteracting.h
@@ -3,7 +3,7 @@
/// @author Melanie Weber
/// @author Andreas Kendziorra
/// @date Tue, 29 July 2014
-/// @version $Id: MSCModel_NonInteracting.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSCModel_NonInteracting.h 18274 2015-04-22 15:00:44Z behrisch $
///
// The container following model for tranship (prototype)
/****************************************************************************/
@@ -69,7 +69,7 @@ public:
static void cleanup();
/// @brief register the given container as a transhiped container
- CState* add(MSContainer* container, MSContainer::MSContainerStage_Tranship* stage, SUMOTime now);
+ CState* add(MSTransportable* container, MSContainer::MSContainerStage_Tranship* stage, SUMOTime now);
private:
static MSCModel_NonInteracting* myModel;
@@ -77,13 +77,13 @@ private:
private:
class MoveToNextEdge : public Command {
public:
- MoveToNextEdge(MSContainer* container, MSContainer::MSContainerStage_Tranship& tranship) : myParent(tranship), myContainer(container) {}
+ MoveToNextEdge(MSTransportable* container, MSContainer::MSContainerStage_Tranship& tranship) : myParent(tranship), myContainer(container) {}
~MoveToNextEdge() {}
SUMOTime execute(SUMOTime currentTime);
private:
MSContainer::MSContainerStage_Tranship& myParent;
- MSContainer* myContainer;
+ MSTransportable* myContainer;
private:
/// @brief Invalidated assignment operator.
MoveToNextEdge& operator=(const MoveToNextEdge&);
diff --git a/src/microsim/MSContainer.cpp b/src/microsim/MSContainer.cpp
index 2c7875d..62bfc5a 100644
--- a/src/microsim/MSContainer.cpp
+++ b/src/microsim/MSContainer.cpp
@@ -3,7 +3,7 @@
/// @author Melanie Weber
/// @author Andreas Kendziorra
/// @date Thu, 12 Jun 2014
-/// @version $Id: MSContainer.cpp 18129 2015-03-24 13:18:25Z behrisch $
+/// @version $Id: MSContainer.cpp 18274 2015-04-22 15:00:44Z behrisch $
///
// The class for modelling container-movements
/****************************************************************************/
@@ -38,7 +38,7 @@
#include "MSEdge.h"
#include "MSLane.h"
#include "MSContainer.h"
-#include "microsim/trigger/MSContainerStop.h"
+#include "microsim/MSStoppingPlace.h"
#include "MSContainerControl.h"
#include "MSInsertionControl.h"
#include "MSVehicle.h"
@@ -57,66 +57,18 @@ const SUMOReal MSContainer::ROADSIDE_OFFSET(3);
// method definitions
// ===========================================================================
/* -------------------------------------------------------------------------
- * MSContainer::MSContainerStage - methods
- * ----------------------------------------------------------------------- */
-MSContainer::MSContainerStage::MSContainerStage(const MSEdge& destination, StageType type)
- : myDestination(destination), myDeparted(-1), myArrived(-1), myType(type) {}
-
-MSContainer::MSContainerStage::~MSContainerStage() {}
-
-const MSEdge&
-MSContainer::MSContainerStage::getDestination() const {
- return myDestination;
-}
-
-void
-MSContainer::MSContainerStage::setDeparted(SUMOTime now) {
- if (myDeparted < 0) {
- myDeparted = now;
- }
-}
-
-void
-MSContainer::MSContainerStage::setArrived(SUMOTime now) {
- myArrived = now;
-}
-
-bool
-MSContainer::MSContainerStage::isWaitingFor(const std::string& /*line*/) const {
- return false;
-}
-
-Position
-MSContainer::MSContainerStage::getEdgePosition(const MSEdge* e, SUMOReal at, SUMOReal offset) const {
- return getLanePosition(e->getLanes()[0], at, offset);
-}
-
-Position
-MSContainer::MSContainerStage::getLanePosition(const MSLane* lane, SUMOReal at, SUMOReal offset) const {
- return lane->getShape().positionAtOffset(lane->interpolateLanePosToGeometryPos(at), offset);
-}
-
-SUMOReal
-MSContainer::MSContainerStage::getEdgeAngle(const MSEdge* e, SUMOReal at) const {
- PositionVector shp = e->getLanes()[0]->getShape();
- return -shp.rotationDegreeAtOffset(at);
-}
-
-
-
-/* -------------------------------------------------------------------------
* MSContainer::MSContainerStage_Driving - methods
* ----------------------------------------------------------------------- */
MSContainer::MSContainerStage_Driving::MSContainerStage_Driving(const MSEdge& destination,
- MSContainerStop* toCS, const std::vector<std::string>& lines)
- : MSContainerStage(destination, DRIVING), myLines(lines.begin(), lines.end()),
+ MSStoppingPlace* toCS, const std::vector<std::string>& lines)
+ : MSTransportable::Stage(destination, DRIVING), myLines(lines.begin(), lines.end()),
myVehicle(0), myDestinationContainerStop(toCS) {}
MSContainer::MSContainerStage_Driving::~MSContainerStage_Driving() {}
void
-MSContainer::MSContainerStage_Driving::proceed(MSNet* net, MSContainer* container, SUMOTime now,
+MSContainer::MSContainerStage_Driving::proceed(MSNet* net, MSTransportable* container, SUMOTime now,
MSEdge* previousEdge, const SUMOReal at) {
myWaitingEdge = previousEdge;
myWaitingPos = at;
@@ -206,7 +158,7 @@ MSContainer::MSContainerStage_Driving::getStageDescription() const {
return isWaiting4Vehicle() ? "waiting for " + joinToString(myLines, ",") : "transport";
}
-MSContainerStop*
+MSStoppingPlace*
MSContainer::MSContainerStage_Driving::getDepartContainerStop() const {
return myDepartContainerStop;
}
@@ -223,12 +175,12 @@ MSContainer::MSContainerStage_Driving::routeOutput(OutputDevice& os) const {
}
void
-MSContainer::MSContainerStage_Driving::beginEventOutput(const MSContainer& container, SUMOTime t, OutputDevice& os) const {
+MSContainer::MSContainerStage_Driving::beginEventOutput(const MSTransportable& container, SUMOTime t, OutputDevice& os) const {
os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival").writeAttr("agent", container.getID()).writeAttr("link", getEdge()->getID()).closeTag();
}
void
-MSContainer::MSContainerStage_Driving::endEventOutput(const MSContainer& container, SUMOTime t, OutputDevice& os) const {
+MSContainer::MSContainerStage_Driving::endEventOutput(const MSTransportable& container, SUMOTime t, OutputDevice& os) const {
os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival").writeAttr("agent", container.getID()).writeAttr("link", getEdge()->getID()).closeTag();
}
@@ -239,7 +191,7 @@ MSContainer::MSContainerStage_Driving::endEventOutput(const MSContainer& contain
* ----------------------------------------------------------------------- */
MSContainer::MSContainerStage_Waiting::MSContainerStage_Waiting(const MSEdge& destination,
SUMOTime duration, SUMOTime until, SUMOReal pos, const std::string& actType) :
- MSContainerStage(destination, WAITING),
+ MSTransportable::Stage(destination, WAITING),
myWaitingDuration(duration),
myWaitingUntil(until),
myActType(actType),
@@ -290,13 +242,13 @@ MSContainer::MSContainerStage_Waiting::getSpeed() const {
return 0;
}
-MSContainerStop*
+MSStoppingPlace*
MSContainer::MSContainerStage_Waiting::getDepartContainerStop() const {
return myCurrentContainerStop;
}
void
-MSContainer::MSContainerStage_Waiting::proceed(MSNet* net, MSContainer* container, SUMOTime now,
+MSContainer::MSContainerStage_Waiting::proceed(MSNet* net, MSTransportable* container, SUMOTime now,
MSEdge* previousEdge, const SUMOReal /* at */) {
previousEdge->addContainer(container);
myWaitingStart = now;
@@ -322,13 +274,13 @@ MSContainer::MSContainerStage_Waiting::routeOutput(OutputDevice& os) const {
}
void
-MSContainer::MSContainerStage_Waiting::beginEventOutput(const MSContainer& container, SUMOTime t, OutputDevice& os) const {
+MSContainer::MSContainerStage_Waiting::beginEventOutput(const MSTransportable& container, SUMOTime t, OutputDevice& os) const {
os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "actstart " + myActType)
.writeAttr("agent", container.getID()).writeAttr("link", getEdge()->getID()).closeTag();
}
void
-MSContainer::MSContainerStage_Waiting::endEventOutput(const MSContainer& container, SUMOTime t, OutputDevice& os) const {
+MSContainer::MSContainerStage_Waiting::endEventOutput(const MSTransportable& container, SUMOTime t, OutputDevice& os) const {
os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "actend " + myActType).writeAttr("agent", container.getID())
.writeAttr("link", getEdge()->getID()).closeTag();
}
@@ -337,10 +289,10 @@ MSContainer::MSContainerStage_Waiting::endEventOutput(const MSContainer& contain
* MSContainer::MSContainerStage_Tranship - methods
* ----------------------------------------------------------------------- */
MSContainer::MSContainerStage_Tranship::MSContainerStage_Tranship(const std::vector<const MSEdge*>& route,
- MSContainerStop* toCS,
+ MSStoppingPlace* toCS,
SUMOReal speed,
SUMOReal departPos, SUMOReal arrivalPos) :
- MSContainerStage(*route.back(), TRANSHIP), myRoute(route),
+ MSTransportable::Stage(*route.back(), MOVING_WITHOUT_VEHICLE), myRoute(route),
myDestinationContainerStop(toCS),
mySpeed(speed), myContainerState(0), myCurrentInternalEdge(0) {
myDepartPos = SUMOVehicleParameter::interpretEdgePos(
@@ -353,7 +305,7 @@ MSContainer::MSContainerStage_Tranship::~MSContainerStage_Tranship() {
}
void
-MSContainer::MSContainerStage_Tranship::proceed(MSNet* /* net */, MSContainer* container, SUMOTime now, MSEdge* previousEdge, const SUMOReal at) {
+MSContainer::MSContainerStage_Tranship::proceed(MSNet* /* net */, MSTransportable* container, SUMOTime now, MSEdge* previousEdge, const SUMOReal at) {
previousEdge->removeContainer(container);
myRouteStep = myRoute.end() - 1; //define that the container is already on its destination edge
MSNet::getInstance()->getContainerControl().setTranship(container);
@@ -361,7 +313,7 @@ MSContainer::MSContainerStage_Tranship::proceed(MSNet* /* net */, MSContainer* c
myDepartPos = at;
}
myContainerState = MSCModel_NonInteracting::getModel()->add(container, this, now);
- ((MSEdge*) *myRouteStep)->addContainer(container);
+ (*myRouteStep)->addContainer(container);
}
const MSEdge*
@@ -408,7 +360,7 @@ MSContainer::MSContainerStage_Tranship::getSpeed() const {
return myContainerState->getSpeed(*this);
}
-MSContainerStop*
+MSStoppingPlace*
MSContainer::MSContainerStage_Tranship::getDepartContainerStop() const {
return myDepartContainerStop;
}
@@ -428,25 +380,25 @@ MSContainer::MSContainerStage_Tranship::routeOutput(OutputDevice& os) const {
void
-MSContainer::MSContainerStage_Tranship::beginEventOutput(const MSContainer& c, SUMOTime t, OutputDevice& os) const {
+MSContainer::MSContainerStage_Tranship::beginEventOutput(const MSTransportable& c, SUMOTime t, OutputDevice& os) const {
os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "departure")
.writeAttr("agent", c.getID()).writeAttr("link", myRoute.front()->getID()).closeTag();
}
void
-MSContainer::MSContainerStage_Tranship::endEventOutput(const MSContainer& c, SUMOTime t, OutputDevice& os) const {
+MSContainer::MSContainerStage_Tranship::endEventOutput(const MSTransportable& c, SUMOTime t, OutputDevice& os) const {
os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival")
.writeAttr("agent", c.getID()).writeAttr("link", myRoute.back()->getID()).closeTag();
}
bool
-MSContainer::MSContainerStage_Tranship::moveToNextEdge(MSContainer* container, SUMOTime currentTime, MSEdge* nextInternal) {
+MSContainer::MSContainerStage_Tranship::moveToNextEdge(MSTransportable* container, SUMOTime currentTime, MSEdge* nextInternal) {
((MSEdge*)getEdge())->removeContainer(container);
if (myRouteStep == myRoute.end() - 1) {
MSNet::getInstance()->getContainerControl().unsetTranship(container);
if (myDestinationContainerStop != 0) {
- myDestinationContainerStop->addContainer(container); //jakob
+ myDestinationContainerStop->addTransportable(container); //jakob
}
if (!container->proceed(MSNet::getInstance(), currentTime)) {
MSNet::getInstance()->getContainerControl().erase(container);
@@ -467,23 +419,11 @@ MSContainer::MSContainerStage_Tranship::moveToNextEdge(MSContainer* container, S
/* -------------------------------------------------------------------------
* MSContainer - methods
* ----------------------------------------------------------------------- */
-MSContainer::MSContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSContainerPlan* plan)
- : myParameter(pars), myVType(vtype), myPlan(plan) {
- myStep = myPlan->begin();
- lastDestination = &(myPlan->back())->getDestination();
+MSContainer::MSContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportablePlan* plan)
+ : MSTransportable(pars, vtype, plan) {
}
MSContainer::~MSContainer() {
- for (MSContainerPlan::const_iterator i = myPlan->begin(); i != myPlan->end(); ++i) {
- delete *i;
- }
- delete myPlan;
- delete myParameter;
-}
-
-const std::string&
-MSContainer::getID() const {
- return myParameter->id;
}
bool
@@ -501,56 +441,10 @@ MSContainer::proceed(MSNet* net, SUMOTime time) {
}
}
-SUMOTime
-MSContainer::getDesiredDepart() const {
- return myParameter->depart;
-}
-
-void
-MSContainer::setDeparted(SUMOTime now) {
- (*myStep)->setDeparted(now);
-}
-
-SUMOReal
-MSContainer::getEdgePos() const {
- return (*myStep)->getEdgePos(MSNet::getInstance()->getCurrentTimeStep());
-}
-
-Position
-MSContainer::getPosition() const {
- return (*myStep)->getPosition(MSNet::getInstance()->getCurrentTimeStep());
-}
-
-SUMOReal
-MSContainer::getAngle() const {
- return (*myStep)->getAngle(MSNet::getInstance()->getCurrentTimeStep());
-}
-
-SUMOReal
-MSContainer::getWaitingSeconds() const {
- return STEPS2TIME((*myStep)->getWaitingTime(MSNet::getInstance()->getCurrentTimeStep()));
-}
-
-SUMOReal
-MSContainer::getSpeed() const {
- return (*myStep)->getSpeed();
-}
-
-MSContainerStop*
-MSContainer::getDepartContainerStop() const {
- return (*myStep)->getDepartContainerStop();
-}
-
-void
-MSContainer::tripInfoOutput(OutputDevice& os) const {
- for (MSContainerPlan::const_iterator i = myPlan->begin(); i != myPlan->end(); ++i) {
- (*i)->tripInfoOutput(os);
- }
-}
void
MSContainer::routeOutput(OutputDevice& os) const {
- MSContainerPlan::const_iterator i = myPlan->begin();
+ MSTransportablePlan::const_iterator i = myPlan->begin();
if ((*i)->getStageType() == WAITING && getDesiredDepart() == static_cast<MSContainerStage_Waiting*>(*i)->getUntil()) {
++i;
}
diff --git a/src/microsim/MSContainer.h b/src/microsim/MSContainer.h
index 9bfadf3..853ee3a 100644
--- a/src/microsim/MSContainer.h
+++ b/src/microsim/MSContainer.h
@@ -3,7 +3,7 @@
/// @author Melanie Weber
/// @author Andreas Kendziorra
/// @date Thu, 12 Jun 2014
-/// @version $Id: MSContainer.h 18129 2015-03-24 13:18:25Z behrisch $
+/// @version $Id: MSContainer.h 18274 2015-04-22 15:00:44Z behrisch $
///
// The class for modelling container-movements
/****************************************************************************/
@@ -37,6 +37,7 @@
#include <utils/common/Command.h>
#include <utils/geom/Position.h>
#include <utils/geom/PositionVector.h>
+#include <microsim/MSTransportable.h>
// ===========================================================================
@@ -47,14 +48,12 @@ class MSEdge;
class MSLane;
class OutputDevice;
class SUMOVehicleParameter;
-class MSContainerStop;
+class MSStoppingPlace;
class SUMOVehicle;
class MSVehicleType;
class MSCModel_NonInteracting;
class CState;
-//typedef std::vector<const MSEdge*> MSEdgeVector;
-
// ===========================================================================
// class definitions
@@ -66,153 +65,28 @@ class CState;
*/
-class MSContainer {
+class MSContainer : public MSTransportable {
public:
- enum StageType {
- DRIVING = 0,
- WAITING = 1,
- TRANSHIP = 2
- };
-
/// @brief the offset for computing container positions when standing at an edge
static const SUMOReal ROADSIDE_OFFSET;
/**
- * The "abstract" class for a single stage of a container movement
- * Contains the destination of the current movement step
- */
- class MSContainerStage {
- public:
- /// constructor
- MSContainerStage(const MSEdge& destination, StageType type);
-
- /// destructor
- virtual ~MSContainerStage();
-
- /// returns the destination edge
- const MSEdge& getDestination() const;
-
- /// Returns the current edge
- virtual const MSEdge* getEdge() const = 0;
- virtual const MSEdge* getFromEdge() const = 0;
- virtual SUMOReal getEdgePos(SUMOTime now) const = 0;
-
- /// returns the position of the container
- virtual Position getPosition(SUMOTime now) const = 0;
-
- /// returns the angle of the container
- virtual SUMOReal getAngle(SUMOTime now) const = 0;
-
- ///
- StageType getStageType() const {
- return myType;
- }
-
- /// @brief return string representation of the current stage
- virtual std::string getStageDescription() const = 0;
-
- /// proceeds to the next step
- virtual void proceed(MSNet* net, MSContainer* container, SUMOTime now, MSEdge* previousEdge, const SUMOReal at) = 0;
-
- /// logs end of the step
- void setDeparted(SUMOTime now);
-
- /// logs end of the step
- void setArrived(SUMOTime now);
-
- /// Whether the container waits for a vehicle of the line specified.
- virtual bool isWaitingFor(const std::string& line) const;
-
- /// @brief Whether the container waits for a vehicle
- virtual bool isWaiting4Vehicle() const {
- return false;
- }
-
- /// @brief the time this container spent waiting
- virtual SUMOTime getWaitingTime(SUMOTime now) const = 0;
-
- /// @brief the speed of the container
- virtual SUMOReal getSpeed() const = 0;
-
- /// @brief get position on edge e at length at with orthogonal offset
- Position getEdgePosition(const MSEdge* e, SUMOReal at, SUMOReal offset) const;
-
- /// @brief get position on lane at length at with orthogonal offset
- Position getLanePosition(const MSLane* lane, SUMOReal at, SUMOReal offset) const;
-
- /// @brief get angle of the edge at a certain position
- SUMOReal getEdgeAngle(const MSEdge* e, SUMOReal at) const;
-
- /* @brief Return the current ContainerStop or the destination containe stop
- *
- * returns the current container stop if the stage=Waiting and the
- * container stop from wich the container departs if stage=Driving
- */
- virtual MSContainerStop* getDepartContainerStop() const = 0;
-
- /** @brief Called on writing tripinfo output
- * @param[in] os The stream to write the information into
- * @exception IOError not yet implemented
- */
- virtual void tripInfoOutput(OutputDevice& os) const = 0;
-
- /** @brief Called on writing vehroute output
- * @param[in] os The stream to write the information into
- * @exception IOError not yet implemented
- */
- virtual void routeOutput(OutputDevice& os) const = 0;
-
- /** @brief Called for writing the events output (begin of an action)
- * @param[in] os The stream to write the information into
- * @exception IOError not yet implemented
- */
- virtual void beginEventOutput(const MSContainer& container, SUMOTime t, OutputDevice& os) const = 0;
-
- /** @brief Called for writing the events output (end of an action)
- * @param[in] os The stream to write the information into
- * @exception IOError not yet implemented
- */
- virtual void endEventOutput(const MSContainer& container, SUMOTime t, OutputDevice& os) const = 0;
-
- protected:
- /// the next edge to reach by getting transported
- const MSEdge& myDestination;
-
- /// the time at which this stage started
- SUMOTime myDeparted;
-
- /// the time at which this stage ended
- SUMOTime myArrived;
-
- /// The type of this stage
- StageType myType;
-
- private:
- /// @brief Invalidated copy constructor.
- MSContainerStage(const MSContainerStage&);
-
- /// @brief Invalidated assignment operator.
- MSContainerStage& operator=(const MSContainerStage&);
-
- };
-
- /**
* A "real" stage performing the travelling by a transport system
* A container is in this stage if it is on a ride or if its waiting for a ride.
* The given route will be chosen. The travel time is computed by the simulation
*/
- class MSContainerStage_Driving : public MSContainerStage {
+ class MSContainerStage_Driving : public MSTransportable::Stage {
public:
/// constructor
- MSContainerStage_Driving(const MSEdge& destination, MSContainerStop* toCS,
+ MSContainerStage_Driving(const MSEdge& destination, MSStoppingPlace* toCS,
const std::vector<std::string>& lines);
/// destructor
~MSContainerStage_Driving();
/// proceeds to the next step
- virtual void proceed(MSNet* net, MSContainer* container, SUMOTime now, MSEdge* previousEdge, const SUMOReal at);
+ virtual void proceed(MSNet* net, MSTransportable* container, SUMOTime now, MSEdge* previousEdge, const SUMOReal at);
/// Returns the current edge
const MSEdge* getEdge() const;
@@ -246,7 +120,7 @@ public:
SUMOReal getSpeed() const;
/// @brief returns the container stop from which the container departs
- MSContainerStop* getDepartContainerStop() const;
+ MSStoppingPlace* getDepartContainerStop() const;
/// @brief assign a vehicle to the container
void setVehicle(SUMOVehicle* v) {
@@ -271,13 +145,13 @@ public:
* @param[in] os The stream to write the information into
* @exception IOError not yet implemented
*/
- virtual void beginEventOutput(const MSContainer& container, SUMOTime t, OutputDevice& os) const;
+ virtual void beginEventOutput(const MSTransportable& container, SUMOTime t, OutputDevice& os) const;
/** @brief Called for writing the events output (end of an action)
* @param[in] os The stream to write the information into
* @exception IOError not yet implemented
*/
- virtual void endEventOutput(const MSContainer& container, SUMOTime t, OutputDevice& os) const;
+ virtual void endEventOutput(const MSTransportable& container, SUMOTime t, OutputDevice& os) const;
private:
/// the lines to choose from
@@ -287,10 +161,10 @@ public:
SUMOVehicle* myVehicle;
/// @brief The destination container stop
- MSContainerStop* myDestinationContainerStop;
+ MSStoppingPlace* myDestinationContainerStop;
/// @brief The container stop from which the container departs
- MSContainerStop* myDepartContainerStop;
+ MSStoppingPlace* myDepartContainerStop;
SUMOReal myWaitingPos;
@@ -313,7 +187,7 @@ public:
* A container is in this stage if it is not on a ride or waiting for a ride, e.g.
* if it is stored, or if gets filled or emptied.
*/
- class MSContainerStage_Waiting : public MSContainerStage {
+ class MSContainerStage_Waiting : public MSTransportable::Stage {
public:
/// constructor
MSContainerStage_Waiting(const MSEdge& destination,
@@ -353,10 +227,10 @@ public:
* this method was added to have a method 'getDepartContainerStop'
* for MSContainer.
*/
- MSContainerStop* getDepartContainerStop() const;
+ MSStoppingPlace* getDepartContainerStop() const;
/// proceeds to the next step
- virtual void proceed(MSNet* net, MSContainer* container, SUMOTime now, MSEdge* previousEdge, const SUMOReal at);
+ virtual void proceed(MSNet* net, MSTransportable* container, SUMOTime now, MSEdge* previousEdge, const SUMOReal at);
/** @brief Called on writing tripinfo output
*
@@ -376,13 +250,13 @@ public:
* @param[in] os The stream to write the information into
* @exception IOError not yet implemented
*/
- virtual void beginEventOutput(const MSContainer& container, SUMOTime t, OutputDevice& os) const;
+ virtual void beginEventOutput(const MSTransportable& container, SUMOTime t, OutputDevice& os) const;
/** @brief Called for writing the events output (end of an action)
* @param[in] os The stream to write the information into
* @exception IOError not yet implemented
*/
- virtual void endEventOutput(const MSContainer& container, SUMOTime t, OutputDevice& os) const;
+ virtual void endEventOutput(const MSTransportable& container, SUMOTime t, OutputDevice& os) const;
private:
/// the time the container is waiting
@@ -400,7 +274,7 @@ public:
SUMOReal myStartPos;
/// @brief the container stop at which the container is waiting
- MSContainerStop* myCurrentContainerStop;
+ MSStoppingPlace* myCurrentContainerStop;
private:
@@ -417,18 +291,18 @@ public:
* A container is in this stage if it gets transhipred between two stops that are
* assumed to be connected.
*/
- class MSContainerStage_Tranship : public MSContainerStage {
+ class MSContainerStage_Tranship : public MSTransportable::Stage {
friend class MSCModel_NonInteracting;
public:
/// constructor
- MSContainerStage_Tranship(const std::vector<const MSEdge*>& route, MSContainerStop* toCS, SUMOReal speed, SUMOReal departPos, SUMOReal arrivalPos);
+ MSContainerStage_Tranship(const std::vector<const MSEdge*>& route, MSStoppingPlace* toCS, SUMOReal speed, SUMOReal departPos, SUMOReal arrivalPos);
/// destructor
~MSContainerStage_Tranship();
/// proceeds to the next step
- virtual void proceed(MSNet* net, MSContainer* container, SUMOTime now, MSEdge* previousEdge, const SUMOReal at);
+ virtual void proceed(MSNet* net, MSTransportable* container, SUMOTime now, MSEdge* previousEdge, const SUMOReal at);
/// Returns the current edge
const MSEdge* getEdge() const;
@@ -460,7 +334,7 @@ public:
}
/// @brief returns the container stop from which the container departs
- MSContainerStop* getDepartContainerStop() const;
+ MSStoppingPlace* getDepartContainerStop() const;
/** @brief Called on writing tripinfo output
* @param[in] os The stream to write the information into
@@ -478,16 +352,16 @@ public:
* @param[in] os The stream to write the information into
* @exception IOError not yet implemented
*/
- virtual void beginEventOutput(const MSContainer& c, SUMOTime t, OutputDevice& os) const;
+ virtual void beginEventOutput(const MSTransportable& c, SUMOTime t, OutputDevice& os) const;
/** @brief Called for writing the events output (end of an action)
* @param[in] os The stream to write the information into
* @exception IOError not yet implemented
*/
- virtual void endEventOutput(const MSContainer& c, SUMOTime t, OutputDevice& os) const;
+ virtual void endEventOutput(const MSTransportable& c, SUMOTime t, OutputDevice& os) const;
/// @brief move forward and return whether the container arrived
- bool moveToNextEdge(MSContainer* container, SUMOTime currentTime, MSEdge* nextInternal = 0);
+ bool moveToNextEdge(MSTransportable* container, SUMOTime currentTime, MSEdge* nextInternal = 0);
/// @brief accessors to be used by MSCModel_NonInteracting
@@ -525,10 +399,10 @@ public:
SUMOReal myArrivalPos;
/// @brief the destination container stop
- MSContainerStop* myDestinationContainerStop;
+ MSStoppingPlace* myDestinationContainerStop;
/// @brief The container stop from which the container departs
- MSContainerStop* myDepartContainerStop;
+ MSStoppingPlace* myDepartContainerStop;
/// @brief the speed of the container
SUMOReal mySpeed;
@@ -549,114 +423,16 @@ public:
};
public:
- /// the structure holding the plan of a container
- typedef std::vector<MSContainerStage*> MSContainerPlan;
-
- /// the last destination of the route of the container
- const MSEdge* lastDestination;
-
-protected:
- /// the plan of the container
- const SUMOVehicleParameter* myParameter;
-
- /// @brief This container's type. (mainly used for drawing related information
- /// Note sure if it is really necessary
- const MSVehicleType* myVType;
-
- /// the plan of the container
- MSContainerPlan* myPlan;
-
- /// the iterator over the route
- MSContainerPlan::iterator myStep;
-
- /// @brief Whether events shall be written
- bool myWriteEvents;
-
-public:
/// constructor
- MSContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSContainerPlan* plan);
+ MSContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportablePlan* plan);
/// destructor
virtual ~MSContainer();
- /// returns the container id
- const std::string& getID() const;
-
/* @brief proceeds to the next step of the route,
- * @return Whether the containers plan continues */
+ * @return Whether the persons plan continues */
bool proceed(MSNet* net, SUMOTime time);
- /// Returns the desired departure time.
- SUMOTime getDesiredDepart() const;
-
- /// logs depart time of the current stage
- void setDeparted(SUMOTime now);
-
- /// Returns the current destination.
- const MSEdge& getDestination() const {
- return (*myStep)->getDestination();
- }
-
- /// Returns the destination after the current destination.
- const MSEdge& getNextDestination() const {
- return (*(myStep + 1))->getDestination();
- }
-
- /// @brief Returns the current edge
- const MSEdge* getEdge() const {
- return (*myStep)->getEdge();
- }
-
- /// @brief Returns the departure edge
- const MSEdge* getFromEdge() const {
- return (*myStep)->getFromEdge();
- }
-
- /// @brief Return the position on the edge
- virtual SUMOReal getEdgePos() const;
-
- /// @brief Return the Network coordinate of the container
- virtual Position getPosition() const;
-
- /// @brief return the current angle of the container
- virtual SUMOReal getAngle() const;
-
- /// @brief the time this container spent waiting in seconds
- virtual SUMOReal getWaitingSeconds() const;
-
- /// @brief the current speed of the container
- virtual SUMOReal getSpeed() const;
-
- /// @brief the current stage type of the container
- StageType getCurrentStageType() const {
- return (*myStep)->getStageType();
- }
-
- /// Returns the current stage description as a string
- std::string getCurrentStageDescription() const {
- return (*myStep)->getStageDescription();
- }
-
- /// @brief Return the current stage
- MSContainerStage* getCurrentStage() const {
- return *myStep;
- }
-
- /* @brief Return the current ContainerStop or the destination containe stop
- *
- * returns the current container stop if the stage=Waiting and the
- * container stop from wich the container departs if stage=Driving
- */
- virtual MSContainerStop* getDepartContainerStop() const;
-
-
- /** @brief Called on writing tripinfo output
- *
- * @param[in] os The stream to write the information into
- * @exception IOError not yet implemented
- */
- void tripInfoOutput(OutputDevice& os) const;
-
/** @brief Called on writing vehroute output
*
* @param[in] os The stream to write the information into
@@ -664,24 +440,6 @@ public:
*/
void routeOutput(OutputDevice& os) const;
- /// Whether the container waits for a vehicle of the line specified.
- bool isWaitingFor(const std::string& line) const {
- return (*myStep)->isWaitingFor(line);
- }
-
- /// Whether the container waits for a vehicle
- bool isWaiting4Vehicle() const {
- return (*myStep)->isWaiting4Vehicle();
- }
-
- const SUMOVehicleParameter& getParameter() const {
- return *myParameter;
- }
-
- inline const MSVehicleType& getVehicleType() const {
- return *myVType;
- }
-
private:
/// @brief Invalidated copy constructor.
MSContainer(const MSContainer&);
diff --git a/src/microsim/MSContainerControl.cpp b/src/microsim/MSContainerControl.cpp
index d9116ea..8d6889b 100644
--- a/src/microsim/MSContainerControl.cpp
+++ b/src/microsim/MSContainerControl.cpp
@@ -3,7 +3,7 @@
/// @author Melanie Weber
/// @author Andreas Kendziorra
/// @date Mon, 16 Jun 2014
-/// @version $Id: MSContainerControl.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSContainerControl.cpp 18274 2015-04-22 15:00:44Z behrisch $
///
// Stores all containers in the net and handles their waiting for cars.
/****************************************************************************/
@@ -51,7 +51,7 @@ MSContainerControl::MSContainerControl() {}
MSContainerControl::~MSContainerControl() {
- for (std::map<std::string, MSContainer*>::iterator i = myContainers.begin(); i != myContainers.end(); ++i) {
+ for (std::map<std::string, MSTransportable*>::iterator i = myContainers.begin(); i != myContainers.end(); ++i) {
delete(*i).second;
}
myContainers.clear();
@@ -60,7 +60,7 @@ MSContainerControl::~MSContainerControl() {
bool
-MSContainerControl::add(const std::string& id, MSContainer* container) {
+MSContainerControl::add(const std::string& id, MSTransportable* container) {
if (myContainers.find(id) == myContainers.end()) {
myContainers[id] = container;
return true;
@@ -70,7 +70,7 @@ MSContainerControl::add(const std::string& id, MSContainer* container) {
void
-MSContainerControl::erase(MSContainer* container) {
+MSContainerControl::erase(MSTransportable* container) {
const std::string& id = container->getID();
if (OptionsCont::getOptions().isSet("tripinfo-output")) {
OutputDevice& od = OutputDevice::getDeviceByOption("tripinfo-output");
@@ -85,7 +85,7 @@ MSContainerControl::erase(MSContainer* container) {
od.closeTag();
od << "\n";
}
- const std::map<std::string, MSContainer*>::iterator i = myContainers.find(id);
+ const std::map<std::string, MSTransportable*>::iterator i = myContainers.find(id);
if (i != myContainers.end()) {
delete i->second;
myContainers.erase(i);
@@ -94,7 +94,7 @@ MSContainerControl::erase(MSContainer* container) {
void
-MSContainerControl::setDeparture(const SUMOTime time, MSContainer* container) {
+MSContainerControl::setDeparture(const SUMOTime time, MSTransportable* container) {
const SUMOTime step = time % DELTA_T == 0 ? time : (time / DELTA_T + 1) * DELTA_T;
if (myWaiting4Departure.find(step) == myWaiting4Departure.end()) {
myWaiting4Departure[step] = ContainerVector();
@@ -104,7 +104,7 @@ MSContainerControl::setDeparture(const SUMOTime time, MSContainer* container) {
void
-MSContainerControl::setWaitEnd(const SUMOTime time, MSContainer* container) {
+MSContainerControl::setWaitEnd(const SUMOTime time, MSTransportable* container) {
const SUMOTime step = time % DELTA_T == 0 ? time : (time / DELTA_T + 1) * DELTA_T;
if (myWaitingUntil.find(step) == myWaitingUntil.end()) {
myWaitingUntil[step] = ContainerVector();
@@ -139,9 +139,9 @@ MSContainerControl::checkWaitingContainers(MSNet* net, const SUMOTime time) {
void
-MSContainerControl::addWaiting(const MSEdge* const edge, MSContainer* container) {
+MSContainerControl::addWaiting(const MSEdge* const edge, MSTransportable* container) {
if (myWaiting4Vehicle.find(edge) == myWaiting4Vehicle.end()) {
- myWaiting4Vehicle[edge] = std::vector<MSContainer*>();
+ myWaiting4Vehicle[edge] = std::vector<MSTransportable*>();
}
myWaiting4Vehicle[edge].push_back(container);
}
@@ -202,14 +202,14 @@ MSContainerControl::hasNonWaiting() const {
void
-MSContainerControl::setTranship(MSContainer* c) {
+MSContainerControl::setTranship(MSTransportable* c) {
myTranship[c->getID()] = c;
}
void
-MSContainerControl::unsetTranship(MSContainer* c) {
- std::map<std::string, MSContainer*>::iterator i = myTranship.find(c->getID());
+MSContainerControl::unsetTranship(MSTransportable* c) {
+ std::map<std::string, MSTransportable*>::iterator i = myTranship.find(c->getID());
if (i != myTranship.end()) {
myTranship.erase(i);
}
@@ -222,7 +222,7 @@ MSContainerControl::abortWaiting() {
const MSEdge* edge = (*i).first;
const ContainerVector& pv = (*i).second;
for (ContainerVector::const_iterator j = pv.begin(); j != pv.end(); ++j) {
- MSContainer* p = (*j);
+ MSTransportable* p = (*j);
edge->removeContainer(p);
WRITE_WARNING("Container " + p->getID() + " aborted waiting for a transport that will never come.");
erase(p);
@@ -232,7 +232,7 @@ MSContainerControl::abortWaiting() {
MSContainer*
-MSContainerControl::buildContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSContainer::MSContainerPlan* plan) const {
+MSContainerControl::buildContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan) const {
return new MSContainer(pars, vtype, plan);
}
diff --git a/src/microsim/MSContainerControl.h b/src/microsim/MSContainerControl.h
index 881b008..3610eca 100644
--- a/src/microsim/MSContainerControl.h
+++ b/src/microsim/MSContainerControl.h
@@ -3,7 +3,7 @@
/// @author Melanie Weber
/// @author Andreas Kendziorra
/// @date Mon, 16 Jun 2014
-/// @version $Id: MSContainerControl.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSContainerControl.h 18274 2015-04-22 15:00:44Z behrisch $
///
// Stores all containers in the net and handles their waiting for cars.
/****************************************************************************/
@@ -57,7 +57,7 @@ class MSVehicle;
class MSContainerControl {
public:
- typedef std::vector<MSContainer*> ContainerVector;
+ typedef std::vector<MSTransportable*> ContainerVector;
/// constructor
MSContainerControl();
@@ -66,22 +66,22 @@ public:
virtual ~MSContainerControl();
/// adds a single container, returns false if an id clash occured
- bool add(const std::string& id, MSContainer* container);
+ bool add(const std::string& id, MSTransportable* container);
/// removes a single container
- virtual void erase(MSContainer* container);
+ virtual void erase(MSTransportable* container);
/// sets the arrival time for a waiting container
- void setDeparture(SUMOTime time, MSContainer* container);
+ void setDeparture(SUMOTime time, MSTransportable* container);
/// sets the arrival time for a waiting container
- void setWaitEnd(SUMOTime time, MSContainer* container);
+ void setWaitEnd(SUMOTime time, MSTransportable* container);
/// checks whether any containers waiting time is over
void checkWaitingContainers(MSNet* net, const SUMOTime time);
/// adds a container to the list of containers waiting for a vehicle on the specified edge
- void addWaiting(const MSEdge* edge, MSContainer* container);
+ void addWaiting(const MSEdge* edge, MSTransportable* container);
/** @brief load any applicable containers
* Loads any container that is waiting on that edge for the given vehicle and removes them from myWaiting
@@ -106,27 +106,20 @@ public:
* @param[in] vtype The type (reusing vehicle type container here)
* @param[in] plan This container's plan
*/
- virtual MSContainer* buildContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSContainer::MSContainerPlan* plan) const;
+ virtual MSContainer* buildContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan) const;
/// adds a container to myTranship
- void setTranship(MSContainer* c);
+ void setTranship(MSTransportable* c);
/// removes a container from myTranship
- void unsetTranship(MSContainer* c);
-//
-// /// @brief returns whether the the given container is waiting for a vehicle on the given edge
-// bool isWaiting4Vehicle(const MSEdge* const edge, MSContainer* p) const;
-//
-// const std::map<std::string, MSContainer*>& getContainers() const {
-// return myContainers;
-// }
-//
+ void unsetTranship(MSTransportable* c);
+
private:
/// all containers by id
- std::map<std::string, MSContainer*> myContainers;
+ std::map<std::string, MSTransportable*> myContainers;
/// all containers being transhiped
- std::map<std::string, MSContainer*> myTranship;
+ std::map<std::string, MSTransportable*> myTranship;
/// @brief Containers waiting for departure
std::map<SUMOTime, ContainerVector> myWaiting4Departure;
diff --git a/src/microsim/MSEdge.cpp b/src/microsim/MSEdge.cpp
index f8993e2..7791d94 100644
--- a/src/microsim/MSEdge.cpp
+++ b/src/microsim/MSEdge.cpp
@@ -8,7 +8,7 @@
/// @author Michael Behrisch
/// @author Sascha Krieg
/// @date Tue, 06 Mar 2001
-/// @version $Id: MSEdge.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSEdge.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// A road/street connecting two junctions
/****************************************************************************/
@@ -45,9 +45,9 @@
#include "MSLaneChanger.h"
#include "MSGlobals.h"
#include "MSVehicle.h"
-#include <microsim/pedestrians/MSPerson.h>
#include "MSContainer.h"
#include "MSEdgeWeightsStorage.h"
+#include <microsim/devices/MSDevice_Routing.h>
#ifdef HAVE_INTERNAL
#include <mesosim/MELoop.h>
@@ -237,7 +237,7 @@ MSEdge::getAllowedLanesWithDefault(const AllowedLanesCont& c, const MSEdge* dest
const std::vector<MSLane*>*
MSEdge::allowedLanes(const MSEdge* destination, SUMOVehicleClass vclass) const {
- if ((myMinimumPermissions & vclass) == vclass) {
+ if (destination == 0 && (myMinimumPermissions & vclass) == vclass) {
// all lanes allow vclass
return getAllowedLanesWithDefault(myAllowed, destination);
}
@@ -250,16 +250,33 @@ MSEdge::allowedLanes(const MSEdge* destination, SUMOVehicleClass vclass) const {
} else {
// this vclass is requested for the first time. rebuild all destinations
// go through connected edges
+#ifdef HAVE_FOX
+ if (MSDevice_Routing::isParallel()) {
+ MSDevice_Routing::lock();
+ }
+#endif
for (AllowedLanesCont::const_iterator i1 = myAllowed.begin(); i1 != myAllowed.end(); ++i1) {
const MSEdge* edge = i1->first;
const std::vector<MSLane*>* lanes = i1->second;
myClassedAllowed[vclass][edge] = new std::vector<MSLane*>();
// go through lanes approaching current edge
for (std::vector<MSLane*>::const_iterator i2 = lanes->begin(); i2 != lanes->end(); ++i2) {
- // allows the current vehicle class?
+ // origin lane allows the current vehicle class?
if ((*i2)->allowsVehicleClass(vclass)) {
- // -> may be used
- myClassedAllowed[vclass][edge]->push_back(*i2);
+ if (edge == 0) {
+ myClassedAllowed[vclass][edge]->push_back(*i2);
+ } else {
+ // target lane allows the current vehicle class?
+ const MSLinkCont& lc = (*i2)->getLinkCont();
+ for (MSLinkCont::const_iterator it_link = lc.begin(); it_link != lc.end(); ++it_link) {
+ const MSLane* targetLane = (*it_link)->getLane();
+ if ((&(targetLane->getEdge()) == edge) && targetLane->allowsVehicleClass(vclass)) {
+ // -> may be used
+ myClassedAllowed[vclass][edge]->push_back(*i2);
+ break;
+ }
+ }
+ }
}
}
// assert that 0 is returned if no connection is allowed for a class
@@ -268,6 +285,11 @@ MSEdge::allowedLanes(const MSEdge* destination, SUMOVehicleClass vclass) const {
myClassedAllowed[vclass][edge] = 0;
}
}
+#ifdef HAVE_FOX
+ if (MSDevice_Routing::isParallel()) {
+ MSDevice_Routing::unlock();
+ }
+#endif
return myClassedAllowed[vclass][destination];
}
}
@@ -644,34 +666,24 @@ MSEdge::getVehicleMaxSpeed(const SUMOVehicle* const veh) const {
}
-std::vector<MSPerson*>
+std::vector<MSTransportable*>
MSEdge::getSortedPersons(SUMOTime timestep) const {
- std::vector<MSPerson*> result(myPersons.begin(), myPersons.end());
- sort(result.begin(), result.end(), person_by_offset_sorter(timestep));
+ std::vector<MSTransportable*> result(myPersons.begin(), myPersons.end());
+ sort(result.begin(), result.end(), transportable_by_position_sorter(timestep));
return result;
}
-std::vector<MSContainer*>
+std::vector<MSTransportable*>
MSEdge::getSortedContainers(SUMOTime timestep) const {
- std::vector<MSContainer*> result(myContainers.begin(), myContainers.end());
- sort(result.begin(), result.end(), container_by_position_sorter(timestep));
+ std::vector<MSTransportable*> result(myContainers.begin(), myContainers.end());
+ sort(result.begin(), result.end(), transportable_by_position_sorter(timestep));
return result;
}
int
-MSEdge::person_by_offset_sorter::operator()(const MSPerson* const p1, const MSPerson* const p2) const {
- const SUMOReal pos1 = p1->getCurrentStage()->getEdgePos(myTime);
- const SUMOReal pos2 = p2->getCurrentStage()->getEdgePos(myTime);
- if (pos1 != pos2) {
- return pos1 < pos2;
- }
- return p1->getID() < p2->getID();
-}
-
-int
-MSEdge::container_by_position_sorter::operator()(const MSContainer* const c1, const MSContainer* const c2) const {
+MSEdge::transportable_by_position_sorter::operator()(const MSTransportable* const c1, const MSTransportable* const c2) const {
const SUMOReal pos1 = c1->getCurrentStage()->getEdgePos(myTime);
const SUMOReal pos2 = c2->getCurrentStage()->getEdgePos(myTime);
if (pos1 != pos2) {
@@ -682,21 +694,36 @@ MSEdge::container_by_position_sorter::operator()(const MSContainer* const c1, co
const MSEdgeVector&
MSEdge::getSuccessors(SUMOVehicleClass vClass) const {
- if (vClass == SVC_IGNORING) {
+ if (vClass == SVC_IGNORING || !MSNet::getInstance()->hasPermissions()) {
return mySuccessors;
}
- ClassesSuccesorMap::const_iterator i = myClassesSuccessorMap.find(vClass);
+#ifdef HAVE_FOX
+ if (MSDevice_Routing::isParallel()) {
+ MSDevice_Routing::lock();
+ }
+#endif
+ std::map<SUMOVehicleClass, MSEdgeVector>::const_iterator i = myClassesSuccessorMap.find(vClass);
if (i != myClassesSuccessorMap.end()) {
// can use cached value
+#ifdef HAVE_FOX
+ if (MSDevice_Routing::isParallel()) {
+ MSDevice_Routing::unlock();
+ }
+#endif
return i->second;
} else {
- // this vClass is requested for the first time. rebuild all succesors
+ // this vClass is requested for the first time. rebuild all successors
for (MSEdgeVector::const_iterator it = mySuccessors.begin(); it != mySuccessors.end(); ++it) {
const std::vector<MSLane*>* allowed = allowedLanes(*it, vClass);
- if (allowed == 0 || allowed->size() > 0) {
+ if (allowed != 0 && allowed->size() > 0) {
myClassesSuccessorMap[vClass].push_back(*it);
}
}
+#ifdef HAVE_FOX
+ if (MSDevice_Routing::isParallel()) {
+ MSDevice_Routing::unlock();
+ }
+#endif
return myClassesSuccessorMap[vClass];
}
}
diff --git a/src/microsim/MSEdge.h b/src/microsim/MSEdge.h
index f939c4a..6673dda 100644
--- a/src/microsim/MSEdge.h
+++ b/src/microsim/MSEdge.h
@@ -6,7 +6,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Mon, 12 Mar 2001
-/// @version $Id: MSEdge.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSEdge.h 18467 2015-05-29 03:50:41Z behrisch $
///
// A road/street connecting two junctions
/****************************************************************************/
@@ -192,14 +192,14 @@ public:
*
* @return This edge's persons sorted by pos
*/
- std::vector<MSPerson*> getSortedPersons(SUMOTime timestep) const;
+ std::vector<MSTransportable*> getSortedPersons(SUMOTime timestep) const;
/** @brief Returns this edge's containers sorted by pos
*
* @return This edge's containers sorted by pos
*/
- std::vector<MSContainer*> getSortedContainers(SUMOTime timestep) const;
+ std::vector<MSTransportable*> getSortedContainers(SUMOTime timestep) const;
/** @brief Get the allowed lanes to reach the destination-edge.
*
@@ -409,7 +409,7 @@ public:
/// @brief returns the minimum travel time for the given vehicle
inline SUMOReal getMinimumTravelTime(const SUMOVehicle* const veh) const {
if (veh != 0) {
- return getLength() / MIN2(veh->getMaxSpeed(), getVehicleMaxSpeed(veh));
+ return getLength() / getVehicleMaxSpeed(veh);
} else {
return getLength() / getSpeedLimit();
}
@@ -546,32 +546,30 @@ public:
/** @brief Returns the maximum speed the vehicle may use on this edge
*
- * Note that the vehicle's max. speed is not considered herein, only the edge's speed limit and the
- * driver's adaptation of this speed.
* @caution Only the first lane is considered
* @return The maximum velocity on this edge for the given vehicle
*/
SUMOReal getVehicleMaxSpeed(const SUMOVehicle* const veh) const;
- virtual void addPerson(MSPerson* p) const {
+ virtual void addPerson(MSTransportable* p) const {
myPersons.insert(p);
}
- virtual void removePerson(MSPerson* p) const {
- std::set<MSPerson*>::iterator i = myPersons.find(p);
+ virtual void removePerson(MSTransportable* p) const {
+ std::set<MSTransportable*>::iterator i = myPersons.find(p);
if (i != myPersons.end()) {
myPersons.erase(i);
}
}
/// @brief Add a container to myContainers
- virtual void addContainer(MSContainer* container) const {
+ virtual void addContainer(MSTransportable* container) const {
myContainers.insert(container);
}
/// @brief Remove container from myContainers
- virtual void removeContainer(MSContainer* container) const {
- std::set<MSContainer*>::iterator i = myContainers.find(container);
+ virtual void removeContainer(MSTransportable* container) const {
+ std::set<MSTransportable*>::iterator i = myContainers.find(container);
if (i != myContainers.end()) {
myContainers.erase(i);
}
@@ -656,30 +654,16 @@ protected:
};
- /** @class person_by_offset_sorter
- * @brief Sorts persons by their positions
+ /** @class transportable_by_position_sorter
+ * @brief Sorts transportables by their positions
*/
- class person_by_offset_sorter {
+ class transportable_by_position_sorter {
public:
/// @brief constructor
- explicit person_by_offset_sorter(SUMOTime timestep): myTime(timestep) { }
+ explicit transportable_by_position_sorter(SUMOTime timestep): myTime(timestep) { }
/// @brief comparing operator
- int operator()(const MSPerson* const p1, const MSPerson* const p2) const;
- private:
- SUMOTime myTime;
- };
-
- /** @class container_by_position_sorter
- * @brief Sorts containers by their positions
- */
- class container_by_position_sorter {
- public:
- /// @brief constructor
- explicit container_by_position_sorter(SUMOTime timestep): myTime(timestep) { }
-
- /// @brief comparing operator
- int operator()(const MSContainer* const c1, const MSContainer* const c2) const;
+ int operator()(const MSTransportable* const c1, const MSTransportable* const c2) const;
private:
SUMOTime myTime;
};
@@ -730,10 +714,10 @@ protected:
MSJunction* myToJunction;
/// @brief Persons on the edge (only for drawing)
- mutable std::set<MSPerson*> myPersons;
+ mutable std::set<MSTransportable*> myPersons;
/// @brief Containers on the edge
- mutable std::set<MSContainer*> myContainers;
+ mutable std::set<MSTransportable*> myContainers;
/// @name Storages for allowed lanes (depending on vehicle classes)
/// @{
@@ -791,8 +775,7 @@ protected:
/// @brief The successors available for a given vClass
- typedef std::map<SUMOVehicleClass, MSEdgeVector> ClassesSuccesorMap;
- mutable ClassesSuccesorMap myClassesSuccessorMap;
+ mutable std::map<SUMOVehicleClass, MSEdgeVector> myClassesSuccessorMap;
private:
/// @brief Invalidated copy constructor.
diff --git a/src/microsim/MSFrame.cpp b/src/microsim/MSFrame.cpp
index 5817bb2..fd6700a 100644
--- a/src/microsim/MSFrame.cpp
+++ b/src/microsim/MSFrame.cpp
@@ -1,4 +1,4 @@
-/****************************************************************************/
+/****************************************************************************/
/// @file MSFrame.cpp
/// @author Daniel Krajzewicz
/// @author Eric Nicolay
@@ -8,7 +8,7 @@
/// @author Mario Krumnow
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: MSFrame.cpp 18103 2015-03-18 12:05:24Z namdre $
+/// @version $Id: MSFrame.cpp 18686 2015-08-21 14:52:03Z namdre $
///
// Sets and checks options for microsim; inits global outputs and settings
/****************************************************************************/
@@ -106,7 +106,7 @@ MSFrame::fillOptions() {
oc.doRegister("load-state", new Option_FileName());//!!! check, describe
oc.addDescription("load-state", "Input", "Loads a network state from FILE");
oc.doRegister("load-state.offset", new Option_String("0", "TIME"));//!!! check, describe
- oc.addDescription("load-state.offset", "Input", "Sets the time offset for vehicle segment exit times");
+ oc.addDescription("load-state.offset", "Input", "Shifts all times loaded from a saved state by the given offset");
// register output options
oc.doRegister("netstate-dump", new Option_FileName());
@@ -128,6 +128,12 @@ MSFrame::fillOptions() {
oc.doRegister("emission-output", new Option_FileName());
oc.addDescription("emission-output", "Output", "Save the emission values of each vehicle");
+
+ oc.doRegister("battery-output", new Option_FileName());
+ oc.addDescription("battery-output", "Output", "Save the battery values of each vehicle");
+ oc.doRegister("battery-output.precision", new Option_Integer(OUTPUT_ACCURACY));
+ oc.addDescription("battery-output.precision", "Output", "Write battery values with the given precision (default 2)");
+
oc.doRegister("fcd-output", new Option_FileName());
oc.addDescription("fcd-output", "Output", "Save the Floating Car Data");
oc.doRegister("fcd-output.geo", new Option_Bool(false));
@@ -179,6 +185,10 @@ MSFrame::fillOptions() {
oc.addSynonyme("vehroute-output.intended-depart", "vehroutes.intended-depart");
oc.addDescription("vehroute-output.intended-depart", "Output", "Write the output with the intended instead of the real departure time");
+ oc.doRegister("vehroute-output.route-length", new Option_Bool(false));
+ oc.addSynonyme("vehroute-output.route-length", "vehroutes.route-length");
+ oc.addDescription("vehroute-output.route-length", "Output", "Include total route length in the output");
+
oc.doRegister("vehroute-output.write-unfinished", new Option_Bool(false));
oc.addDescription("vehroute-output.write-unfinished", "Output", "Write vehroute output for vehicles which have not arrived at simulation end");
@@ -239,7 +249,7 @@ MSFrame::fillOptions() {
oc.addDescription("max-num-vehicles", "Processing", "Quit simulation if this number of vehicles is exceeded");
oc.doRegister("scale", new Option_Float());
- oc.addDescription("scale", "Processing", "Scale demand by the given factor (0..1)");
+ oc.addDescription("scale", "Processing", "Scale demand by the given factor (by discarding or duplicating vehicles)");
oc.doRegister("time-to-teleport", new Option_String("300", "TIME"));
oc.addDescription("time-to-teleport", "Processing", "Specify how long a vehicle may wait until being teleported, defaults to 300, non-positive values disable teleporting");
@@ -284,8 +294,8 @@ MSFrame::fillOptions() {
oc.doRegister("routing-algorithm", new Option_String("dijkstra"));
oc.addDescription("routing-algorithm", "Routing",
"Select among routing algorithms ['dijkstra', 'astar', 'CH', 'CHWrapper']");
- oc.doRegister("weights.random-factor", new Option_Float());
- oc.addDescription("weights.random-factor", "Routing", "Edge weights for routing are dynamically disturbed by a random factor between [1,FLOAT]");
+ oc.doRegister("weights.random-factor", new Option_Float(1.));
+ oc.addDescription("weights.random-factor", "Routing", "Edge weights for routing are dynamically disturbed by a random factor drawn uniformly from [1,FLOAT)");
// devices
oc.addOptionSubTopic("Emissions");
@@ -293,6 +303,7 @@ MSFrame::fillOptions() {
oc.addDescription("phemlight-path", "Emissions", "Determines where to load PHEMlight definitions from.");
oc.addOptionSubTopic("Communication");
+ oc.addOptionSubTopic("Battery");
MSDevice::insertOptions(oc);
// register report options
@@ -381,6 +392,7 @@ MSFrame::buildStreams() {
//extended
OutputDevice::createDeviceByOption("fcd-output", "fcd-export", "fcd_file.xsd");
OutputDevice::createDeviceByOption("emission-output", "emission-export", "emission_file.xsd");
+ OutputDevice::createDeviceByOption("battery-output", "battery-export");
OutputDevice::createDeviceByOption("full-output", "full-export", "full_file.xsd");
OutputDevice::createDeviceByOption("queue-output", "queue-export", "queue_file.xsd");
OutputDevice::createDeviceByOption("amitran-output", "trajectories", "amitran/trajectories.xsd\" timeStepSize=\"" + toString(STEPS2MS(DELTA_T)));
diff --git a/src/microsim/MSInsertionControl.cpp b/src/microsim/MSInsertionControl.cpp
index 27e254c..92d9ba1 100644
--- a/src/microsim/MSInsertionControl.cpp
+++ b/src/microsim/MSInsertionControl.cpp
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Mon, 12 Mar 2001
-/// @version $Id: MSInsertionControl.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSInsertionControl.cpp 18473 2015-06-03 21:35:22Z namdre $
///
// Inserts vehicles into the network when their departure time is reached
/****************************************************************************/
@@ -141,6 +141,11 @@ MSInsertionControl::tryInsert(SUMOTime time, SUMOVehicle* veh,
MSVehicleContainer::VehicleVector& refusedEmits) {
assert(veh->getParameter().depart < time + DELTA_T);
const MSEdge& edge = *veh->getEdge();
+ if (veh->isOnRoad()) {
+ // may have been inserted forcefully already
+ veh->onDepart();
+ return 1;
+ }
if ((!myCheckEdgesOnce || edge.getLastFailedInsertionTime() != time) && edge.insertVehicle(*veh, time)) {
// Successful insertion
checkFlowWait(veh);
diff --git a/src/microsim/MSInternalJunction.cpp b/src/microsim/MSInternalJunction.cpp
index ab801b6..5196d97 100644
--- a/src/microsim/MSInternalJunction.cpp
+++ b/src/microsim/MSInternalJunction.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Wed, 12 Dez 2001
-/// @version $Id: MSInternalJunction.cpp 18153 2015-03-26 08:19:10Z namdre $
+/// @version $Id: MSInternalJunction.cpp 18635 2015-08-14 13:33:44Z namdre $
///
// junction.
/****************************************************************************/
@@ -73,9 +73,12 @@ MSInternalJunction::postloadInit() {
assert(specialLane->getLinkCont().size() == 1);
MSLink* thisLink = specialLane->getLinkCont()[0];
const MSRightOfWayJunction* parent = dynamic_cast<const MSRightOfWayJunction*>(specialLane->getEdge().getToJunction());
- assert(parent != 0);
+ if (parent == 0) {
+ // parent has type traffic_light_unregulated
+ return;
+ }
const int ownLinkIndex = specialLane->getIncomingLanes()[0].viaLink->getIndex();
- const MSLogicJunction::LinkFoes& foeLinks = parent->getLogic()->getFoesFor(ownLinkIndex);
+ const MSLogicJunction::LinkBits& response = parent->getLogic()->getResponseFor(ownLinkIndex);
// inform links where they have to report approaching vehicles to
unsigned int requestPos = 0;
for (std::vector<MSLane*>::iterator i = myInternalLanes.begin(); i != myInternalLanes.end(); ++i) {
@@ -83,7 +86,7 @@ MSInternalJunction::postloadInit() {
for (MSLinkCont::const_iterator q = lc.begin(); q != lc.end(); ++q) {
if ((*q)->getViaLane() != 0) {
const int foeIndex = (*i)->getIncomingLanes()[0].viaLink->getIndex();
- if (foeLinks.test(foeIndex)) {
+ if (response.test(foeIndex)) {
// only respect vehicles before internal junctions if they
// have priority (see the analogous foeLinks.test() when
// initializing myLinkFoeInternalLanes in MSRightOfWayJunction
diff --git a/src/microsim/MSJunctionLogic.cpp b/src/microsim/MSJunctionLogic.cpp
index 0de8e2a..60d0df4 100644
--- a/src/microsim/MSJunctionLogic.cpp
+++ b/src/microsim/MSJunctionLogic.cpp
@@ -4,7 +4,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date Wed, 12 Dez 2001
-/// @version $Id: MSJunctionLogic.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSJunctionLogic.cpp 18635 2015-08-14 13:33:44Z namdre $
///
// kinds of logic-implementations.
/****************************************************************************/
@@ -40,7 +40,7 @@
// ===========================================================================
// static variable definitions
// ===========================================================================
-MSLogicJunction::LinkFoes MSJunctionLogic::myDummyFoes;
+MSLogicJunction::LinkBits MSJunctionLogic::myDummyFoes;
// ===========================================================================
diff --git a/src/microsim/MSJunctionLogic.h b/src/microsim/MSJunctionLogic.h
index a0ed734..3c81d85 100644
--- a/src/microsim/MSJunctionLogic.h
+++ b/src/microsim/MSJunctionLogic.h
@@ -4,7 +4,7 @@
/// @author Daniel Krajzewicz
/// @author Sascha Krieg
/// @date Wed, 12 Dez 2001
-/// @version $Id: MSJunctionLogic.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSJunctionLogic.h 18756 2015-08-31 19:16:33Z behrisch $
///
// kinds of logic-implementations.
/****************************************************************************/
@@ -51,13 +51,14 @@ public:
/// Returns the logic's number of links.
unsigned int nLinks();
- /// Returns the foes of the given link
- virtual const MSLogicJunction::LinkFoes& getFoesFor(unsigned int linkIndex) const {
+ /// @brief Returns the response for the given link
+ virtual const MSLogicJunction::LinkBits& getResponseFor(unsigned int linkIndex) const {
UNUSED_PARAMETER(linkIndex);
return myDummyFoes;
}
- virtual const std::bitset<64>& getInternalFoesFor(unsigned int linkIndex) const {
+ /// @brief Returns the foes for the given link
+ virtual const MSLogicJunction::LinkBits& getFoesFor(unsigned int linkIndex) const {
UNUSED_PARAMETER(linkIndex);
return myDummyFoes;
}
@@ -86,7 +87,7 @@ protected:
unsigned int myNLinks;
/// @brief A dummy foe container
- static MSLogicJunction::LinkFoes myDummyFoes;
+ static MSLogicJunction::LinkBits myDummyFoes;
private:
/// Default constructor.
diff --git a/src/microsim/MSLane.cpp b/src/microsim/MSLane.cpp
index 55393fa..8548c5b 100644
--- a/src/microsim/MSLane.cpp
+++ b/src/microsim/MSLane.cpp
@@ -9,7 +9,7 @@
/// @author Christoph Sommer
/// @author Mario Krumnow
/// @date Mon, 05 Mar 2001
-/// @version $Id: MSLane.cpp 18108 2015-03-19 11:11:30Z behrisch $
+/// @version $Id: MSLane.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Representation of a lane in the micro simulation
/****************************************************************************/
@@ -93,7 +93,9 @@ MSLane::MSLane(const std::string& id, SUMOReal maxSpeed, SUMOReal length, MSEdge
myPermissions(permissions),
myLogicalPredecessorLane(0),
myBruttoVehicleLengthSum(0), myNettoVehicleLengthSum(0), myInlappingVehicleEnd(10000), myInlappingVehicle(0),
- myLengthGeometryFactor(myShape.length() / myLength) {}
+ myLengthGeometryFactor(myShape.length() / myLength) {
+ myRestrictions = MSNet::getInstance()->getRestrictions(edge->getEdgeType());
+}
MSLane::~MSLane() {
@@ -354,13 +356,9 @@ MSLane::freeInsertion(MSVehicle& veh, SUMOReal mspeed,
}
-bool
-MSLane::insertVehicle(MSVehicle& veh) {
- SUMOReal pos = 0;
+SUMOReal
+MSLane::getDepartSpeed(const MSVehicle& veh, bool& patchSpeed) {
SUMOReal speed = 0;
- bool patchSpeed = true; // whether the speed shall be adapted to infrastructure/traffic in front
-
- // determine the speed
const SUMOVehicleParameter& pars = veh.getParameter();
switch (pars.departSpeedProcedure) {
case DEPART_SPEED_GIVEN:
@@ -368,11 +366,11 @@ MSLane::insertVehicle(MSVehicle& veh) {
patchSpeed = false;
break;
case DEPART_SPEED_RANDOM:
- speed = RandHelper::rand(MIN2(veh.getMaxSpeed(), getVehicleMaxSpeed(&veh)));
+ speed = RandHelper::rand(getVehicleMaxSpeed(&veh));
patchSpeed = true; // @todo check
break;
case DEPART_SPEED_MAX:
- speed = MIN2(veh.getMaxSpeed(), getVehicleMaxSpeed(&veh));
+ speed = getVehicleMaxSpeed(&veh);
patchSpeed = true; // @todo check
break;
case DEPART_SPEED_DEFAULT:
@@ -381,6 +379,16 @@ MSLane::insertVehicle(MSVehicle& veh) {
patchSpeed = false; // @todo check
break;
}
+ return speed;
+}
+
+
+bool
+MSLane::insertVehicle(MSVehicle& veh) {
+ SUMOReal pos = 0;
+ bool patchSpeed = true; // whether the speed shall be adapted to infrastructure/traffic in front
+ const SUMOVehicleParameter& pars = veh.getParameter();
+ SUMOReal speed = getDepartSpeed(veh, patchSpeed);
// determine the position
switch (pars.departPosProcedure) {
@@ -452,6 +460,11 @@ MSLane::isInsertionSuccess(MSVehicle* aVehicle,
aVehicle->getID() + "'. Inserting at lane end instead.");
pos = myLength;
}
+ std::string msg;
+ if (!MSGlobals::gCheckRoutes && aVehicle->getParameter().wasSet(VEHPARS_FORCE_REROUTE) && !aVehicle->hasValidRoute(msg)) {
+ MSNet::getInstance()->getInsertionControl().descheduleDeparture(aVehicle);
+ return false;
+ }
aVehicle->setTentativeLaneAndPosition(this, pos);
aVehicle->updateBestLanes(false, this);
const MSCFModel& cfModel = aVehicle->getCarFollowModel();
@@ -625,7 +638,9 @@ MSLane::isInsertionSuccess(MSVehicle* aVehicle,
void
MSLane::forceVehicleInsertion(MSVehicle* veh, SUMOReal pos) {
veh->updateBestLanes(true, this);
- incorporateVehicle(veh, pos, veh->getSpeed(), find_if(myVehicles.begin(), myVehicles.end(), bind2nd(VehPosition(), pos)));
+ bool dummy;
+ const SUMOReal speed = veh->hasDeparted() ? veh->getSpeed() : getDepartSpeed(*veh, dummy);
+ incorporateVehicle(veh, pos, speed, find_if(myVehicles.begin(), myVehicles.end(), bind2nd(VehPosition(), pos)));
}
@@ -634,6 +649,14 @@ SUMOReal
MSLane::setPartialOccupation(MSVehicle* v, SUMOReal leftVehicleLength) {
myInlappingVehicle = v;
myInlappingVehicleEnd = myLength - leftVehicleLength;
+ if (v->getLaneChangeModel().isChangingLanes()) {
+ MSLane* shadowLane = v->getLaneChangeModel().getShadowLane(this);
+ if (shadowLane != 0) {
+ v->getLaneChangeModel().setShadowPartialOccupator(shadowLane);
+ shadowLane->myInlappingVehicle = v;
+ shadowLane->myInlappingVehicleEnd = myLength - leftVehicleLength;
+ }
+ }
return myLength;
}
@@ -643,6 +666,13 @@ MSLane::resetPartialOccupation(MSVehicle* v) {
if (v == myInlappingVehicle) {
myInlappingVehicleEnd = 10000;
myInlappingVehicle = 0;
+ if (v->getLaneChangeModel().isChangingLanes()) {
+ MSLane* shadowLane = v->getLaneChangeModel().getShadowLane(this);
+ if (shadowLane != 0 && v == shadowLane->myInlappingVehicle) {
+ shadowLane->myInlappingVehicle = 0;
+ shadowLane->myInlappingVehicleEnd = 10000;
+ }
+ }
}
}
@@ -696,9 +726,7 @@ MSLane::detectCollisions(SUMOTime timestep, const std::string& stage) {
++veh;
continue;
}
- SUMOReal gap = (*pred)->getPositionOnLane() - (*pred)->getVehicleType().getLength() - (*veh)->getPositionOnLane() - (*veh)->getVehicleType().getMinGap();
- if (gap < -NUMERICAL_EPS) {
- handleCollision(timestep, stage, *veh, *pred, gap);
+ if (handleCollision(timestep, stage, *veh, *pred, (*pred)->getPositionOnLane() - (*pred)->getVehicleType().getLength())) {
veh = myVehicles.erase(veh); // remove current vehicle
lastVeh = myVehicles.end() - 1;
if (veh == myVehicles.end()) {
@@ -710,31 +738,41 @@ MSLane::detectCollisions(SUMOTime timestep, const std::string& stage) {
}
MSVehicle* predV = getPartialOccupator();
if (predV != 0) {
- SUMOReal gap = getPartialOccupatorEnd() - (*lastVeh)->getPositionOnLane() - (*lastVeh)->getVehicleType().getMinGap();
- if (gap < -NUMERICAL_EPS) {
- handleCollision(timestep, stage, *lastVeh, predV, gap);
+ if (handleCollision(timestep, stage, *lastVeh, predV, getPartialOccupatorEnd())) {
myVehicles.erase(lastVeh);
}
}
}
-void
-MSLane::handleCollision(SUMOTime timestep, const std::string& stage, MSVehicle* collider, MSVehicle* victim, const SUMOReal gap) {
- if (collider->getLane() == this) {
- WRITE_WARNING("Teleporting vehicle '" + collider->getID() + "'; collision with '"
- + victim->getID() + "', lane='" + getID() + "', gap=" + toString(gap)
- + ", time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + " stage=" + stage + ".");
- MSNet::getInstance()->getVehicleControl().registerCollision();
- myBruttoVehicleLengthSum -= collider->getVehicleType().getLengthWithGap();
- myNettoVehicleLengthSum -= collider->getVehicleType().getLength();
- MSVehicleTransfer::getInstance()->add(timestep, collider);
- } else {
- WRITE_WARNING("Shadow of vehicle '" + collider->getID() + "'; collision with '"
- + victim->getID() + "', lane='" + getID() + "', gap=" + toString(gap)
- + ", time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + " stage=" + stage + ".");
- collider->getLaneChangeModel().endLaneChangeManeuver();
+bool
+MSLane::handleCollision(SUMOTime timestep, const std::string& stage, MSVehicle* collider, MSVehicle* victim, const SUMOReal victimRear) {
+ const SUMOReal gap = victimRear - collider->getPositionOnLane() - collider->getVehicleType().getMinGap();
+ if (gap < -NUMERICAL_EPS) {
+ if (collider->getLane() == this) {
+ if (MSGlobals::gLaneChangeDuration > DELTA_T
+ && collider->getLaneChangeModel().isChangingLanes()
+ && victim->getLaneChangeModel().isChangingLanes()
+ && victim->getLane() != this) {
+ // synchroneous lane change maneuver
+ return false;
+ }
+ WRITE_WARNING("Teleporting vehicle '" + collider->getID() + "'; collision with '"
+ + victim->getID() + "', lane='" + getID() + "', gap=" + toString(gap)
+ + ", time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + " stage=" + stage + ".");
+ MSNet::getInstance()->getVehicleControl().registerCollision();
+ myBruttoVehicleLengthSum -= collider->getVehicleType().getLengthWithGap();
+ myNettoVehicleLengthSum -= collider->getVehicleType().getLength();
+ MSVehicleTransfer::getInstance()->add(timestep, collider);
+ return true;
+ } else {
+ //WRITE_WARNING("Shadow of vehicle '" + collider->getID() + "'; collision with '"
+ // + victim->getID() + "', lane='" + getID() + "', gap=" + toString(gap)
+ // + ", time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + " stage=" + stage + ".");
+ //collider->getLaneChangeModel().endLaneChangeManeuver(MSMoveReminder::NOTIFICATION_TELEPORT);
+ }
}
+ return false;
}
@@ -774,7 +812,7 @@ MSLane::executeMovements(SUMOTime t, std::vector<MSLane*>& into) {
SUMOReal oldPos = veh->getPositionOnLane() - SPEED2DIST(veh->getSpeed());
veh->workOnMoveReminders(oldPos, veh->getPositionOnLane(), pspeed);
into.push_back(target);
- if (veh->getLaneChangeModel().isChangingLanes()) {
+ if (veh->getLaneChangeModel().hasShadowVehicle()) {
MSLane* shadowLane = veh->getLaneChangeModel().getShadowLane();
if (shadowLane != 0) {
into.push_back(shadowLane);
@@ -805,7 +843,7 @@ MSLane::executeMovements(SUMOTime t, std::vector<MSLane*>& into) {
if (myVehicles.size() > 0) {
if (MSGlobals::gTimeToGridlock > 0 || MSGlobals::gTimeToGridlockHighways > 0) {
MSVehicle* veh = myVehicles.back(); // the vehice at the front of the queue
- if (!veh->isStopped()) {
+ if (!veh->isStopped() && veh->getLane() == this) {
const bool wrongLane = !veh->getLane()->appropriate(veh);
const bool r1 = MSGlobals::gTimeToGridlock > 0 && veh->getWaitingTime() > MSGlobals::gTimeToGridlock;
const bool r2 = MSGlobals::gTimeToGridlockHighways > 0 && veh->getWaitingTime() > MSGlobals::gTimeToGridlockHighways && veh->getLane()->getSpeedLimit() > 69. / 3.6 && wrongLane;
@@ -986,7 +1024,8 @@ MSLane::succLinkSec(const SUMOVehicle& veh, unsigned int nRouteSuccs,
// if we are on an internal lane there should only be one link and it must be allowed
if (succLinkSource.getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) {
assert(succLinkSource.myLinks.size() == 1);
- assert(succLinkSource.myLinks[0]->getLane()->allowsVehicleClass(veh.getVehicleType().getVehicleClass()));
+ // could have been disallowed dynamically with a rerouter or via TraCI
+ // assert(succLinkSource.myLinks[0]->getLane()->allowsVehicleClass(veh.getVehicleType().getVehicleClass()));
return succLinkSource.myLinks.begin();
}
// a link may be used if
@@ -1210,6 +1249,36 @@ MSLane::getFollowerOnConsecutive(
return result;
}
+std::pair<MSVehicle* const, SUMOReal>
+MSLane::getLeader(const MSVehicle* veh, const SUMOReal vehPos, bool checkNext) const {
+ // get the leading vehicle for (shadow) veh
+ // XXX this only works as long as all lanes of an edge have equal length
+ for (VehCont::const_iterator i = myVehicles.begin(); i != myVehicles.end(); ++i) {
+ if ((*i)->getPositionOnLane() > vehPos + NUMERICAL_EPS) {
+ // XXX refactor leaderInfo to use a const vehicle all the way through the call hierarchy
+ MSVehicle* pred = (MSVehicle*)*i;
+ return std::pair<MSVehicle* const, SUMOReal>(pred, pred->getPositionOnLane() - pred->getVehicleType().getLength() - veh->getVehicleType().getMinGap() - vehPos);
+ }
+ }
+ // XXX from here on the code mirrors MSLaneChanger::getRealLeader
+ MSVehicle* pred = getPartialOccupator();
+ if (pred != 0) {
+ return std::pair<MSVehicle*, SUMOReal>(pred, getPartialOccupatorEnd() - veh->getVehicleType().getMinGap() - vehPos);
+ }
+ if (checkNext) {
+ SUMOReal seen = getLength() - vehPos;
+ SUMOReal speed = veh->getSpeed();
+ SUMOReal dist = veh->getCarFollowModel().brakeGap(speed) + veh->getVehicleType().getMinGap();
+ if (seen > dist) {
+ return std::pair<MSVehicle* const, SUMOReal>(static_cast<MSVehicle*>(0), -1);
+ }
+ const std::vector<MSLane*>& bestLaneConts = veh->getBestLanesContinuation(this);
+ return getLeaderOnConsecutive(dist, seen, speed, *veh, bestLaneConts);
+ } else {
+ return std::make_pair(static_cast<MSVehicle*>(0), -1);
+ }
+}
+
std::pair<MSVehicle* const, SUMOReal>
MSLane::getLeaderOnConsecutive(SUMOReal dist, SUMOReal seen, SUMOReal speed, const MSVehicle& veh,
@@ -1369,7 +1438,7 @@ MSLane::getLogicalPredecessorLane() const {
++i;
}
}
- // get the edge with the most connections to this lane's edge
+ // get the lane with the "straightest" connection
if (pred.size() != 0) {
std::sort(pred.begin(), pred.end(), by_connections_to_sorter(&getEdge()));
MSEdge* best = *pred.begin();
@@ -1381,6 +1450,18 @@ MSLane::getLogicalPredecessorLane() const {
}
+MSLane*
+MSLane::getLogicalPredecessorLane(const MSEdge& fromEdge) const {
+ for (std::vector<IncomingLaneInfo>::const_iterator i = myIncomingLanes.begin(); i != myIncomingLanes.end(); ++i) {
+ MSLane* cand = (*i).lane;
+ if (&(cand->getEdge()) == &fromEdge) {
+ return (*i).lane;
+ }
+ }
+ return 0;
+}
+
+
LinkState
MSLane::getIncomingLinkState() const {
MSLane* pred = getLogicalPredecessorLane();
diff --git a/src/microsim/MSLane.h b/src/microsim/MSLane.h
index 5ae07c3..7ac21dd 100644
--- a/src/microsim/MSLane.h
+++ b/src/microsim/MSLane.h
@@ -8,7 +8,7 @@
/// @author Michael Behrisch
/// @author Mario Krumnow
/// @date Mon, 12 Mar 2001
-/// @version $Id: MSLane.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSLane.h 18756 2015-08-31 19:16:33Z behrisch $
///
// Representation of a lane in the micro simulation
/****************************************************************************/
@@ -352,7 +352,13 @@ public:
* @return This lane's resulting max. speed
*/
inline SUMOReal getVehicleMaxSpeed(const SUMOVehicle* const veh) const {
- return myMaxSpeed * veh->getChosenSpeedFactor();
+ if (myRestrictions != 0) {
+ std::map<SUMOVehicleClass, SUMOReal>::const_iterator r = myRestrictions->find(veh->getVClass());
+ if (r != myRestrictions->end()) {
+ return MIN2(veh->getMaxSpeed(), r->second * veh->getChosenSpeedFactor());
+ }
+ }
+ return MIN2(veh->getMaxSpeed(), myMaxSpeed * veh->getChosenSpeedFactor());
}
@@ -600,6 +606,17 @@ public:
/// @brief return by how much further the leader must be inserted to avoid rear end collisions
SUMOReal getMissingRearGap(SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const;
+ /** @brief Returns the immediate leader of veh and the distance to veh
+ * starting on this lane
+ *
+ * Iterates over the current lane to find a leader and then uses
+ * getLeaderOnConsecutive()
+ * @param[in] veh The vehicle for which the information shall be computed
+ * @param[in] vehPos The vehicle position relative to this lane (may be negative)
+ * @param[in] checkNext Whether lanes after this one shall be checked
+ * @return
+ */
+ std::pair<MSVehicle* const, SUMOReal> getLeader(const MSVehicle* veh, const SUMOReal vehPos, bool checkNext) const;
/** @brief Returns the immediate leader and the distance to him
*
@@ -647,8 +664,15 @@ public:
std::pair<MSVehicle* const, SUMOReal> getCriticalLeader(SUMOReal dist, SUMOReal seen, SUMOReal speed, const MSVehicle& veh) const;
+ /** @brief get the most likely precedecessor lane (sorted using by_connections_to_sorter).
+ * The result is cached in myLogicalPredecessorLane
+ */
MSLane* getLogicalPredecessorLane() const;
+ /** @brief return the (first) predecessor lane from the given edge
+ */
+ MSLane* getLogicalPredecessorLane(const MSEdge& fromEdge) const;
+
/// @brief get the state of the link from the logical predecessor to this lane
LinkState getIncomingLinkState() const;
@@ -789,12 +813,19 @@ protected:
MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED);
- /// @brief issue warning and add the vehicle to MSVehicleTransfer
- void handleCollision(SUMOTime timestep, const std::string& stage, MSVehicle* collider, MSVehicle* victim, const SUMOReal gap);
+ /// @brief detect whether there is a collision. then issue warning and add the vehicle to MSVehicleTransfer
+ bool handleCollision(SUMOTime timestep, const std::string& stage, MSVehicle* collider, MSVehicle* victim, const SUMOReal victimRear);
/// @brief compute maximum braking distance on this lane
SUMOReal getMaximumBrakeDist() const;
+ /* @brief determine depart speed and whether it may be patched
+ * @param[in] veh The departing vehicle
+ * @param[out] whether the speed may be patched to account for safety
+ * @return the depart speed
+ */
+ SUMOReal getDepartSpeed(const MSVehicle& veh, bool& patchSpeed);
+
protected:
/// Unique numerical ID (set on reading by netload)
size_t myNumericalID;
@@ -831,6 +862,9 @@ protected:
/// The vClass permissions for this lane
SVCPermissions myPermissions;
+ /// The vClass speed restrictions for this lane
+ const std::map<SUMOVehicleClass, SUMOReal>* myRestrictions;
+
std::vector<IncomingLaneInfo> myIncomingLanes;
mutable MSLane* myLogicalPredecessorLane;
@@ -888,7 +922,8 @@ private:
};
/** @class by_id_sorter
- * @brief Sorts edges by their ids
+ * @brief Sorts edges by their angle relative to the given edge (straight comes first)
+ *
*/
class by_connections_to_sorter {
public:
diff --git a/src/microsim/MSLaneChanger.cpp b/src/microsim/MSLaneChanger.cpp
index 6ab84cb..ee20a85 100644
--- a/src/microsim/MSLaneChanger.cpp
+++ b/src/microsim/MSLaneChanger.cpp
@@ -7,7 +7,7 @@
/// @author Friedemann Wesner
/// @author Jakob Erdmann
/// @date Fri, 01 Feb 2002
-/// @version $Id: MSLaneChanger.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSLaneChanger.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Performs lane changing of vehicles
/****************************************************************************/
@@ -49,13 +49,6 @@
#include <foreign/nvwa/debug_new.h>
#endif // CHECK_MEMORY_LEAKS
-//#define DEBUG_VEHICLE_GUI_SELECTION 1
-#ifdef DEBUG_VEHICLE_GUI_SELECTION
-#include <utils/gui/div/GUIGlobalSelection.h>
-#include <guisim/GUIVehicle.h>
-#include <guisim/GUILane.h>
-#endif
-
// ===========================================================================
// member method definitions
@@ -136,7 +129,7 @@ MSLaneChanger::change() {
myCandi = findCandidate();
MSVehicle* vehicle = veh(myCandi);
#ifdef DEBUG_VEHICLE_GUI_SELECTION
- if (gSelected.isSelected(GLO_VEHICLE, static_cast<const GUIVehicle*>(vehicle)->getGlID())) {
+ if (gDebugSelectedVehicle == vehicle->getID()) {
int bla = 0;
}
#endif
@@ -399,7 +392,7 @@ MSLaneChanger::updateChanger(bool vehHasChanged) {
// "Push" the vehicles to the back, i.e. follower becomes vehicle,
// vehicle becomes leader, and leader becomes predecessor of vehicle,
// if it exists.
- if (!vehHasChanged) {
+ if (!vehHasChanged || MSGlobals::gLaneChangeDuration > DELTA_T) {
myCandi->lead = veh(myCandi);
}
myCandi->veh = myCandi->veh + 1;
@@ -515,6 +508,77 @@ MSLaneChanger::checkChange(
}
}
}
+ if ((state & LCA_BLOCKED) == 0 && (state & LCA_WANTS_LANECHANGE) != 0 && MSGlobals::gLaneChangeDuration > DELTA_T) {
+ // ensure that a continuous lane change manoeuvre can be completed
+ // before the next turning movement
+ SUMOReal seen = myCandi->lane->getLength() - vehicle->getPositionOnLane();
+ const SUMOReal decel = vehicle->getCarFollowModel().getMaxDecel() * STEPS2TIME(MSGlobals::gLaneChangeDuration);
+ const SUMOReal avgSpeed = 0.5 * (vehicle->getSpeed() + MAX2((SUMOReal)0, vehicle->getSpeed() - decel));
+ const SUMOReal space2change = avgSpeed * STEPS2TIME(MSGlobals::gLaneChangeDuration);
+ // for finding turns it doesn't matter whether we look along the current lane or the target lane
+ const std::vector<MSLane*>& bestLaneConts = vehicle->getBestLanesContinuation();
+ unsigned int view = 1;
+ MSLane* nextLane = vehicle->getLane();
+ MSLinkCont::const_iterator link = MSLane::succLinkSec(*vehicle, view, *nextLane, bestLaneConts);
+ while (!nextLane->isLinkEnd(link) && seen <= space2change) {
+ if ((*link)->getDirection() == LINKDIR_LEFT || (*link)->getDirection() == LINKDIR_RIGHT
+ // the lanes after an internal junction are on different
+ // edges and do not allow lane-changing
+ || (nextLane->getEdge().isInternal() && (*link)->getViaLaneOrLane()->getEdge().isInternal())
+ ) {
+ state |= LCA_INSUFFICIENT_SPACE;
+ break;
+ }
+#ifdef HAVE_INTERNAL_LANES
+ if ((*link)->getViaLane() == 0) {
+ view++;
+ }
+#else
+ view++;
+#endif
+ nextLane = (*link)->getViaLaneOrLane();
+ seen += nextLane->getLength();
+ // get the next link used
+ link = MSLane::succLinkSec(*vehicle, view, *nextLane, bestLaneConts);
+ }
+
+ if ((state & LCA_BLOCKED) == 0) {
+ // check for dangerous leaders in case the target lane changes laterally between
+ // now and the lane-changing midpoint
+ const SUMOReal speed = vehicle->getSpeed();
+ seen = myCandi->lane->getLength() - vehicle->getPositionOnLane();
+ nextLane = vehicle->getLane();
+ view = 1;
+ const SUMOReal dist = vehicle->getCarFollowModel().brakeGap(speed) + vehicle->getVehicleType().getMinGap();
+ MSLinkCont::const_iterator link = MSLane::succLinkSec(*vehicle, view, *nextLane, bestLaneConts);
+ while (!nextLane->isLinkEnd(link) && seen <= space2change && seen <= dist) {
+ nextLane = (*link)->getViaLaneOrLane();
+ MSLane* targetLane = nextLane->getParallelLane(laneOffset);
+ if (targetLane == 0) {
+ state |= LCA_INSUFFICIENT_SPACE;
+ break;
+ } else {
+ std::pair<MSVehicle* const, SUMOReal> neighLead2 = targetLane->getLeader(vehicle, -seen, true);
+ if (neighLead2.first != 0 && neighLead2.first != neighLead.first
+ && (neighLead2.second < vehicle->getCarFollowModel().getSecureGap(
+ vehicle->getSpeed(), neighLead2.first->getSpeed(), neighLead2.first->getCarFollowModel().getMaxDecel()))) {
+ state |= blockedByLeader;
+ break;
+ }
+ }
+#ifdef HAVE_INTERNAL_LANES
+ if ((*link)->getViaLane() == 0) {
+ view++;
+ }
+#else
+ view++;
+#endif
+ seen += nextLane->getLength();
+ // get the next link used
+ link = MSLane::succLinkSec(*vehicle, view, *nextLane, bestLaneConts);
+ }
+ }
+ }
#ifndef NO_TRACI
// let TraCI influence the wish to change lanes and the security to take
//const int oldstate = state;
diff --git a/src/microsim/MSLink.cpp b/src/microsim/MSLink.cpp
index 602964b..3d03691 100644
--- a/src/microsim/MSLink.cpp
+++ b/src/microsim/MSLink.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Sept 2002
-/// @version $Id: MSLink.cpp 18148 2015-03-25 13:39:50Z namdre $
+/// @version $Id: MSLink.cpp 18319 2015-04-29 06:49:01Z namdre $
///
// A connnection between lanes
/****************************************************************************/
@@ -59,7 +59,7 @@ SUMOTime MSLink::myLookaheadTime = TIME2STEPS(1);
// member method definitions
// ===========================================================================
#ifndef HAVE_INTERNAL_LANES
-MSLink::MSLink(MSLane* succLane, LinkDirection dir, LinkState state, SUMOReal length) :
+MSLink::MSLink(MSLane* succLane, LinkDirection dir, LinkState state, SUMOReal length, bool keepClear) :
myLane(succLane),
myIndex(-1),
myState(state),
@@ -68,9 +68,10 @@ MSLink::MSLink(MSLane* succLane, LinkDirection dir, LinkState state, SUMOReal le
myLength(length),
myHasFoes(false),
myAmCont(false),
+ myKeepClear(keepClear),
myJunction(0)
#else
-MSLink::MSLink(MSLane* succLane, MSLane* via, LinkDirection dir, LinkState state, SUMOReal length) :
+MSLink::MSLink(MSLane* succLane, MSLane* via, LinkDirection dir, LinkState state, SUMOReal length, bool keepClear) :
myLane(succLane),
myIndex(-1),
myState(state),
@@ -79,6 +80,7 @@ MSLink::MSLink(MSLane* succLane, MSLane* via, LinkDirection dir, LinkState state
myLength(length),
myHasFoes(false),
myAmCont(false),
+ myKeepClear(keepClear),
myJunctionInlane(via),
myInternalLaneBefore(0),
myJunction(0)
diff --git a/src/microsim/MSLink.h b/src/microsim/MSLink.h
index da2eeb2..ff26ef2 100644
--- a/src/microsim/MSLink.h
+++ b/src/microsim/MSLink.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: MSLink.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSLink.h 18319 2015-04-29 06:49:01Z namdre $
///
// A connnection between lanes
/****************************************************************************/
@@ -141,8 +141,9 @@ public:
* @param[in] dir The direction of this link
* @param[in] state The state of this link
* @param[in] length The length of this link
+ * @param[in] keepClear Whether the junction after this link must be kept clear
*/
- MSLink(MSLane* succLane, LinkDirection dir, LinkState state, SUMOReal length);
+ MSLink(MSLane* succLane, LinkDirection dir, LinkState state, SUMOReal length, bool keepClear);
#else
/** @brief Constructor for simulation which uses internal lanes
*
@@ -152,7 +153,7 @@ public:
* @param[in] state The state of this link
* @param[in] length The length of this link
*/
- MSLink(MSLane* succLane, MSLane* via, LinkDirection dir, LinkState state, SUMOReal length);
+ MSLink(MSLane* succLane, MSLane* via, LinkDirection dir, LinkState state, SUMOReal length, bool keepClear);
#endif
@@ -331,6 +332,11 @@ public:
}
+ /// @brief whether the junction after this link must be kept clear
+ bool keepClear() const {
+ return myKeepClear;
+ }
+
/// @brief whether this is a link past an internal junction which currently has priority
bool lastWasContMajor() const;
@@ -405,6 +411,8 @@ private:
bool myAmCont;
+ bool myKeepClear;
+
#ifdef HAVE_INTERNAL_LANES
/// @brief The following junction-internal lane if used
MSLane* const myJunctionInlane;
diff --git a/src/microsim/MSLogicJunction.h b/src/microsim/MSLogicJunction.h
index a7b7155..6a43f19 100644
--- a/src/microsim/MSLogicJunction.h
+++ b/src/microsim/MSLogicJunction.h
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Wed, 12 Dez 2001
-/// @version $Id: MSLogicJunction.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSLogicJunction.h 18635 2015-08-14 13:33:44Z namdre $
///
// with one ore more logics.
/****************************************************************************/
@@ -61,13 +61,8 @@ public:
/// Destructor.
virtual ~MSLogicJunction();
- /** @brief Container for link foes */
- typedef std::bitset<64> LinkFoes;
-
- /** @brief Container for junction-internal lane occupation
- Each element of this container represents one particular
- junction-internal lane */
- typedef std::bitset<64> InnerState;
+ /** @brief Container for link response and foes */
+ typedef std::bitset<64> LinkBits;
/// initialises the junction after the whole net has been loaded
virtual void postloadInit();
diff --git a/src/microsim/MSNet.cpp b/src/microsim/MSNet.cpp
index ba35f46..1665739 100644
--- a/src/microsim/MSNet.cpp
+++ b/src/microsim/MSNet.cpp
@@ -10,7 +10,7 @@
/// @author Mario Krumnow
/// @author Christoph Sommer
/// @date Tue, 06 Mar 2001
-/// @version $Id: MSNet.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSNet.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// The simulated network and simulation perfomer
/****************************************************************************/
@@ -77,6 +77,9 @@
#include <utils/iodevices/OutputDevice_File.h>
#include "output/MSFCDExport.h"
#include "output/MSEmissionExport.h"
+
+#include "output/MSBatteryExport.h"
+
#include "output/MSFullExport.h"
#include "output/MSQueueExport.h"
#include "output/MSVTKExport.h"
@@ -168,8 +171,9 @@ MSNet::MSNet(MSVehicleControl* vc, MSEventControl* beginOfTimestepEvents,
MSEventControl* endOfTimestepEvents, MSEventControl* insertionEvents,
ShapeContainer* shapeCont):
myVehiclesMoved(0),
- myHaveRestrictions(false),
+ myHavePermissions(false),
myHasInternalLinks(false),
+ myHasElevation(false),
myRouterTTInitialized(false),
myRouterTTDijkstra(0),
myRouterTTAStar(0),
@@ -234,6 +238,7 @@ MSNet::closeBuilding(MSEdgeControl* edges, MSJunctionControl* junctions,
mySimBeginMillis = SysUtils::getCurrentMillis();
}
myHasInternalLinks = hasInternalLinks;
+ myHasElevation = checkElevation();
}
@@ -276,6 +281,22 @@ MSNet::~MSNet() {
}
+void
+MSNet::addRestriction(const std::string& id, const SUMOVehicleClass svc, const SUMOReal speed) {
+ myRestrictions[id][svc] = speed;
+}
+
+
+const std::map<SUMOVehicleClass, SUMOReal>*
+MSNet::getRestrictions(const std::string& id) const {
+ std::map<std::string, std::map<SUMOVehicleClass, SUMOReal> >::const_iterator i = myRestrictions.find(id);
+ if (i == myRestrictions.end()) {
+ return 0;
+ }
+ return &i->second;
+}
+
+
int
MSNet::simulate(SUMOTime start, SUMOTime stop) {
// report the begin when wished
@@ -567,7 +588,7 @@ MSNet::writeOutput() {
// check fcd dumps
if (OptionsCont::getOptions().isSet("fcd-output")) {
- MSFCDExport::write(OutputDevice::getDeviceByOption("fcd-output"), myStep);
+ MSFCDExport::write(OutputDevice::getDeviceByOption("fcd-output"), myStep, myHasElevation);
}
// check emission dumps
@@ -575,6 +596,12 @@ MSNet::writeOutput() {
MSEmissionExport::write(OutputDevice::getDeviceByOption("emission-output"), myStep);
}
+ // battery dumps
+ if (OptionsCont::getOptions().isSet("battery-output")) {
+ MSBatteryExport::write(OutputDevice::getDeviceByOption("battery-output"), myStep,
+ oc.getInt("battery-output.precision"));
+ }
+
// check full dumps
if (OptionsCont::getOptions().isSet("full-output")) {
MSFullExport::write(OutputDevice::getDeviceByOption("full-output"), myStep);
@@ -739,12 +766,12 @@ MSNet::informVehicleStateListener(const SUMOVehicle* const vehicle, VehicleState
// ------ Insertion and retrieval of bus stops ------
bool
-MSNet::addBusStop(MSBusStop* busStop) {
+MSNet::addBusStop(MSStoppingPlace* busStop) {
return myBusStopDict.add(busStop->getID(), busStop);
}
-MSBusStop*
+MSStoppingPlace*
MSNet::getBusStop(const std::string& id) const {
return myBusStopDict.get(id);
}
@@ -752,9 +779,9 @@ MSNet::getBusStop(const std::string& id) const {
std::string
MSNet::getBusStopID(const MSLane* lane, const SUMOReal pos) const {
- const std::map<std::string, MSBusStop*>& vals = myBusStopDict.getMyMap();
- for (std::map<std::string, MSBusStop*>::const_iterator it = vals.begin(); it != vals.end(); ++it) {
- MSBusStop* stop = it->second;
+ const std::map<std::string, MSStoppingPlace*>& vals = myBusStopDict.getMyMap();
+ for (std::map<std::string, MSStoppingPlace*>::const_iterator it = vals.begin(); it != vals.end(); ++it) {
+ MSStoppingPlace* stop = it->second;
if (&stop->getLane() == lane && fabs(stop->getEndLanePosition() - pos) < POSITION_EPS) {
return stop->getID();
}
@@ -764,20 +791,20 @@ MSNet::getBusStopID(const MSLane* lane, const SUMOReal pos) const {
// ------ Insertion and retrieval of container stops ------
bool
-MSNet::addContainerStop(MSContainerStop* containerStop) {
+MSNet::addContainerStop(MSStoppingPlace* containerStop) {
return myContainerStopDict.add(containerStop->getID(), containerStop);
}
-MSContainerStop*
+MSStoppingPlace*
MSNet::getContainerStop(const std::string& id) const {
return myContainerStopDict.get(id);
}
std::string
MSNet::getContainerStopID(const MSLane* lane, const SUMOReal pos) const {
- const std::map<std::string, MSContainerStop*>& vals = myContainerStopDict.getMyMap();
- for (std::map<std::string, MSContainerStop*>::const_iterator it = vals.begin(); it != vals.end(); ++it) {
- MSContainerStop* stop = it->second;
+ const std::map<std::string, MSStoppingPlace*>& vals = myContainerStopDict.getMyMap();
+ for (std::map<std::string, MSStoppingPlace*>::const_iterator it = vals.begin(); it != vals.end(); ++it) {
+ MSStoppingPlace* stop = it->second;
if (&stop->getLane() == lane && fabs(stop->getEndLanePosition() - pos) < POSITION_EPS) {
return stop->getID();
}
@@ -786,19 +813,44 @@ MSNet::getContainerStopID(const MSLane* lane, const SUMOReal pos) const {
}
+bool
+MSNet::addChrgStn(MSChrgStn* chrgStn) {
+ return myChrgStnDict.add(chrgStn->getID(), chrgStn);
+}
+
+
+MSChrgStn*
+MSNet::getChrgStn(const std::string& id) const {
+ return myChrgStnDict.get(id);
+}
+
+
+std::string
+MSNet::getChrgStnID(const MSLane* lane, const SUMOReal pos) const {
+ const std::map<std::string, MSChrgStn*>& vals = myChrgStnDict.getMyMap();
+ for (std::map<std::string, MSChrgStn*>::const_iterator it = vals.begin(); it != vals.end(); ++it) {
+ MSChrgStn* chrgStn = it->second;
+ if (&chrgStn->getLane() == lane && chrgStn->getBeginLanePosition() <= pos && chrgStn->getEndLanePosition() >= pos) {
+ return chrgStn->getID();
+ }
+ }
+ return "";
+}
+
+
SUMOAbstractRouter<MSEdge, SUMOVehicle>&
MSNet::getRouterTT(const MSEdgeVector& prohibited) const {
if (!myRouterTTInitialized) {
myRouterTTInitialized = true;
const std::string routingAlgorithm = OptionsCont::getOptions().getString("routing-algorithm");
if (routingAlgorithm == "dijkstra") {
- myRouterTTDijkstra = new DijkstraRouterTT<MSEdge, SUMOVehicle, prohibited_withRestrictions<MSEdge, SUMOVehicle> >(
+ myRouterTTDijkstra = new DijkstraRouterTT<MSEdge, SUMOVehicle, prohibited_withPermissions<MSEdge, SUMOVehicle> >(
MSEdge::numericalDictSize(), true, &MSNet::getTravelTime);
} else {
if (routingAlgorithm != "astar") {
WRITE_WARNING("TraCI and Triggers cannot use routing algorithm '" + routingAlgorithm + "'. using 'astar' instead.");
}
- myRouterTTAStar = new AStarRouter<MSEdge, SUMOVehicle, prohibited_withRestrictions<MSEdge, SUMOVehicle> >(
+ myRouterTTAStar = new AStarRouter<MSEdge, SUMOVehicle, prohibited_withPermissions<MSEdge, SUMOVehicle> >(
MSEdge::numericalDictSize(), true, &MSNet::getTravelTime);
}
}
@@ -816,7 +868,7 @@ MSNet::getRouterTT(const MSEdgeVector& prohibited) const {
SUMOAbstractRouter<MSEdge, SUMOVehicle>&
MSNet::getRouterEffort(const MSEdgeVector& prohibited) const {
if (myRouterEffort == 0) {
- myRouterEffort = new DijkstraRouterEffort<MSEdge, SUMOVehicle, prohibited_withRestrictions<MSEdge, SUMOVehicle> >(
+ myRouterEffort = new DijkstraRouterEffort<MSEdge, SUMOVehicle, prohibited_withPermissions<MSEdge, SUMOVehicle> >(
MSEdge::numericalDictSize(), true, &MSNet::getEffort, &MSNet::getTravelTime);
}
myRouterEffort->prohibit(prohibited);
@@ -844,4 +896,17 @@ MSNet::getLanesRTree() const {
}
+bool
+MSNet::checkElevation() {
+ const MSEdgeVector& edges = myEdges->getEdges();
+ for (MSEdgeVector::const_iterator e = edges.begin(); e != edges.end(); ++e) {
+ for (std::vector<MSLane*>::const_iterator i = (*e)->getLanes().begin(); i != (*e)->getLanes().end(); ++i) {
+ if ((*i)->getShape().hasElevation()) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
/****************************************************************************/
diff --git a/src/microsim/MSNet.h b/src/microsim/MSNet.h
index 11f29fc..8f7a3fd 100644
--- a/src/microsim/MSNet.h
+++ b/src/microsim/MSNet.h
@@ -8,7 +8,7 @@
/// @author Clemens Honomichl
/// @author Michael Behrisch
/// @date Mon, 12 Mar 2001
-/// @version $Id: MSNet.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSNet.h 18686 2015-08-21 14:52:03Z namdre $
///
// The simulated network and simulation perfomer
/****************************************************************************/
@@ -49,8 +49,8 @@
#include <utils/geom/Boundary.h>
#include <utils/geom/Position.h>
#include <utils/common/SUMOTime.h>
-#include <microsim/trigger/MSBusStop.h>
-#include <microsim/trigger/MSContainerStop.h>
+#include <microsim/trigger/MSChrgStn.h>
+#include <microsim/MSStoppingPlace.h>
#include <utils/common/UtilExceptions.h>
#include <utils/common/NamedObjectCont.h>
#include <utils/vehicle/SUMOAbstractRouter.h>
@@ -165,20 +165,36 @@ public:
bool hasInternalLinks);
- /** @brief Returns whether the network has vehicle class restrictions
- * @return whether restrictions are present
+ /** @brief Returns whether the network has specific vehicle class permissions
+ * @return whether permissions are present
*/
- bool hasRestrictions() const {
- return myHaveRestrictions;
+ bool hasPermissions() const {
+ return myHavePermissions;
}
- /// @brief Labels the network to contain vehicle class restrictions
- void setRestrictionFound() {
- myHaveRestrictions = true;
+ /// @brief Labels the network to contain vehicle class permissions
+ void setPermissionsFound() {
+ myHavePermissions = true;
}
+ /** @brief Adds a restriction for an edge type
+ * @param[in] id The id of the type
+ * @param[in] svc The vehicle class the restriction refers to
+ * @param[in] speed The restricted speed
+ */
+ void addRestriction(const std::string& id, const SUMOVehicleClass svc, const SUMOReal speed);
+
+
+ /** @brief Returns the restrictions for an edge type
+ * If no restrictions are present, 0 is returned.
+ * @param[in] id The id of the type
+ * @return The mapping of vehicle classes to maximum speeds
+ */
+ const std::map<SUMOVehicleClass, SUMOReal>* getRestrictions(const std::string& id) const;
+
+
/** @brief Clears all dictionaries
* @todo Try to move all this to the destructor
*/
@@ -400,7 +416,6 @@ public:
return *myShapeContainer;
}
-
/** @brief Returns the net's internal edge travel times/efforts container
*
* If the net does not have such a container, it is built.
@@ -409,8 +424,6 @@ public:
MSEdgeWeightsStorage& getWeightsStorage();
/// @}
-
-
/// @name Insertion and retrieval of bus stops
/// @{
@@ -425,14 +438,14 @@ public:
* @param[in] busStop The bus stop to add
* @return Whether the bus stop could be added
*/
- bool addBusStop(MSBusStop* busStop);
+ bool addBusStop(MSStoppingPlace* busStop);
/** @brief Returns the named bus stop
* @param[in] id The id of the bus stop to return.
* @return The named bus stop, or 0 if no such stop exists
*/
- MSBusStop* getBusStop(const std::string& id) const;
+ MSStoppingPlace* getBusStop(const std::string& id) const;
/** @brief Returns the bus stop close to the given position
@@ -458,13 +471,13 @@ public:
* @param[in] containerStop The container stop to add
* @return Whether the container stop could be added
*/
- bool addContainerStop(MSContainerStop* containerStop);
+ bool addContainerStop(MSStoppingPlace* containerStop);
/** @brief Returns the named container stop
* @param[in] id The id of the container stop to return.
* @return The named container stop, or 0 if no such stop exists
*/
- MSContainerStop* getContainerStop(const std::string& id) const;
+ MSStoppingPlace* getContainerStop(const std::string& id) const;
/** @brief Returns the container stop close to the given position
* @param[in] lane the lane of the container stop to return.
@@ -474,6 +487,32 @@ public:
std::string getContainerStopID(const MSLane* lane, const SUMOReal pos) const;
/// @}
+ /** @brief Adds a chargingg station
+ *
+ * If another charging station with the same id exists, false is returned.
+ * Otherwise, the charging station is added to the internal bus stop
+ * container "myChrgStnDict".
+ *
+ * This control gets responsible for deletion of the added charging station.
+ *
+ * @param[in] chrgStn The charging station add
+ * @return Whether the charging station could be added
+ */
+ bool addChrgStn(MSChrgStn* chrgStn);
+
+ /** @brief Returns the named charging station
+ * @param[in] id The id of the charging station to return.
+ * @return The named charging station, or 0 if no such stop exists
+ */
+ MSChrgStn* getChrgStn(const std::string& id) const;
+
+ /** @brief Returns the charging station close to the given position
+ * @param[in] lane the lane of the charging station to return.
+ * @param[in] pos the position of the bus stop to return.
+ * @return The charging station id on the location, or "" if no such stop exists
+ */
+ std::string getChrgStnID(const MSLane* lane, const SUMOReal pos) const;
+ /// @}
/// @name Notification about vehicle state changes
@@ -586,6 +625,15 @@ public:
return myHasInternalLinks;
}
+ /// @brief return whether the network contains internal links
+ bool hasElevation() const {
+ return myHasElevation;
+ }
+
+protected:
+ /// @brief check all lanes for elevation data
+ bool checkElevation();
+
protected:
/// @brief Unique instance of MSNet
static MSNet* myInstance;
@@ -647,7 +695,7 @@ protected:
long mySimBeginMillis;
/// @brief The overall number of vehicle movements
- SUMOLong myVehiclesMoved;
+ long long int myVehiclesMoved;
//}
@@ -664,19 +712,28 @@ protected:
/// @brief Whether the network contains edges which not all vehicles may pass
- bool myHaveRestrictions;
+ bool myHavePermissions;
+
+ /// @brief The vehicle class specific speed restrictions
+ std::map<std::string, std::map<SUMOVehicleClass, SUMOReal> > myRestrictions;
/// @brief Whether the network contains internal links/lanes/edges
bool myHasInternalLinks;
+ /// @brief Whether the network contains elevation data
+ bool myHasElevation;
+
/// @brief Storage for maximum vehicle number
int myTooManyVehicles;
/// @brief Dictionary of bus stops
- NamedObjectCont<MSBusStop*> myBusStopDict;
+ NamedObjectCont<MSStoppingPlace*> myBusStopDict;
/// @brief Dictionary of container stops
- NamedObjectCont<MSContainerStop*> myContainerStopDict;
+ NamedObjectCont<MSStoppingPlace*> myContainerStopDict;
+
+ /// @brief Dictionary of charging Stations
+ NamedObjectCont<MSChrgStn*> myChrgStnDict;
/// @brief Container for vehicle state listener
std::vector<VehicleStateListener*> myVehicleStateListeners;
@@ -687,9 +744,9 @@ protected:
* @note we provide one member for every switchable router type
* because the class structure makes it inconvenient to use a superclass*/
mutable bool myRouterTTInitialized;
- mutable DijkstraRouterTT<MSEdge, SUMOVehicle, prohibited_withRestrictions<MSEdge, SUMOVehicle> >* myRouterTTDijkstra;
- mutable AStarRouter<MSEdge, SUMOVehicle, prohibited_withRestrictions<MSEdge, SUMOVehicle> >* myRouterTTAStar;
- mutable DijkstraRouterEffort<MSEdge, SUMOVehicle, prohibited_withRestrictions<MSEdge, SUMOVehicle> >* myRouterEffort;
+ mutable DijkstraRouterTT<MSEdge, SUMOVehicle, prohibited_withPermissions<MSEdge, SUMOVehicle> >* myRouterTTDijkstra;
+ mutable AStarRouter<MSEdge, SUMOVehicle, prohibited_withPermissions<MSEdge, SUMOVehicle> >* myRouterTTAStar;
+ mutable DijkstraRouterEffort<MSEdge, SUMOVehicle, prohibited_withPermissions<MSEdge, SUMOVehicle> >* myRouterEffort;
mutable MSPedestrianRouterDijkstra* myPedestrianRouter;
diff --git a/src/microsim/MSPersonControl.cpp b/src/microsim/MSPersonControl.cpp
index 5f77b6e..d34712f 100644
--- a/src/microsim/MSPersonControl.cpp
+++ b/src/microsim/MSPersonControl.cpp
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Mon, 9 Jul 2001
-/// @version $Id: MSPersonControl.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSPersonControl.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Stores all persons in the net and handles their waiting for cars.
/****************************************************************************/
@@ -53,7 +53,7 @@ MSPersonControl::MSPersonControl() {}
MSPersonControl::~MSPersonControl() {
- for (std::map<std::string, MSPerson*>::iterator i = myPersons.begin(); i != myPersons.end(); ++i) {
+ for (std::map<std::string, MSTransportable*>::iterator i = myPersons.begin(); i != myPersons.end(); ++i) {
delete(*i).second;
}
myPersons.clear();
@@ -71,9 +71,9 @@ MSPersonControl::add(const std::string& id, MSPerson* person) {
}
-MSPerson*
+MSTransportable*
MSPersonControl::get(const std::string& id) const {
- std::map<std::string, MSPerson*>::const_iterator i = myPersons.find(id);
+ std::map<std::string, MSTransportable*>::const_iterator i = myPersons.find(id);
if (i == myPersons.end()) {
return 0;
}
@@ -82,7 +82,7 @@ MSPersonControl::get(const std::string& id) const {
void
-MSPersonControl::erase(MSPerson* person) {
+MSPersonControl::erase(MSTransportable* person) {
const std::string& id = person->getID();
if (OptionsCont::getOptions().isSet("tripinfo-output")) {
OutputDevice& od = OutputDevice::getDeviceByOption("tripinfo-output");
@@ -97,7 +97,7 @@ MSPersonControl::erase(MSPerson* person) {
od.closeTag();
od << "\n";
}
- const std::map<std::string, MSPerson*>::iterator i = myPersons.find(id);
+ const std::map<std::string, MSTransportable*>::iterator i = myPersons.find(id);
if (i != myPersons.end()) {
delete i->second;
myPersons.erase(i);
@@ -116,7 +116,7 @@ MSPersonControl::setDeparture(const SUMOTime time, MSPerson* person) {
void
-MSPersonControl::setWaitEnd(const SUMOTime time, MSPerson* person) {
+MSPersonControl::setWaitEnd(const SUMOTime time, MSTransportable* person) {
const SUMOTime step = time % DELTA_T == 0 ? time : (time / DELTA_T + 1) * DELTA_T;
if (myWaitingUntil.find(step) == myWaitingUntil.end()) {
myWaitingUntil[step] = PersonVector();
@@ -151,9 +151,9 @@ MSPersonControl::checkWaitingPersons(MSNet* net, const SUMOTime time) {
void
-MSPersonControl::addWaiting(const MSEdge* const edge, MSPerson* person) {
+MSPersonControl::addWaiting(const MSEdge* const edge, MSTransportable* person) {
if (myWaiting4Vehicle.find(edge) == myWaiting4Vehicle.end()) {
- myWaiting4Vehicle[edge] = std::vector<MSPerson*>();
+ myWaiting4Vehicle[edge] = std::vector<MSTransportable*>();
}
myWaiting4Vehicle[edge].push_back(person);
}
@@ -183,7 +183,11 @@ MSPersonControl::boardAnyWaiting(MSEdge* edge, MSVehicle* vehicle, MSVehicle::St
stop->duration = boardingDuration;
}
//update the time point at which the next person can board the vehicle
- stop->timeToBoardNextPerson = currentTime + boardingDuration;
+ if (stop->timeToBoardNextPerson > currentTime - DELTA_T) {
+ stop->timeToBoardNextPerson += boardingDuration;
+ } else {
+ stop->timeToBoardNextPerson = currentTime + boardingDuration;
+ }
static_cast<MSPerson::MSPersonStage_Driving*>((*i)->getCurrentStage())->setVehicle(vehicle);
i = waitPersons.erase(i);
@@ -212,14 +216,14 @@ MSPersonControl::hasNonWaiting() const {
void
-MSPersonControl::setWalking(MSPerson* p) {
+MSPersonControl::setWalking(MSTransportable* p) {
myWalking[p->getID()] = p;
}
void
-MSPersonControl::unsetWalking(MSPerson* p) {
- std::map<std::string, MSPerson*>::iterator i = myWalking.find(p->getID());
+MSPersonControl::unsetWalking(MSTransportable* p) {
+ std::map<std::string, MSTransportable*>::iterator i = myWalking.find(p->getID());
if (i != myWalking.end()) {
myWalking.erase(i);
}
@@ -232,7 +236,7 @@ MSPersonControl::abortWaiting() {
const MSEdge* edge = (*i).first;
const PersonVector& pv = (*i).second;
for (PersonVector::const_iterator j = pv.begin(); j != pv.end(); ++j) {
- MSPerson* p = (*j);
+ MSTransportable* p = (*j);
edge->removePerson(p);
WRITE_WARNING("Person " + p->getID() + " aborted waiting for a ride that will never come.");
erase(p);
@@ -242,7 +246,7 @@ MSPersonControl::abortWaiting() {
MSPerson*
-MSPersonControl::buildPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPerson::MSPersonPlan* plan) const {
+MSPersonControl::buildPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan) const {
return new MSPerson(pars, vtype, plan);
}
diff --git a/src/microsim/MSPersonControl.h b/src/microsim/MSPersonControl.h
index 48e7ab2..da040b9 100644
--- a/src/microsim/MSPersonControl.h
+++ b/src/microsim/MSPersonControl.h
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Mon, 9 Jul 2001
-/// @version $Id: MSPersonControl.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSPersonControl.h 18274 2015-04-22 15:00:44Z behrisch $
///
// Stores all persons in the net and handles their waiting for cars.
/****************************************************************************/
@@ -59,10 +59,10 @@ class MSVehicle;
class MSPersonControl {
public:
/// @brief Definition of a list of persons
- typedef std::vector<MSPerson*> PersonVector;
+ typedef std::vector<MSTransportable*> PersonVector;
/// @brief Definition of the internal persons map iterator
- typedef std::map<std::string, MSPerson*>::const_iterator constVehIt;
+ typedef std::map<std::string, MSTransportable*>::const_iterator constVehIt;
public:
@@ -86,23 +86,23 @@ public:
* @param[in] id The id of the person
* @return The named person, if existing, otherwise 0
*/
- MSPerson* get(const std::string& id) const;
+ MSTransportable* get(const std::string& id) const;
/// removes a single person
- virtual void erase(MSPerson* person);
+ virtual void erase(MSTransportable* person);
/// sets the arrival time for a waiting or walking person
void setDeparture(SUMOTime time, MSPerson* person);
/// sets the arrival time for a waiting or walking person
- void setWaitEnd(SUMOTime time, MSPerson* person);
+ void setWaitEnd(SUMOTime time, MSTransportable* person);
/// checks whether any persons waiting or walking time is over
void checkWaitingPersons(MSNet* net, const SUMOTime time);
/// adds a person to the list of persons waiting for a vehicle on the specified edge
- void addWaiting(const MSEdge* edge, MSPerson* person);
+ void addWaiting(const MSEdge* edge, MSTransportable* person);
/** @brief board any applicable persons
* Boards any people who wait on that edge for the given vehicle and removes them from myWaiting
@@ -128,10 +128,10 @@ public:
* @param[in] vtype The type (reusing vehicle type container here)
* @param[in] plan This person's plan
*/
- virtual MSPerson* buildPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPerson::MSPersonPlan* plan) const;
+ virtual MSPerson* buildPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan) const;
- void setWalking(MSPerson* p);
- void unsetWalking(MSPerson* p);
+ void setWalking(MSTransportable* p);
+ void unsetWalking(MSTransportable* p);
/// @brief returns whether the the given person is waiting for a vehicle on the given edge
bool isWaiting4Vehicle(const MSEdge* const edge, MSPerson* p) const;
@@ -163,10 +163,10 @@ public:
protected:
/// all persons by id
- std::map<std::string, MSPerson*> myPersons;
+ std::map<std::string, MSTransportable*> myPersons;
/// all persons by id
- std::map<std::string, MSPerson*> myWalking;
+ std::map<std::string, MSTransportable*> myWalking;
/// @brief Persons waiting for departure
std::map<SUMOTime, PersonVector> myWaiting4Departure;
diff --git a/src/microsim/MSRightOfWayJunction.cpp b/src/microsim/MSRightOfWayJunction.cpp
index cb91207..9d535f9 100644
--- a/src/microsim/MSRightOfWayJunction.cpp
+++ b/src/microsim/MSRightOfWayJunction.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Wed, 12 Dez 2001
-/// @version $Id: MSRightOfWayJunction.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSRightOfWayJunction.cpp 18635 2015-08-14 13:33:44Z namdre $
///
// junction.
/****************************************************************************/
@@ -105,12 +105,12 @@ MSRightOfWayJunction::postloadInit() {
if (myLogic->getLogicSize() <= requestPos) {
throw ProcessError("Found invalid logic position of a link for junction '" + getID() + "' (" + toString(requestPos) + ", max " + toString(myLogic->getLogicSize()) + ") -> (network error)");
}
- const MSLogicJunction::LinkFoes& foeLinks = myLogic->getFoesFor(requestPos); // SUMO_ATTR_RESPONSE
- const std::bitset<64>& internalFoes = myLogic->getInternalFoesFor(requestPos); // SUMO_ATTR_FOES
+ const MSLogicJunction::LinkBits& linkResponse = myLogic->getResponseFor(requestPos); // SUMO_ATTR_RESPONSE
+ const MSLogicJunction::LinkBits& linkFoes = myLogic->getFoesFor(requestPos); // SUMO_ATTR_FOES
bool cont = myLogic->getIsCont(requestPos);
myLinkFoeLinks[*j] = std::vector<MSLink*>();
for (unsigned int c = 0; c < maxNo; ++c) {
- if (foeLinks.test(c)) {
+ if (linkResponse.test(c)) {
MSLink* foe = sortedLinks[c].second;
myLinkFoeLinks[*j].push_back(foe);
#ifdef HAVE_INTERNAL_LANES
@@ -127,7 +127,7 @@ MSRightOfWayJunction::postloadInit() {
}
std::vector<MSLink*> foes;
for (unsigned int c = 0; c < maxNo; ++c) {
- if (internalFoes.test(c)) {
+ if (linkFoes.test(c)) {
MSLink* foe = sortedLinks[c].second;
foes.push_back(foe);
#ifdef HAVE_INTERNAL_LANES
@@ -154,9 +154,9 @@ MSRightOfWayJunction::postloadInit() {
if (sortedLinks[c].second->getLane() == 0) { // dead end
continue;
}
- if (internalFoes.test(c)) {
+ if (linkFoes.test(c)) {
myLinkFoeInternalLanes[*j].push_back(myInternalLanes[li]);
- if (foeLinks.test(c)) {
+ if (linkResponse.test(c)) {
const std::vector<MSLane::IncomingLaneInfo>& l = myInternalLanes[li]->getIncomingLanes();
if (l.size() == 1 && l[0].lane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) {
myLinkFoeInternalLanes[*j].push_back(l[0].lane);
diff --git a/src/microsim/MSRoute.cpp b/src/microsim/MSRoute.cpp
index d2981d7..217c18c 100644
--- a/src/microsim/MSRoute.cpp
+++ b/src/microsim/MSRoute.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Sept 2002
-/// @version $Id: MSRoute.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSRoute.cpp 18663 2015-08-19 13:02:24Z namdre $
///
// A vehicle route
/****************************************************************************/
@@ -262,7 +262,7 @@ MSRoute::getDistanceBetween(SUMOReal fromPos, SUMOReal toPos,
ConstMSEdgeVector::const_iterator it2 = std::find(it + 1, myEdges.end(), toEdge);
if (fromEdge == toEdge) {
- if (fromPos < toPos) {
+ if (fromPos <= toPos) {
return toPos - fromPos;
} else if (it2 == myEdges.end()) {
// we don't visit the edge again
diff --git a/src/microsim/MSRouteHandler.cpp b/src/microsim/MSRouteHandler.cpp
index 8a0c337..8a69359 100644
--- a/src/microsim/MSRouteHandler.cpp
+++ b/src/microsim/MSRouteHandler.cpp
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Mon, 9 Jul 2001
-/// @version $Id: MSRouteHandler.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSRouteHandler.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Parser and container for routes during their loading
/****************************************************************************/
@@ -54,8 +54,7 @@
#include <utils/options/OptionsCont.h>
#include "MSNet.h"
-#include <microsim/trigger/MSBusStop.h>
-//#include <microsim/trigger/MSContainerStop.h>
+#include <microsim/MSStoppingPlace.h>
#include <microsim/MSGlobals.h>
#include <utils/xml/SUMOVehicleParserHelper.h>
@@ -143,10 +142,10 @@ MSRouteHandler::myStartElement(int element,
SUMORouteHandler::myStartElement(element, attrs);
switch (element) {
case SUMO_TAG_PERSON:
- myActivePlan = new MSPerson::MSPersonPlan();
+ myActivePlan = new MSTransportable::MSTransportablePlan();
break;
case SUMO_TAG_CONTAINER:
- myActiveContainerPlan = new MSContainer::MSContainerPlan();
+ myActiveContainerPlan = new MSTransportable::MSTransportablePlan();
break;
case SUMO_TAG_RIDE: {
const std::string pid = myVehicleParameter->id;
@@ -155,7 +154,7 @@ MSRouteHandler::myStartElement(int element,
const std::string desc = attrs.get<std::string>(SUMO_ATTR_LINES, pid.c_str(), ok);
StringTokenizer st(desc);
std::string bsID = attrs.getOpt<std::string>(SUMO_ATTR_BUS_STOP, 0, ok, "");
- MSBusStop* bs = 0;
+ MSStoppingPlace* bs = 0;
if (bsID != "") {
bs = MSNet::getInstance()->getBusStop(bsID);
if (bs == 0) {
@@ -189,8 +188,6 @@ MSRouteHandler::myStartElement(int element,
case SUMO_TAG_WALK: {
myActiveRoute.clear();
bool ok = true;
- SUMOReal departPos = attrs.getOpt<SUMOReal>(SUMO_ATTR_DEPARTPOS, myVehicleParameter->id.c_str(), ok, 0);
- SUMOReal arrivalPos = attrs.getOpt<SUMOReal>(SUMO_ATTR_ARRIVALPOS, myVehicleParameter->id.c_str(), ok, -NUMERICAL_EPS);
const SUMOTime duration = attrs.getOptSUMOTimeReporting(SUMO_ATTR_DURATION, 0, ok, -1);
if (attrs.hasAttribute(SUMO_ATTR_DURATION) && duration <= 0) {
throw ProcessError("Non-positive walking duration for '" + myVehicleParameter->id + "'.");
@@ -205,17 +202,12 @@ MSRouteHandler::myStartElement(int element,
if (speed <= 0) {
throw ProcessError("Non-positive walking speed for '" + myVehicleParameter->id + "'.");
}
- std::string bsID = attrs.getOpt<std::string>(SUMO_ATTR_BUS_STOP, 0, ok, "");
- MSBusStop* bs = 0;
- if (bsID != "") {
- bs = MSNet::getInstance()->getBusStop(bsID);
- if (bs == 0) {
- throw ProcessError("Unknown bus stop '" + bsID + "' for person '" + myVehicleParameter->id + "'.");
- }
- arrivalPos = bs->getEndLanePosition();
- }
+ SUMOReal departPos = 0;
+ SUMOReal arrivalPos = 0;
+ MSStoppingPlace* bs = 0;
if (attrs.hasAttribute(SUMO_ATTR_EDGES)) {
MSEdge::parseEdgesList(attrs.get<std::string>(SUMO_ATTR_EDGES, myVehicleParameter->id.c_str(), ok), myActiveRoute, myActiveRouteID);
+ parseWalkPositions(attrs, myVehicleParameter->id, myActiveRoute.front(), myActiveRoute.back(), departPos, arrivalPos, bs, ok);
} else {
if (attrs.hasAttribute(SUMO_ATTR_FROM) && attrs.hasAttribute(SUMO_ATTR_TO)) {
const std::string fromID = attrs.get<std::string>(SUMO_ATTR_FROM, myVehicleParameter->id.c_str(), ok);
@@ -228,9 +220,8 @@ MSRouteHandler::myStartElement(int element,
if (to == 0) {
throw ProcessError("The to edge '" + toID + "' within a walk of person '" + myVehicleParameter->id + "' is not known.");
}
- MSNet::getInstance()->getPedestrianRouter().compute(from, to,
- SUMOVehicleParameter::interpretEdgePos(departPos, from->getLength(), SUMO_ATTR_DEPARTPOS, "person walking from " + from->getID()),
- SUMOVehicleParameter::interpretEdgePos(arrivalPos, to->getLength(), SUMO_ATTR_ARRIVALPOS, "person walking to " + to->getID()),
+ parseWalkPositions(attrs, myVehicleParameter->id, from, to, departPos, arrivalPos, bs, ok);
+ MSNet::getInstance()->getPedestrianRouter().compute(from, to, departPos, arrivalPos,
speed, 0, 0, myActiveRoute);
if (myActiveRoute.empty()) {
const std::string error = "No connection found between '" + from->getID() + "' and '" + to->getID() + "' for person '" + myVehicleParameter->id + "'.";
@@ -239,7 +230,7 @@ MSRouteHandler::myStartElement(int element,
myActiveRoute.push_back(to); // pedestrian will teleport
//WRITE_WARNING(error);
} else {
- WRITE_ERROR(error);
+ throw ProcessError(error);
}
}
//std::cout << myVehicleParameter->id << " edges=" << toString(myActiveRoute) << "\n";
@@ -266,7 +257,7 @@ MSRouteHandler::myStartElement(int element,
const std::string desc = attrs.get<std::string>(SUMO_ATTR_LINES, containerId.c_str(), ok);
StringTokenizer st(desc);
std::string csID = attrs.getOpt<std::string>(SUMO_ATTR_CONTAINER_STOP, 0, ok, "");
- MSContainerStop* cs = 0;
+ MSStoppingPlace* cs = 0;
if (csID != "") {
cs = MSNet::getInstance()->getContainerStop(csID);
if (cs == 0) {
@@ -313,7 +304,7 @@ MSRouteHandler::myStartElement(int element,
throw ProcessError("Non-positive tranship speed for container '" + myVehicleParameter->id + "'.");
}
std::string csID = attrs.getOpt<std::string>(SUMO_ATTR_CONTAINER_STOP, 0, ok, "");
- MSContainerStop* cs = 0;
+ MSStoppingPlace* cs = 0;
if (csID != "") {
cs = MSNet::getInstance()->getContainerStop(csID);
if (cs == 0) {
@@ -705,7 +696,7 @@ MSRouteHandler::closeVehicle() {
vehControl.addWaiting(*route->begin(), vehicle);
vehControl.registerOneWaitingForContainer();
} else {
- // !!! no scaling for triggered vehicles yet
+ // !!! no upscaling for triggered vehicles yet
for (unsigned int i = 1; i < quota; i++) {
MSNet::getInstance()->getInsertionControl().add(vehicle);
SUMOVehicleParameter* newPars = new SUMOVehicleParameter(*myVehicleParameter);
@@ -860,8 +851,8 @@ MSRouteHandler::addStop(const SUMOSAXAttributes& attrs) {
MSEdge* edge = 0;
// try to parse the assigned bus stop
if (stop.busstop != "") {
- // ok, we have obviously a bus stop
- MSBusStop* bs = MSNet::getInstance()->getBusStop(stop.busstop);
+ // ok, we have a bus stop
+ MSStoppingPlace* bs = MSNet::getInstance()->getBusStop(stop.busstop);
if (bs == 0) {
WRITE_ERROR("The bus stop '" + stop.busstop + "' is not known" + errorSuffix);
return;
@@ -874,7 +865,7 @@ MSRouteHandler::addStop(const SUMOSAXAttributes& attrs) {
} //try to parse the assigned container stop
else if (stop.containerstop != "") {
// ok, we have obviously a container stop
- MSContainerStop* cs = MSNet::getInstance()->getContainerStop(stop.containerstop);
+ MSStoppingPlace* cs = MSNet::getInstance()->getContainerStop(stop.containerstop);
if (cs == 0) {
WRITE_ERROR("The container stop '" + stop.containerstop + "' is not known" + errorSuffix);
return;
@@ -884,6 +875,18 @@ MSRouteHandler::addStop(const SUMOSAXAttributes& attrs) {
stop.endPos = cs->getEndLanePosition();
stop.startPos = cs->getBeginLanePosition();
edge = &l.getEdge();
+ } else if (stop.chrgStn != "") {
+ // ok, we have a Charging station
+ MSChrgStn* cs = MSNet::getInstance()->getChrgStn(stop.busstop);
+ if (cs != 0) {
+ const MSLane& l = cs->getLane();
+ stop.lane = l.getID();
+ stop.endPos = cs->getEndLanePosition();
+ stop.startPos = cs->getBeginLanePosition();
+ } else {
+ WRITE_ERROR("The charging station '" + stop.chrgStn + "' is not known" + errorSuffix);
+ return;
+ }
} else {
// no, the lane and the position should be given
// get the lane
@@ -948,4 +951,53 @@ MSRouteHandler::addStop(const SUMOSAXAttributes& attrs) {
}
+void
+MSRouteHandler::parseWalkPositions(const SUMOSAXAttributes& attrs, const std::string& personID,
+ const MSEdge* fromEdge, const MSEdge* toEdge,
+ SUMOReal& departPos, SUMOReal& arrivalPos, MSStoppingPlace*& bs, bool& ok) {
+ const std::string description = "person '" + personID + "' walking from " + fromEdge->getID();
+
+ departPos = parseWalkPos(SUMO_ATTR_DEPARTPOS, description, fromEdge,
+ attrs.getOpt<std::string>(SUMO_ATTR_DEPARTPOS, description.c_str(), ok, "0"));
+
+ std::string bsID = attrs.getOpt<std::string>(SUMO_ATTR_BUS_STOP, 0, ok, "");
+ if (bsID != "") {
+ if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) {
+ WRITE_WARNING("Ignoring '" + toString(SUMO_ATTR_ARRIVALPOS)
+ + "' for " + description + " because '" + toString(SUMO_ATTR_BUS_STOP) + "' is given.");
+ }
+ bs = MSNet::getInstance()->getBusStop(bsID);
+ if (bs == 0) {
+ throw ProcessError("Unknown bus stop '" + bsID + "' for " + description + ".");
+ }
+ arrivalPos = bs->getEndLanePosition();
+ } else {
+ if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) {
+ arrivalPos = parseWalkPos(SUMO_ATTR_ARRIVALPOS, description, toEdge,
+ attrs.getOpt<std::string>(SUMO_ATTR_ARRIVALPOS, description.c_str(), ok, toString(-POSITION_EPS)));
+ } else {
+ arrivalPos = -NUMERICAL_EPS;
+ }
+ }
+}
+
+
+SUMOReal
+MSRouteHandler::parseWalkPos(SumoXMLAttr attr, const std::string& id, const MSEdge* edge, const std::string& val) {
+ SUMOReal result;
+ std::string error;
+ ArrivalPosDefinition proc;
+ // only supports 'random' and 'max'
+ if (!SUMOVehicleParameter::parseArrivalPos(val, toString(SUMO_TAG_WALK), id, result, proc, error)) {
+ throw ProcessError(error);
+ }
+ if (proc == ARRIVAL_POS_RANDOM) {
+ result = myParsingRNG.rand(edge->getLength());
+ } else if (proc == ARRIVAL_POS_MAX) {
+ result = edge->getLength();
+ }
+ return SUMOVehicleParameter::interpretEdgePos(result, edge->getLength(), attr, id);
+}
+
+
/****************************************************************************/
diff --git a/src/microsim/MSRouteHandler.h b/src/microsim/MSRouteHandler.h
index ac33dc1..ab5bae7 100644
--- a/src/microsim/MSRouteHandler.h
+++ b/src/microsim/MSRouteHandler.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Mon, 9 Jul 2001
-/// @version $Id: MSRouteHandler.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSRouteHandler.h 18756 2015-08-31 19:16:33Z behrisch $
///
// Parser and container for routes during their loading
/****************************************************************************/
@@ -143,15 +143,21 @@ protected:
/// Processing of a stop
void addStop(const SUMOSAXAttributes& attrs);
+ ///@ brief parse depart- and arrival positions of a walk
+ void parseWalkPositions(const SUMOSAXAttributes& attrs, const std::string& personID,
+ const MSEdge* fromEdge, const MSEdge* toEdge,
+ SUMOReal& departPos, SUMOReal& arrivalPos, MSStoppingPlace*& bs, bool& ok);
+ SUMOReal parseWalkPos(SumoXMLAttr attr, const std::string& id, const MSEdge* edge, const std::string& val);
+
protected:
/// @brief The current route
ConstMSEdgeVector myActiveRoute;
/// @brief The plan of the current person
- MSPerson::MSPersonPlan* myActivePlan;
+ MSTransportable::MSTransportablePlan* myActivePlan;
/// @brief The plan of the current container
- MSContainer::MSContainerPlan* myActiveContainerPlan;
+ MSTransportable::MSTransportablePlan* myActiveContainerPlan;
/// @brief Information whether vehicles shall be directly added to the network or kept within the buffer
bool myAddVehiclesDirectly;
diff --git a/src/microsim/MSStateHandler.cpp b/src/microsim/MSStateHandler.cpp
index c89a22d..e693fab 100644
--- a/src/microsim/MSStateHandler.cpp
+++ b/src/microsim/MSStateHandler.cpp
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Thu, 13 Dec 2012
-/// @version $Id: MSStateHandler.cpp 17899 2015-02-18 09:21:14Z namdre $
+/// @version $Id: MSStateHandler.cpp 18226 2015-04-17 11:42:25Z behrisch $
///
// Parser and output filter for routes and vehicles state saving and loading
/****************************************************************************/
@@ -35,6 +35,7 @@
#endif
#include <sstream>
+#include <utils/common/TplConvert.h>
#include <utils/iodevices/OutputDevice.h>
#include <utils/xml/SUMOXMLDefinitions.h>
#include <utils/xml/SUMOVehicleParserHelper.h>
@@ -77,7 +78,7 @@ void
MSStateHandler::saveState(const std::string& file, SUMOTime step) {
OutputDevice& out = OutputDevice::getDevice(file);
out.writeHeader<MSEdge>(SUMO_TAG_SNAPSHOT);
- out.writeAttr(SUMO_ATTR_VERSION, VERSION_STRING).writeAttr(SUMO_ATTR_TIME, step);
+ out.writeAttr(SUMO_ATTR_VERSION, VERSION_STRING).writeAttr(SUMO_ATTR_TIME, time2string(step));
MSRoute::dict_saveState(out);
MSNet::getInstance()->getVehicleControl().saveState(out);
if (MSGlobals::gUseMesoSim) {
@@ -104,7 +105,7 @@ MSStateHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) {
MSVehicleControl& vc = MSNet::getInstance()->getVehicleControl();
switch (element) {
case SUMO_TAG_SNAPSHOT: {
- myTime = attrs.getInt(SUMO_ATTR_TIME);
+ myTime = string2time(attrs.getString(SUMO_ATTR_TIME));
const std::string& version = attrs.getString(SUMO_ATTR_VERSION);
if (version != VERSION_STRING) {
WRITE_WARNING("State was written with sumo version " + version + " (present: " + VERSION_STRING + ")!");
@@ -171,7 +172,7 @@ MSStateHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) {
case SUMO_TAG_VEHICLE: {
SUMOVehicleParameter* p = new SUMOVehicleParameter();
p->id = attrs.getString(SUMO_ATTR_ID);
- p->depart = attrs.getInt(SUMO_ATTR_DEPART) - myOffset;
+ p->depart = string2time(attrs.getString(SUMO_ATTR_DEPART)) - myOffset;
p->routeid = attrs.getString(SUMO_ATTR_ROUTE);
p->vtypeid = attrs.getString(SUMO_ATTR_TYPE);
const MSRoute* route = MSRoute::dictionary(p->routeid);
@@ -217,7 +218,7 @@ MSStateHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) {
SUMOSAXAttributes::parseStringVector(attrs.getString(SUMO_ATTR_VALUE), vehIDs);
if (MSGlobals::gUseMesoSim) {
#ifdef HAVE_INTERNAL
- mySegment->loadState(vehIDs, MSNet::getInstance()->getVehicleControl(), attrs.getInt(SUMO_ATTR_TIME) - myOffset, myQueIndex++);
+ mySegment->loadState(vehIDs, MSNet::getInstance()->getVehicleControl(), TplConvert::_2long(attrs.getString(SUMO_ATTR_TIME).c_str()) - myOffset, myQueIndex++);
#endif
} else {
MSEdge::dictionary(myEdgeAndLane.first)->getLanes()[myEdgeAndLane.second]->loadState(
diff --git a/src/microsim/MSStoppingPlace.cpp b/src/microsim/MSStoppingPlace.cpp
new file mode 100644
index 0000000..85f1cf2
--- /dev/null
+++ b/src/microsim/MSStoppingPlace.cpp
@@ -0,0 +1,114 @@
+/****************************************************************************/
+/// @file MSStoppingPlace.cpp
+/// @author Daniel Krajzewicz
+/// @author Michael Behrisch
+/// @date Mon, 13.12.2005
+/// @version $Id: MSStoppingPlace.cpp 18756 2015-08-31 19:16:33Z behrisch $
+///
+// A lane area vehicles can halt at
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+#include <cassert>
+#include <utils/vehicle/SUMOVehicle.h>
+#include <microsim/MSVehicleType.h>
+#include "MSStoppingPlace.h"
+
+#ifdef CHECK_MEMORY_LEAKS
+#include <foreign/nvwa/debug_new.h>
+#endif // CHECK_MEMORY_LEAKS
+
+
+// ===========================================================================
+// method definitions
+// ===========================================================================
+MSStoppingPlace::MSStoppingPlace(const std::string& id,
+ const std::vector<std::string>& lines,
+ MSLane& lane,
+ SUMOReal begPos, SUMOReal endPos)
+ : Named(id), myLines(lines), myLane(lane),
+ myBegPos(begPos), myEndPos(endPos), myLastFreePos(endPos) {
+ computeLastFreePos();
+}
+
+
+MSStoppingPlace::~MSStoppingPlace() {}
+
+
+const MSLane&
+MSStoppingPlace::getLane() const {
+ return myLane;
+}
+
+
+SUMOReal
+MSStoppingPlace::getBeginLanePosition() const {
+ return myBegPos;
+}
+
+
+SUMOReal
+MSStoppingPlace::getEndLanePosition() const {
+ return myEndPos;
+}
+
+
+void
+MSStoppingPlace::enter(SUMOVehicle* what, SUMOReal beg, SUMOReal end) {
+ myEndPositions[what] = std::pair<SUMOReal, SUMOReal>(beg, end);
+ computeLastFreePos();
+}
+
+
+SUMOReal
+MSStoppingPlace::getLastFreePos(const SUMOVehicle& forVehicle) const {
+ if (myLastFreePos != myEndPos) {
+ return myLastFreePos - forVehicle.getVehicleType().getMinGap();
+ }
+ return myLastFreePos;
+}
+
+
+void
+MSStoppingPlace::leaveFrom(SUMOVehicle* what) {
+ assert(myEndPositions.find(what) != myEndPositions.end());
+ myEndPositions.erase(myEndPositions.find(what));
+ computeLastFreePos();
+}
+
+
+void
+MSStoppingPlace::computeLastFreePos() {
+ myLastFreePos = myEndPos;
+ std::map<SUMOVehicle*, std::pair<SUMOReal, SUMOReal> >::iterator i;
+ for (i = myEndPositions.begin(); i != myEndPositions.end(); i++) {
+ if (myLastFreePos > (*i).second.second) {
+ myLastFreePos = (*i).second.second;
+ }
+ }
+}
+
+
+
+/****************************************************************************/
+
diff --git a/src/microsim/MSStoppingPlace.h b/src/microsim/MSStoppingPlace.h
new file mode 100644
index 0000000..25c12f8
--- /dev/null
+++ b/src/microsim/MSStoppingPlace.h
@@ -0,0 +1,204 @@
+/****************************************************************************/
+/// @file MSStoppingPlace.h
+/// @author Daniel Krajzewicz
+/// @author Michael Behrisch
+/// @date Mon, 13.12.2005
+/// @version $Id: MSStoppingPlace.h 18756 2015-08-31 19:16:33Z behrisch $
+///
+// A lane area vehicles can halt at
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+#ifndef MSStoppingPlace_h
+#define MSStoppingPlace_h
+
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+#include <vector>
+#include <algorithm>
+#include <map>
+#include <string>
+#include <utils/common/Named.h>
+
+
+// ===========================================================================
+// class declarations
+// ===========================================================================
+class MSLane;
+class SUMOVehicle;
+class MSTransportable;
+
+
+// ===========================================================================
+// class definitions
+// ===========================================================================
+/**
+ * @class MSStoppingPlace
+ * @brief A lane area vehicles can halt at
+ *
+ * The stop tracks the last free space a vehicle may halt at by being
+ * informed about a vehicle's entering and depart. It keeps the information
+ * about entered vehicles' begin and end position within an internal
+ * container ("myEndPositions") and is so able to compute the last free space.
+ *
+ * Please note that using the last free space disallows vehicles to enter a
+ * free space in between other vehicles.
+ */
+class MSStoppingPlace : public Named {
+public:
+ /** @brief Constructor
+ *
+ * @param[in] id The id of the stop
+ * @param[in] net The net the stop belongs to
+ * @param[in] lines Names of the lines that halt on this stop
+ * @param[in] lane The lane the stop is placed on
+ * @param[in] begPos Begin position of the stop on the lane
+ * @param[in] endPos End position of the stop on the lane
+ */
+ MSStoppingPlace(const std::string& id,
+ const std::vector<std::string>& lines, MSLane& lane,
+ SUMOReal begPos, SUMOReal endPos);
+
+
+ /// @brief Destructor
+ virtual ~MSStoppingPlace();
+
+
+ /** @brief Returns the lane this stop is located at
+ *
+ * @return Reference to the lane the stop is located at
+ */
+ const MSLane& getLane() const;
+
+
+ /** @brief Returns the begin position of this stop
+ *
+ * @return The position the stop begins at
+ */
+ SUMOReal getBeginLanePosition() const;
+
+
+ /** @brief Returns the end position of this stop
+ *
+ * @return The position the stop ends at
+ */
+ SUMOReal getEndLanePosition() const;
+
+
+ /** @brief Called if a vehicle enters this stop
+ *
+ * Stores the position of the entering vehicle in myEndPositions.
+ *
+ * Recomputes the free space using "computeLastFreePos" then.
+ *
+ * @param[in] what The vehicle that enters the bus stop
+ * @param[in] beg The begin halting position of the vehicle
+ * @param[in] what The end halting position of the vehicle
+ * @see computeLastFreePos
+ */
+ void enter(SUMOVehicle* what, SUMOReal beg, SUMOReal end);
+
+
+ /** @brief Called if a vehicle leaves this stop
+ *
+ * Removes the position of the vehicle from myEndPositions.
+ *
+ * Recomputes the free space using "computeLastFreePos" then.
+ *
+ * @param[in] what The vehicle that leaves the bus stop
+ * @see computeLastFreePos
+ */
+ void leaveFrom(SUMOVehicle* what);
+
+
+ /** @brief Returns the last free position on this stop
+ *
+ * @return The last free position of this bus stop
+ */
+ SUMOReal getLastFreePos(const SUMOVehicle& forVehicle) const;
+
+
+ /** @brief Returns the number of transportables waiting on this stop
+ */
+ unsigned int getTransportableNumber() const {
+ return static_cast<unsigned int>(myWaitingTransportables.size());
+ }
+
+ /// @brief adds a transportable to this stop
+ void addTransportable(MSTransportable* p) {
+ myWaitingTransportables.push_back(p);
+ }
+
+ /// @brief Removes a transportable from this stop
+ void removeTransportable(MSTransportable* p) {
+ std::vector<MSTransportable*>::iterator i = std::find(myWaitingTransportables.begin(), myWaitingTransportables.end(), p);
+ if (i != myWaitingTransportables.end()) {
+ myWaitingTransportables.erase(i);
+ }
+ }
+
+protected:
+ /** @brief Computes the last free position on this stop
+ *
+ * The last free position is the one, the last vehicle ends at.
+ * It is stored in myLastFreePos. If no vehicle halts, the last free
+ * position gets the value of myEndPos.
+ */
+ void computeLastFreePos();
+
+
+protected:
+ /// @brief The list of lines that are assigned to this stop
+ std::vector<std::string> myLines;
+
+ /// @brief A map from objects (vehicles) to the areas they acquire after entering the stop
+ std::map<SUMOVehicle*, std::pair<SUMOReal, SUMOReal> > myEndPositions;
+
+ /// @brief The lane this bus stop is located at
+ MSLane& myLane;
+
+ /// @brief The begin position this bus stop is located at
+ SUMOReal myBegPos;
+
+ /// @brief The end position this bus stop is located at
+ SUMOReal myEndPos;
+
+ /// @brief The last free position at this stop (variable)
+ SUMOReal myLastFreePos;
+
+ /// @brief Persons waiting at this stop
+ std::vector<MSTransportable*> myWaitingTransportables;
+
+
+private:
+ /// @brief Invalidated copy constructor.
+ MSStoppingPlace(const MSStoppingPlace&);
+
+ /// @brief Invalidated assignment operator.
+ MSStoppingPlace& operator=(const MSStoppingPlace&);
+
+
+};
+
+
+#endif
+
+/****************************************************************************/
+
diff --git a/src/microsim/MSTransportable.cpp b/src/microsim/MSTransportable.cpp
new file mode 100644
index 0000000..7523e4e
--- /dev/null
+++ b/src/microsim/MSTransportable.cpp
@@ -0,0 +1,157 @@
+/****************************************************************************/
+/// @file MSTransportable.cpp
+/// @author Melanie Weber
+/// @author Andreas Kendziorra
+/// @author Michael Behrisch
+/// @date Thu, 12 Jun 2014
+/// @version $Id: MSTransportable.cpp 18756 2015-08-31 19:16:33Z behrisch $
+///
+// The common superclass for modelling transportable objects like persons and containers
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+#include <utils/vehicle/SUMOVehicleParameter.h>
+#include "MSEdge.h"
+#include "MSLane.h"
+#include "MSTransportable.h"
+
+#ifdef CHECK_MEMORY_LEAKS
+#include <foreign/nvwa/debug_new.h>
+#endif // CHECK_MEMORY_LEAKS
+
+// ===========================================================================
+// method definitions
+// ===========================================================================
+/* -------------------------------------------------------------------------
+ * MSTransportable::Stage - methods
+ * ----------------------------------------------------------------------- */
+MSTransportable::Stage::Stage(const MSEdge& destination, StageType type)
+ : myDestination(destination), myDeparted(-1), myArrived(-1), myType(type) {}
+
+MSTransportable::Stage::~Stage() {}
+
+const MSEdge&
+MSTransportable::Stage::getDestination() const {
+ return myDestination;
+}
+
+void
+MSTransportable::Stage::setDeparted(SUMOTime now) {
+ if (myDeparted < 0) {
+ myDeparted = now;
+ }
+}
+
+void
+MSTransportable::Stage::setArrived(SUMOTime now) {
+ myArrived = now;
+}
+
+bool
+MSTransportable::Stage::isWaitingFor(const std::string& /*line*/) const {
+ return false;
+}
+
+Position
+MSTransportable::Stage::getEdgePosition(const MSEdge* e, SUMOReal at, SUMOReal offset) const {
+ return getLanePosition(e->getLanes()[0], at, offset);
+}
+
+Position
+MSTransportable::Stage::getLanePosition(const MSLane* lane, SUMOReal at, SUMOReal offset) const {
+ return lane->getShape().positionAtOffset(lane->interpolateLanePosToGeometryPos(at), offset);
+}
+
+SUMOReal
+MSTransportable::Stage::getEdgeAngle(const MSEdge* e, SUMOReal at) const {
+ PositionVector shp = e->getLanes()[0]->getShape();
+ return -shp.rotationDegreeAtOffset(at);
+}
+
+
+/* -------------------------------------------------------------------------
+ * MSTransportable - methods
+ * ----------------------------------------------------------------------- */
+MSTransportable::MSTransportable(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportablePlan* plan)
+ : myParameter(pars), myVType(vtype), myPlan(plan) {
+ myStep = myPlan->begin();
+}
+
+MSTransportable::~MSTransportable() {
+ for (MSTransportablePlan::const_iterator i = myPlan->begin(); i != myPlan->end(); ++i) {
+ delete *i;
+ }
+ delete myPlan;
+ delete myParameter;
+}
+
+const std::string&
+MSTransportable::getID() const {
+ return myParameter->id;
+}
+
+SUMOTime
+MSTransportable::getDesiredDepart() const {
+ return myParameter->depart;
+}
+
+void
+MSTransportable::setDeparted(SUMOTime now) {
+ (*myStep)->setDeparted(now);
+}
+
+SUMOReal
+MSTransportable::getEdgePos() const {
+ return (*myStep)->getEdgePos(MSNet::getInstance()->getCurrentTimeStep());
+}
+
+Position
+MSTransportable::getPosition() const {
+ return (*myStep)->getPosition(MSNet::getInstance()->getCurrentTimeStep());
+}
+
+SUMOReal
+MSTransportable::getAngle() const {
+ return (*myStep)->getAngle(MSNet::getInstance()->getCurrentTimeStep());
+}
+
+SUMOReal
+MSTransportable::getWaitingSeconds() const {
+ return STEPS2TIME((*myStep)->getWaitingTime(MSNet::getInstance()->getCurrentTimeStep()));
+}
+
+SUMOReal
+MSTransportable::getSpeed() const {
+ return (*myStep)->getSpeed();
+}
+
+
+void
+MSTransportable::tripInfoOutput(OutputDevice& os) const {
+ for (MSTransportablePlan::const_iterator i = myPlan->begin(); i != myPlan->end(); ++i) {
+ (*i)->tripInfoOutput(os);
+ }
+}
+
+
+/****************************************************************************/
diff --git a/src/microsim/MSTransportable.h b/src/microsim/MSTransportable.h
new file mode 100644
index 0000000..6b59e19
--- /dev/null
+++ b/src/microsim/MSTransportable.h
@@ -0,0 +1,306 @@
+/****************************************************************************/
+/// @file MSTransportable.h
+/// @author Michael Behrisch
+/// @date Tue, 21 Apr 2015
+/// @version $Id: MSTransportable.h 18274 2015-04-22 15:00:44Z behrisch $
+///
+// The common superclass for modelling transportable objects like persons and containers
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+#ifndef MSTransportable_h
+#define MSTransportable_h
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+
+// ===========================================================================
+// class declarations
+// ===========================================================================
+class MSEdge;
+class MSLane;
+class MSNet;
+class MSVehicleType;
+class OutputDevice;
+class Position;
+class SUMOVehicleParameter;
+
+
+// ===========================================================================
+// class definitions
+// ===========================================================================
+/**
+ * @class MSTransportable
+ *
+ * The class holds a simulated moveable object
+ */
+class MSTransportable {
+public:
+ enum StageType {
+ DRIVING = 0,
+ WAITING = 1,
+ MOVING_WITHOUT_VEHICLE = 2 // walking for persons, tranship for containers
+ };
+
+ /**
+ * The "abstract" class for a single stage of a movement
+ * Contains the destination of the current movement step
+ */
+ class Stage {
+ public:
+ /// constructor
+ Stage(const MSEdge& destination, StageType type);
+
+ /// destructor
+ virtual ~Stage();
+
+ /// returns the destination edge
+ const MSEdge& getDestination() const;
+
+ /// Returns the current edge
+ virtual const MSEdge* getEdge() const = 0;
+ virtual const MSEdge* getFromEdge() const = 0;
+ virtual SUMOReal getEdgePos(SUMOTime now) const = 0;
+
+ /// returns the position of the transportable
+ virtual Position getPosition(SUMOTime now) const = 0;
+
+ /// returns the angle of the transportable
+ virtual SUMOReal getAngle(SUMOTime now) const = 0;
+
+ ///
+ StageType getStageType() const {
+ return myType;
+ }
+
+ /// @brief return string representation of the current stage
+ virtual std::string getStageDescription() const = 0;
+
+ /// proceeds to the next step
+ virtual void proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, MSEdge* previousEdge, const SUMOReal at) = 0;
+
+ /// logs end of the step
+ void setDeparted(SUMOTime now);
+
+ /// logs end of the step
+ void setArrived(SUMOTime now);
+
+ /// Whether the transportable waits for a vehicle of the line specified.
+ virtual bool isWaitingFor(const std::string& line) const;
+
+ /// @brief Whether the transportable waits for a vehicle
+ virtual bool isWaiting4Vehicle() const {
+ return false;
+ }
+
+ /// @brief the time this transportable spent waiting
+ virtual SUMOTime getWaitingTime(SUMOTime now) const = 0;
+
+ /// @brief the speed of the transportable
+ virtual SUMOReal getSpeed() const = 0;
+
+ /// @brief get position on edge e at length at with orthogonal offset
+ Position getEdgePosition(const MSEdge* e, SUMOReal at, SUMOReal offset) const;
+
+ /// @brief get position on lane at length at with orthogonal offset
+ Position getLanePosition(const MSLane* lane, SUMOReal at, SUMOReal offset) const;
+
+ /// @brief get angle of the edge at a certain position
+ SUMOReal getEdgeAngle(const MSEdge* e, SUMOReal at) const;
+
+ /** @brief Called on writing tripinfo output
+ * @param[in] os The stream to write the information into
+ * @exception IOError not yet implemented
+ */
+ virtual void tripInfoOutput(OutputDevice& os) const = 0;
+
+ /** @brief Called on writing vehroute output
+ * @param[in] os The stream to write the information into
+ * @exception IOError not yet implemented
+ */
+ virtual void routeOutput(OutputDevice& os) const = 0;
+
+ /** @brief Called for writing the events output (begin of an action)
+ * @param[in] os The stream to write the information into
+ * @exception IOError not yet implemented
+ */
+ virtual void beginEventOutput(const MSTransportable& container, SUMOTime t, OutputDevice& os) const = 0;
+
+ /** @brief Called for writing the events output (end of an action)
+ * @param[in] os The stream to write the information into
+ * @exception IOError not yet implemented
+ */
+ virtual void endEventOutput(const MSTransportable& container, SUMOTime t, OutputDevice& os) const = 0;
+
+ protected:
+ /// the next edge to reach by getting transported
+ const MSEdge& myDestination;
+
+ /// the time at which this stage started
+ SUMOTime myDeparted;
+
+ /// the time at which this stage ended
+ SUMOTime myArrived;
+
+ /// The type of this stage
+ StageType myType;
+
+ private:
+ /// @brief Invalidated copy constructor.
+ Stage(const Stage&);
+
+ /// @brief Invalidated assignment operator.
+ Stage& operator=(const Stage&);
+
+ };
+
+ /// the structure holding the plan of a container
+ typedef std::vector<MSTransportable::Stage*> MSTransportablePlan;
+
+ /// constructor
+ MSTransportable(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportablePlan* plan);
+
+ /// destructor
+ virtual ~MSTransportable();
+
+ /* @brief proceeds to the next step of the route,
+ * @return Whether the containers plan continues */
+ virtual bool proceed(MSNet* net, SUMOTime time) = 0;
+
+ /// returns the id of the transportable
+ const std::string& getID() const;
+
+ inline const SUMOVehicleParameter& getParameter() const {
+ return *myParameter;
+ }
+
+ inline const MSVehicleType& getVehicleType() const {
+ return *myVType;
+ }
+
+ /// Returns the desired departure time.
+ SUMOTime getDesiredDepart() const;
+
+ /// logs depart time of the current stage
+ void setDeparted(SUMOTime now);
+
+ /// Returns the current destination.
+ const MSEdge& getDestination() const {
+ return (*myStep)->getDestination();
+ }
+
+ /// Returns the destination after the current destination.
+ const MSEdge& getNextDestination() const {
+ return (*(myStep + 1))->getDestination();
+ }
+
+ /// @brief Returns the current edge
+ const MSEdge* getEdge() const {
+ return (*myStep)->getEdge();
+ }
+
+ /// @brief Returns the departure edge
+ const MSEdge* getFromEdge() const {
+ return (*myStep)->getFromEdge();
+ }
+
+ /// @brief Return the position on the edge
+ virtual SUMOReal getEdgePos() const;
+
+ /// @brief Return the Network coordinate of the container
+ virtual Position getPosition() const;
+
+ /// @brief return the current angle of the container
+ virtual SUMOReal getAngle() const;
+
+ /// @brief the time this container spent waiting in seconds
+ virtual SUMOReal getWaitingSeconds() const;
+
+ /// @brief the current speed of the container
+ virtual SUMOReal getSpeed() const;
+
+ /// @brief the current stage type of the container
+ StageType getCurrentStageType() const {
+ return (*myStep)->getStageType();
+ }
+
+ /// Returns the current stage description as a string
+ std::string getCurrentStageDescription() const {
+ return (*myStep)->getStageDescription();
+ }
+
+ /// @brief Return the current stage
+ MSTransportable::Stage* getCurrentStage() const {
+ return *myStep;
+ }
+
+ /** @brief Called on writing tripinfo output
+ *
+ * @param[in] os The stream to write the information into
+ * @exception IOError not yet implemented
+ */
+ void tripInfoOutput(OutputDevice& os) const;
+
+ /** @brief Called on writing vehroute output
+ *
+ * @param[in] os The stream to write the information into
+ * @exception IOError not yet implemented
+ */
+ virtual void routeOutput(OutputDevice& os) const = 0;
+
+ /// Whether the container waits for a vehicle of the line specified.
+ bool isWaitingFor(const std::string& line) const {
+ return (*myStep)->isWaitingFor(line);
+ }
+
+ /// Whether the container waits for a vehicle
+ bool isWaiting4Vehicle() const {
+ return (*myStep)->isWaiting4Vehicle();
+ }
+
+protected:
+ /// the plan of the container
+ const SUMOVehicleParameter* myParameter;
+
+ /// @brief This container's type. (mainly used for drawing related information
+ /// Note sure if it is really necessary
+ const MSVehicleType* myVType;
+
+ /// @brief Whether events shall be written
+ bool myWriteEvents;
+
+ /// the plan of the container
+ MSTransportablePlan* myPlan;
+
+ /// the iterator over the route
+ MSTransportablePlan::iterator myStep;
+
+private:
+ /// @brief Invalidated copy constructor.
+ MSTransportable(const MSTransportable&);
+
+ /// @brief Invalidated assignment operator.
+ MSTransportable& operator=(const MSTransportable&);
+
+};
+
+
+#endif
+
+/****************************************************************************/
diff --git a/src/microsim/MSVehicle.cpp b/src/microsim/MSVehicle.cpp
index 586d7a7..5bd6e3e 100644
--- a/src/microsim/MSVehicle.cpp
+++ b/src/microsim/MSVehicle.cpp
@@ -12,7 +12,7 @@
/// @author Axel Wegener
/// @author Christoph Sommer
/// @date Mon, 05 Mar 2001
-/// @version $Id: MSVehicle.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSVehicle.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Representation of a vehicle in the micro simulation
/****************************************************************************/
@@ -59,7 +59,7 @@
#include <microsim/MSVehicleControl.h>
#include <microsim/MSVehicleTransfer.h>
#include <microsim/MSGlobals.h>
-#include "trigger/MSBusStop.h"
+#include "MSStoppingPlace.h"
#include "devices/MSDevice_Person.h"
#include "devices/MSDevice_Container.h"
#include "MSEdgeWeightsStorage.h"
@@ -87,13 +87,8 @@
#include <foreign/nvwa/debug_new.h>
#endif // CHECK_MEMORY_LEAKS
+// enable here and in utils/gui/globjects/GUIGLObjectPopupMenu.cpp
//#define DEBUG_VEHICLE_GUI_SELECTION 1
-#ifdef DEBUG_VEHICLE_GUI_SELECTION
-#undef ID_LIST
-#include <utils/gui/div/GUIGlobalSelection.h>
-#include <guisim/GUIVehicle.h>
-#include <guisim/GUILane.h>
-#endif
#define BUS_STOP_OFFSET 0.5
@@ -368,12 +363,11 @@ MSVehicle::Influencer::postProcessVTD(MSVehicle* v) {
* MSVehicle-methods
* ----------------------------------------------------------------------- */
MSVehicle::~MSVehicle() {
- delete myLaneChangeModel;
- // other
delete myEdgeWeights;
for (std::vector<MSLane*>::iterator i = myFurtherLanes.begin(); i != myFurtherLanes.end(); ++i) {
(*i)->resetPartialOccupation(this);
}
+ delete myLaneChangeModel; // still needed when calling resetPartialOccupation (getShadowLane)
myFurtherLanes.clear();
for (DriveItemVector::iterator i = myLFLinkLanes.begin(); i != myLFLinkLanes.end(); ++i) {
if ((*i).myLink != 0) {
@@ -662,6 +656,10 @@ MSVehicle::getAngle() const {
p2 = myFurtherLanes.size() > 0
? myFurtherLanes.back()->geometryPositionAtOffset(myFurtherLanes.back()->getPartialOccupatorEnd())
: myLane->getShape().front();
+ if (getLaneChangeModel().isChangingLanes() && myFurtherLanes.size() > 0 && getLaneChangeModel().getShadowLane(myFurtherLanes.back()) == 0) {
+ // special case where there target lane has no predecessor
+ p2 = myLane->getShape().front();
+ }
}
SUMOReal result = (p1 != p2 ?
atan2(p1.x() - p2.x(), p2.y() - p1.y()) * 180. / M_PI :
@@ -782,7 +780,7 @@ MSVehicle::addStop(const SUMOVehicleParameter::Stop& stopPar, std::string& error
} else {
errorMsg = "Stop";
}
- errorMsg += " for vehicle '" + myParameter->id + "' on lane '" + stopPar.lane + "' is behind departPos.";
+ errorMsg += " for vehicle '" + myParameter->id + "' on lane '" + stopPar.lane + "' is before departPos.";
return false;
}
}
@@ -805,7 +803,7 @@ MSVehicle::addStop(const SUMOVehicleParameter::Stop& stopPar, std::string& error
bool
MSVehicle::isStopped() const {
- return !myStops.empty() && myStops.begin()->reached;
+ return !myStops.empty() && myStops.begin()->reached /*&& myState.mySpeed < SUMO_const_haltingSpeed @todo #1864#*/;
}
@@ -844,9 +842,9 @@ MSVehicle::processNextStop(SUMOReal currentVelocity) {
loaded &= stop.awaitedContainers.size() == 0;
if (boarded) {
if (stop.busstop != 0) {
- const std::vector<MSPerson*>& persons = myPersonDevice->getPersons();
- for (std::vector<MSPerson*>::const_iterator i = persons.begin(); i != persons.end(); ++i) {
- stop.busstop->removePerson(*i);
+ const std::vector<MSTransportable*>& persons = myPersonDevice->getPersons();
+ for (std::vector<MSTransportable*>::const_iterator i = persons.begin(); i != persons.end(); ++i) {
+ stop.busstop->removeTransportable(*i);
}
}
// the triggering condition has been fulfilled. Maybe we want to wait a bit longer for additional riders (car pooling)
@@ -858,9 +856,9 @@ MSVehicle::processNextStop(SUMOReal currentVelocity) {
}
if (loaded) {
if (stop.containerstop != 0) {
- const std::vector<MSContainer*>& containers = myContainerDevice->getContainers();
- for (std::vector<MSContainer*>::const_iterator i = containers.begin(); i != containers.end(); ++i) {
- stop.containerstop->removeContainer(*i);
+ const std::vector<MSTransportable*>& containers = myContainerDevice->getContainers();
+ for (std::vector<MSTransportable*>::const_iterator i = containers.begin(); i != containers.end(); ++i) {
+ stop.containerstop->removeTransportable(*i);
}
}
// the triggering condition has been fulfilled
@@ -963,7 +961,7 @@ MSVehicle::planMove(const SUMOTime t, const MSVehicle* pred, const SUMOReal leng
void
MSVehicle::planMoveInternal(const SUMOTime t, const MSVehicle* pred, DriveItemVector& lfLinks) const {
#ifdef DEBUG_VEHICLE_GUI_SELECTION
- if (gSelected.isSelected(GLO_VEHICLE, static_cast<const GUIVehicle*>(this)->getGlID())) {
+ if (gDebugSelectedVehicle == getID()) {
int bla = 0;
}
#endif
@@ -1020,6 +1018,14 @@ MSVehicle::planMoveInternal(const SUMOTime t, const MSVehicle* pred, DriveItemVe
// check leader on lane
// leader is given for the first edge only
adaptToLeader(leaderInfo, seen, lastLink, lane, v, vLinkPass);
+ if (getLaneChangeModel().hasShadowVehicle()) {
+ // also slow down for leaders on the shadowLane
+ const MSLane* shadowLane = getLaneChangeModel().getShadowLane(lane);
+ if (shadowLane != 0) {
+ std::pair<const MSVehicle*, SUMOReal> shadowLeaderInfo = shadowLane->getLeader(this, lane->getLength() - seen, false);
+ adaptToLeader(shadowLeaderInfo, seen, lastLink, shadowLane, v, vLinkPass);
+ }
+ }
// process stops
if (!myStops.empty() && &myStops.begin()->lane->getEdge() == &lane->getEdge()) {
@@ -1086,18 +1092,21 @@ MSVehicle::planMoveInternal(const SUMOTime t, const MSVehicle* pred, DriveItemVe
// slow down to finish lane change before the shadow lane ends
(getLaneChangeModel().isLaneChangeMidpointPassed() &&
(*link)->getViaLaneOrLane()->getParallelLane(-getLaneChangeModel().getLaneChangeDirection()) == 0)) {
+ // XXX maybe this is too harsh. Vehicles could cut some corners here
const SUMOReal timeRemaining = STEPS2TIME((1 - getLaneChangeModel().getLaneChangeCompletion()) * MSGlobals::gLaneChangeDuration);
- const SUMOReal va = seen / timeRemaining;
+ const SUMOReal va = MAX2((SUMOReal)0, (seen - POSITION_EPS) / timeRemaining);
v = MIN2(va, v);
}
}
- bool setRequest = v > 0; // even if red, if we cannot break we should issue a request
+ // - even if red, if we cannot break we should issue a request
+ // - always issue a request to leave the intersection we are currently on
+ bool setRequest = v > 0 || (myLane->getEdge().isInternal() && lastLink == 0);
SUMOReal vLinkWait = MIN2(v, cfModel.stopSpeed(this, getSpeed(), stopDist));
const SUMOReal brakeDist = cfModel.brakeGap(myState.mySpeed) - myState.mySpeed * cfModel.getHeadwayTime();
if (yellowOrRed && seen >= brakeDist) {
// the vehicle is able to brake in front of a yellow/red traffic light
- lfLinks.push_back(DriveProcessItem(*link, vLinkWait, vLinkWait, false, t + TIME2STEPS(seen / MAX2(vLinkWait, NUMERICAL_EPS)), vLinkWait, 0, SUMOTime_MAX, seen));
+ lfLinks.push_back(DriveProcessItem(*link, vLinkWait, vLinkWait, false, t + TIME2STEPS(seen / MAX2(vLinkWait, NUMERICAL_EPS)), vLinkWait, 0, 0, seen));
//lfLinks.push_back(DriveProcessItem(0, vLinkWait, vLinkWait, false, 0, 0, stopDist));
break;
}
@@ -1249,7 +1258,7 @@ MSVehicle::getSafeFollowSpeed(const std::pair<const MSVehicle*, SUMOReal> leader
bool
MSVehicle::executeMove() {
#ifdef DEBUG_VEHICLE_GUI_SELECTION
- if (gSelected.isSelected(GLO_VEHICLE, static_cast<const GUIVehicle*>(this)->getGlID())) {
+ if (gDebugSelectedVehicle == getID()) {
int bla = 0;
}
#endif
@@ -1443,6 +1452,9 @@ MSVehicle::executeMove() {
assert(myState.myPos > 0);
enterLaneAtMove(approachedLane);
myLane = approachedLane;
+ if (hasArrived()) {
+ break;
+ }
if (getLaneChangeModel().isChangingLanes()) {
if (link->getDirection() == LINKDIR_LEFT || link->getDirection() == LINKDIR_RIGHT) {
// abort lane change
@@ -1532,11 +1544,8 @@ MSVehicle::getSpaceTillLastStanding(const MSLane* l, bool& foundStopped) const {
void
MSVehicle::checkRewindLinkLanes(const SUMOReal lengthsInFront, DriveItemVector& lfLinks) const {
#ifdef DEBUG_VEHICLE_GUI_SELECTION
- if (gSelected.isSelected(GLO_VEHICLE, static_cast<const GUIVehicle*>(this)->getGlID())) {
+ if (gDebugSelectedVehicle == getID()) {
int bla = 0;
- if (MSNet::getInstance()->getCurrentTimeStep() == 152000) {
- bla = 0;
- }
}
#endif
#ifdef HAVE_INTERNAL_LANES
@@ -1558,7 +1567,7 @@ MSVehicle::checkRewindLinkLanes(const SUMOReal lengthsInFront, DriveItemVector&
// get the next lane, determine whether it is an internal lane
const MSLane* approachedLane = item.myLink->getViaLane();
if (approachedLane != 0) {
- if (item.myLink->hasFoes()/* && item.myLink->willHaveBlockedFoe()*/) {
+ if (item.myLink->hasFoes() && item.myLink->keepClear()/* && item.myLink->willHaveBlockedFoe()*/) {
seenSpace = seenSpace - approachedLane->getBruttoVehLenSum();
hadVehicle |= approachedLane->getVehicleNumber() != 0;
} else {
@@ -1607,12 +1616,12 @@ MSVehicle::checkRewindLinkLanes(const SUMOReal lengthsInFront, DriveItemVector&
#ifdef DEBUG_VEHICLE_GUI_SELECTION
- if (gSelected.isSelected(GLO_VEHICLE, static_cast<const GUIVehicle*>(this)->getGlID())) {
+ if (gDebugSelectedVehicle == getID()) {
int bla = 0;
}
#endif
// check which links allow continuation and add pass available to the previous item
- for (int i = (int)(lfLinks.size() - 1); i > 0; --i) {
+ for (int i = ((int)lfLinks.size() - 1); i > 0; --i) {
DriveProcessItem& item = lfLinks[i - 1];
const bool canLeaveJunction = item.myLink->getViaLane() == 0 || lfLinks[i].mySetRequest;
const bool opened = item.myLink != 0 && canLeaveJunction && (item.myLink->havePriority() ||
@@ -1659,7 +1668,7 @@ MSVehicle::checkRewindLinkLanes(const SUMOReal lengthsInFront, DriveItemVector&
impatienceCorrection = MAX2(SUMOReal(0), STEPS2TIME(myWaitingTime));
}
*/
- if (leftSpace < -impatienceCorrection / 10. && item.myLink->hasFoes()) {
+ if (leftSpace < -impatienceCorrection / 10. && item.myLink->hasFoes() && item.myLink->keepClear()) {
removalBegin = i;
}
//removalBegin = i;
@@ -1768,41 +1777,21 @@ MSVehicle::enterLaneAtLaneChange(MSLane* enteredLane) {
addReminder(*rem);
}
activateReminders(MSMoveReminder::NOTIFICATION_LANE_CHANGE);
- /*
- for (std::vector<MSLane*>::iterator i = myFurtherLanes.begin(); i != myFurtherLanes.end(); ++i) {
- (*i)->resetPartialOccupation(this);
- }
- myFurtherLanes.clear();
- */
- if (myState.myPos - getVehicleType().getLength() < 0) {
- // we have to rebuild "further lanes"
- const MSRoute& route = getRoute();
- MSRouteIterator i = myCurrEdge;
- MSLane* lane = myLane;
- SUMOReal leftLength = getVehicleType().getLength() - myState.myPos;
- while (i != route.begin() && leftLength > 0) {
- /* const MSEdge* const prev = */ *(--i);
- lane = lane->getLogicalPredecessorLane();
- if (lane == 0) {
- break;
- }
- myFurtherLanes.push_back(lane);
+ MSLane* lane = myLane;
+ SUMOReal leftLength = getVehicleType().getLength() - myState.myPos;
+ for (int i = 0; i < (int)myFurtherLanes.size(); i++) {
+ if (lane != 0) {
+ lane = lane->getLogicalPredecessorLane(myFurtherLanes[i]->getEdge());
+ }
+ if (lane != 0) {
+ myFurtherLanes[i]->resetPartialOccupation(this);
+ myFurtherLanes[i] = lane;
leftLength -= (lane)->setPartialOccupation(this, leftLength);
- /*
- const std::vector<MSLane::IncomingLaneInfo> &incomingLanes = lane->getIncomingLanes();
- for (std::vector<MSLane::IncomingLaneInfo>::const_iterator j = incomingLanes.begin(); j != incomingLanes.end(); ++j) {
- if (&(*j).lane->getEdge() == prev) {
- #ifdef HAVE_INTERNAL_LANES
- (*j).lane->setPartialOccupation(this, leftLength);
- #else
- leftLength -= (*j).length;
- (*j).lane->setPartialOccupation(this, leftLength);
- #endif
- leftLength -= (*j).lane->getLength();
- break;
- }
+ } else {
+ // keep the old values, but ensure there is no shadow
+ if (myLaneChangeModel->isChangingLanes()) {
+ myLaneChangeModel->setNoShadowPartialOccupator(myFurtherLanes[i]);
}
- */
}
}
}
@@ -1859,7 +1848,9 @@ MSVehicle::leaveLane(const MSMoveReminder::Notification reason) {
rem = myMoveReminders.erase(rem);
}
}
- if (reason != MSMoveReminder::NOTIFICATION_JUNCTION) {
+ if (reason != MSMoveReminder::NOTIFICATION_JUNCTION && reason != MSMoveReminder::NOTIFICATION_LANE_CHANGE) {
+ // @note. In case of lane change, myFurtherLanes and partial occupation
+ // are handled in enterLaneAtLaneChange()
for (std::vector<MSLane*>::iterator i = myFurtherLanes.begin(); i != myFurtherLanes.end(); ++i) {
(*i)->resetPartialOccupation(this);
}
@@ -1873,7 +1864,8 @@ MSVehicle::leaveLane(const MSMoveReminder::Notification reason) {
}
if (reason != MSMoveReminder::NOTIFICATION_PARKING && reason != MSMoveReminder::NOTIFICATION_LANE_CHANGE) {
while (!myStops.empty() && myStops.front().edge == myCurrEdge) {
- WRITE_WARNING("Vehicle '" + getID() + "' skips stop on lane '" + myStops.front().lane->getID() + "'.");
+ WRITE_WARNING("Vehicle '" + getID() + "' skips stop on lane '" + myStops.front().lane->getID()
+ + "' time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + ".")
myStops.pop_front();
}
}
@@ -1901,7 +1893,7 @@ MSVehicle::getBestLanes() const {
void
MSVehicle::updateBestLanes(bool forceRebuild, const MSLane* startLane) {
#ifdef DEBUG_VEHICLE_GUI_SELECTION
- if (gSelected.isSelected(GLO_VEHICLE, static_cast<const GUIVehicle*>(this)->getGlID())) {
+ if (gDebugSelectedVehicle == getID()) {
int bla = 0;
myLastBestLanesEdge = 0;
}
@@ -2319,7 +2311,7 @@ MSVehicle::getHarmonoise_NoiseEmissions() const {
void
-MSVehicle::addPerson(MSPerson* person) {
+MSVehicle::addPerson(MSTransportable* person) {
if (myPersonDevice == 0) {
myPersonDevice = MSDevice_Person::buildVehicleDevices(*this, myDevices);
myMoveReminders.push_back(std::make_pair(myPersonDevice, 0.));
@@ -2341,7 +2333,7 @@ MSVehicle::addPerson(MSPerson* person) {
}
void
-MSVehicle::addContainer(MSContainer* container) {
+MSVehicle::addContainer(MSTransportable* container) {
if (myContainerDevice == 0) {
myContainerDevice = MSDevice_Container::buildVehicleDevices(*this, myDevices);
myMoveReminders.push_back(std::make_pair(myContainerDevice, 0.));
@@ -2381,6 +2373,12 @@ MSVehicle::setBlinkerInformation() {
switchOnSignal(VEH_SIGNAL_BLINKER_LEFT);
} else if ((state & LCA_RIGHT) != 0) {
switchOnSignal(VEH_SIGNAL_BLINKER_RIGHT);
+ } else if (getLaneChangeModel().isChangingLanes()) {
+ if (getLaneChangeModel().getLaneChangeDirection() == 1) {
+ switchOnSignal(VEH_SIGNAL_BLINKER_LEFT);
+ } else {
+ switchOnSignal(VEH_SIGNAL_BLINKER_RIGHT);
+ }
} else {
const MSLane* lane = getLane();
MSLinkCont::const_iterator link = MSLane::succLinkSec(*this, 1, *lane, getBestLanesContinuation());
@@ -2429,11 +2427,11 @@ MSVehicle::setTentativeLaneAndPosition(MSLane* lane, const SUMOReal pos) {
#ifndef NO_TRACI
bool
-MSVehicle::addTraciStop(MSLane* lane, SUMOReal pos, SUMOReal /*radius*/, SUMOTime duration,
- bool parking, bool triggered, bool containerTriggered, std::string& errorMsg) {
+MSVehicle::addTraciStop(MSLane* const lane, const SUMOReal startPos, const SUMOReal endPos, const SUMOTime duration, const SUMOTime until,
+ const bool parking, const bool triggered, const bool containerTriggered, std::string& errorMsg) {
//if the stop exists update the duration
for (std::list<Stop>::iterator iter = myStops.begin(); iter != myStops.end(); iter++) {
- if (iter->lane == lane && fabs(iter->endPos - pos) < POSITION_EPS) {
+ if (iter->lane == lane && fabs(iter->endPos - endPos) < POSITION_EPS) {
if (duration == 0 && !iter->reached) {
myStops.erase(iter);
} else {
@@ -2445,16 +2443,64 @@ MSVehicle::addTraciStop(MSLane* lane, SUMOReal pos, SUMOReal /*radius*/, SUMOTim
SUMOVehicleParameter::Stop newStop;
newStop.lane = lane->getID();
- newStop.busstop = MSNet::getInstance()->getBusStopID(lane, pos);
- newStop.containerstop = MSNet::getInstance()->getContainerStopID(lane, pos);
- newStop.startPos = pos - POSITION_EPS;
- newStop.endPos = pos;
+ newStop.startPos = startPos;
+ newStop.endPos = endPos;
+ newStop.duration = duration;
+ newStop.until = until;
+ newStop.triggered = triggered;
+ newStop.containerTriggered = containerTriggered;
+ newStop.parking = parking;
+ newStop.index = STOP_INDEX_FIT;
+ const bool result = addStop(newStop, errorMsg);
+ if (myLane != 0) {
+ updateBestLanes(true);
+ }
+ return result;
+}
+
+
+bool
+MSVehicle::addTraciBusOrContainerStop(const std::string& stopId, const SUMOTime duration, const SUMOTime until, const bool parking,
+ const bool triggered, const bool containerTriggered, const bool isContainerStop, std::string& errorMsg) {
+ //if the stop exists update the duration
+ for (std::list<Stop>::iterator iter = myStops.begin(); iter != myStops.end(); iter++) {
+ const Named* const stop = isContainerStop ? (Named*)iter->containerstop : iter->busstop;
+ if (stop != 0 && stop->getID() == stopId) {
+ if (duration == 0 && !iter->reached) {
+ myStops.erase(iter);
+ } else {
+ iter->duration = duration;
+ }
+ return true;
+ }
+ }
+
+ SUMOVehicleParameter::Stop newStop;
+ MSStoppingPlace* bs = 0;
+ if (isContainerStop) {
+ newStop.containerstop = stopId;
+ bs = MSNet::getInstance()->getContainerStop(stopId);
+ if (bs == 0) {
+ errorMsg = "The container stop '" + stopId + "' is not known for vehicle '" + getID() + "'";
+ return false;
+ }
+ } else {
+ newStop.busstop = stopId;
+ bs = MSNet::getInstance()->getBusStop(stopId);
+ if (bs == 0) {
+ errorMsg = "The bus stop '" + stopId + "' is not known for vehicle '" + getID() + "'";
+ return false;
+ }
+ }
newStop.duration = duration;
- newStop.until = -1;
+ newStop.until = until;
newStop.triggered = triggered;
newStop.containerTriggered = containerTriggered;
newStop.parking = parking;
newStop.index = STOP_INDEX_FIT;
+ newStop.lane = bs->getLane().getID();
+ newStop.endPos = bs->getEndLanePosition();
+ newStop.startPos = bs->getBeginLanePosition();
const bool result = addStop(newStop, errorMsg);
if (myLane != 0) {
updateBestLanes(true);
@@ -2542,9 +2588,9 @@ void
MSVehicle::saveState(OutputDevice& out) {
MSBaseVehicle::saveState(out);
// here starts the vehicle internal part (see loading)
- std::vector<int> internals;
+ std::vector<SUMOTime> internals;
internals.push_back(myDeparture);
- internals.push_back((int)distance(myRoute->begin(), myCurrEdge));
+ internals.push_back((SUMOTime)distance(myRoute->begin(), myCurrEdge));
out.writeAttr(SUMO_ATTR_STATE, toString(internals));
out.writeAttr(SUMO_ATTR_POSITION, myState.myPos);
out.writeAttr(SUMO_ATTR_SPEED, myState.mySpeed);
diff --git a/src/microsim/MSVehicle.h b/src/microsim/MSVehicle.h
index 1c71cc8..400e01f 100644
--- a/src/microsim/MSVehicle.h
+++ b/src/microsim/MSVehicle.h
@@ -10,7 +10,7 @@
/// @author Michael Behrisch
/// @author Axel Wegener
/// @date Mon, 12 Mar 2001
-/// @version $Id: MSVehicle.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSVehicle.h 18686 2015-08-21 14:52:03Z namdre $
///
// Representation of a vehicle in the micro simulation
/****************************************************************************/
@@ -58,8 +58,8 @@ class MSMoveReminder;
class MSLaneChanger;
class MSVehicleTransfer;
class MSAbstractLaneChangeModel;
-class MSBusStop;
-class MSContainerStop;
+class MSStoppingPlace;
+class MSChrgStn;
class MSPerson;
class MSDevice;
class MSEdgeWeightsStorage;
@@ -447,6 +447,10 @@ public:
MSAbstractLaneChangeModel& getLaneChangeModel();
const MSAbstractLaneChangeModel& getLaneChangeModel() const;
+ const std::vector<MSLane*>& getFurtherLanes() const {
+ return myFurtherLanes;
+ }
+
/// @name strategical/tactical lane choosing methods
/// @{
@@ -563,9 +567,11 @@ public:
/// @brief The lane to stop at
const MSLane* lane;
/// @brief (Optional) bus stop if one is assigned to the stop
- MSBusStop* busstop;
+ MSStoppingPlace* busstop;
/// @brief (Optional) container stop if one is assigned to the stop
- MSContainerStop* containerstop;
+ MSStoppingPlace* containerstop;
+ /// @brief (Optional) charging station if one is assigned to the stop
+ MSChrgStn* chrgStn;
/// @brief The stopping position start
SUMOReal startPos;
/// @brief The stopping position end
@@ -650,8 +656,8 @@ public:
* @return The velocity in dependance to the next/current stop
* @todo Describe more detailed
* @see Stop
- * @see MSBusStop
- * @see MSContainerStop
+ * @see MSStoppingPlace
+ * @see MSStoppingPlace
*/
SUMOReal processNextStop(SUMOReal currentVelocity);
@@ -726,7 +732,7 @@ public:
/** @brief Adds a passenger
* @param[in] person The person to add
*/
- void addPerson(MSPerson* person);
+ void addPerson(MSTransportable* person);
/// @name Interaction with containers
//@{
@@ -734,7 +740,7 @@ public:
/** @brief Adds a container
* @param[in] container The container to add
*/
- void addContainer(MSContainer* container);
+ void addContainer(MSTransportable* container);
/** @brief Returns the number of persons
@@ -854,16 +860,31 @@ public:
/**
* schedule a new stop for the vehicle; each time a stop is reached, the vehicle
* will wait for the given duration before continuing on its route
- * @param lane lane on wich to stop
- * @param pos position on the given lane at wich to stop
- * @param radius the vehicle will stop if it is within the range [pos-radius, pos+radius]
- * @param duration after waiting for the time period duration, the vehicle will
+ * @param lane lane on wich to stop
+ * @param startPos start position on the given lane at wich to stop
+ * @param endPos end position on the given lane at wich to stop
+ * @param duration waiting time duration
+ * @param until time step at which the stop shall end
* @param parking a flag indicating whether the traci stop is used for parking or not
* @param triggered a flag indicating whether the traci stop is triggered or not
* @param containerTriggered a flag indicating whether the traci stop is triggered by a container or not
*/
- bool addTraciStop(MSLane* lane, SUMOReal pos, SUMOReal radius, SUMOTime duration,
- bool parking, bool triggered, bool containerTriggered, std::string& errorMsg);
+ bool addTraciStop(MSLane* const lane, const SUMOReal startPos, const SUMOReal endPos, const SUMOTime duration, const SUMOTime until,
+ const bool parking, const bool triggered, const bool containerTriggered, std::string& errorMsg);
+
+ /**
+ * schedule a new stop for the vehicle; each time a stop is reached, the vehicle
+ * will wait for the given duration before continuing on its route
+ * @param stopId bus or container stop id
+ * @param duration waiting time duration
+ * @param until time step at which the stop shall end
+ * @param parking a flag indicating whether the traci stop is used for parking or not
+ * @param triggered a flag indicating whether the traci stop is triggered or not
+ * @param containerTriggered a flag indicating whether the traci stop is triggered by a container or not
+ * @param isContainerStop a flag indicating whether the stop is a container stop
+ */
+ bool addTraciBusOrContainerStop(const std::string& stopId, const SUMOTime duration, const SUMOTime until, const bool parking,
+ const bool triggered, const bool containerTriggered, const bool isContainerStop, std::string& errorMsg);
/**
* returns the next imminent stop in the stop queue
diff --git a/src/microsim/MSVehicleTransfer.cpp b/src/microsim/MSVehicleTransfer.cpp
index 7bf334d..e945d8f 100644
--- a/src/microsim/MSVehicleTransfer.cpp
+++ b/src/microsim/MSVehicleTransfer.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sep 2003
-/// @version $Id: MSVehicleTransfer.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSVehicleTransfer.cpp 18429 2015-05-21 08:58:17Z namdre $
///
// A mover of vehicles that got stucked due to grid locks
/****************************************************************************/
@@ -57,12 +57,13 @@ const std::set<const MSVehicle*> MSVehicleTransfer::myEmptyVehicleSet;
// ===========================================================================
void
MSVehicleTransfer::add(const SUMOTime t, MSVehicle* veh) {
- veh->getLaneChangeModel().endLaneChangeManeuver();
if (veh->isParking()) {
+ veh->getLaneChangeModel().endLaneChangeManeuver(MSMoveReminder::NOTIFICATION_PARKING);
MSNet::getInstance()->informVehicleStateListener(veh, MSNet::VEHICLE_STATE_STARTING_PARKING);
myParkingVehicles[veh->getLane()].insert(veh); // initialized to empty set on first use
veh->onRemovalFromNet(MSMoveReminder::NOTIFICATION_PARKING);
} else {
+ veh->getLaneChangeModel().endLaneChangeManeuver(MSMoveReminder::NOTIFICATION_TELEPORT);
MSNet::getInstance()->informVehicleStateListener(veh, MSNet::VEHICLE_STATE_STARTING_TELEPORT);
if (veh->succEdge(1) == 0) {
WRITE_WARNING("Vehicle '" + veh->getID() + "' teleports beyond end of route ('" + veh->getEdge()->getID() + "'), time " + time2string(t) + ".");
diff --git a/src/microsim/Makefile.am b/src/microsim/Makefile.am
index d715506..0a6a661 100644
--- a/src/microsim/Makefile.am
+++ b/src/microsim/Makefile.am
@@ -21,12 +21,14 @@ MSNet.cpp MSNet.h MSNoLogicJunction.cpp MSNoLogicJunction.h \
MSPersonControl.cpp MSPersonControl.h \
MSRightOfWayJunction.cpp MSRightOfWayJunction.h \
MSRoute.cpp MSRoute.h MSRouteHandler.cpp MSRouteHandler.h \
+MSStoppingPlace.cpp MSStoppingPlace.h \
MSVehicle.cpp MSVehicle.h \
MSVehicleContainer.cpp MSVehicleContainer.h \
MSVehicleControl.cpp MSVehicleControl.h \
MSVehicleTransfer.cpp MSVehicleTransfer.h \
MSVehicleType.cpp MSVehicleType.h \
-MSStateHandler.h MSStateHandler.cpp
+MSStateHandler.h MSStateHandler.cpp \
+MSTransportable.h MSTransportable.cpp
SUBDIRS = actions cfmodels devices lcmodels logging output pedestrians \
traffic_lights trigger
diff --git a/src/microsim/Makefile.in b/src/microsim/Makefile.in
index 3f5b273..3b59f91 100644
--- a/src/microsim/Makefile.in
+++ b/src/microsim/Makefile.in
@@ -110,10 +110,11 @@ am_libmicrosim_a_OBJECTS = MSBaseVehicle.$(OBJEXT) \
MSLogicJunction.$(OBJEXT) MSMoveReminder.$(OBJEXT) \
MSNet.$(OBJEXT) MSNoLogicJunction.$(OBJEXT) \
MSPersonControl.$(OBJEXT) MSRightOfWayJunction.$(OBJEXT) \
- MSRoute.$(OBJEXT) MSRouteHandler.$(OBJEXT) MSVehicle.$(OBJEXT) \
+ MSRoute.$(OBJEXT) MSRouteHandler.$(OBJEXT) \
+ MSStoppingPlace.$(OBJEXT) MSVehicle.$(OBJEXT) \
MSVehicleContainer.$(OBJEXT) MSVehicleControl.$(OBJEXT) \
MSVehicleTransfer.$(OBJEXT) MSVehicleType.$(OBJEXT) \
- MSStateHandler.$(OBJEXT)
+ MSStateHandler.$(OBJEXT) MSTransportable.$(OBJEXT)
libmicrosim_a_OBJECTS = $(am_libmicrosim_a_OBJECTS)
AM_V_P = $(am__v_P_ at AM_V@)
am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
@@ -404,12 +405,14 @@ MSNet.cpp MSNet.h MSNoLogicJunction.cpp MSNoLogicJunction.h \
MSPersonControl.cpp MSPersonControl.h \
MSRightOfWayJunction.cpp MSRightOfWayJunction.h \
MSRoute.cpp MSRoute.h MSRouteHandler.cpp MSRouteHandler.h \
+MSStoppingPlace.cpp MSStoppingPlace.h \
MSVehicle.cpp MSVehicle.h \
MSVehicleContainer.cpp MSVehicleContainer.h \
MSVehicleControl.cpp MSVehicleControl.h \
MSVehicleTransfer.cpp MSVehicleTransfer.h \
MSVehicleType.cpp MSVehicleType.h \
-MSStateHandler.h MSStateHandler.cpp
+MSStateHandler.h MSStateHandler.cpp \
+MSTransportable.h MSTransportable.cpp
SUBDIRS = actions cfmodels devices lcmodels logging output pedestrians \
traffic_lights trigger
@@ -491,6 +494,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSRoute.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSRouteHandler.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSStateHandler.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSStoppingPlace.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSTransportable.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSVehicle.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSVehicleContainer.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSVehicleControl.Po at am__quote@
diff --git a/src/microsim/actions/Command_SaveTLCoupledDet.cpp b/src/microsim/actions/Command_SaveTLCoupledDet.cpp
index d057146..c8744c6 100644
--- a/src/microsim/actions/Command_SaveTLCoupledDet.cpp
+++ b/src/microsim/actions/Command_SaveTLCoupledDet.cpp
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date 15 Feb 2004
-/// @version $Id: Command_SaveTLCoupledDet.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: Command_SaveTLCoupledDet.cpp 18213 2015-04-16 11:55:42Z behrisch $
///
// Writes e2 state on each tls switch
/****************************************************************************/
@@ -47,7 +47,7 @@
// method definitions
// ===========================================================================
Command_SaveTLCoupledDet::Command_SaveTLCoupledDet(MSTLLogicControl::TLSLogicVariants& tlls,
- MSDetectorFileOutput* dtf, unsigned int begin, OutputDevice& device)
+ MSDetectorFileOutput* dtf, SUMOTime begin, OutputDevice& device)
: myDevice(device), myLogics(tlls), myDetector(dtf),
myStartTime(begin) {
tlls.addSwitchCommand(this);
diff --git a/src/microsim/actions/Command_SaveTLCoupledDet.h b/src/microsim/actions/Command_SaveTLCoupledDet.h
index 8042cd6..0b96a37 100644
--- a/src/microsim/actions/Command_SaveTLCoupledDet.h
+++ b/src/microsim/actions/Command_SaveTLCoupledDet.h
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date 15 Feb 2004
-/// @version $Id: Command_SaveTLCoupledDet.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: Command_SaveTLCoupledDet.h 18213 2015-04-16 11:55:42Z behrisch $
///
// Writes e2 state on each tls switch
/****************************************************************************/
@@ -64,7 +64,7 @@ public:
* @param[in] device The output device to write the detector values into
*/
Command_SaveTLCoupledDet(MSTLLogicControl::TLSLogicVariants& tlls,
- MSDetectorFileOutput* dtf, unsigned int begin, OutputDevice& device);
+ MSDetectorFileOutput* dtf, SUMOTime begin, OutputDevice& device);
/// @brief Destructor
diff --git a/src/microsim/actions/Command_SaveTLCoupledLaneDet.cpp b/src/microsim/actions/Command_SaveTLCoupledLaneDet.cpp
index 530af6b..32f9030 100644
--- a/src/microsim/actions/Command_SaveTLCoupledLaneDet.cpp
+++ b/src/microsim/actions/Command_SaveTLCoupledLaneDet.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date 15 Feb 2004
-/// @version $Id: Command_SaveTLCoupledLaneDet.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: Command_SaveTLCoupledLaneDet.cpp 18213 2015-04-16 11:55:42Z behrisch $
///
// Writes e2 state of a link for the time the link has yellow/red
/****************************************************************************/
@@ -49,7 +49,7 @@
// method definitions
// ===========================================================================
Command_SaveTLCoupledLaneDet::Command_SaveTLCoupledLaneDet(MSTLLogicControl::TLSLogicVariants& tlls,
- MSDetectorFileOutput* dtf, unsigned int begin, OutputDevice& device, MSLink* link)
+ MSDetectorFileOutput* dtf, SUMOTime begin, OutputDevice& device, MSLink* link)
: Command_SaveTLCoupledDet(tlls, dtf, begin, device),
myLink(link), myLastState(LINKSTATE_TL_RED),
myHadOne(false) {
diff --git a/src/microsim/actions/Command_SaveTLCoupledLaneDet.h b/src/microsim/actions/Command_SaveTLCoupledLaneDet.h
index d49f374..8f6d47b 100644
--- a/src/microsim/actions/Command_SaveTLCoupledLaneDet.h
+++ b/src/microsim/actions/Command_SaveTLCoupledLaneDet.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date 15 Feb 2004
-/// @version $Id: Command_SaveTLCoupledLaneDet.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: Command_SaveTLCoupledLaneDet.h 18213 2015-04-16 11:55:42Z behrisch $
///
// Writes e2 state of a link for the time the link has yellow/red
/****************************************************************************/
@@ -56,7 +56,7 @@ public:
* @param[in] link The link that shall be observed
*/
Command_SaveTLCoupledLaneDet(MSTLLogicControl::TLSLogicVariants& tlls,
- MSDetectorFileOutput* dtf, unsigned int begin, OutputDevice& device,
+ MSDetectorFileOutput* dtf, SUMOTime begin, OutputDevice& device,
MSLink* link);
diff --git a/src/microsim/cfmodels/MSCFModel_IDM.cpp b/src/microsim/cfmodels/MSCFModel_IDM.cpp
index e6874a5..6e52adb 100644
--- a/src/microsim/cfmodels/MSCFModel_IDM.cpp
+++ b/src/microsim/cfmodels/MSCFModel_IDM.cpp
@@ -4,7 +4,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date Thu, 03 Sep 2009
-/// @version $Id: MSCFModel_IDM.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSCFModel_IDM.cpp 18467 2015-05-29 03:50:41Z behrisch $
///
// The Intelligent Driver Model (IDM) car-following model
/****************************************************************************/
@@ -71,7 +71,7 @@ MSCFModel_IDM::moveHelper(MSVehicle* const veh, SUMOReal vPos) const {
const SUMOReal vNext = MSCFModel::moveHelper(veh, vPos);
if (myAdaptationFactor != 1.) {
VehicleVariables* vars = (VehicleVariables*)veh->getCarFollowVariables();
- vars->levelOfService += (vNext / desiredSpeed(veh) - vars->levelOfService) / myAdaptationTime * TS;
+ vars->levelOfService += (vNext / veh->getLane()->getVehicleMaxSpeed(veh) - vars->levelOfService) / myAdaptationTime * TS;
}
return vNext;
}
@@ -79,7 +79,7 @@ MSCFModel_IDM::moveHelper(MSVehicle* const veh, SUMOReal vPos) const {
SUMOReal
MSCFModel_IDM::followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal /*predMaxDecel*/) const {
- return _v(veh, gap2pred, speed, predSpeed, desiredSpeed(veh));
+ return _v(veh, gap2pred, speed, predSpeed, veh->getLane()->getVehicleMaxSpeed(veh));
}
@@ -88,7 +88,7 @@ MSCFModel_IDM::stopSpeed(const MSVehicle* const veh, const SUMOReal speed, SUMOR
if (gap2pred < 0.01) {
return 0;
}
- return _v(veh, gap2pred, speed, 0, desiredSpeed(veh), false);
+ return _v(veh, gap2pred, speed, 0, veh->getLane()->getVehicleMaxSpeed(veh), false);
}
@@ -98,7 +98,7 @@ MSCFModel_IDM::interactionGap(const MSVehicle* const veh, SUMOReal vL) const {
// Resolve the IDM equation to gap. Assume predecessor has
// speed != 0 and that vsafe will be the current speed plus acceleration,
// i.e that with this gap there will be no interaction.
- const SUMOReal acc = myAccel * (1. - pow(veh->getSpeed() / desiredSpeed(veh), myDelta));
+ const SUMOReal acc = myAccel * (1. - pow(veh->getSpeed() / veh->getLane()->getVehicleMaxSpeed(veh), myDelta));
const SUMOReal vNext = veh->getSpeed() + acc;
const SUMOReal gap = (vNext - vL) * (veh->getSpeed() + vL) / (2 * myDecel) + vL;
diff --git a/src/microsim/cfmodels/MSCFModel_IDM.h b/src/microsim/cfmodels/MSCFModel_IDM.h
index 555709c..a7d8984 100644
--- a/src/microsim/cfmodels/MSCFModel_IDM.h
+++ b/src/microsim/cfmodels/MSCFModel_IDM.h
@@ -4,7 +4,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date Thu, 03 Sep 2009
-/// @version $Id: MSCFModel_IDM.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSCFModel_IDM.h 18467 2015-05-29 03:50:41Z behrisch $
///
// The Intelligent Driver Model (IDM) car-following model
/****************************************************************************/
@@ -158,10 +158,6 @@ private:
SUMOReal _v(const MSVehicle* const veh, const SUMOReal gap2pred, const SUMOReal mySpeed,
const SUMOReal predSpeed, const SUMOReal desSpeed, const bool respectMinGap = true) const;
- SUMOReal desiredSpeed(const MSVehicle* const veh) const {
- return MIN2(myType->getMaxSpeed(), veh->getLane()->getVehicleMaxSpeed(veh));
- }
-
private:
/// @brief The IDM delta exponent
diff --git a/src/microsim/cfmodels/MSCFModel_KraussPS.cpp b/src/microsim/cfmodels/MSCFModel_KraussPS.cpp
index d264b85..16db643 100644
--- a/src/microsim/cfmodels/MSCFModel_KraussPS.cpp
+++ b/src/microsim/cfmodels/MSCFModel_KraussPS.cpp
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Mon, 04 Aug 2009
-/// @version $Id: MSCFModel_KraussPS.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSCFModel_KraussPS.cpp 18467 2015-05-29 03:50:41Z behrisch $
///
// Krauss car-following model, changing accel and speed by slope
/****************************************************************************/
@@ -50,7 +50,6 @@ MSCFModel_KraussPS::MSCFModel_KraussPS(const MSVehicleType* vtype, SUMOReal acce
MSCFModel_KraussPS::~MSCFModel_KraussPS() {}
-
SUMOReal
MSCFModel_KraussPS::maxNextSpeed(SUMOReal speed, const MSVehicle* const veh) const {
const SUMOReal gravity = 9.80665;
@@ -61,12 +60,10 @@ MSCFModel_KraussPS::maxNextSpeed(SUMOReal speed, const MSVehicle* const veh) con
}
-
MSCFModel*
MSCFModel_KraussPS::duplicate(const MSVehicleType* vtype) const {
return new MSCFModel_KraussPS(vtype, myAccel, myDecel, myDawdle, myHeadwayTime);
}
-//void MSCFModel::saveState(std::ostream &os) {}
-
+/****************************************************************************/
diff --git a/src/microsim/devices/MSDevice.cpp b/src/microsim/devices/MSDevice.cpp
index ab4a645..2ed25aa 100644
--- a/src/microsim/devices/MSDevice.cpp
+++ b/src/microsim/devices/MSDevice.cpp
@@ -1,9 +1,9 @@
-/****************************************************************************/
+/****************************************************************************/
/// @file MSDevice.cpp
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date 14.08.2013
-/// @version $Id: MSDevice.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSDevice.cpp 18686 2015-08-21 14:52:03Z namdre $
///
// Abstract in-vehicle device
/****************************************************************************/
@@ -41,6 +41,7 @@
#include "MSDevice_BTreceiver.h"
#include "MSDevice_BTsender.h"
#include "MSDevice_Example.h"
+#include "MSDevice_Battery.h"
#ifdef CHECK_MEMORY_LEAKS
#include <foreign/nvwa/debug_new.h>
@@ -66,6 +67,7 @@ MSDevice::insertOptions(OptionsCont& oc) {
MSDevice_BTreceiver::insertOptions(oc);
MSDevice_BTsender::insertOptions(oc);
MSDevice_Example::insertOptions(oc);
+ MSDevice_Battery::insertOptions(oc);
}
@@ -78,6 +80,7 @@ MSDevice::buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into) {
MSDevice_BTreceiver::buildVehicleDevices(v, into);
MSDevice_BTsender::buildVehicleDevices(v, into);
MSDevice_Example::buildVehicleDevices(v, into);
+ MSDevice_Battery::buildVehicleDevices(v, into);
}
@@ -118,12 +121,16 @@ MSDevice::equippedByDefaultAssignmentOptions(const OptionsCont& oc, const std::s
}
// assignment by abstract parameters
bool haveByParameter = false;
- if (v.getParameter().knowsParameter("has." + deviceName + ".device")) {
- haveByParameter = TplConvert::_2bool(v.getParameter().getParameter("has." + deviceName + ".device", "false").c_str());
- } else {
- haveByParameter = TplConvert::_2bool(v.getVehicleType().getParameter().getParameter("has." + deviceName + ".device", "false").c_str());
+ bool parameterGiven = false;
+ const std::string key = "has." + deviceName + ".device";
+ if (v.getParameter().knowsParameter(key)) {
+ parameterGiven = true;
+ haveByParameter = TplConvert::_2bool(v.getParameter().getParameter(key, "false").c_str());
+ } else if (v.getVehicleType().getParameter().knowsParameter(key)) {
+ parameterGiven = true;
+ haveByParameter = TplConvert::_2bool(v.getVehicleType().getParameter().getParameter(key, "false").c_str());
}
- return haveByNumber || haveByName || haveByParameter;
+ return (haveByNumber && !parameterGiven) || haveByName || haveByParameter;
}
diff --git a/src/microsim/devices/MSDevice_Battery.cpp b/src/microsim/devices/MSDevice_Battery.cpp
new file mode 100644
index 0000000..135dd59
--- /dev/null
+++ b/src/microsim/devices/MSDevice_Battery.cpp
@@ -0,0 +1,667 @@
+/****************************************************************************/
+/// @file MSDevice_Battery.cpp
+/// @author Tamas Kurczveil
+/// @author Pablo Alvarez L�pez
+/// @date 20.12.2013
+/// @version $Id: MSDevice_Battery.cpp 18762 2015-09-01 16:27:09Z behrisch $ // ATENCION
+///
+// The Battery parameters for the vehicle
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+#include <utils/common/TplConvert.h>
+#include <utils/options/OptionsCont.h>
+#include <utils/iodevices/OutputDevice.h>
+#include <utils/common/SUMOTime.h>
+#include <microsim/MSNet.h>
+#include <microsim/MSLane.h>
+#include <microsim/MSEdge.h>
+#include <microsim/MSVehicle.h>
+#include "MSDevice_Tripinfo.h"
+#include "MSDevice_Battery.h"
+
+#define PI 3.141592654
+
+#ifdef CHECK_MEMORY_LEAKS
+#include <foreign/nvwa/debug_new.h>
+#endif // CHECK_MEMORY_LEAKS
+
+
+// ===========================================================================
+// method definitions
+// ===========================================================================
+// ---------------------------------------------------------------------------
+// static initialisation methods
+// ---------------------------------------------------------------------------
+void
+MSDevice_Battery::insertOptions(OptionsCont& oc) {
+ insertDefaultAssignmentOptions("battery", "Battery", oc);
+}
+
+
+void
+MSDevice_Battery::buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into) {
+ if (!equippedByDefaultAssignmentOptions(OptionsCont::getOptions(), "battery", v)) {
+ return;
+ }
+
+ // Declare default parameters
+ SUMOReal new_ActBatKap = 0;
+ SUMOReal new_MaxBatKap = 0;
+ SUMOReal new_PowerMax = 100;
+ SUMOReal new_Mass = 1000;
+ SUMOReal new_FrontSurfaceArea = 2;
+ SUMOReal new_AirDragCoefficient = 0.4;
+ SUMOReal new_InternalMomentOfInertia = 10;
+ SUMOReal new_RadialDragCoefficient = 1;
+ SUMOReal new_RollDragCoefficient = 0.5;
+ SUMOReal new_ConstantPowerIntake = 10;
+ SUMOReal new_PropulsionEfficiency = 0.5;
+ SUMOReal new_RecuperationEfficiency = 0;
+ SUMOReal new_LastAngle = 0;
+ SUMOReal new_LastEnergy = 0;
+
+ // MaxBatKap
+ new_MaxBatKap = TplConvert::_2SUMOReal(v.getVehicleType().getParameter().getParameter("MaxBatKap", "0").c_str());
+
+ // ActBatKap
+ if (v.getParameter().getParameter("ActBatKap", "-") == "-") {
+ new_ActBatKap = new_MaxBatKap / 2.0;
+ } else {
+ new_ActBatKap = TplConvert::_2SUMOReal(v/*.getVehicleType()*/.getParameter().getParameter("ActBatKap", "0").c_str());
+ }
+
+ // Power
+ new_PowerMax = TplConvert::_2SUMOReal(v.getVehicleType().getParameter().getParameter("PowerMax", "100").c_str());
+
+ // Mass
+ new_Mass = TplConvert::_2SUMOReal(v.getVehicleType().getParameter().getParameter("Mass", "1000").c_str());
+
+ // FrontSurfaceArea
+ new_FrontSurfaceArea = TplConvert::_2SUMOReal(v.getVehicleType().getParameter().getParameter("FrontSurfaceArea", "2").c_str());
+
+ // AirDragCoefficient
+ new_AirDragCoefficient = TplConvert::_2SUMOReal(v.getVehicleType().getParameter().getParameter("AirDragCoefficient", "0.4").c_str());
+
+ // InternalMomentOfInertia
+ new_InternalMomentOfInertia = TplConvert::_2SUMOReal(v.getVehicleType().getParameter().getParameter("InternalMomentOfInertia", "10").c_str());
+
+ // Radial Drag Coefficient
+ new_RadialDragCoefficient = TplConvert::_2SUMOReal(v.getVehicleType().getParameter().getParameter("RadialDragCoefficient", "1").c_str());
+
+ // RollDragCoefficient
+ new_RollDragCoefficient = TplConvert::_2SUMOReal(v.getVehicleType().getParameter().getParameter("RollDragCoefficient", "0.5").c_str());
+
+ // ConstantPowerIntake
+ new_ConstantPowerIntake = TplConvert::_2SUMOReal(v.getVehicleType().getParameter().getParameter("ConstantPowerIntake", "10").c_str());
+
+ // PropulsionEfficiency
+ new_PropulsionEfficiency = TplConvert::_2SUMOReal(v.getVehicleType().getParameter().getParameter("PropulsionEfficiency", "0.5").c_str());
+
+ // RecuperationEfficiency
+ new_RecuperationEfficiency = TplConvert::_2SUMOReal(v.getVehicleType().getParameter().getParameter("RecuperationEfficiency", "0").c_str());
+
+ // constructor
+ MSDevice_Battery* device = new MSDevice_Battery(v, "battery_" + v.getID(),
+ new_ActBatKap, new_MaxBatKap, new_PowerMax, new_Mass, new_FrontSurfaceArea, new_AirDragCoefficient,
+ new_InternalMomentOfInertia, new_RadialDragCoefficient, new_RollDragCoefficient,
+ new_ConstantPowerIntake, new_PropulsionEfficiency, new_RecuperationEfficiency,
+ new_LastAngle, new_LastEnergy);
+
+ into.push_back(device);
+}
+
+
+bool MSDevice_Battery::notifyMove(SUMOVehicle& veh, SUMOReal /* oldPos */, SUMOReal /* newPos */, SUMOReal /* newSpeed */) {
+ // Start vehicleStoppedTimer if the vehicle is stopped (that's mean, speed is < 0.2). In other case reset timer
+ if (veh.getSpeed() < 0.2) {
+ // Increase vehicle stopped timer
+ increaseVehicleStoppedTimer();
+ } else {
+ // Reset vehicle Stopped
+ resetVehicleStoppedTimer();
+ }
+
+ // Update Energy from the battery
+ if (getMaxBatKap() != 0) {
+ Consum = getPropEnergy(veh);
+
+ // Energy lost/gained from vehicle movement (via vehicle energy model) [kWh]
+ setActBatKap(getActBatKap() - Consum);
+
+ // saturate between 0 and MaxBatKap [kWh]
+ if (getActBatKap() < 0) {
+ setActBatKap(0);
+
+ if (getMaxBatKap() > 0) {
+ WRITE_WARNING("Battery from vehicle with ID = '" + veh.getID() + "' is depleted.");
+ }
+
+ } else if (getActBatKap() > getMaxBatKap()) {
+ setActBatKap(getMaxBatKap());
+ }
+
+ setLastAngle(veh.getAngle());
+ }
+
+ // Check if vehicle has under their position one charge Station
+ std::string ChargingStationID = MSNet::getInstance()->getChrgStnID(veh.getLane(), veh.getPositionOnLane());
+
+ // If vehicle is over a charging station
+ if (ChargingStationID != "") {
+ // Declare a pointer to the charging station
+ MSChrgStn* ChargingStationPointer = MSNet::getInstance()->getChrgStn(ChargingStationID);
+
+ // if the vehicle is almost stopped, or charge in transit is enabled, then charge vehicle
+ if ((veh.getSpeed() < 0.2) || (ChargingStationPointer->getChargeInTransit() == 1)) {
+ // Set Flags Stopped/intransit to
+ if (veh.getSpeed() < 0.2) {
+ // vehicle ist almost stopped, then is charging stopped
+ ItsChargingStopped = true;
+
+ // therefore isn't charging in transit
+ ItsChargingInTransit = false;
+ } else {
+ // vehicle is moving, and the Charging station allow charge in transit
+ ItsChargingStopped = false;
+
+ // Therefore charge in transit
+ ItsChargingInTransit = true;
+ }
+
+ // Set actChrgStn parameter
+ actChrgStn = ChargingStationID;
+
+ // Only update charging start time if vehicle allow charge in transit, or in other case
+ // if the vehicle not allow charge in transit but it's stopped.
+ if (ChargingStationPointer->getChargeInTransit() == 1 || veh.getSpeed() < 0.2) {
+ // Update Charging start time
+ increaseChargingStartTime();
+ }
+
+ // time it takes the vehicle at the station < charging station time delay?
+ if (getChargingStartTime() > ChargingStationPointer->getChargeDelay()) {
+ // Calulate energy charged (Fix);
+ energyCharged = ChargingStationPointer->getChrgPower() * ChargingStationPointer->getEfficency();
+
+ // Convert from [kWs] to [kWh] (3600s / 1h):
+ energyCharged /= 3600;
+
+ // Update Battery charge
+ if ((energyCharged + getActBatKap()) > getMaxBatKap()) {
+ setActBatKap(getMaxBatKap());
+ } else {
+ setActBatKap(getActBatKap() + energyCharged);
+ }
+ }
+ }
+ }
+ // In other case, vehicle will be not charged
+ else {
+ // Disable flags
+ ItsChargingInTransit = false;
+ ItsChargingStopped = false;
+
+ // Disable charging station
+ actChrgStn = "NULL";
+
+ // Set energy charged to 0
+ energyCharged = 0.00;
+
+ // Reset timer
+ resetChargingStartTime();
+ }
+
+ // Always return true.
+ return true;
+}
+
+
+bool MSDevice_Battery::notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) {
+ // Set last Energy ONLY when the vehicle is introduced in the simulation (That's mean, that the reason is 0)
+ if (reason == 0) {
+ setLastEnergy(getMass() * veh.getSpeed() * veh.getSpeed() / 2 + getMass() * 9.81 * veh.getLane()->getShape().front().z() + getInternalMomentOfInertia() * 0.5 * veh.getSpeed() * veh.getSpeed());
+ setLastAngle(veh.getLane()->getShape().beginEndAngle() * 180 / PI);
+ }
+
+ // This function return always true
+ return true;
+}
+
+
+void MSDevice_Battery::generateOutput() const {
+ //Function implemented in MSBatteryExport
+ /*if (OptionsCont::getOptions().isSet("tripinfo-output"))
+ {
+ OutputDevice& os = OutputDevice::getDeviceByOption("tripinfo-output");
+
+ os.openTag("Battery");
+ os.writeAttr("Act Bat Kap", toString(ActBatKap));
+ os.writeAttr("Max Bat Kap", toString(MaxBatKap));
+ os.writeAttr("Power Max", toString(PowerMax));
+ os.writeAttr("Mass", toString(Mass));
+ os.writeAttr("Front Surface Area", toString(FrontSurfaceArea));
+ os.writeAttr("Air Drag Coefficient", toString(AirDragCoefficient));
+ os.writeAttr("Radial Drag Coefficient", toString(RadialDragCoefficient));
+ os.writeAttr("RollDrag Coefficient", toString(RollDragCoefficient));
+ os.writeAttr("Constant Power Intake", toString(ConstantPowerIntake));
+ os.writeAttr("Propulsion Efficiency", toString(PropulsionEfficiency));
+ os.writeAttr("Recuperation Efficiency", toString(RecuperationEfficiency));
+ os.writeAttr("Last Angle", toString(LastAngle));
+ os.writeAttr("Last Energy", toString(LastEnergy));
+ os.closeTag();
+ }*/
+}
+
+
+// ---------------------------------------------------------------------------
+// MSDevice_Battery-methods
+// ---------------------------------------------------------------------------
+MSDevice_Battery::MSDevice_Battery(SUMOVehicle& holder, const std::string& id, const SUMOReal new_ActBatKap, const SUMOReal new_MaxBatKap, const SUMOReal new_PowerMax, const SUMOReal new_Mass, const SUMOReal new_FrontSurfaceArea, const SUMOReal new_AirDragCoefficient, const SUMOReal new_InternalMomentOfInertia, const SUMOReal new_RadialDragCoefficient, const SUMOReal new_RollDragCoefficient, const SUMOReal new_ConstantPowerIntake, const SUMOReal new_PropulsionEfficiency, const SUMOReal n [...]
+ :
+ MSDevice(holder, id),
+ ActBatKap(new_ActBatKap), // [ActBatKap <= MaxBatKap]
+ MaxBatKap(new_MaxBatKap), // [MaxBatKap >= 0]
+ PowerMax(new_PowerMax), // [PowerMax >= 0]
+ Mass(new_Mass), // [Mass >= 0]
+ FrontSurfaceArea(new_FrontSurfaceArea), // [FrontSurfaceArea >= 0]
+ AirDragCoefficient(new_AirDragCoefficient), // [AirDragCoefficient >=0]
+ InternalMomentOfInertia(new_InternalMomentOfInertia), // [InternalMomentOfInertia >= 0]
+ RadialDragCoefficient(new_RadialDragCoefficient), // [RadialDragCoefficient >=0]
+ RollDragCoefficient(new_RollDragCoefficient), // [RollDragCoefficient >= 0]
+ ConstantPowerIntake(new_ConstantPowerIntake), // [ConstantPowerIntake >= 0]
+ PropulsionEfficiency(new_PropulsionEfficiency), // [1 >= PropulsionEfficiency >= 0]
+ RecuperationEfficiency(new_RecuperationEfficiency), // [1 >= RecuperationEfficiency >= 0]
+ LastAngle(new_LastAngle), // Limit not needed
+ LastEnergy(new_LastEnergy) { // Limit not needed
+ // Initially the Vehicle is not charging and is not in a Chargin Station
+ ItsChargingStopped = false;
+ ItsChargingInTransit = false;
+
+ // Initially the energy charged is null
+ energyCharged = 0;
+
+ // Initially the Vehicle stopped and the consum is cero.
+ Consum = 0;
+
+ // Initially the vehicle is stopped and the corresponding variable is 0
+ vehicleStopped = 0;
+
+ // Initially the Vehicle are not over a Charging Station
+ actChrgStn = "NULL";
+
+ if (ActBatKap > MaxBatKap) {
+ WRITE_WARNING("Battery builder: Vehicle with id = " + getID() + " has a actual battery capacity (" + SUMOReal_str(ActBatKap) + ") greater than it's max battery capacity(" + SUMOReal_str(MaxBatKap) + ").");
+ }
+
+ if (MaxBatKap < 0) {
+ WRITE_WARNING("Battery builder: Vehicle with id = " + getID() + " has not a valid battery capacity (" + SUMOReal_str(MaxBatKap) + ").");
+ }
+
+ if (PowerMax < 0) {
+ WRITE_WARNING("Battery builder: Vehicle with id = " + getID() + " has not a valid power max (" + SUMOReal_str(PowerMax) + ").");
+ }
+
+ if (Mass < 0) {
+ WRITE_WARNING("Battery builder: Vehicle with id = " + getID() + " has not a valid mass (" + SUMOReal_str(Mass) + ").");
+ }
+
+ if (FrontSurfaceArea < 0) {
+ WRITE_WARNING("Battery builder: Vehicle with id = " + getID() + " has not a valid front surface Area (" + SUMOReal_str(FrontSurfaceArea) + ").");
+ }
+
+ if (AirDragCoefficient < 0) {
+ WRITE_WARNING("Battery builder: Vehicle with id = " + getID() + " has not a valid drag coefficient (" + SUMOReal_str(AirDragCoefficient) + ").");
+ }
+
+ if (InternalMomentOfInertia < 0) {
+ WRITE_WARNING("Battery builder: Vehicle with id = " + getID() + " has not a valid internal moment of inertia (" + SUMOReal_str(InternalMomentOfInertia) + ").");
+ }
+
+ if (RadialDragCoefficient < 0) {
+ WRITE_WARNING("Battery builder: Vehicle with id = " + getID() + " has not a valid radial friction coefficient (" + SUMOReal_str(RadialDragCoefficient) + ").");
+ }
+
+ if (RollDragCoefficient < 0) {
+ WRITE_WARNING("Battery builder: Vehicle with id = " + getID() + " has not a valid roll friction coefficient (" + SUMOReal_str(RollDragCoefficient) + ").");
+ }
+
+ if (ConstantPowerIntake < 0) {
+ WRITE_WARNING("Battery builder: Vehicle with id = " + getID() + " has not a valid constant power intake (" + SUMOReal_str(ConstantPowerIntake) + ").");
+ }
+
+ if (PropulsionEfficiency < 0 || PropulsionEfficiency > 1) {
+ WRITE_WARNING("Battery builder: Vehicle with id = " + getID() + " has not a valid propulsion efficiency (" + SUMOReal_str(PropulsionEfficiency) + ").");
+ }
+
+ if (RecuperationEfficiency < 0 || RecuperationEfficiency > 1) {
+ WRITE_WARNING("Battery builder: Vehicle with id = " + getID() + " has not a valid Recuparation efficiency (" + SUMOReal_str(RecuperationEfficiency) + ").");
+ }
+}
+
+
+MSDevice_Battery::~MSDevice_Battery()
+{}
+
+
+// SET FUNCTIONS
+
+void MSDevice_Battery::setActBatKap(const SUMOReal new_ActBatKap) {
+ ActBatKap = new_ActBatKap;
+
+ if (ActBatKap > MaxBatKap) {
+ WRITE_WARNING("Function setActBatKap: Actual battery capacity (" + SUMOReal_str(ActBatKap) + ") from Vehicle with id = " + getID() + " is greater than it's max battery capacity(" + SUMOReal_str(MaxBatKap) + ").");
+ }
+}
+
+
+void MSDevice_Battery::setMaxBatKap(const SUMOReal new_MaxBatKap) {
+ MaxBatKap = new_MaxBatKap;
+
+ if (MaxBatKap < 0) {
+ WRITE_WARNING("Function setMaxBatKap: Vehicle with id = " + getID() + " has not a valid battery capacity (" + SUMOReal_str(MaxBatKap) + ").");
+ }
+}
+
+
+void MSDevice_Battery::setMass(const SUMOReal new_Mass) {
+ Mass = new_Mass;
+
+ if (Mass < 0) {
+ WRITE_WARNING("Function setMass: Vehicle with id = " + getID() + " has not a valid mass (" + SUMOReal_str(Mass) + ").");
+ }
+}
+
+
+void MSDevice_Battery::setPowerMax(const SUMOReal new_PowerMax) {
+ PowerMax = new_PowerMax;
+
+ if (PowerMax < 0) {
+ WRITE_WARNING("Function setPowerMax: Vehicle with id = " + getID() + " has not a valid power max (" + SUMOReal_str(PowerMax) + ").");
+ }
+}
+
+void MSDevice_Battery::setFrontSurfaceArea(const SUMOReal new_FrontSurfaceArea) {
+ FrontSurfaceArea = new_FrontSurfaceArea;
+
+ if (FrontSurfaceArea < 0) {
+ WRITE_WARNING("Function setFrontSurfaceArea: Vehicle with id = " + getID() + " has not a valid front surface Area (" + SUMOReal_str(FrontSurfaceArea) + ").");
+ }
+}
+
+
+void MSDevice_Battery::setAirDragCoefficient(const SUMOReal new_AirDragCoefficient) {
+ AirDragCoefficient = new_AirDragCoefficient;
+
+ if (AirDragCoefficient < 0) {
+ WRITE_WARNING("Function setAirDragCoefficient: Vehicle with id = " + getID() + " has not a valid drag coefficient (" + SUMOReal_str(AirDragCoefficient) + ").");
+ }
+}
+
+
+void MSDevice_Battery::setInternalMomentOfInertia(const SUMOReal new_InternalMomentOfInertia) {
+ InternalMomentOfInertia = new_InternalMomentOfInertia;
+
+ if (InternalMomentOfInertia < 0) {
+ WRITE_WARNING("Function setInternalMomentOfInertia: Vehicle with id = " + getID() + " has not a valid internal moment of inertia (" + SUMOReal_str(InternalMomentOfInertia) + ").");
+ }
+}
+
+
+void MSDevice_Battery::setRadialDragCoefficient(const SUMOReal new_RadialDragCoefficient) {
+ RadialDragCoefficient = new_RadialDragCoefficient;
+
+ if (RadialDragCoefficient < 0) {
+ WRITE_WARNING("Function setRadialDragCoefficient: Vehicle with id = " + getID() + " has not a valid radial friction coefficient (" + SUMOReal_str(RadialDragCoefficient) + ").");
+ }
+}
+
+
+void MSDevice_Battery::setRollDragCoefficient(const SUMOReal new_RollDragCoefficient) {
+ RollDragCoefficient = new_RollDragCoefficient;
+
+ if (RollDragCoefficient < 0) {
+ WRITE_WARNING("Function setRollDragCoefficient: Vehicle with id = " + getID() + " has not a valid roll friction coefficient (" + SUMOReal_str(RollDragCoefficient) + ").");
+ }
+}
+
+
+void MSDevice_Battery::setConstantPowerIntake(const SUMOReal new_ConstantPowerIntake) {
+ ConstantPowerIntake = new_ConstantPowerIntake;
+
+ if (ConstantPowerIntake < 0) {
+ WRITE_WARNING("Function setConstantPowerIntake: Vehicle with id = " + getID() + " has not a valid constant power intake (" + SUMOReal_str(ConstantPowerIntake) + ").");
+ }
+}
+
+
+void MSDevice_Battery::setPropulsionEfficiency(const SUMOReal new_PropulsionEfficiency) {
+ PropulsionEfficiency = new_PropulsionEfficiency;
+
+ if (PropulsionEfficiency < 0 || PropulsionEfficiency > 1) {
+ WRITE_WARNING("Function setPropulsionEfficiency: Vehicle with id = " + getID() + " has not a valid propulsion efficiency (" + SUMOReal_str(PropulsionEfficiency) + ").");
+ }
+}
+
+
+void MSDevice_Battery::setRecuperationEfficiency(const SUMOReal new_RecuperationEfficiency) {
+ RecuperationEfficiency = new_RecuperationEfficiency;
+
+ if (RecuperationEfficiency < 0 || RecuperationEfficiency > 1) {
+ WRITE_WARNING("Function setRecuperationEfficiency: Vehicle with id = " + getID() + " has not a valid recuparation efficiency (" + SUMOReal_str(RecuperationEfficiency) + ").");
+ }
+}
+
+
+void MSDevice_Battery::setLastAngle(const SUMOReal new_LastAngle) {
+ LastAngle = new_LastAngle;
+}
+
+
+void MSDevice_Battery::setLastEnergy(const SUMOReal new_LastEnergy) {
+ LastEnergy = new_LastEnergy ;
+}
+
+inline void MSDevice_Battery::resetChargingStartTime() {
+ ChargingStartTime = 0;
+}
+
+inline void MSDevice_Battery::increaseChargingStartTime() {
+ ChargingStartTime++;
+}
+
+inline void MSDevice_Battery::resetVehicleStoppedTimer() {
+ vehicleStopped = 0;
+}
+
+inline void MSDevice_Battery::increaseVehicleStoppedTimer() {
+ vehicleStopped++;
+}
+
+//GET FUNCTIONS
+
+SUMOReal MSDevice_Battery::getActBatKap() const {
+ return ActBatKap;
+}
+
+SUMOReal MSDevice_Battery::getMaxBatKap() const {
+ return MaxBatKap;
+}
+
+SUMOReal MSDevice_Battery::getPowerMax() const {
+ return PowerMax;
+}
+
+SUMOReal MSDevice_Battery::getMass() const {
+ return Mass;
+}
+
+SUMOReal MSDevice_Battery::getFrontSurfaceArea() const {
+ return FrontSurfaceArea;
+}
+
+SUMOReal MSDevice_Battery::getAirDragCoefficient() const {
+ return AirDragCoefficient;
+}
+
+SUMOReal MSDevice_Battery::getInternalMomentOfInertia() const {
+ return InternalMomentOfInertia;
+}
+
+SUMOReal MSDevice_Battery::getRadialDragCoefficient() const {
+ return RadialDragCoefficient;
+}
+
+SUMOReal MSDevice_Battery::getRollDragCoefficient() const {
+ return RollDragCoefficient;
+}
+
+SUMOReal MSDevice_Battery::getConstantPowerIntake() const {
+ return ConstantPowerIntake;
+}
+
+SUMOReal MSDevice_Battery::getPropulsionEfficiency() const {
+ return PropulsionEfficiency;
+}
+
+SUMOReal MSDevice_Battery::getRecuperationEfficiency() const {
+ return RecuperationEfficiency;
+}
+
+SUMOReal MSDevice_Battery::getLastAngle() const {
+ return LastAngle;
+}
+
+SUMOReal MSDevice_Battery::getLastEnergy() const {
+ return LastEnergy;
+}
+
+SUMOReal MSDevice_Battery::getConsum() const {
+ return Consum;
+}
+
+bool MSDevice_Battery::isChargingStopped() const {
+ return ItsChargingStopped;
+}
+
+bool MSDevice_Battery::isChargingInTransit() const {
+ return ItsChargingInTransit;
+}
+
+SUMOReal MSDevice_Battery::getChargingStartTime() const {
+ return ChargingStartTime;
+}
+
+const std::string& MSDevice_Battery::getChrgStnID() const {
+ return actChrgStn;
+}
+
+SUMOReal MSDevice_Battery::getChrgEnergy() const {
+ return energyCharged;
+}
+
+
+int MSDevice_Battery::getVehicleStopped() const {
+ return vehicleStopped;
+}
+
+
+SUMOReal MSDevice_Battery::getPropEnergy(SUMOVehicle& veh) {
+ // calculate current kinetic energy
+ SUMOReal height_cur = veh.getPositionOnLane() / veh.getLane()->getLength() * (veh.getLane()->getShape().back().z() - veh.getLane()->getShape().front().z());
+
+ // kinetic energy of vehicle with current velocity
+ SUMOReal currentEnergy = 0.5 * getMass() * veh.getSpeed() * veh.getSpeed();
+
+ // add current potential energy of vehicle at current position
+ currentEnergy += getMass() * 9.81 * height_cur;
+
+ // Calculate the radius of the vehicle's current path if is distintc (r = ds / dphi)
+ SUMOReal radius = 0;
+
+ if (getLastAngle() != veh.getAngle())
+ radius = veh.getSpeed() * 180 / (PI * (
+ (fabs(getLastAngle() - veh.getAngle()) < fabs(veh.getAngle() - getLastAngle())) ?
+ fabs(getLastAngle() - veh.getAngle()) :
+ fabs(veh.getAngle() - getLastAngle())));
+
+ // add current rotational energy of internal rotating elements
+ currentEnergy += getInternalMomentOfInertia() * veh.getSpeed() * veh.getSpeed();
+
+ // kinetic + potential + rotational energy gain [Ws] (MODIFICATED LAST ANGLE)
+ SUMOReal EnergyLoss = (currentEnergy - getLastEnergy());
+
+ // save current total energy for next time step
+ setLastEnergy(currentEnergy);
+
+ // Calculate energy losses:
+ // EnergyLoss,Air = 1/2 * rho_air [kg/m^3] * FrontSurfaceArea [m^2] * AirDragCoefficient [-] * v_Veh^2 [m/s] * s [m]
+ // ... with rho_air [kg/m^3] = 1,2041 kg/m^3 (at T = 20�C)
+ // ... with s [m] = v_Veh [m/s] * 1 [s]
+ EnergyLoss += 0.5 * 1.2041 * getFrontSurfaceArea() * getAirDragCoefficient() * fabs(veh.getSpeed() * veh.getSpeed() * veh.getSpeed());
+
+ // Energy loss through Air resistance [Ws]
+ // EnergyLoss,Tire = c_R [-] * F_N [N] * s [m]
+ // ... with c_R = ~0.012 (car tire on asphalt)
+ // ... with F_N [N] = Mass [kg] * g [m/s^2]
+ EnergyLoss += getRollDragCoefficient() * 9.81 * getMass() * fabs(veh.getSpeed());
+
+ // Energy loss through Roll resistance [Ws]
+ // ... (fabs(veh.getSpeed())>=0.01) = 0, if vehicle isn't moving
+ // EnergyLoss,internalFrictionRadialForce = c [m] * F_rad [N];
+ if (getLastAngle() != veh.getAngle()) {
+ // Energy loss through friction by radial force [Ws]
+ EnergyLoss += getRadialDragCoefficient() * getMass() * veh.getSpeed() * veh.getSpeed() / radius;
+ }
+
+ // EnergyLoss,constantConsumers
+ // Energy loss through constant loads (e.g. A/C) [Ws]
+ EnergyLoss += getConstantPowerIntake();
+
+ //E_Bat = E_kin_pot + EnergyLoss;
+ if (EnergyLoss > 0) {
+ // Assumption: Efficiency of PropulsionEfficiency when accelerating
+ EnergyLoss = EnergyLoss / getPropulsionEfficiency();
+ } else {
+ // Assumption: Efficiency of RecuperationEfficiency when recuperating
+ EnergyLoss = EnergyLoss * getRecuperationEfficiency();
+ }
+
+ // convert from [Ws] to [kWh] (3600s / 1h):
+ EnergyLoss = EnergyLoss / 3600 ; // EnergyLoss[Ws] * 1[h]/3600[s] * 1[k]/1000
+
+
+ // original EnergyLoss = EnergyLoss / 3600 / 1000 ; // EnergyLoss[Ws] * 1[h]/3600[s] * 1[k]/1000
+
+ //BATTERYS CAPACITY CHANGE !!
+
+ return(EnergyLoss);
+}
+
+
+// Private methods
+
+std::string MSDevice_Battery::SUMOReal_str(const SUMOReal& var) {
+ std::ostringstream convert;
+ convert << var;
+ return convert.str();
+}
diff --git a/src/microsim/devices/MSDevice_Battery.h b/src/microsim/devices/MSDevice_Battery.h
new file mode 100644
index 0000000..aed467b
--- /dev/null
+++ b/src/microsim/devices/MSDevice_Battery.h
@@ -0,0 +1,379 @@
+/****************************************************************************/
+/// @file MSDevice_Battery.h
+/// @author Tamas Kurczveil
+/// @author Pablo Alvarez L�pez
+/// @date 20-12-13
+/// @version $Id: MSDevice_Battery.h 18762 2015-09-01 16:27:09Z behrisch $
+///
+// The Battery parameters for the vehicle
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+#ifndef MSDevice_Battery_h
+#define MSDevice_Battery_h
+
+#include <microsim/devices/MSDevice.h>
+#include <microsim/MSVehicle.h>
+#include <microsim/trigger/MSChrgStn.h>
+#include <utils/common/SUMOTime.h>
+#include <iostream>
+#include <sstream>
+#include <string>
+
+
+// ===========================================================================
+// class declarations
+// ===========================================================================
+class SUMOVehicle;
+
+
+// ===========================================================================
+// class definitions
+// ===========================================================================
+/**
+ * @class MSDevice_Battery
+ * @brief The battery parametereter
+ *
+ * MSDevice_Battery //COMPLETAR
+
+ */
+class MSDevice_Battery : public MSDevice {
+public:
+ /** @brief Inserts MSDevice_Example-options
+ * @param[filled] oc The options container to add the options to
+ */
+ static void insertOptions(OptionsCont& oc);
+
+
+ /** @brief Build devices for the given vehicle, if needed
+ *
+ * The options are read and evaluated whether a example-device shall be built
+ * for the given vehicle.
+ *
+ * The built device is stored in the given vector.
+ *
+ * @param[in] v The vehicle for which a device may be built
+ * @param[filled] into The vector to store the built device in
+ */
+ static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into);
+
+
+public:
+ /// @brief Destructor.
+ ~MSDevice_Battery();
+
+ /// @name Methods called on vehicle movement / state change, overwriting MSDevice
+ /// @{
+
+ /** @brief Checks for waiting steps when the vehicle moves // IMPLEMENTADA!!
+ *
+ * @param[in] veh Vehicle that asks this reminder.
+ * @param[in] oldPos Position before move.
+ * @param[in] newPos Position after move with newSpeed.
+ * @param[in] newSpeed Moving speed.
+ *
+ * @return True (always).
+ */
+ bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos,
+ SUMOReal newPos, SUMOReal newSpeed);
+
+
+ /** @brief Saves departure info on insertion
+ *
+ * @param[in] veh The entering vehicle.
+ * @param[in] reason how the vehicle enters the lane
+ * @return Always true
+ * @see MSMoveReminder::notifyEnter
+ * @see MSMoveReminder::Notification
+ */
+ bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason);
+
+
+ /** @brief Saves arrival info
+ *
+ * @param[in] veh The leaving vehicle.
+ * @param[in] lastPos Position on the lane when leaving.
+ * @param[in] isArrival whether the vehicle arrived at its destination
+ * @param[in] isLaneChange whether the vehicle changed from the lane
+ * @return True if it did not leave the net.
+ *
+ bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos,
+ MSMoveReminder::Notification reason);
+ /// @}
+
+ */
+
+ /** @brief Called on writing tripinfo output
+ *
+ * @param[in] os The stream to write the information into
+ * @exception IOError not yet implemented
+ * @see MSDevice::generateOutput
+ */
+ void generateOutput() const;
+
+
+private:
+ /** @brief Constructor
+ *
+ * @param[in] holder The vehicle that holds this device
+ * @param[in] id The ID of the device
+ * @param[in] period The period with which a new route shall be searched
+ * @param[in] preInsertionPeriod The route search period before insertion
+ */
+ MSDevice_Battery(SUMOVehicle& holder, const std::string& id, const SUMOReal new_ActBatKap, const SUMOReal new_MaxBatKap, const SUMOReal new_PowerMax, const SUMOReal new_Mass, const SUMOReal new_FrontSurfaceArea, const SUMOReal new_AirDragCoefficient, const SUMOReal new_InternalMomentOfInertia, const SUMOReal new_RadialDragCoefficient, const SUMOReal new_RollDragCoefficient, const SUMOReal new_ConstantPowerIntake, const SUMOReal new_PropulsionEfficiency, const SUMOReal new_Recuperatio [...]
+
+
+public:
+ // GET FUNCTIONS
+
+ /// @brief Get parameter 01, the actual vehicles' Battery Capacity in kWh
+ SUMOReal getActBatKap() const;
+
+ /// @brief Get parameter 02, the total vehicles' Battery Capacity in kWh
+ SUMOReal getMaxBatKap() const;
+
+ /// @brief Get parameter 03, the maximum power when accelerating
+ inline SUMOReal getPowerMax() const;
+
+ /// @brief Get parameter 04, vehicle's Mass
+ inline SUMOReal getMass() const;
+
+ /// @brief Get parameter 05, vehicle's front surface Area
+ inline SUMOReal getFrontSurfaceArea() const;
+
+ /// @brief Get parameter 06, vehicle's drag coefficient
+ inline SUMOReal getAirDragCoefficient() const;
+
+ /// @brief Get parameter 07, vehicles' internal moment of inertia
+ inline SUMOReal getInternalMomentOfInertia() const;
+
+ /// @brief Get parameter 08, vehicles' radial friction coefficient
+ inline SUMOReal getRadialDragCoefficient() const;
+
+ /// @brief Get parameter 09, vehicles' roll friction coefficient
+ inline SUMOReal getRollDragCoefficient() const;
+
+ /// @brief Get parameter 10, vehicles' constant power intake
+ inline SUMOReal getConstantPowerIntake() const;
+
+ /// @brief Get parameter 11, vehicles' Propulsion efficiency
+ inline SUMOReal getPropulsionEfficiency() const;
+
+ /// @brief Get parameter 12, vehicles' Recuparation efficiency
+ inline SUMOReal getRecuperationEfficiency() const;
+
+ /// @brief Get parameter 13, vehicles' last angle
+ inline SUMOReal getLastAngle() const;
+
+ /// @brief Get parameter 14, vehicles' last Energy
+ inline SUMOReal getLastEnergy() const;
+
+ /// @brief Get parameter 15, true if Vehicle it's charging, false if not.
+ bool isChargingStopped() const;
+
+ /// @brief Get parameter 16, true if Vehicle it's charging, false if not.
+ bool isChargingInTransit() const;
+
+ /// @brief Get parameter 17, charging start time.
+ inline SUMOReal getChargingStartTime() const;
+
+ /// @brief Get parameter 18, consum (Strange error with linker)
+ SUMOReal getConsum() const;
+
+ /// @brief Get parameter 19, Charging Station I
+ const std::string& getChrgStnID() const;
+
+ /// @brief Get parameter 20, charging energy
+ SUMOReal getChrgEnergy() const;
+
+ /// @brief Get parameter 20, charging energy
+ int getVehicleStopped() const;
+
+ /// @brief get propulsion energy
+ SUMOReal getPropEnergy(SUMOVehicle& veh);
+
+
+ // SET FUNCTIONS
+
+ /// @brief Set parameter 01, The actual vehicles' Battery Capacity in kWh
+ inline void setActBatKap(const SUMOReal new_ActBatKap);
+
+ /// @brief Set parameter 02, The total vehicles' Battery Capacity in kWh
+ inline void setMaxBatKap(const SUMOReal new_MaxBatKap);
+
+ /// @brief Set parameter 03, The maximum power when accelerating
+ inline void setPowerMax(const SUMOReal new_Pmax);
+
+ /// @brief Set parameter 04, vehicle's Mass
+ inline void setMass(const SUMOReal new_Mass);
+
+ /// @brief Set parameter 05, vehicle's front surface Area
+ inline void setFrontSurfaceArea(const SUMOReal new_FrontSurfaceArea);
+
+ /// @brief Set parameter 06, vehicle's drag coefficient
+ inline void setAirDragCoefficient(const SUMOReal new_C_Veh);
+
+ /// @brief Set parameter 07, vehicles' internal moment of inertia
+ inline void setInternalMomentOfInertia(const SUMOReal new_InternalMomentOfInertia);
+
+ /// @brief Set parameter 08, Vehicles' radial friction coefficient
+ inline void setRadialDragCoefficient(const SUMOReal new_RadialDragCoefficient);
+
+ /// @brief Set parameter 09, vehicles' roll friction coefficient
+ inline void setRollDragCoefficient(const SUMOReal new_RollDragCoefficient);
+
+ /// @brief Set parameter 10, vehicles' constant power intake
+ inline void setConstantPowerIntake(const SUMOReal new_ConstantPowerIntake);
+
+ /// @brief Set parameter 11, vehicles' Propulsion efficiency
+ inline void setPropulsionEfficiency(const SUMOReal new_PropulsionEfficiency);
+
+ /// @brief Set parameter 12, vehicles' Recuparation efficiency
+ inline void setRecuperationEfficiency(const SUMOReal new_RecuperationEfficiency);
+
+ /// @brief Set parameter 13, vehicles' last Angle
+ inline void setLastAngle(const SUMOReal new_LastAngle);
+
+ /// @brief Set parameter 14, vehicles' last Energy
+ inline void setLastEnergy(const SUMOReal new_LastEnergy);
+
+ /// @brief Set parameter 17a, reset charging start time
+ inline void resetChargingStartTime();
+
+ /// @brief Set parameter 17b, increase Charging Start time
+ inline void increaseChargingStartTime();
+
+ /// @brief Set parameter 21a, reset vehicleStopped
+ inline void resetVehicleStoppedTimer();
+
+ /// @brief Set parameter 21a, increase vehicleStopped
+ inline void increaseVehicleStoppedTimer();
+
+
+
+
+
+
+
+private:
+
+ /// @brief Parameter 01, The actual vehicles' Battery Capacity in kWh
+ /// @condition [ActBatKap <= MaxBatKap]
+ SUMOReal ActBatKap;
+
+ /// @brief Parameter 02, The total vehicles' Battery Capacity in kWh
+ /// @condition [MaxBatKap >= 0]
+ SUMOReal MaxBatKap;
+
+ /// @brief Parameter 03, The Maximum Power when accelerating
+ /// @condition [PowerMax >= 0]
+ SUMOReal PowerMax;
+
+ /// @brief Parameter 04, Vehicle's Mass
+ /// @condition [Mass >= 0]
+ SUMOReal Mass;
+
+ /// @brief Parameter 05, Vehicle's front surface Area
+ /// @condition [FrontSurfaceArea >= 0]
+ SUMOReal FrontSurfaceArea;
+
+ /// @brief Parameter 06, Vehicle's drag coefficient
+ /// @condition [AirDragCoefficient >=0]
+ SUMOReal AirDragCoefficient;
+
+ /// @brief Parameter 07, Vehicles' internal moment of inertia
+ /// @condition [InternalMomentOfInertia >= 0]
+ SUMOReal InternalMomentOfInertia;
+
+ /// @brief Parameter 08, Vehicles' radial friction coefficient
+ /// @condition [RadialDragCoefficient >=0]
+ SUMOReal RadialDragCoefficient;
+
+ /// @brief Parameter 09, Vehicles' roll friction coefficient
+ /// @condition [RollDragCoefficient >= 0]
+ SUMOReal RollDragCoefficient;
+
+ /// @brief Parameter 10, Vehicles' constant power intake
+ /// @condition [ConstantPowerIntake >= 0]
+ SUMOReal ConstantPowerIntake;
+
+ /// @brief Parameter 11, Vehicles' propulsion efficiency
+ /// @condition [1 >= PropulsionEfficiency >= 0]
+ SUMOReal PropulsionEfficiency;
+
+ /// @brief Parameter 12, Vehicles' recuparation efficiency
+ /// @condition [1 >= RecuperationEfficiency >= 0]
+ SUMOReal RecuperationEfficiency;
+
+ /// @brief Parameter 13, Vehicles' last angle
+ /// @condition none
+ SUMOReal LastAngle;
+
+ /// @brief Parameter 14, Vehicles' last energy
+ /// @condition none
+ SUMOReal LastEnergy;
+
+ /// @brief Parameter 15, Flag: Vehicles it's charging stopped
+ /// @condition by default is false.
+ bool ItsChargingStopped;
+
+ /// @brief Parameter 16, Flag: Vehicles it's charging in transit
+ /// @condition by default is false.
+ bool ItsChargingInTransit;
+
+ /// @brief Parameter 17, Moment, wich the vehicle has beging to charging
+ /// @condition none
+ SUMOReal ChargingStartTime;
+
+ /// @brief Parameter 18, Vehicle consum during a time step
+ /// @condition by default is 0.
+ SUMOReal Consum;
+
+ /// @brief Parameter 19, Vehicle consum during a time step
+ /// @condition by default is "".
+ std::string actChrgStn;
+
+ /// @brief Parameter 20, Energy charged in each timestep
+ SUMOReal energyCharged;
+
+ /// @brief Parameter 21, How many timestep the vehicle is stopped
+ int vehicleStopped;
+
+
+ /** @brief convert from SUMOReal to String
+ * @param[in] var Variable in SUMOReal format
+ * @return Variable var in String format
+ */
+ std::string SUMOReal_str(const SUMOReal& var);
+
+
+ /// @brief Invalidated copy constructor.
+ MSDevice_Battery(const MSDevice_Battery&);
+
+
+ /// @brief Invalidated assignment operator.
+ MSDevice_Battery& operator=(const MSDevice_Battery&);
+};
+
+#endif
+
diff --git a/src/microsim/devices/MSDevice_Container.cpp b/src/microsim/devices/MSDevice_Container.cpp
index 525d826..96ecc7b 100644
--- a/src/microsim/devices/MSDevice_Container.cpp
+++ b/src/microsim/devices/MSDevice_Container.cpp
@@ -3,7 +3,7 @@
/// @author Melanie Weber
/// @author Andreas Kendziorra
/// @date Mon, 16 Jun 2014
-/// @version $Id: MSDevice_Container.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSDevice_Container.cpp 18274 2015-04-22 15:00:44Z behrisch $
///
// A device which is used to keep track of containers riding with a vehicle
/****************************************************************************/
@@ -29,7 +29,7 @@
//#include <microsim/MSLane.h>
#include <microsim/MSEdge.h>
#include <microsim/MSContainer.h>
-#include <microsim/trigger/MSContainerStop.h>
+#include <microsim/MSStoppingPlace.h>
#include <microsim/MSContainerControl.h>
#include "MSDevice_Container.h"
@@ -69,15 +69,15 @@ MSDevice_Container::notifyMove(SUMOVehicle& veh, SUMOReal /*oldPos*/, SUMOReal /
if (myStopped) {
// if veh is not anymore at the stop
if (!veh.isStopped()) {
- for (std::vector<MSContainer*>::iterator i = myContainers.begin(); i != myContainers.end(); ++i) {
+ for (std::vector<MSTransportable*>::iterator i = myContainers.begin(); i != myContainers.end(); ++i) {
(*i)->setDeparted(MSNet::getInstance()->getCurrentTimeStep());
}
myStopped = false;
}
} else {
if (veh.isStopped()) {
- for (std::vector<MSContainer*>::iterator i = myContainers.begin(); i != myContainers.end();) {
- MSContainer* container = *i;
+ for (std::vector<MSTransportable*>::iterator i = myContainers.begin(); i != myContainers.end();) {
+ MSTransportable* container = *i;
if (&(container->getDestination()) == veh.getEdge()) {
if (!container->proceed(MSNet::getInstance(), MSNet::getInstance()->getCurrentTimeStep())) {
MSNet::getInstance()->getContainerControl().erase(container);
@@ -97,7 +97,7 @@ MSDevice_Container::notifyMove(SUMOVehicle& veh, SUMOReal /*oldPos*/, SUMOReal /
bool
MSDevice_Container::notifyEnter(SUMOVehicle& /*veh*/, MSMoveReminder::Notification reason) {
if (reason == MSMoveReminder::NOTIFICATION_DEPARTED) {
- for (std::vector<MSContainer*>::iterator i = myContainers.begin(); i != myContainers.end(); ++i) {
+ for (std::vector<MSTransportable*>::iterator i = myContainers.begin(); i != myContainers.end(); ++i) {
(*i)->setDeparted(MSNet::getInstance()->getCurrentTimeStep());
}
}
@@ -109,8 +109,8 @@ bool
MSDevice_Container::notifyLeave(SUMOVehicle& veh, SUMOReal /*lastPos*/,
MSMoveReminder::Notification reason) {
if (reason >= MSMoveReminder::NOTIFICATION_ARRIVED) {
- for (std::vector<MSContainer*>::iterator i = myContainers.begin(); i != myContainers.end(); ++i) {
- MSContainer* container = *i;
+ for (std::vector<MSTransportable*>::iterator i = myContainers.begin(); i != myContainers.end(); ++i) {
+ MSTransportable* container = *i;
if (&(container->getDestination()) != veh.getEdge()) {
WRITE_WARNING("Teleporting container '" + container->getID() +
"' from vehicle destination '" + veh.getEdge()->getID() +
@@ -126,7 +126,7 @@ MSDevice_Container::notifyLeave(SUMOVehicle& veh, SUMOReal /*lastPos*/,
void
-MSDevice_Container::addContainer(MSContainer* container) {
+MSDevice_Container::addContainer(MSTransportable* container) {
myContainers.push_back(container);
}
diff --git a/src/microsim/devices/MSDevice_Container.h b/src/microsim/devices/MSDevice_Container.h
index 390933c..010fc33 100644
--- a/src/microsim/devices/MSDevice_Container.h
+++ b/src/microsim/devices/MSDevice_Container.h
@@ -3,7 +3,7 @@
/// @author Melanie Weber
/// @author Andreas Kendziorra
/// @date Mon, 16 Jun 2014
-/// @version $Id: MSDevice_Container.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSDevice_Container.h 18274 2015-04-22 15:00:44Z behrisch $
///
// A device which is used to keep track of containers riding with a vehicle
/****************************************************************************/
@@ -116,7 +116,7 @@ public:
*
* @param[in] container The container to add.
*/
- void addContainer(MSContainer* container);
+ void addContainer(MSTransportable* container);
/** @brief Return the number of containers
@@ -130,7 +130,7 @@ public:
/** @brief Returns the list of containers using this vehicle
* @return Containers within this vehicle
*/
- const std::vector<MSContainer*>& getContainers() const {
+ const std::vector<MSTransportable*>& getContainers() const {
return myContainers;
}
@@ -148,7 +148,7 @@ private:
private:
/// @brief The containers of the vehicle
- std::vector<MSContainer*> myContainers;
+ std::vector<MSTransportable*> myContainers;
/// @brief Whether the vehicle is at a stop
bool myStopped;
diff --git a/src/microsim/devices/MSDevice_Example.cpp b/src/microsim/devices/MSDevice_Example.cpp
index 64b7d84..05c38a5 100644
--- a/src/microsim/devices/MSDevice_Example.cpp
+++ b/src/microsim/devices/MSDevice_Example.cpp
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date 11.06.2013
-/// @version $Id: MSDevice_Example.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSDevice_Example.cpp 18361 2015-05-11 11:50:06Z namdre $
///
// A device which stands as an implementation example and which outputs movereminder calls
/****************************************************************************/
@@ -54,9 +54,7 @@
void
MSDevice_Example::insertOptions(OptionsCont& oc) {
oc.addOptionSubTopic("Example Device");
-
- oc.doRegister("device.example.explicit", new Option_String());
- oc.addDescription("device.example.explicit", "Example Device", "Assign a device to named vehicles");
+ insertDefaultAssignmentOptions("example", "Example Device", oc);
oc.doRegister("device.example.parameter", new Option_Float(0.0));
oc.addDescription("device.example.parameter", "Example Device", "An exemplary parameter which can be used by all instances of the example device");
diff --git a/src/microsim/devices/MSDevice_Person.cpp b/src/microsim/devices/MSDevice_Person.cpp
index 57807e9..18fcd85 100644
--- a/src/microsim/devices/MSDevice_Person.cpp
+++ b/src/microsim/devices/MSDevice_Person.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Fri, 30.01.2009
-/// @version $Id: MSDevice_Person.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSDevice_Person.cpp 18274 2015-04-22 15:00:44Z behrisch $
///
// A device which is used to keep track of Persons riding with a vehicle
/****************************************************************************/
@@ -73,15 +73,15 @@ bool
MSDevice_Person::notifyMove(SUMOVehicle& veh, SUMOReal /*oldPos*/, SUMOReal /*newPos*/, SUMOReal /*newSpeed*/) {
if (myStopped) {
if (!veh.isStopped()) {
- for (std::vector<MSPerson*>::iterator i = myPersons.begin(); i != myPersons.end(); ++i) {
+ for (std::vector<MSTransportable*>::iterator i = myPersons.begin(); i != myPersons.end(); ++i) {
(*i)->setDeparted(MSNet::getInstance()->getCurrentTimeStep());
}
myStopped = false;
}
} else {
if (veh.isStopped()) {
- for (std::vector<MSPerson*>::iterator i = myPersons.begin(); i != myPersons.end();) {
- MSPerson* person = *i;
+ for (std::vector<MSTransportable*>::iterator i = myPersons.begin(); i != myPersons.end();) {
+ MSTransportable* person = *i;
if (&(person->getDestination()) == veh.getEdge()) {
if (!person->proceed(MSNet::getInstance(), MSNet::getInstance()->getCurrentTimeStep())) {
MSNet::getInstance()->getPersonControl().erase(person);
@@ -101,7 +101,7 @@ MSDevice_Person::notifyMove(SUMOVehicle& veh, SUMOReal /*oldPos*/, SUMOReal /*ne
bool
MSDevice_Person::notifyEnter(SUMOVehicle& /*veh*/, MSMoveReminder::Notification reason) {
if (reason == MSMoveReminder::NOTIFICATION_DEPARTED) {
- for (std::vector<MSPerson*>::iterator i = myPersons.begin(); i != myPersons.end(); ++i) {
+ for (std::vector<MSTransportable*>::iterator i = myPersons.begin(); i != myPersons.end(); ++i) {
(*i)->setDeparted(MSNet::getInstance()->getCurrentTimeStep());
}
}
@@ -113,8 +113,8 @@ bool
MSDevice_Person::notifyLeave(SUMOVehicle& veh, SUMOReal /*lastPos*/,
MSMoveReminder::Notification reason) {
if (reason >= MSMoveReminder::NOTIFICATION_ARRIVED) {
- for (std::vector<MSPerson*>::iterator i = myPersons.begin(); i != myPersons.end(); ++i) {
- MSPerson* person = *i;
+ for (std::vector<MSTransportable*>::iterator i = myPersons.begin(); i != myPersons.end(); ++i) {
+ MSTransportable* person = *i;
if (&(person->getDestination()) != veh.getEdge()) {
WRITE_WARNING("Teleporting person '" + person->getID() +
"' from vehicle destination '" + veh.getEdge()->getID() +
@@ -130,7 +130,7 @@ MSDevice_Person::notifyLeave(SUMOVehicle& veh, SUMOReal /*lastPos*/,
void
-MSDevice_Person::addPerson(MSPerson* person) {
+MSDevice_Person::addPerson(MSTransportable* person) {
myPersons.push_back(person);
}
diff --git a/src/microsim/devices/MSDevice_Person.h b/src/microsim/devices/MSDevice_Person.h
index d2b0c43..47bb2b2 100644
--- a/src/microsim/devices/MSDevice_Person.h
+++ b/src/microsim/devices/MSDevice_Person.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Fri, 30.01.2009
-/// @version $Id: MSDevice_Person.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSDevice_Person.h 18274 2015-04-22 15:00:44Z behrisch $
///
// A device which is used to keep track of Persons riding with a vehicle
/****************************************************************************/
@@ -117,7 +117,7 @@ public:
*
* @param[in] person The passenger to add.
*/
- void addPerson(MSPerson* person);
+ void addPerson(MSTransportable* person);
/** @brief Return the number of passengers
@@ -131,7 +131,7 @@ public:
/** @brief Returns the list of persons using this vehicle
* @return Persons within this vehicle
*/
- const std::vector<MSPerson*>& getPersons() const {
+ const std::vector<MSTransportable*>& getPersons() const {
return myPersons;
}
@@ -149,7 +149,7 @@ private:
private:
/// @brief The passengers of the vehicle
- std::vector<MSPerson*> myPersons;
+ std::vector<MSTransportable*> myPersons;
/// @brief Whether the vehicle is at a stop
bool myStopped;
diff --git a/src/microsim/devices/MSDevice_Routing.cpp b/src/microsim/devices/MSDevice_Routing.cpp
index 98ef142..7c75f2a 100644
--- a/src/microsim/devices/MSDevice_Routing.cpp
+++ b/src/microsim/devices/MSDevice_Routing.cpp
@@ -6,7 +6,7 @@
/// @author Christoph Sommer
/// @author Jakob Erdmann
/// @date Tue, 04 Dec 2007
-/// @version $Id: MSDevice_Routing.cpp 18103 2015-03-18 12:05:24Z namdre $
+/// @version $Id: MSDevice_Routing.cpp 18467 2015-05-29 03:50:41Z behrisch $
///
// A device that performs vehicle rerouting based on current edge speeds
/****************************************************************************/
@@ -42,7 +42,6 @@
#include <utils/common/StaticCommand.h>
#include <utils/vehicle/DijkstraRouterTT.h>
#include <utils/vehicle/AStarRouter.h>
-#include <utils/vehicle/BulkStarRouter.h>
#include <utils/vehicle/CHRouter.h>
#include <utils/vehicle/CHRouterWrapper.h>
@@ -150,7 +149,7 @@ MSDevice_Routing::buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& in
}
}
myLastAdaptation = MSNet::getInstance()->getCurrentTimeStep();
- myRandomizeWeightsFactor = oc.isSet("weights.random-factor") ? oc.getFloat("weights.random-factor") : 1;
+ myRandomizeWeightsFactor = oc.getFloat("weights.random-factor");
if (myRandomizeWeightsFactor < 1) {
WRITE_ERROR("weights.random-factor cannot be less than 1");
}
@@ -318,25 +317,25 @@ MSDevice_Routing::reroute(const SUMOTime currentTime, const bool onInit) {
if (needThread && myRouter == 0) {
OptionsCont& oc = OptionsCont::getOptions();
const std::string routingAlgorithm = oc.getString("routing-algorithm");
- const bool mayHaveRestrictions = MSNet::getInstance()->hasRestrictions() || oc.getInt("remote-port") != 0;
+ const bool mayHaveRestrictions = MSNet::getInstance()->hasPermissions() || oc.getInt("remote-port") != 0;
if (routingAlgorithm == "dijkstra") {
if (mayHaveRestrictions) {
- myRouter = new DijkstraRouterTT<MSEdge, SUMOVehicle, prohibited_withRestrictions<MSEdge, SUMOVehicle> >(
+ myRouter = new DijkstraRouterTT<MSEdge, SUMOVehicle, prohibited_withPermissions<MSEdge, SUMOVehicle> >(
MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort);
} else {
- myRouter = new DijkstraRouterTT<MSEdge, SUMOVehicle, prohibited_noRestrictions<MSEdge, SUMOVehicle> >(
+ myRouter = new DijkstraRouterTT<MSEdge, SUMOVehicle, noProhibitions<MSEdge, SUMOVehicle> >(
MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort);
}
} else if (routingAlgorithm == "astar") {
if (mayHaveRestrictions) {
- typedef AStarRouter<MSEdge, SUMOVehicle, prohibited_withRestrictions<MSEdge, SUMOVehicle> > AStar;
+ typedef AStarRouter<MSEdge, SUMOVehicle, prohibited_withPermissions<MSEdge, SUMOVehicle> > AStar;
const AStar::LookupTable* lookup = 0;
if (oc.isSet("device.rerouting.shortest-path-file")) {
lookup = AStar::createLookupTable(oc.getString("device.rerouting.shortest-path-file"), (int)MSEdge::numericalDictSize());
}
myRouter = new AStar(MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort, lookup);
} else {
- typedef AStarRouter<MSEdge, SUMOVehicle, prohibited_noRestrictions<MSEdge, SUMOVehicle> > AStar;
+ typedef AStarRouter<MSEdge, SUMOVehicle, noProhibitions<MSEdge, SUMOVehicle> > AStar;
const AStar::LookupTable* lookup = 0;
if (oc.isSet("device.rerouting.shortest-path-file")) {
lookup = AStar::createLookupTable(oc.getString("device.rerouting.shortest-path-file"), (int)MSEdge::numericalDictSize());
@@ -346,16 +345,16 @@ MSDevice_Routing::reroute(const SUMOTime currentTime, const bool onInit) {
} else if (routingAlgorithm == "CH") {
const SUMOTime weightPeriod = myAdaptationInterval > 0 ? myAdaptationInterval : std::numeric_limits<int>::max();
if (mayHaveRestrictions) {
- myRouter = new CHRouter<MSEdge, SUMOVehicle, prohibited_withRestrictions<MSEdge, SUMOVehicle> >(
+ myRouter = new CHRouter<MSEdge, SUMOVehicle, prohibited_withPermissions<MSEdge, SUMOVehicle> >(
MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort, myHolder.getVClass(), weightPeriod, true);
} else {
- myRouter = new CHRouter<MSEdge, SUMOVehicle, prohibited_noRestrictions<MSEdge, SUMOVehicle> >(
+ myRouter = new CHRouter<MSEdge, SUMOVehicle, noProhibitions<MSEdge, SUMOVehicle> >(
MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort, myHolder.getVClass(), weightPeriod, false);
}
} else if (routingAlgorithm == "CHWrapper") {
const SUMOTime begin = string2time(oc.getString("begin"));
const SUMOTime weightPeriod = myAdaptationInterval > 0 ? myAdaptationInterval : std::numeric_limits<int>::max();
- myRouter = new CHRouterWrapper<MSEdge, SUMOVehicle, prohibited_withRestrictions<MSEdge, SUMOVehicle> >(
+ myRouter = new CHRouterWrapper<MSEdge, SUMOVehicle, prohibited_withPermissions<MSEdge, SUMOVehicle> >(
MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort, begin, weightPeriod);
} else {
throw ProcessError("Unknown routing algorithm '" + routingAlgorithm + "'!");
diff --git a/src/microsim/devices/MSDevice_Routing.h b/src/microsim/devices/MSDevice_Routing.h
index 98986a7..9250b71 100644
--- a/src/microsim/devices/MSDevice_Routing.h
+++ b/src/microsim/devices/MSDevice_Routing.h
@@ -4,7 +4,7 @@
/// @author Daniel Krajzewicz
/// @author Jakob Erdmann
/// @date Tue, 04 Dec 2007
-/// @version $Id: MSDevice_Routing.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSDevice_Routing.h 18394 2015-05-18 13:26:24Z behrisch $
///
// A device that performs vehicle rerouting based on current edge speeds
/****************************************************************************/
@@ -116,6 +116,9 @@ public:
static void unlock() {
myThreadPool.unlock();
}
+ static bool isParallel() {
+ return myThreadPool.size() > 0;
+ }
#endif
diff --git a/src/microsim/devices/MSDevice_Vehroutes.cpp b/src/microsim/devices/MSDevice_Vehroutes.cpp
index aa8be11..6c69f14 100644
--- a/src/microsim/devices/MSDevice_Vehroutes.cpp
+++ b/src/microsim/devices/MSDevice_Vehroutes.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Fri, 30.01.2009
-/// @version $Id: MSDevice_Vehroutes.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSDevice_Vehroutes.cpp 18375 2015-05-15 07:05:22Z behrisch $
///
// A device which collects info on the vehicle trip
/****************************************************************************/
@@ -30,6 +30,7 @@
#include <config.h>
#endif
+#include <microsim/MSGlobals.h>
#include <microsim/MSNet.h>
#include <microsim/MSLane.h>
#include <microsim/MSEdge.h>
@@ -53,7 +54,7 @@ bool MSDevice_Vehroutes::myLastRouteOnly = false;
bool MSDevice_Vehroutes::myDUAStyle = false;
bool MSDevice_Vehroutes::mySorted = false;
bool MSDevice_Vehroutes::myIntendedDepart = false;
-bool MSDevice_Vehroutes::myWithTaz = false;
+bool MSDevice_Vehroutes::myRouteLength = false;
MSDevice_Vehroutes::StateListener MSDevice_Vehroutes::myStateListener;
std::map<const SUMOTime, int> MSDevice_Vehroutes::myDepartureCounts;
std::map<const SUMOTime, std::map<const std::string, std::string> > MSDevice_Vehroutes::myRouteInfos;
@@ -74,7 +75,7 @@ MSDevice_Vehroutes::init() {
myDUAStyle = OptionsCont::getOptions().getBool("vehroute-output.dua");
mySorted = myDUAStyle || OptionsCont::getOptions().getBool("vehroute-output.sorted");
myIntendedDepart = OptionsCont::getOptions().getBool("vehroute-output.intended-depart");
- myWithTaz = OptionsCont::getOptions().getBool("device.rerouting.with-taz");
+ myRouteLength = OptionsCont::getOptions().getBool("vehroute-output.route-length");
MSNet::getInstance()->addVehicleStateListener(&myStateListener);
}
}
@@ -128,9 +129,12 @@ MSDevice_Vehroutes::~MSDevice_Vehroutes() {
bool
MSDevice_Vehroutes::notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) {
- if (mySorted && reason == NOTIFICATION_DEPARTED && myStateListener.myDevices[&veh] == this) {
- const SUMOTime departure = myIntendedDepart ? myHolder.getParameter().depart : MSNet::getInstance()->getCurrentTimeStep();
- myDepartureCounts[departure]++;
+ if (reason == MSMoveReminder::NOTIFICATION_DEPARTED) {
+ myDepartPos = veh.getPositionOnLane();
+ if (mySorted && myStateListener.myDevices[&veh] == this) {
+ const SUMOTime departure = myIntendedDepart ? myHolder.getParameter().depart : MSNet::getInstance()->getCurrentTimeStep();
+ myDepartureCounts[departure]++;
+ }
}
return mySaveExits;
}
@@ -225,9 +229,18 @@ MSDevice_Vehroutes::generateOutput() const {
od.writeAttr(SUMO_ATTR_DEPART, time2string(departure));
if (myHolder.hasArrived()) {
od.writeAttr("arrival", time2string(MSNet::getInstance()->getCurrentTimeStep()));
+ if (myRouteLength) {
+ const bool includeInternalLengths = MSGlobals::gUsingInternalLanes && MSNet::getInstance()->hasInternalLinks();
+ const SUMOReal routeLength = myHolder.getRoute().getDistanceBetween(myDepartPos, myHolder.getArrivalPos(),
+ myHolder.getRoute().begin(), myHolder.getCurrentRouteEdge(), includeInternalLengths);
+ od.writeAttr("routeLength", routeLength);
+ }
+ }
+ if (myHolder.getParameter().wasSet(VEHPARS_FROM_TAZ_SET)) {
+ od.writeAttr(SUMO_ATTR_FROM_TAZ, myHolder.getParameter().fromTaz);
}
- if (myWithTaz) {
- od.writeAttr(SUMO_ATTR_FROM_TAZ, myHolder.getParameter().fromTaz).writeAttr(SUMO_ATTR_TO_TAZ, myHolder.getParameter().toTaz);
+ if (myHolder.getParameter().wasSet(VEHPARS_TO_TAZ_SET)) {
+ od.writeAttr(SUMO_ATTR_TO_TAZ, myHolder.getParameter().toTaz);
}
if (myDUAStyle) {
const RandomDistributor<const MSRoute*>* const routeDist = MSRoute::distDictionary("!" + myHolder.getID());
diff --git a/src/microsim/devices/MSDevice_Vehroutes.h b/src/microsim/devices/MSDevice_Vehroutes.h
index 3fc5401..ca46a99 100644
--- a/src/microsim/devices/MSDevice_Vehroutes.h
+++ b/src/microsim/devices/MSDevice_Vehroutes.h
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Fri, 30.01.2009
-/// @version $Id: MSDevice_Vehroutes.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSDevice_Vehroutes.h 18375 2015-05-15 07:05:22Z behrisch $
///
// A device which collects info on the vehicle trip
/****************************************************************************/
@@ -172,8 +172,8 @@ private:
/// @brief A shortcut for the Option "vehroute-output.intended-depart"
static bool myIntendedDepart;
- /// @brief A shortcut for the Option "device.routing.with-taz"
- static bool myWithTaz;
+ /// @brief A shortcut for the Option "vehroute-output.route-length"
+ static bool myRouteLength;
/** @class StateListener
@@ -239,6 +239,9 @@ private:
};
+ /// @brief The position on the lane the vehicle departed at
+ SUMOReal myDepartPos;
+
/// @brief The currently used route
const MSRoute* myCurrentRoute;
diff --git a/src/microsim/devices/Makefile.am b/src/microsim/devices/Makefile.am
index ec565cd..14e5e86 100644
--- a/src/microsim/devices/Makefile.am
+++ b/src/microsim/devices/Makefile.am
@@ -8,6 +8,7 @@ MSDevice_Emissions.cpp MSDevice_Emissions.h \
MSDevice_Person.cpp MSDevice_Person.h \
MSDevice_Routing.cpp MSDevice_Routing.h \
MSDevice_Tripinfo.cpp MSDevice_Tripinfo.h \
+MSDevice_Battery.cpp MSDevice_Battery.h \
MSDevice_Example.cpp MSDevice_Example.h \
MSDevice_Vehroutes.cpp MSDevice_Vehroutes.h
diff --git a/src/microsim/devices/Makefile.in b/src/microsim/devices/Makefile.in
index 75bbb4e..d959870 100644
--- a/src/microsim/devices/Makefile.in
+++ b/src/microsim/devices/Makefile.in
@@ -102,8 +102,8 @@ am_libmicrosimdevs_a_OBJECTS = MSDevice.$(OBJEXT) \
MSDevice_BTreceiver.$(OBJEXT) MSDevice_BTsender.$(OBJEXT) \
MSDevice_Container.$(OBJEXT) MSDevice_Emissions.$(OBJEXT) \
MSDevice_Person.$(OBJEXT) MSDevice_Routing.$(OBJEXT) \
- MSDevice_Tripinfo.$(OBJEXT) MSDevice_Example.$(OBJEXT) \
- MSDevice_Vehroutes.$(OBJEXT)
+ MSDevice_Tripinfo.$(OBJEXT) MSDevice_Battery.$(OBJEXT) \
+ MSDevice_Example.$(OBJEXT) MSDevice_Vehroutes.$(OBJEXT)
libmicrosimdevs_a_OBJECTS = $(am_libmicrosimdevs_a_OBJECTS)
AM_V_P = $(am__v_P_ at AM_V@)
am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
@@ -339,6 +339,7 @@ MSDevice_Emissions.cpp MSDevice_Emissions.h \
MSDevice_Person.cpp MSDevice_Person.h \
MSDevice_Routing.cpp MSDevice_Routing.h \
MSDevice_Tripinfo.cpp MSDevice_Tripinfo.h \
+MSDevice_Battery.cpp MSDevice_Battery.h \
MSDevice_Example.cpp MSDevice_Example.h \
MSDevice_Vehroutes.cpp MSDevice_Vehroutes.h
@@ -394,6 +395,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSDevice.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSDevice_BTreceiver.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSDevice_BTsender.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSDevice_Battery.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSDevice_Container.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSDevice_Emissions.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSDevice_Example.Po at am__quote@
diff --git a/src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp b/src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp
index 6a5879e..ba5d605 100644
--- a/src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp
+++ b/src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Fri, 29.04.2005
-/// @version $Id: MSAbstractLaneChangeModel.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSAbstractLaneChangeModel.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Interface for lane-change models
/****************************************************************************/
@@ -129,12 +129,28 @@ bool
MSAbstractLaneChangeModel::startLaneChangeManeuver(MSLane* source, MSLane* target, int direction) {
target->enteredByLaneChange(&myVehicle);
if (MSGlobals::gLaneChangeDuration > DELTA_T) {
+ // initialize further lanes for shadow vehicle
+ // (must come before myLaneChangeCompletion is initialized)
+ const std::vector<MSLane*>& further = myVehicle.getFurtherLanes();
+ SUMOReal leftLength = myVehicle.getVehicleType().getLength() - myVehicle.getPositionOnLane();
+ MSLane* lane = target;
+ for (int i = 0; i < (int)further.size(); i++) {
+ lane = lane->getLogicalPredecessorLane(further[i]->getEdge());
+ if (lane != 0) {
+ leftLength -= lane->setPartialOccupation(&myVehicle, leftLength);
+ setShadowPartialOccupator(lane);
+ } else {
+ break;
+ }
+ }
myLaneChangeCompletion = 0;
myShadowLane = target;
myHaveShadow = true;
myLaneChangeMidpointPassed = false;
myLaneChangeDirection = direction;
continueLaneChangeManeuver(false);
+ myVehicle.switchOffSignal(MSVehicle::VEH_SIGNAL_BLINKER_RIGHT | MSVehicle::VEH_SIGNAL_BLINKER_LEFT);
+ myVehicle.switchOnSignal(direction == 1 ? MSVehicle::VEH_SIGNAL_BLINKER_LEFT : MSVehicle::VEH_SIGNAL_BLINKER_RIGHT);
return true;
} else {
myVehicle.leaveLane(MSMoveReminder::NOTIFICATION_LANE_CHANGE);
@@ -146,13 +162,23 @@ MSAbstractLaneChangeModel::startLaneChangeManeuver(MSLane* source, MSLane* targe
}
+MSLane*
+MSAbstractLaneChangeModel::getShadowLane(const MSLane* lane) const {
+ if (std::find(myNoPartiallyOccupatedByShadow.begin(), myNoPartiallyOccupatedByShadow.end(), lane) == myNoPartiallyOccupatedByShadow.end()) {
+ const int shadowDirection = myLaneChangeMidpointPassed ? -myLaneChangeDirection : myLaneChangeDirection;
+ return lane->getParallelLane(shadowDirection);
+ } else {
+ return 0;
+ }
+}
+
+
void
MSAbstractLaneChangeModel::continueLaneChangeManeuver(bool moved) {
if (moved && myHaveShadow) {
// move shadow to next lane
- removeLaneChangeShadow();
- const int shadowDirection = myLaneChangeMidpointPassed ? -myLaneChangeDirection : myLaneChangeDirection;
- myShadowLane = myVehicle.getLane()->getParallelLane(shadowDirection);
+ removeLaneChangeShadow(MSMoveReminder::NOTIFICATION_JUNCTION, false);
+ myShadowLane = getShadowLane(myVehicle.getLane());
if (myShadowLane == 0) {
// abort lane change
WRITE_WARNING("Vehicle '" + myVehicle.getID() + "' could not finish continuous lane change (lane disappeared) time=" +
@@ -168,6 +194,11 @@ MSAbstractLaneChangeModel::continueLaneChangeManeuver(bool moved) {
// maneuver midpoint reached, swap myLane and myShadowLane
myLaneChangeMidpointPassed = true;
MSLane* tmp = myVehicle.getLane();
+ // removing partial occupator shadows - will be rebuilt in enterLaneAtLaneChange
+ for (std::vector<MSLane*>::const_iterator it = myPartiallyOccupatedByShadow.begin(); it != myPartiallyOccupatedByShadow.end(); ++it) {
+ (*it)->resetPartialOccupation(&myVehicle);
+ }
+ myPartiallyOccupatedByShadow.clear();
myVehicle.leaveLane(MSMoveReminder::NOTIFICATION_LANE_CHANGE);
myVehicle.enterLaneAtLaneChange(myShadowLane);
myShadowLane = tmp;
@@ -184,7 +215,7 @@ MSAbstractLaneChangeModel::continueLaneChangeManeuver(bool moved) {
const SUMOReal sourceHalfWidth = myShadowLane->getWidth() / 2.0;
const SUMOReal targetHalfWidth = myVehicle.getLane()->getWidth() / 2.0;
if (myLaneChangeCompletion * (sourceHalfWidth + targetHalfWidth) - myVehicle.getVehicleType().getWidth() / 2.0 > sourceHalfWidth) {
- removeLaneChangeShadow();
+ removeLaneChangeShadow(MSMoveReminder::NOTIFICATION_LANE_CHANGE);
}
}
// finish maneuver
@@ -196,13 +227,26 @@ MSAbstractLaneChangeModel::continueLaneChangeManeuver(bool moved) {
void
-MSAbstractLaneChangeModel::removeLaneChangeShadow() {
+MSAbstractLaneChangeModel::removeLaneChangeShadow(const MSMoveReminder::Notification reason, bool notify) {
if (myShadowLane != 0 && myHaveShadow) {
- myShadowLane->removeVehicle(&myVehicle, MSMoveReminder::NOTIFICATION_LANE_CHANGE);
+ myShadowLane->removeVehicle(&myVehicle, reason, notify);
myHaveShadow = false;
+ // maintain pointer to myShadowLane for interpolating position
}
}
+void
+MSAbstractLaneChangeModel::endLaneChangeManeuver(const MSMoveReminder::Notification reason) {
+ removeLaneChangeShadow(reason);
+ myLaneChangeCompletion = 1;
+ myShadowLane = 0;
+ // removing partial occupator shadows
+ for (std::vector<MSLane*>::const_iterator it = myPartiallyOccupatedByShadow.begin(); it != myPartiallyOccupatedByShadow.end(); ++it) {
+ (*it)->resetPartialOccupation(&myVehicle);
+ }
+ myPartiallyOccupatedByShadow.clear();
+ myNoPartiallyOccupatedByShadow.clear();
+}
bool
MSAbstractLaneChangeModel::cancelRequest(int state) {
diff --git a/src/microsim/lcmodels/MSAbstractLaneChangeModel.h b/src/microsim/lcmodels/MSAbstractLaneChangeModel.h
index 8041824..acbd7f3 100644
--- a/src/microsim/lcmodels/MSAbstractLaneChangeModel.h
+++ b/src/microsim/lcmodels/MSAbstractLaneChangeModel.h
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Fri, 29.04.2005
-/// @version $Id: MSAbstractLaneChangeModel.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSAbstractLaneChangeModel.h 18440 2015-05-26 10:40:28Z namdre $
///
// Interface for lane-change models
/****************************************************************************/
@@ -90,11 +90,15 @@ enum LaneChangeAction {
// The vehicle is blocked being overlapping
LCA_OVERLAPPING = 1 << 13,
+ // The vehicle does not have enough space to complete a continuous lane
+ // change before the next turning movement
+ LCA_INSUFFICIENT_SPACE = 1 << 14,
+
LCA_BLOCKED_LEFT = LCA_BLOCKED_BY_LEFT_LEADER | LCA_BLOCKED_BY_LEFT_FOLLOWER,
LCA_BLOCKED_RIGHT = LCA_BLOCKED_BY_RIGHT_LEADER | LCA_BLOCKED_BY_RIGHT_FOLLOWER,
LCA_BLOCKED_BY_LEADER = LCA_BLOCKED_BY_LEFT_LEADER | LCA_BLOCKED_BY_RIGHT_LEADER,
LCA_BLOCKED_BY_FOLLOWER = LCA_BLOCKED_BY_LEFT_FOLLOWER | LCA_BLOCKED_BY_RIGHT_FOLLOWER,
- LCA_BLOCKED = LCA_BLOCKED_LEFT | LCA_BLOCKED_RIGHT
+ LCA_BLOCKED = LCA_BLOCKED_LEFT | LCA_BLOCKED_RIGHT | LCA_INSUFFICIENT_SPACE
/// @}
@@ -251,6 +255,9 @@ public:
return myShadowLane;
}
+ /// @brief return the shadow lane for the given lane
+ MSLane* getShadowLane(const MSLane* lane) const;
+
inline SUMOTime getLastLaneChangeOffset() const {
return myLastLaneChangeOffset;
@@ -272,6 +279,11 @@ public:
return myLaneChangeCompletion < (1 - NUMERICAL_EPS);
}
+ /// @brief return true if the vehicle currently has a shadow vehicle
+ inline bool hasShadowVehicle() const {
+ return myHaveShadow;
+ }
+
/// @brief return the direction of the current lane change maneuver
inline int getLaneChangeDirection() const {
return myLaneChangeDirection;
@@ -287,7 +299,6 @@ public:
myAlreadyMoved = false;
}
-
/// @brief start the lane change maneuver and return whether it continues
bool startLaneChangeManeuver(MSLane* source, MSLane* target, int direction);
@@ -299,20 +310,24 @@ public:
/* @brief finish the lane change maneuver
*/
- inline void endLaneChangeManeuver() {
- removeLaneChangeShadow();
- myLaneChangeCompletion = 1;
- myShadowLane = 0;
- }
+ void endLaneChangeManeuver(const MSMoveReminder::Notification reason = MSMoveReminder::NOTIFICATION_LANE_CHANGE);
/// @brief remove the shadow copy of a lane change maneuver
- void removeLaneChangeShadow();
+ void removeLaneChangeShadow(const MSMoveReminder::Notification reason, bool notify = true);
/// @brief reserve space at the end of the lane to avoid dead locks
virtual void saveBlockerLength(SUMOReal length) {
UNUSED_PARAMETER(length);
};
+ void setShadowPartialOccupator(MSLane* lane) {
+ myPartiallyOccupatedByShadow.push_back(lane);
+ }
+
+ void setNoShadowPartialOccupator(MSLane* lane) {
+ myNoPartiallyOccupatedByShadow.push_back(lane);
+ }
+
protected:
virtual bool congested(const MSVehicle* const neighLeader);
@@ -350,6 +365,13 @@ protected:
/// @brief The vehicle's car following model
const MSCFModel& myCarFollowModel;
+ /// @brief list of lanes where the shadow vehicle is partial occupator
+ std::vector<MSLane*> myPartiallyOccupatedByShadow;
+
+ /* @brief list of lanes where there is no shadow vehicle partial occupator
+ * (when changing to a lane that has no predecessor) */
+ std::vector<MSLane*> myNoPartiallyOccupatedByShadow;
+
/* @brief to be called by derived classes in their changed() method.
* If dir=0 is given, the current value remains unchanged */
void initLastLaneChangeOffset(int dir);
diff --git a/src/microsim/lcmodels/MSLCM_DK2008.cpp b/src/microsim/lcmodels/MSLCM_DK2008.cpp
index baa0002..d2f5b24 100644
--- a/src/microsim/lcmodels/MSLCM_DK2008.cpp
+++ b/src/microsim/lcmodels/MSLCM_DK2008.cpp
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Tue, 29.05.2005
-/// @version $Id: MSLCM_DK2008.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSLCM_DK2008.cpp 18403 2015-05-19 10:41:09Z namdre $
///
// A lane change model developed by D. Krajzewicz between 2004 and 2010
/****************************************************************************/
@@ -44,13 +44,6 @@
#endif // CHECK_MEMORY_LEAKS
//#define DEBUG_VEHICLE_GUI_SELECTION 1
-#ifdef DEBUG_VEHICLE_GUI_SELECTION
-#include <utils/gui/div/GUIGlobalSelection.h>
-#include <guisim/GUIVehicle.h>
-#include <guisim/GUILane.h>
-#endif
-
-
// ===========================================================================
// variable definitions
@@ -110,7 +103,7 @@ MSLCM_DK2008::wantsChangeToRight(MSAbstractLaneChangeModel::MSLCMessager& msgPas
MSVehicle** firstBlocked) {
UNUSED_PARAMETER(firstBlocked);
#ifdef DEBUG_VEHICLE_GUI_SELECTION
- if (gSelected.isSelected(GLO_VEHICLE, static_cast<const GUIVehicle*>(&myVehicle)->getGlID())) {
+ if (gDebugSelectedVehicle == myVehicle.getID()) {
int bla = 0;
}
#endif
@@ -322,7 +315,7 @@ MSLCM_DK2008::wantsChangeToLeft(MSAbstractLaneChangeModel::MSLCMessager& msgPass
MSVehicle** firstBlocked) {
UNUSED_PARAMETER(firstBlocked);
#ifdef DEBUG_VEHICLE_GUI_SELECTION
- if (gSelected.isSelected(GLO_VEHICLE, static_cast<const GUIVehicle*>(&myVehicle)->getGlID())) {
+ if (gDebugSelectedVehicle == myVehicle.getID()) {
int bla = 0;
}
#endif
@@ -523,7 +516,7 @@ MSLCM_DK2008::wantsChangeToLeft(MSAbstractLaneChangeModel::MSLCMessager& msgPass
SUMOReal
MSLCM_DK2008::patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel& cfModel) {
#ifdef DEBUG_VEHICLE_GUI_SELECTION
- if (gSelected.isSelected(GLO_VEHICLE, static_cast<const GUIVehicle*>(&myVehicle)->getGlID())) {
+ if (gDebugSelectedVehicle == myVehicle.getID()) {
int bla = 0;
}
#endif
diff --git a/src/microsim/lcmodels/MSLCM_JE2013.cpp b/src/microsim/lcmodels/MSLCM_JE2013.cpp
index 80a3e4b..8b87c66 100644
--- a/src/microsim/lcmodels/MSLCM_JE2013.cpp
+++ b/src/microsim/lcmodels/MSLCM_JE2013.cpp
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Fri, 08.10.2013
-/// @version $Id: MSLCM_JE2013.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSLCM_JE2013.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// A lane change model developed by J. Erdmann
// based on the model of D. Krajzewicz developed between 2004 and 2011 (MSLCM_DK2004)
@@ -43,13 +43,6 @@
#endif // CHECK_MEMORY_LEAKS
//#define DEBUG_VEHICLE_GUI_SELECTION 1
-#ifdef DEBUG_VEHICLE_GUI_SELECTION
-#include <utils/gui/div/GUIGlobalSelection.h>
-#include <guisim/GUIVehicle.h>
-#include <guisim/GUILane.h>
-#endif
-
-
// ===========================================================================
// variable definitions
@@ -96,7 +89,7 @@
#define TURN_LANE_DIST (SUMOReal)200.0 // the distance at which a lane leading elsewhere is considered to be a turn-lane that must be avoided
//#define DEBUG_COND (myVehicle.getID() == "1501_27271428" || myVehicle.getID() == "1502_27270000")
-//#define DEBUG_COND (myVehicle.getID() == "175129_26220000")
+//#define DEBUG_COND (myVehicle.getID() == "overtaking")
//#define DEBUG_COND (myVehicle.getID() == "pkw150478" || myVehicle.getID() == "pkw150494" || myVehicle.getID() == "pkw150289")
//#define DEBUG_COND (myVehicle.getID() == "A" || myVehicle.getID() == "B") // fail change to left
//#define DEBUG_COND (myVehicle.getID() == "Costa_12_13") // test stops_overtaking
@@ -763,6 +756,14 @@ MSLCM_JE2013::_wantsChange(
// : laSpeed * LOOK_FORWARD_NEAR;
SUMOReal laDist = myLookAheadSpeed * (right ? LOOK_FORWARD_RIGHT : LOOK_FORWARD_LEFT);
laDist += myVehicle.getVehicleType().getLengthWithGap() * (SUMOReal) 2.;
+
+ // react to a stopped leader on the current lane
+ if (bestLaneOffset == 0 && leader.first != 0 && leader.first->isStopped()) {
+ // value is doubled for the check since we change back and forth
+ laDist = 0.5 * (myVehicle.getVehicleType().getLengthWithGap()
+ + leader.first->getVehicleType().getLengthWithGap());
+ }
+
// free space that is available for changing
//const SUMOReal neighSpeed = (neighLead.first != 0 ? neighLead.first->getSpeed() :
// neighFollow.first != 0 ? neighFollow.first->getSpeed() :
diff --git a/src/microsim/lcmodels/MSLCM_LC2013.cpp b/src/microsim/lcmodels/MSLCM_LC2013.cpp
index cb29c14..c9d7963 100644
--- a/src/microsim/lcmodels/MSLCM_LC2013.cpp
+++ b/src/microsim/lcmodels/MSLCM_LC2013.cpp
@@ -6,7 +6,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Fri, 08.10.2013
-/// @version $Id: MSLCM_LC2013.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSLCM_LC2013.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// A lane change model developed by D. Krajzewicz, J. Erdmann et al. between 2004 and 2013
/****************************************************************************/
@@ -44,13 +44,6 @@
#endif // CHECK_MEMORY_LEAKS
//#define DEBUG_VEHICLE_GUI_SELECTION 1
-#ifdef DEBUG_VEHICLE_GUI_SELECTION
-#include <utils/gui/div/GUIGlobalSelection.h>
-#include <guisim/GUIVehicle.h>
-#include <guisim/GUILane.h>
-#endif
-
-
// ===========================================================================
// variable definitions
@@ -461,6 +454,14 @@ MSLCM_LC2013::_wantsChange(
}
SUMOReal laDist = myLookAheadSpeed * (right ? LOOK_FORWARD_RIGHT : LOOK_FORWARD_LEFT);
laDist += myVehicle.getVehicleType().getLengthWithGap() * (SUMOReal) 2.;
+
+ // react to a stopped leader on the current lane
+ if (bestLaneOffset == 0 && leader.first != 0 && leader.first->isStopped()) {
+ // value is doubled for the check since we change back and forth
+ laDist = 0.5 * (myVehicle.getVehicleType().getLengthWithGap()
+ + leader.first->getVehicleType().getLengthWithGap());
+ }
+
// free space that is available for changing
//const SUMOReal neighSpeed = (neighLead.first != 0 ? neighLead.first->getSpeed() :
// neighFollow.first != 0 ? neighFollow.first->getSpeed() :
diff --git a/src/microsim/output/MSBatteryExport.cpp b/src/microsim/output/MSBatteryExport.cpp
new file mode 100644
index 0000000..3616829
--- /dev/null
+++ b/src/microsim/output/MSBatteryExport.cpp
@@ -0,0 +1,151 @@
+/****************************************************************************/
+/// @file MSBatteryExport.cpp
+/// @author Mario Krumnow
+/// @author Tamas Kurczveil
+/// @author Pablo Alvarez L�pez
+/// @date 20-12-13
+/// @version $Id: MSBatteryExport.cpp 18762 2015-09-01 16:27:09Z behrisch $
+///
+// Realises dumping Battery Data
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+#include <microsim/MSEdgeControl.h>
+#include <microsim/MSEdge.h>
+#include <microsim/MSLane.h>
+#include <microsim/MSGlobals.h>
+#include <utils/iodevices/OutputDevice.h>
+#include "MSBatteryExport.h"
+#include <microsim/MSNet.h>
+#include <microsim/MSVehicle.h>
+#include <microsim/devices/MSDevice_Battery.h>
+
+#ifdef HAVE_MESOSIM
+#include <mesosim/MELoop.h>
+#include <mesosim/MESegment.h>
+#endif
+
+#ifdef CHECK_MEMORY_LEAKS
+#include <foreign/nvwa/debug_new.h>
+#endif // CHECK_MEMORY_LEAKS
+
+
+// ===========================================================================
+// method definitions
+// ===========================================================================
+void
+MSBatteryExport::write(OutputDevice& of, SUMOTime timestep, int precision) {
+ of.openTag("timestep").writeAttr("time", time2string(timestep));
+ of.setPrecision(precision);
+
+ MSVehicleControl& vc = MSNet::getInstance()->getVehicleControl();
+ MSVehicleControl::constVehIt it = vc.loadedVehBegin();
+ MSVehicleControl::constVehIt end = vc.loadedVehEnd();
+ for (; it != end; ++it) {
+ const MSVehicle* veh = static_cast<const MSVehicle*>((*it).second);
+
+ if (!veh->isOnRoad()) {
+ continue;
+ }
+
+ std::string fclass = veh->getVehicleType().getID();
+ fclass = fclass.substr(0, fclass.find_first_of("@"));
+
+ Position pos = veh->getLane()->getShape().positionAtOffset(veh->getPositionOnLane());
+
+ if (static_cast<MSDevice_Battery*>(veh->getDevice(typeid(MSDevice_Battery))) != 0) {
+ // Get battery
+ MSDevice_Battery* batteryToExport = dynamic_cast<MSDevice_Battery*>(veh->getDevice(typeid(MSDevice_Battery)));
+
+ // Open Row
+ of.openTag("vehicle");
+
+ // Write ID
+ of.writeAttr("id", veh->getID());
+
+ // Write consum
+ of.writeAttr("Consum", batteryToExport->getConsum());
+
+ // Write ActBatKap
+ of.writeAttr("ActBatKap", batteryToExport->getActBatKap());
+
+ // Write MaxBatKap
+ of.writeAttr("MaxBatKap", batteryToExport->getMaxBatKap());
+
+ // Write Charging Station ID
+ of.writeAttr("ChrgStnId", batteryToExport->getChrgStnID());
+
+ // Write Charge charged in the Battery
+ of.writeAttr("Charge", batteryToExport->getChrgEnergy());
+
+ // Write ChargeInTransit
+ if (batteryToExport->isChargingInTransit()) {
+ of.writeAttr("ChargeInTransit", batteryToExport->getChrgEnergy());
+ } else {
+ of.writeAttr("ChargeInTransit", 0.00);
+ }
+
+ // Write ChargingStopped
+ if (batteryToExport->isChargingStopped()) {
+ of.writeAttr("ChargeStopped", batteryToExport->getChrgEnergy());
+ } else {
+ of.writeAttr("ChargeStopped", 0.00);
+ }
+
+ // Write Speed
+ of.writeAttr("speed", veh->getSpeed());
+
+ // Write Acceleration
+ of.writeAttr("acceleration", veh->getAcceleration());
+
+ // Write pos x
+ of.writeAttr("x", veh->getPosition().x());
+
+ // Write pos y
+ of.writeAttr("y", veh->getPosition().y());
+
+ // Write Lane ID
+ of.writeAttr("lane", veh->getLane()->getID());
+
+ // Write vehicle position in the lane
+ of.writeAttr("posOnLane", veh->getPositionOnLane());
+
+ // Write Time stopped (In all cases)
+ of.writeAttr("timeStopped", batteryToExport->getVehicleStopped());
+
+ /*0
+ 1
+ 2
+ 3
+ 4
+ vehiclestopped�berein station
+
+ wielangevehiceladen
+ */
+ // Close Row
+ of.closeTag();
+ }
+ }
+ of.closeTag();
+
+}
diff --git a/src/microsim/output/MSBatteryExport.h b/src/microsim/output/MSBatteryExport.h
new file mode 100644
index 0000000..2c1b89a
--- /dev/null
+++ b/src/microsim/output/MSBatteryExport.h
@@ -0,0 +1,81 @@
+/****************************************************************************/
+/// @file MSBatteryExport.h
+/// @author Mario Krumnow
+/// @author Tamas Kurczveil
+/// @author Pablo Alvarez L�pez
+/// @date 20-12-13
+/// @version $Id: MSBatteryExport.h 18762 2015-09-01 16:27:09Z behrisch $
+///
+// Realises dumping Battery Data
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+#ifndef MSBatteryExport_h
+#define MSBatteryExport_h
+
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+#include <utils/common/SUMOTime.h>
+
+
+// ===========================================================================
+// class declarations
+// ===========================================================================
+class OutputDevice;
+
+
+// ===========================================================================
+// class definitions
+// ===========================================================================
+/**
+ * @class MSBatteryExport
+ * @brief Realises dumping Battery Data
+ *
+ * The class offers a static method, which writes all available Battery factors
+ * of each vehicles of the network into the given OutputDevice.
+ *
+ * @todo consider error-handling on write (using IOError)
+ */
+class MSBatteryExport {
+public:
+ /** @brief Writes the complete network state of the given edges into the given device
+ *
+ * Opens the current time step and export the Battery factors of all availabel vehicles
+ *
+ * @param[in] of The output device to use
+ * @param[in] timestep The current time step
+ * @param[in] precision The output precision
+ * @exception IOError If an error on writing occurs (!!! not yet implemented)
+ */
+ static void write(OutputDevice& of, SUMOTime timestep, int precision);
+
+
+private:
+ /// @brief Invalidated copy constructor.
+ MSBatteryExport(const MSBatteryExport&);
+
+ /// @brief Invalidated assignment operator.
+ MSBatteryExport& operator=(const MSBatteryExport&);
+
+};
+
+
+#endif
+
diff --git a/src/microsim/output/MSDetectorControl.cpp b/src/microsim/output/MSDetectorControl.cpp
index f237406..aa73f0b 100644
--- a/src/microsim/output/MSDetectorControl.cpp
+++ b/src/microsim/output/MSDetectorControl.cpp
@@ -7,7 +7,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date 2005-09-15
-/// @version $Id: MSDetectorControl.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSDetectorControl.cpp 18213 2015-04-16 11:55:42Z behrisch $
///
// Detectors container; responsible for string and output generation
/****************************************************************************/
@@ -76,7 +76,7 @@ MSDetectorControl::close(SUMOTime step) {
void
-MSDetectorControl::add(SumoXMLTag type, MSDetectorFileOutput* d, const std::string& device, int splInterval, SUMOTime begin) {
+MSDetectorControl::add(SumoXMLTag type, MSDetectorFileOutput* d, const std::string& device, SUMOTime splInterval, SUMOTime begin) {
if (!myDetectors[type].add(d->getID(), d)) {
throw ProcessError(toString(type) + " detector '" + d->getID() + "' could not be build (declared twice?).");
}
diff --git a/src/microsim/output/MSDetectorControl.h b/src/microsim/output/MSDetectorControl.h
index ebfe30b..d05e097 100644
--- a/src/microsim/output/MSDetectorControl.h
+++ b/src/microsim/output/MSDetectorControl.h
@@ -6,7 +6,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date 2005-09-15
-/// @version $Id: MSDetectorControl.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSDetectorControl.h 18213 2015-04-16 11:55:42Z behrisch $
///
// Detectors container; responsible for string and output generation
/****************************************************************************/
@@ -102,7 +102,7 @@ public:
* @param[in] splInterval The sample interval of the detector
* @exception ProcessError If the detector is already known
*/
- void add(SumoXMLTag type, MSDetectorFileOutput* d, const std::string& device, int splInterval, SUMOTime begin = -1);
+ void add(SumoXMLTag type, MSDetectorFileOutput* d, const std::string& device, SUMOTime splInterval, SUMOTime begin = -1);
diff --git a/src/microsim/output/MSE3Collector.cpp b/src/microsim/output/MSE3Collector.cpp
index 72e1d4c..524a2ee 100644
--- a/src/microsim/output/MSE3Collector.cpp
+++ b/src/microsim/output/MSE3Collector.cpp
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Tue Dec 02 2003 22:17 CET
-/// @version $Id: MSE3Collector.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSE3Collector.cpp 18213 2015-04-16 11:55:42Z behrisch $
///
// A detector of vehicles passing an area between entry/exit points
/****************************************************************************/
@@ -291,7 +291,7 @@ MSE3Collector::detectorUpdate(const SUMOTime step) {
values.intervalSpeedSum += veh->getSpeed() * TS;
if (veh->getSpeed() < myHaltingSpeedThreshold) {
if (values.haltingBegin == -1) {
- values.haltingBegin = step;
+ values.haltingBegin = STEPS2TIME(step);
}
if (step - values.haltingBegin > myHaltingTimeThreshold) {
values.haltings++;
diff --git a/src/microsim/output/MSFCDExport.cpp b/src/microsim/output/MSFCDExport.cpp
index 7d6dec7..4d8a330 100644
--- a/src/microsim/output/MSFCDExport.cpp
+++ b/src/microsim/output/MSFCDExport.cpp
@@ -5,7 +5,7 @@
/// @author Mario Krumnow
/// @author Michael Behrisch
/// @date 2012-04-26
-/// @version $Id: MSFCDExport.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSFCDExport.cpp 18287 2015-04-23 13:20:21Z namdre $
///
// Realises dumping Floating Car Data (FCD) Data
/****************************************************************************/
@@ -54,7 +54,7 @@
// method definitions
// ===========================================================================
void
-MSFCDExport::write(OutputDevice& of, SUMOTime timestep) {
+MSFCDExport::write(OutputDevice& of, SUMOTime timestep, bool elevation) {
const bool useGeo = OptionsCont::getOptions().getBool("fcd-output.geo");
const bool signals = OptionsCont::getOptions().getBool("fcd-output.signals");
of.openTag("timestep").writeAttr(SUMO_ATTR_TIME, time2string(timestep));
@@ -72,6 +72,9 @@ MSFCDExport::write(OutputDevice& of, SUMOTime timestep) {
of.writeAttr(SUMO_ATTR_ID, veh->getID());
of.writeAttr(SUMO_ATTR_X, pos.x());
of.writeAttr(SUMO_ATTR_Y, pos.y());
+ if (elevation) {
+ of.writeAttr(SUMO_ATTR_Z, pos.z());
+ }
of.writeAttr(SUMO_ATTR_ANGLE, veh->getAngle());
of.writeAttr(SUMO_ATTR_TYPE, veh->getVehicleType().getID());
of.writeAttr(SUMO_ATTR_SPEED, veh->getSpeed());
@@ -91,9 +94,9 @@ MSFCDExport::write(OutputDevice& of, SUMOTime timestep) {
MSEdgeControl& ec = MSNet::getInstance()->getEdgeControl();
const MSEdgeVector& edges = ec.getEdges();
for (MSEdgeVector::const_iterator e = edges.begin(); e != edges.end(); ++e) {
- const std::vector<MSPerson*>& persons = (*e)->getSortedPersons(timestep);
- for (std::vector<MSPerson*>::const_iterator it_p = persons.begin(); it_p != persons.end(); ++it_p) {
- MSPerson* p = *it_p;
+ const std::vector<MSTransportable*>& persons = (*e)->getSortedPersons(timestep);
+ for (std::vector<MSTransportable*>::const_iterator it_p = persons.begin(); it_p != persons.end(); ++it_p) {
+ MSTransportable* p = *it_p;
Position pos = p->getPosition();
if (useGeo) {
of.setPrecision(GEO_OUTPUT_ACCURACY);
@@ -103,6 +106,9 @@ MSFCDExport::write(OutputDevice& of, SUMOTime timestep) {
of.writeAttr(SUMO_ATTR_ID, p->getID());
of.writeAttr(SUMO_ATTR_X, pos.x());
of.writeAttr(SUMO_ATTR_Y, pos.y());
+ if (elevation) {
+ of.writeAttr(SUMO_ATTR_Z, pos.z());
+ }
of.writeAttr(SUMO_ATTR_ANGLE, p->getAngle());
of.writeAttr(SUMO_ATTR_SPEED, p->getSpeed());
of.writeAttr(SUMO_ATTR_POSITION, p->getEdgePos());
@@ -117,9 +123,9 @@ MSFCDExport::write(OutputDevice& of, SUMOTime timestep) {
MSEdgeControl& ec = MSNet::getInstance()->getEdgeControl();
const std::vector<MSEdge*>& edges = ec.getEdges();
for (std::vector<MSEdge*>::const_iterator e = edges.begin(); e != edges.end(); ++e) {
- const std::vector<MSContainer*>& containers = (*e)->getSortedContainers(timestep);
- for (std::vector<MSContainer*>::const_iterator it_c = containers.begin(); it_c != containers.end(); ++it_c) {
- MSContainer* c = *it_c;
+ const std::vector<MSTransportable*>& containers = (*e)->getSortedContainers(timestep);
+ for (std::vector<MSTransportable*>::const_iterator it_c = containers.begin(); it_c != containers.end(); ++it_c) {
+ MSTransportable* c = *it_c;
Position pos = c->getPosition();
if (useGeo) {
of.setPrecision(GEO_OUTPUT_ACCURACY);
@@ -129,6 +135,9 @@ MSFCDExport::write(OutputDevice& of, SUMOTime timestep) {
of.writeAttr(SUMO_ATTR_ID, c->getID());
of.writeAttr(SUMO_ATTR_X, pos.x());
of.writeAttr(SUMO_ATTR_Y, pos.y());
+ if (elevation) {
+ of.writeAttr(SUMO_ATTR_Z, pos.z());
+ }
of.writeAttr(SUMO_ATTR_ANGLE, c->getAngle());
of.writeAttr(SUMO_ATTR_SPEED, c->getSpeed());
of.writeAttr(SUMO_ATTR_POSITION, c->getEdgePos());
diff --git a/src/microsim/output/MSFCDExport.h b/src/microsim/output/MSFCDExport.h
index 285a635..e25aea4 100644
--- a/src/microsim/output/MSFCDExport.h
+++ b/src/microsim/output/MSFCDExport.h
@@ -2,7 +2,7 @@
/// @file MSFCDExport.h
/// @author Mario Krumnow
/// @date 2012-04-26
-/// @version $Id: MSFCDExport.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSFCDExport.h 18287 2015-04-23 13:20:21Z namdre $
///
// Realises dumping Floating Car Data (FCD) Data
/****************************************************************************/
@@ -62,9 +62,10 @@ public:
*
* @param[in] of The output device to use
* @param[in] timestep The current time step
+ * @param[in] elevation Whether elevation data shall be written
* @exception IOError If an error on writing occurs (!!! not yet implemented)
*/
- static void write(OutputDevice& of, SUMOTime timestep);
+ static void write(OutputDevice& of, SUMOTime timestep, bool elevation);
private:
diff --git a/src/microsim/output/MSMeanData.cpp b/src/microsim/output/MSMeanData.cpp
index 7a2aa02..e10e38a 100644
--- a/src/microsim/output/MSMeanData.cpp
+++ b/src/microsim/output/MSMeanData.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Mon, 10.05.2004
-/// @version $Id: MSMeanData.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSMeanData.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Data collector for edges/lanes
/****************************************************************************/
@@ -276,7 +276,9 @@ void
MSMeanData::init() {
const MSEdgeVector& edges = MSNet::getInstance()->getEdgeControl().getEdges();
for (MSEdgeVector::const_iterator e = edges.begin(); e != edges.end(); ++e) {
- if (myDumpInternal || (*e)->getPurpose() != MSEdge::EDGEFUNCTION_INTERNAL) {
+ const MSEdge::EdgeBasicFunction efun = (*e)->getPurpose();
+ if ((myDumpInternal || efun != MSEdge::EDGEFUNCTION_INTERNAL)
+ && efun != MSEdge::EDGEFUNCTION_CROSSING && efun != MSEdge::EDGEFUNCTION_WALKINGAREA) {
myEdges.push_back(*e);
myMeasures.push_back(std::vector<MeanDataValues*>());
const std::vector<MSLane*>& lanes = (*e)->getLanes();
diff --git a/src/microsim/output/MSVTypeProbe.cpp b/src/microsim/output/MSVTypeProbe.cpp
index b3c5d18..efe4324 100644
--- a/src/microsim/output/MSVTypeProbe.cpp
+++ b/src/microsim/output/MSVTypeProbe.cpp
@@ -5,7 +5,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Wed, 24.10.2007
-/// @version $Id: MSVTypeProbe.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSVTypeProbe.cpp 18293 2015-04-24 10:11:37Z namdre $
///
// Writes positions of vehicles that have a certain (named) type
/****************************************************************************/
@@ -64,7 +64,10 @@ MSVTypeProbe::~MSVTypeProbe() {
SUMOTime
MSVTypeProbe::execute(SUMOTime currentTime) {
- myOutputDevice.openTag("timestep") << " time=\"" << time2string(currentTime) << "\" id=\"" << getID() << "\" vType=\"" << myVType << "\"";
+ myOutputDevice.openTag(SUMO_TAG_TIMESTEP);
+ myOutputDevice.writeAttr(SUMO_ATTR_TIME, time2string(currentTime));
+ myOutputDevice.writeAttr(SUMO_ATTR_ID, getID());
+ myOutputDevice.writeAttr("vType", myVType);
MSVehicleControl& vc = MSNet::getInstance()->getVehicleControl();
for (MSVehicleControl::constVehIt it = vc.loadedVehBegin(); it != vc.loadedVehEnd(); ++it) {
const SUMOVehicle* veh = it->second;
@@ -72,19 +75,25 @@ MSVTypeProbe::execute(SUMOTime currentTime) {
if (myVType == "" || myVType == veh->getVehicleType().getID()) {
if (veh->isOnRoad()) {
Position pos = veh->getPosition();
- myOutputDevice.openTag("vehicle").writeAttr("id", veh->getID());
+ myOutputDevice.openTag(SUMO_TAG_VEHICLE);
+ myOutputDevice.writeAttr(SUMO_ATTR_ID, veh->getID());
if (microVeh != 0) {
- myOutputDevice.writeAttr("lane", microVeh->getLane()->getID());
+ myOutputDevice.writeAttr(SUMO_ATTR_LANE, microVeh->getLane()->getID());
+ }
+ myOutputDevice.writeAttr(SUMO_ATTR_POSITION, veh->getPositionOnLane());
+ myOutputDevice.writeAttr(SUMO_ATTR_X, pos.x());
+ myOutputDevice.writeAttr(SUMO_ATTR_Y, pos.y());
+ if (MSNet::getInstance()->hasElevation()) {
+ myOutputDevice.writeAttr(SUMO_ATTR_Z, pos.z());
}
- myOutputDevice.writeAttr("pos", veh->getPositionOnLane());
- myOutputDevice.writeAttr("x", pos.x()).writeAttr("y", pos.y());
if (GeoConvHelper::getFinal().usingGeoProjection()) {
GeoConvHelper::getFinal().cartesian2geo(pos);
myOutputDevice.setPrecision(GEO_OUTPUT_ACCURACY);
- myOutputDevice.writeAttr("lat", pos.y()).writeAttr("lon", pos.x());
+ myOutputDevice.writeAttr(SUMO_ATTR_LAT, pos.y());
+ myOutputDevice.writeAttr(SUMO_ATTR_LON, pos.x());
myOutputDevice.setPrecision();
}
- myOutputDevice.writeAttr("speed", veh->getSpeed());
+ myOutputDevice.writeAttr(SUMO_ATTR_SPEED, veh->getSpeed());
myOutputDevice.closeTag();
}
}
diff --git a/src/microsim/output/MSXMLRawOut.cpp b/src/microsim/output/MSXMLRawOut.cpp
index 1ab9b22..aef4241 100644
--- a/src/microsim/output/MSXMLRawOut.cpp
+++ b/src/microsim/output/MSXMLRawOut.cpp
@@ -6,7 +6,7 @@
/// @author Bjoern Hendriks
/// @author Michael Behrisch
/// @date Mon, 10.05.2004
-/// @version $Id: MSXMLRawOut.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSXMLRawOut.cpp 18274 2015-04-22 15:00:44Z behrisch $
///
// Realises dumping the complete network state
/****************************************************************************/
@@ -99,8 +99,8 @@ MSXMLRawOut::writeEdge(OutputDevice& of, const MSEdge& edge, SUMOTime timestep)
#endif
}
//en
- const std::vector<MSPerson*>& persons = edge.getSortedPersons(timestep);
- const std::vector<MSContainer*>& containers = edge.getSortedContainers(timestep);
+ const std::vector<MSTransportable*>& persons = edge.getSortedPersons(timestep);
+ const std::vector<MSTransportable*>& containers = edge.getSortedContainers(timestep);
if (dump || persons.size() > 0 || containers.size() > 0) {
of.openTag("edge") << " id=\"" << edge.getID() << "\"";
if (dump) {
@@ -122,7 +122,7 @@ MSXMLRawOut::writeEdge(OutputDevice& of, const MSEdge& edge, SUMOTime timestep)
#endif
}
// write persons
- for (std::vector<MSPerson*>::const_iterator it_p = persons.begin(); it_p != persons.end(); ++it_p) {
+ for (std::vector<MSTransportable*>::const_iterator it_p = persons.begin(); it_p != persons.end(); ++it_p) {
of.openTag(SUMO_TAG_PERSON);
of.writeAttr(SUMO_ATTR_ID, (*it_p)->getID());
of.writeAttr(SUMO_ATTR_POSITION, (*it_p)->getEdgePos());
@@ -131,7 +131,7 @@ MSXMLRawOut::writeEdge(OutputDevice& of, const MSEdge& edge, SUMOTime timestep)
of.closeTag();
}
// write containers
- for (std::vector<MSContainer*>::const_iterator it_c = containers.begin(); it_c != containers.end(); ++it_c) {
+ for (std::vector<MSTransportable*>::const_iterator it_c = containers.begin(); it_c != containers.end(); ++it_c) {
of.openTag(SUMO_TAG_CONTAINER);
of.writeAttr(SUMO_ATTR_ID, (*it_c)->getID());
of.writeAttr(SUMO_ATTR_POSITION, (*it_c)->getEdgePos());
diff --git a/src/microsim/output/Makefile.am b/src/microsim/output/Makefile.am
index 1b72ee3..577a4c5 100644
--- a/src/microsim/output/Makefile.am
+++ b/src/microsim/output/Makefile.am
@@ -19,6 +19,7 @@ MSVTypeProbe.cpp MSVTypeProbe.h \
MSXMLRawOut.cpp MSXMLRawOut.h \
MSFCDExport.cpp MSFCDExport.h \
MSAmitranTrajectories.cpp MSAmitranTrajectories.h \
+MSBatteryExport.cpp MSBatteryExport.h \
MSEmissionExport.cpp MSEmissionExport.h \
MSVTKExport.cpp MSVTKExport.h \
MSFullExport.cpp MSFullExport.h \
diff --git a/src/microsim/output/Makefile.in b/src/microsim/output/Makefile.in
index 18d1953..1cd544f 100644
--- a/src/microsim/output/Makefile.in
+++ b/src/microsim/output/Makefile.in
@@ -106,9 +106,9 @@ am_libmicrosimoutput_a_OBJECTS = MSDetectorControl.$(OBJEXT) \
MSMeanData_Net.$(OBJEXT) MSMeanData_Amitran.$(OBJEXT) \
MSRouteProbe.$(OBJEXT) MSVTypeProbe.$(OBJEXT) \
MSXMLRawOut.$(OBJEXT) MSFCDExport.$(OBJEXT) \
- MSAmitranTrajectories.$(OBJEXT) MSEmissionExport.$(OBJEXT) \
- MSVTKExport.$(OBJEXT) MSFullExport.$(OBJEXT) \
- MSQueueExport.$(OBJEXT)
+ MSAmitranTrajectories.$(OBJEXT) MSBatteryExport.$(OBJEXT) \
+ MSEmissionExport.$(OBJEXT) MSVTKExport.$(OBJEXT) \
+ MSFullExport.$(OBJEXT) MSQueueExport.$(OBJEXT)
libmicrosimoutput_a_OBJECTS = $(am_libmicrosimoutput_a_OBJECTS)
AM_V_P = $(am__v_P_ at AM_V@)
am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
@@ -355,6 +355,7 @@ MSVTypeProbe.cpp MSVTypeProbe.h \
MSXMLRawOut.cpp MSXMLRawOut.h \
MSFCDExport.cpp MSFCDExport.h \
MSAmitranTrajectories.cpp MSAmitranTrajectories.h \
+MSBatteryExport.cpp MSBatteryExport.h \
MSEmissionExport.cpp MSEmissionExport.h \
MSVTKExport.cpp MSVTKExport.h \
MSFullExport.cpp MSFullExport.h \
@@ -410,6 +411,7 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSAmitranTrajectories.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSBatteryExport.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSDetectorControl.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSE2Collector.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSE3Collector.Po at am__quote@
diff --git a/src/microsim/pedestrians/MSPModel.h b/src/microsim/pedestrians/MSPModel.h
index 9a15a11..92bd0bf 100644
--- a/src/microsim/pedestrians/MSPModel.h
+++ b/src/microsim/pedestrians/MSPModel.h
@@ -2,7 +2,7 @@
/// @file MSPModel.h
/// @author Jakob Erdmann
/// @date Mon, 13 Jan 2014
-/// @version $Id: MSPModel.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSPModel.h 18209 2015-04-16 11:17:10Z namdre $
///
// The pedestrian following model (prototype)
/****************************************************************************/
@@ -111,6 +111,9 @@ public:
/// @brief return the current speed of the person
virtual SUMOReal getSpeed(const MSPerson::MSPersonStage_Walking& stage) const = 0;
+
+ /// @brief return the list of internal edges if the pedestrian is on an intersection
+ virtual const MSEdge* getNextEdge(const MSPerson::MSPersonStage_Walking& stage) const = 0;
};
diff --git a/src/microsim/pedestrians/MSPModel_NonInteracting.cpp b/src/microsim/pedestrians/MSPModel_NonInteracting.cpp
index b53fa0d..b419307 100644
--- a/src/microsim/pedestrians/MSPModel_NonInteracting.cpp
+++ b/src/microsim/pedestrians/MSPModel_NonInteracting.cpp
@@ -2,7 +2,7 @@
/// @file MSPModel_NonInteracting.h
/// @author Jakob Erdmann
/// @date Mon, 13 Jan 2014
-/// @version $Id: MSPModel_NonInteracting.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSPModel_NonInteracting.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// The pedestrian following model (prototype)
/****************************************************************************/
@@ -172,4 +172,10 @@ MSPModel_NonInteracting::PState::getSpeed(const MSPerson::MSPersonStage_Walking&
return stage.getMaxSpeed();
}
+
+const MSEdge*
+MSPModel_NonInteracting::PState::getNextEdge(const MSPerson::MSPersonStage_Walking& stage) const {
+ return stage.getNextRouteEdge();
+}
+
/****************************************************************************/
diff --git a/src/microsim/pedestrians/MSPModel_NonInteracting.h b/src/microsim/pedestrians/MSPModel_NonInteracting.h
index 9765ca7..a877fcd 100644
--- a/src/microsim/pedestrians/MSPModel_NonInteracting.h
+++ b/src/microsim/pedestrians/MSPModel_NonInteracting.h
@@ -2,7 +2,7 @@
/// @file MSPModel_NonInteracting.h
/// @author Jakob Erdmann
/// @date Mon, 13 Jan 2014
-/// @version $Id: MSPModel_NonInteracting.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSPModel_NonInteracting.h 18209 2015-04-16 11:17:10Z namdre $
///
// The pedestrian following model (prototype)
/****************************************************************************/
@@ -94,6 +94,7 @@ private:
SUMOReal getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
SUMOReal getSpeed(const MSPerson::MSPersonStage_Walking& stage) const;
+ const MSEdge* getNextEdge(const MSPerson::MSPersonStage_Walking& stage) const;
/// @}
/// @brief compute walking time on edge and update state members
diff --git a/src/microsim/pedestrians/MSPModel_Striping.cpp b/src/microsim/pedestrians/MSPModel_Striping.cpp
index 3bd8061..f7c6144 100644
--- a/src/microsim/pedestrians/MSPModel_Striping.cpp
+++ b/src/microsim/pedestrians/MSPModel_Striping.cpp
@@ -2,7 +2,7 @@
/// @file MSPModel_Striping.h
/// @author Jakob Erdmann
/// @date Mon, 13 Jan 2014
-/// @version $Id: MSPModel_Striping.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSPModel_Striping.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// The pedestrian following model (prototype)
/****************************************************************************/
@@ -117,7 +117,7 @@ MSPModel_Striping::~MSPModel_Striping() {
PedestrianState*
MSPModel_Striping::add(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, SUMOTime) {
- assert(person->getCurrentStageType() == MSPerson::WALKING);
+ assert(person->getCurrentStageType() == MSTransportable::MOVING_WITHOUT_VEHICLE);
const MSLane* lane = getSidewalk(person->getEdge());
PState* ped = new PState(person, stage, lane);
myActiveLanes[lane].push_back(ped);
@@ -345,7 +345,8 @@ MSPModel_Striping::getNextLane(const PState& ped, const MSLane* currentLane, con
std::cout << " next walkingArea " << (nextDir == FORWARD ? "forward" : "backward") << "\n";
}
} else {
- nextDir = junction == nextRouteEdge->getFromJunction() ? FORWARD : BACKWARD;
+ // walk forward by default
+ nextDir = junction == nextRouteEdge->getToJunction() ? BACKWARD : FORWARD;
// try to use a direct link as fallback
// direct links only exist if built explicitly. They are used to model tl-controlled links if there are no crossings
if (ped.myDir == FORWARD) {
@@ -482,6 +483,7 @@ MSPModel_Striping::getNextLaneObstacles(NextLanesObstacles& nextLanesObs, const
}
Pedestrians& pedestrians = getPedestrians(nextLane);
if (nextLane->getEdge().isWalkingArea()) {
+ const SUMOReal minY = stripeWidth * - 0.5 + NUMERICAL_EPS;
const SUMOReal maxY = stripeWidth * (stripes - 0.5) - NUMERICAL_EPS;
// complex transformation into the coordinate system of the current lane
// (pedestrians on next lane may walk at arbitrary angles relative to the current lane)
@@ -492,7 +494,7 @@ MSPModel_Striping::getNextLaneObstacles(NextLanesObstacles& nextLanesObs, const
PState& p = *pedestrians[ii];
Position relPos = lane->getShape().transformToVectorCoordinates(p.getPosition(*p.myStage, -1), true);
const SUMOReal newY = relPos.y() + lateral_offset;
- if (newY >= 0 && newY <= maxY) {
+ if (newY >= minY && newY <= maxY) {
addCloserObstacle(obs, relPos.x(), p.stripe(newY), p.myPerson->getID(), stripes, currentDir);
addCloserObstacle(obs, relPos.x(), p.otherStripe(newY), p.myPerson->getID(), stripes, currentDir);
}
@@ -554,6 +556,8 @@ MSPModel_Striping::moveInDirection(SUMOTime currentTime, std::set<MSPerson*>& ch
//std::cout << SIMTIME << ">>> lane=" << lane->getID() << " numPeds=" << pedestrians.size() << "\n";
if (lane->getEdge().isWalkingArea()) {
const SUMOReal lateral_offset = (lane->getWidth() - stripeWidth) * 0.5;
+ const SUMOReal minY = stripeWidth * - 0.5 + NUMERICAL_EPS;
+ const SUMOReal maxY = stripeWidth * (numStripes(lane) - 0.5) - NUMERICAL_EPS;
const WalkingAreaPath* debugPath = 0;
// need to handle each walkingAreaPath seperately and transform
// coordinates beforehand
@@ -585,8 +589,7 @@ MSPModel_Striping::moveInDirection(SUMOTime currentTime, std::set<MSPerson*>& ch
} else {
const Position relPos = path->shape.transformToVectorCoordinates(p->getPosition(*p->myStage, -1));
const SUMOReal newY = relPos.y() + lateral_offset;
- if (relPos != Position::INVALID &&
- newY >= 0 && newY <= lane->getWidth()) {
+ if (relPos != Position::INVALID && newY >= minY && newY <= maxY) {
PState* tp = new PState(*p);
tp->myRelX = relPos.x();
tp->myRelY = newY;
@@ -621,8 +624,11 @@ MSPModel_Striping::moveInDirection(SUMOTime currentTime, std::set<MSPerson*>& ch
PState* p = *it;
if (p->myDir != dir) {
++it;
- } else if (p->moveToNextLane(currentTime)) {
+ } else if (p->distToLaneEnd() < 0) {
+ // moveToNextLane may trigger re-insertion (for consecutive
+ // walks) so erase must be called first
it = pedestrians.erase(it);
+ p->moveToNextLane(currentTime);
if (p->myLane != 0) {
changedLane.insert(p->myPerson);
myActiveLanes[p->myLane].push_back(p);
@@ -808,7 +814,7 @@ MSPModel_Striping::PState::getLength() const {
int
MSPModel_Striping::PState::stripe(SUMOReal relY) const {
const int max = numStripes(myLane) - 1;
- return MIN2(MAX2(0, (int)floor((relY + 0.5 * stripeWidth) / stripeWidth)), max);
+ return MIN2(MAX2(0, (int)floor(relY / stripeWidth + 0.5)), max);
}
@@ -865,9 +871,8 @@ MSPModel_Striping::PState::moveToNextLane(SUMOTime currentTime) {
//if (ped.myPerson->getID() == DEBUG1) {
// std::cout << SIMTIME << " addToLane x=" << ped.myRelX << " newDir=" << newDir << " newLane=" << newLane->getID() << " walkingAreaShape=" << walkingAreaShape << "\n";
//}
- //std::cout << " changing to " << newLane->getID() << " myRelY=" << ped.myRelY << " oldStripes=" << oldStripes << " newStripes=" << numStripes(newLane);
+ //std::cout << " changing to " << newLane->getID() << " myRelY=" << ped.myRelY << " oldStripes=" << numStripes(myLane) << " newStripes=" << numStripes(newLane);
//std::cout << " newY=" << ped.myRelY << " myDir=" << ped.myDir << " newDir=" << newDir;
- const int oldStripes = numStripes(myLane);
const int oldDir = myDir;
const MSLane* oldLane = myLane;
myLane = myNLI.lane;
@@ -927,7 +932,7 @@ MSPModel_Striping::PState::moveToNextLane(SUMOTime currentTime) {
myRelY = (numStripes(oldLane) - 1) * stripeWidth - myRelY;
}
// adjust to differences in sidewalk width
- myRelY += 0.5 * stripeWidth * (numStripes(myLane) - oldStripes);
+ myRelY += 0.5 * (myLane->getWidth() - oldLane->getWidth());
}
return true;
} else {
@@ -942,21 +947,20 @@ MSPModel_Striping::PState::walk(const Obstacles& obs, SUMOTime currentTime) {
const int sMax = stripes - 1;
assert(stripes == numStripes(myLane));
const SUMOReal vMax = myStage->getMaxSpeed();
- // ultimate goal is to chose the prefered stripe (chosen)
+ // ultimate goal is to choose the prefered stripe (chosen)
const int current = stripe();
const int other = otherStripe();
int chosen = current;
// compute utility for all stripes
- std::vector<SUMOReal> utility(stripes, 0);
-
+ std::vector<SUMOReal> utility(stripes);
// penalize lateral movement (may increase jamming)
for (int i = 0; i < stripes; ++i) {
- utility[i] += abs(i - current) * LATERAL_PENALTY;
+ utility[i] = abs(i - current) * LATERAL_PENALTY;
}
// compute distances
std::vector<SUMOReal> distance(stripes);
for (int i = 0; i < stripes; ++i) {
- distance[i] += myDir * (obs[i].x - myRelX);
+ distance[i] = myDir * (obs[i].x - myRelX);
}
// forbid stripes which are blocked and also all stripes behind them
for (int i = 0; i < stripes; ++i) {
@@ -1072,8 +1076,8 @@ MSPModel_Striping::PState::walk(const Obstacles& obs, SUMOTime currentTime) {
const SUMOReal yDist = (chosen * stripeWidth) - myRelY;
if (fabs(yDist) > NUMERICAL_EPS) {
ySpeed = (yDist > 0 ?
- MIN2(maxYSpeed, yDist) :
- MAX2(-maxYSpeed, yDist));
+ MIN2(maxYSpeed, DIST2SPEED(yDist)) :
+ MAX2(-maxYSpeed, DIST2SPEED(yDist)));
}
// DEBUG
if DEBUGCOND(myPerson->getID()) {
@@ -1168,6 +1172,13 @@ MSPModel_Striping::PState::getSpeed(const MSPerson::MSPersonStage_Walking&) cons
return mySpeed;
}
+
+const MSEdge*
+MSPModel_Striping::PState::getNextEdge(const MSPerson::MSPersonStage_Walking&) const {
+ return myNLI.lane == 0 ? 0 : &myNLI.lane->getEdge();
+}
+
+
// ===========================================================================
// MSPModel_Striping::MovePedestrians method definitions
// ===========================================================================
diff --git a/src/microsim/pedestrians/MSPModel_Striping.h b/src/microsim/pedestrians/MSPModel_Striping.h
index 6705548..2721074 100644
--- a/src/microsim/pedestrians/MSPModel_Striping.h
+++ b/src/microsim/pedestrians/MSPModel_Striping.h
@@ -2,7 +2,7 @@
/// @file MSPModel_Striping.h
/// @author Jakob Erdmann
/// @date Mon, 13 Jan 2014
-/// @version $Id: MSPModel_Striping.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSPModel_Striping.h 18209 2015-04-16 11:17:10Z namdre $
///
// The pedestrian following model (prototype)
/****************************************************************************/
@@ -216,6 +216,7 @@ protected:
SUMOReal getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const;
SUMOReal getSpeed(const MSPerson::MSPersonStage_Walking& stage) const;
+ const MSEdge* getNextEdge(const MSPerson::MSPersonStage_Walking& stage) const;
/// @}
PState(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, const MSLane* lane);
diff --git a/src/microsim/pedestrians/MSPerson.cpp b/src/microsim/pedestrians/MSPerson.cpp
index f78bb4b..a27cdaa 100644
--- a/src/microsim/pedestrians/MSPerson.cpp
+++ b/src/microsim/pedestrians/MSPerson.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Mon, 9 Jul 2001
-/// @version $Id: MSPerson.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: MSPerson.cpp 18274 2015-04-22 15:00:44Z behrisch $
///
// The class for modelling person-movements
/****************************************************************************/
@@ -36,6 +36,7 @@
#include <utils/iodevices/OutputDevice.h>
#include <utils/options/OptionsCont.h>
#include <utils/common/ToString.h>
+#include <utils/common/StringUtils.h>
#include <microsim/MSNet.h>
#include <microsim/MSEdge.h>
#include <microsim/MSLane.h>
@@ -49,78 +50,17 @@
#include <foreign/nvwa/debug_new.h>
#endif // CHECK_MEMORY_LEAKS
-/* -------------------------------------------------------------------------
- * static member definitions
- * ----------------------------------------------------------------------- */
-
// ===========================================================================
// method definitions
// ===========================================================================
/* -------------------------------------------------------------------------
- * MSPerson::MSPersonStage - methods
- * ----------------------------------------------------------------------- */
-MSPerson::MSPersonStage::MSPersonStage(const MSEdge& destination, StageType type)
- : myDestination(destination), myDeparted(-1), myArrived(-1), myType(type) {}
-
-
-MSPerson::MSPersonStage::~MSPersonStage() {}
-
-
-const MSEdge&
-MSPerson::MSPersonStage::getDestination() const {
- return myDestination;
-}
-
-
-void
-MSPerson::MSPersonStage::setDeparted(SUMOTime now) {
- if (myDeparted < 0) {
- myDeparted = now;
- }
-}
-
-
-void
-MSPerson::MSPersonStage::setArrived(SUMOTime now) {
- myArrived = now;
-}
-
-
-bool
-MSPerson::MSPersonStage::isWaitingFor(const std::string& /*line*/) const {
- return false;
-}
-
-
-Position
-MSPerson::MSPersonStage::getEdgePosition(const MSEdge* e, SUMOReal at, SUMOReal offset) const {
- return getLanePosition(e->getLanes()[0], at, offset);
-}
-
-
-Position
-MSPerson::MSPersonStage::getLanePosition(const MSLane* lane, SUMOReal at, SUMOReal offset) const {
- return lane->getShape().positionAtOffset(lane->interpolateLanePosToGeometryPos(at), offset);
-}
-
-
-SUMOReal
-MSPerson::MSPersonStage::getEdgeAngle(const MSEdge* e, SUMOReal at) const {
- // @todo: well, definitely not the nicest way... Should be precomputed
- PositionVector shp = e->getLanes()[0]->getShape();
- return -shp.rotationDegreeAtOffset(at);
-}
-
-
-
-/* -------------------------------------------------------------------------
* MSPerson::MSPersonStage_Walking - methods
* ----------------------------------------------------------------------- */
MSPerson::MSPersonStage_Walking::MSPersonStage_Walking(const ConstMSEdgeVector& route,
- MSBusStop* toBS,
+ MSStoppingPlace* toBS,
SUMOTime walkingTime, SUMOReal speed,
SUMOReal departPos, SUMOReal arrivalPos) :
- MSPersonStage(*route.back(), WALKING), myWalkingTime(walkingTime), myRoute(route),
+ MSTransportable::Stage(*route.back(), MOVING_WITHOUT_VEHICLE), myWalkingTime(walkingTime), myRoute(route),
myCurrentInternalEdge(0),
myDepartPos(departPos), myArrivalPos(arrivalPos), myDestinationBusStop(toBS),
mySpeed(speed),
@@ -186,7 +126,7 @@ MSPerson::MSPersonStage_Walking::getSpeed() const {
void
-MSPerson::MSPersonStage_Walking::proceed(MSNet* net, MSPerson* person, SUMOTime now,
+MSPerson::MSPersonStage_Walking::proceed(MSNet* net, MSTransportable* person, SUMOTime now,
MSEdge* previousEdge, const SUMOReal at) {
previousEdge->removePerson(person);
myRouteStep = myRoute.begin();
@@ -203,8 +143,8 @@ MSPerson::MSPersonStage_Walking::proceed(MSNet* net, MSPerson* person, SUMOTime
mySpeed = computeAverageSpeed();
}
}
- myPedestrianState = MSPModel::getModel()->add(person, this, now);
- ((MSEdge*) *myRouteStep)->addPerson(person);
+ myPedestrianState = MSPModel::getModel()->add(dynamic_cast<MSPerson*>(person), this, now);
+ (*myRouteStep)->addPerson(person);
}
@@ -239,14 +179,14 @@ MSPerson::MSPersonStage_Walking::routeOutput(OutputDevice& os) const {
void
-MSPerson::MSPersonStage_Walking::beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const {
+MSPerson::MSPersonStage_Walking::beginEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const {
os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "departure")
.writeAttr("agent", p.getID()).writeAttr("link", myRoute.front()->getID()).closeTag();
}
void
-MSPerson::MSPersonStage_Walking::endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const {
+MSPerson::MSPersonStage_Walking::endEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const {
os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival")
.writeAttr("agent", p.getID()).writeAttr("link", myRoute.back()->getID()).closeTag();
}
@@ -259,7 +199,7 @@ MSPerson::MSPersonStage_Walking::moveToNextEdge(MSPerson* person, SUMOTime curre
if (myRouteStep == myRoute.end() - 1) {
MSNet::getInstance()->getPersonControl().unsetWalking(person);
if (myDestinationBusStop != 0) {
- myDestinationBusStop->addPerson(person);
+ myDestinationBusStop->addTransportable(person);
}
if (!person->proceed(MSNet::getInstance(), currentTime)) {
MSNet::getInstance()->getPersonControl().erase(person);
@@ -284,8 +224,8 @@ MSPerson::MSPersonStage_Walking::moveToNextEdge(MSPerson* person, SUMOTime curre
* MSPerson::MSPersonStage_Driving - methods
* ----------------------------------------------------------------------- */
MSPerson::MSPersonStage_Driving::MSPersonStage_Driving(const MSEdge& destination,
- MSBusStop* toBS, const std::vector<std::string>& lines)
- : MSPersonStage(destination, DRIVING), myLines(lines.begin(), lines.end()),
+ MSStoppingPlace* toBS, const std::vector<std::string>& lines)
+ : MSTransportable::Stage(destination, DRIVING), myLines(lines.begin(), lines.end()),
myVehicle(0), myDestinationBusStop(toBS) {}
@@ -343,7 +283,7 @@ MSPerson::MSPersonStage_Driving::getAngle(SUMOTime /* now */) const {
void
-MSPerson::MSPersonStage_Driving::proceed(MSNet* net, MSPerson* person, SUMOTime now,
+MSPerson::MSPersonStage_Driving::proceed(MSNet* net, MSTransportable* person, SUMOTime now,
MSEdge* previousEdge, const SUMOReal at) {
myWaitingEdge = previousEdge;
myWaitingPos = at;
@@ -407,13 +347,13 @@ MSPerson::MSPersonStage_Driving::routeOutput(OutputDevice& os) const {
void
-MSPerson::MSPersonStage_Driving::beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const {
+MSPerson::MSPersonStage_Driving::beginEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const {
os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival").writeAttr("agent", p.getID()).writeAttr("link", getEdge()->getID()).closeTag();
}
void
-MSPerson::MSPersonStage_Driving::endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const {
+MSPerson::MSPersonStage_Driving::endEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const {
os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival").writeAttr("agent", p.getID()).writeAttr("link", getEdge()->getID()).closeTag();
}
@@ -424,7 +364,7 @@ MSPerson::MSPersonStage_Driving::endEventOutput(const MSPerson& p, SUMOTime t, O
* ----------------------------------------------------------------------- */
MSPerson::MSPersonStage_Waiting::MSPersonStage_Waiting(const MSEdge& destination,
SUMOTime duration, SUMOTime until, SUMOReal pos, const std::string& actType) :
- MSPersonStage(destination, WAITING),
+ MSTransportable::Stage(destination, WAITING),
myWaitingDuration(duration),
myWaitingUntil(until),
myActType(actType),
@@ -474,7 +414,7 @@ MSPerson::MSPersonStage_Waiting::getAngle(SUMOTime /* now */) const {
void
-MSPerson::MSPersonStage_Waiting::proceed(MSNet* net, MSPerson* person, SUMOTime now,
+MSPerson::MSPersonStage_Waiting::proceed(MSNet* net, MSTransportable* person, SUMOTime now,
MSEdge* previousEdge, const SUMOReal /* at */) {
previousEdge->addPerson(person);
myWaitingStart = now;
@@ -503,14 +443,14 @@ MSPerson::MSPersonStage_Waiting::routeOutput(OutputDevice& os) const {
void
-MSPerson::MSPersonStage_Waiting::beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const {
+MSPerson::MSPersonStage_Waiting::beginEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const {
os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "actstart " + myActType)
.writeAttr("agent", p.getID()).writeAttr("link", getEdge()->getID()).closeTag();
}
void
-MSPerson::MSPersonStage_Waiting::endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const {
+MSPerson::MSPersonStage_Waiting::endEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const {
os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "actend " + myActType).writeAttr("agent", p.getID())
.writeAttr("link", getEdge()->getID()).closeTag();
}
@@ -533,24 +473,12 @@ MSPerson::MSPersonStage_Waiting::getSpeed() const {
/* -------------------------------------------------------------------------
* MSPerson - methods
* ----------------------------------------------------------------------- */
-MSPerson::MSPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPersonPlan* plan)
- : myParameter(pars), myVType(vtype), myPlan(plan) {
- myStep = myPlan->begin();
+MSPerson::MSPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan)
+ : MSTransportable(pars, vtype, plan) {
}
MSPerson::~MSPerson() {
- for (MSPersonPlan::const_iterator i = myPlan->begin(); i != myPlan->end(); ++i) {
- delete *i;
- }
- delete myPlan;
- delete myParameter;
-}
-
-
-const std::string&
-MSPerson::getID() const {
- return myParameter->id;
}
@@ -581,29 +509,9 @@ MSPerson::proceed(MSNet* net, SUMOTime time) {
}
-SUMOTime
-MSPerson::getDesiredDepart() const {
- return myParameter->depart;
-}
-
-
-void
-MSPerson::setDeparted(SUMOTime now) {
- (*myStep)->setDeparted(now);
-}
-
-
-void
-MSPerson::tripInfoOutput(OutputDevice& os) const {
- for (MSPersonPlan::const_iterator i = myPlan->begin(); i != myPlan->end(); ++i) {
- (*i)->tripInfoOutput(os);
- }
-}
-
-
void
MSPerson::routeOutput(OutputDevice& os) const {
- MSPersonPlan::const_iterator i = myPlan->begin();
+ MSTransportable::MSTransportablePlan::const_iterator i = myPlan->begin();
if ((*i)->getStageType() == WAITING && getDesiredDepart() == static_cast<MSPersonStage_Waiting*>(*i)->getUntil()) {
++i;
}
@@ -612,31 +520,17 @@ MSPerson::routeOutput(OutputDevice& os) const {
}
}
-SUMOReal
-MSPerson::getEdgePos() const {
- return (*myStep)->getEdgePos(MSNet::getInstance()->getCurrentTimeStep());
-}
-
-Position
-MSPerson::getPosition() const {
- return (*myStep)->getPosition(MSNet::getInstance()->getCurrentTimeStep());
-}
-
-
-SUMOReal
-MSPerson::getAngle() const {
- return (*myStep)->getAngle(MSNet::getInstance()->getCurrentTimeStep());
-}
-
-SUMOReal
-MSPerson::getWaitingSeconds() const {
- return STEPS2TIME((*myStep)->getWaitingTime(MSNet::getInstance()->getCurrentTimeStep()));
-}
-
-SUMOReal
-MSPerson::getSpeed() const {
- return (*myStep)->getSpeed();
+const std::string&
+MSPerson::getNextEdge() const {
+ if (getCurrentStageType() == MOVING_WITHOUT_VEHICLE) {
+ MSPersonStage_Walking* walkingStage = dynamic_cast<MSPersonStage_Walking*>(*myStep);
+ assert(walkingStage != 0);
+ const MSEdge* nextEdge = walkingStage->getPedestrianState()->getNextEdge(*walkingStage);
+ if (nextEdge != 0) {
+ return nextEdge->getID();
+ }
+ }
+ return StringUtils::emptyString;
}
-
/****************************************************************************/
diff --git a/src/microsim/pedestrians/MSPerson.h b/src/microsim/pedestrians/MSPerson.h
index fe25ae3..3a54e73 100644
--- a/src/microsim/pedestrians/MSPerson.h
+++ b/src/microsim/pedestrians/MSPerson.h
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Mon, 9 Jul 2001
-/// @version $Id: MSPerson.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSPerson.h 18756 2015-08-31 19:16:33Z behrisch $
///
// The class for modelling person-movements
/****************************************************************************/
@@ -40,6 +40,7 @@
#include <utils/common/Command.h>
#include <utils/geom/Position.h>
#include <utils/geom/PositionVector.h>
+#include <microsim/MSTransportable.h>
// ===========================================================================
@@ -50,7 +51,7 @@ class MSEdge;
class MSLane;
class OutputDevice;
class SUMOVehicleParameter;
-class MSBusStop;
+class MSStoppingPlace;
class SUMOVehicle;
class MSVehicleType;
class MSPModel;
@@ -66,143 +67,26 @@ typedef std::vector<const MSEdge*> ConstMSEdgeVector;
*
* The class holds a simulated person together with her movement stages
*/
-class MSPerson {
+class MSPerson : public MSTransportable {
public:
- enum StageType {
- WALKING = 0,
- DRIVING = 1,
- WAITING = 2
- };
-
-
- /**
- * The "abstract" class for a single stage of a persons movement
- * Contains the destination of the current movement step
- */
- class MSPersonStage {
- public:
- /// constructor
- MSPersonStage(const MSEdge& destination, StageType type);
-
- /// destructor
- virtual ~MSPersonStage();
-
- /// returns the destination edge
- const MSEdge& getDestination() const;
-
- /// Returns the current edge
- virtual const MSEdge* getEdge() const = 0;
- virtual const MSEdge* getFromEdge() const = 0;
- virtual SUMOReal getEdgePos(SUMOTime now) const = 0;
-
- ///
- virtual Position getPosition(SUMOTime now) const = 0;
- virtual SUMOReal getAngle(SUMOTime now) const = 0;
-
- ///
- StageType getStageType() const {
- return myType;
- }
-
- /// @brief return string representation of the current stage
- virtual std::string getStageDescription() const = 0;
-
- /// proceeds to the next step
- virtual void proceed(MSNet* net, MSPerson* person, SUMOTime now, MSEdge* previousEdge, const SUMOReal at) = 0;
-
- /// logs end of the step
- void setDeparted(SUMOTime now);
-
- /// logs end of the step
- void setArrived(SUMOTime now);
-
- /// Whether the person waits for a vehicle of the line specified.
- virtual bool isWaitingFor(const std::string& line) const;
-
- /// @brief Whether the person waits for a vehicle
- virtual bool isWaiting4Vehicle() const {
- return false;
- }
-
- /// @brief the time this person spent waiting
- virtual SUMOTime getWaitingTime(SUMOTime now) const = 0;
-
- /// @brief the time this person spent waiting
- virtual SUMOReal getSpeed() const = 0;
-
- /// @brief get position on edge e at length at with orthogonal offset
- Position getEdgePosition(const MSEdge* e, SUMOReal at, SUMOReal offset) const;
-
- /// @brief get position on lane at length at with orthogonal offset
- Position getLanePosition(const MSLane* lane, SUMOReal at, SUMOReal offset) const;
-
- SUMOReal getEdgeAngle(const MSEdge* e, SUMOReal at) const;
-
- /** @brief Called on writing tripinfo output
- * @param[in] os The stream to write the information into
- * @exception IOError not yet implemented
- */
- virtual void tripInfoOutput(OutputDevice& os) const = 0;
-
- /** @brief Called on writing vehroute output
- * @param[in] os The stream to write the information into
- * @exception IOError not yet implemented
- */
- virtual void routeOutput(OutputDevice& os) const = 0;
-
- /** @brief Called for writing the events output (begin of an action)
- * @param[in] os The stream to write the information into
- * @exception IOError not yet implemented
- */
- virtual void beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const = 0;
-
- /** @brief Called for writing the events output (end of an action)
- * @param[in] os The stream to write the information into
- * @exception IOError not yet implemented
- */
- virtual void endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const = 0;
-
-
- protected:
- /// the next edge to reach (either by walking or driving)
- const MSEdge& myDestination;
-
- /// the time at which this stage started
- SUMOTime myDeparted;
-
- /// the time at which this stage ended
- SUMOTime myArrived;
-
- /// The type of this stage
- StageType myType;
-
- private:
- /// @brief Invalidated copy constructor.
- MSPersonStage(const MSPersonStage&);
-
- /// @brief Invalidated assignment operator.
- MSPersonStage& operator=(const MSPersonStage&);
-
- };
-
/**
* A "real" stage performing the walking to an edge
* The walking does not need any route as it is not simulated.
* Only the duration is needed
*/
- class MSPersonStage_Walking : public MSPersonStage {
+ class MSPersonStage_Walking : public MSTransportable::Stage {
friend class MSPModel;
friend class GUIPerson; // debugging
public:
/// constructor
- MSPersonStage_Walking(const ConstMSEdgeVector& route, MSBusStop* toBS, SUMOTime walkingTime, SUMOReal speed, SUMOReal departPos, SUMOReal arrivalPos);
+ MSPersonStage_Walking(const ConstMSEdgeVector& route, MSStoppingPlace* toBS, SUMOTime walkingTime, SUMOReal speed, SUMOReal departPos, SUMOReal arrivalPos);
/// destructor
~MSPersonStage_Walking();
/// proceeds to the next step
- virtual void proceed(MSNet* net, MSPerson* person, SUMOTime now, MSEdge* previousEdge, const SUMOReal at);
+ virtual void proceed(MSNet* net, MSTransportable* person, SUMOTime now, MSEdge* previousEdge, const SUMOReal at);
/// Returns the current edge
const MSEdge* getEdge() const;
@@ -238,13 +122,13 @@ public:
* @param[in] os The stream to write the information into
* @exception IOError not yet implemented
*/
- virtual void beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const;
+ virtual void beginEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
/** @brief Called for writing the events output (end of an action)
* @param[in] os The stream to write the information into
* @exception IOError not yet implemented
*/
- virtual void endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const;
+ virtual void endEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
/// @brief move forward and return whether the person arrived
bool moveToNextEdge(MSPerson* person, SUMOTime currentTime, MSEdge* nextInternal = 0);
@@ -303,7 +187,7 @@ public:
SUMOReal myDepartPos;
SUMOReal myArrivalPos;
- MSBusStop* myDestinationBusStop;
+ MSStoppingPlace* myDestinationBusStop;
SUMOReal mySpeed;
/// @brief state that is to be manipulated by MSPModel
@@ -337,17 +221,17 @@ public:
* A "real" stage performing the travelling by a transport system
* The given route will be chosen. The travel time is computed by the simulation
*/
- class MSPersonStage_Driving : public MSPersonStage {
+ class MSPersonStage_Driving : public MSTransportable::Stage {
public:
/// constructor
- MSPersonStage_Driving(const MSEdge& destination, MSBusStop* toBS,
+ MSPersonStage_Driving(const MSEdge& destination, MSStoppingPlace* toBS,
const std::vector<std::string>& lines);
/// destructor
~MSPersonStage_Driving();
/// proceeds to the next step
- virtual void proceed(MSNet* net, MSPerson* person, SUMOTime now, MSEdge* previousEdge, const SUMOReal at);
+ virtual void proceed(MSNet* net, MSTransportable* person, SUMOTime now, MSEdge* previousEdge, const SUMOReal at);
/// Returns the current edge
const MSEdge* getEdge() const;
@@ -394,13 +278,13 @@ public:
* @param[in] os The stream to write the information into
* @exception IOError not yet implemented
*/
- virtual void beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const;
+ virtual void beginEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
/** @brief Called for writing the events output (end of an action)
* @param[in] os The stream to write the information into
* @exception IOError not yet implemented
*/
- virtual void endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const;
+ virtual void endEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
private:
/// the lines to choose from
@@ -409,7 +293,7 @@ public:
/// @brief The taken vehicle
SUMOVehicle* myVehicle;
- MSBusStop* myDestinationBusStop;
+ MSStoppingPlace* myDestinationBusStop;
SUMOReal myWaitingPos;
/// @brief The time since which this person is waiting for a ride
SUMOTime myWaitingSince;
@@ -427,7 +311,7 @@ public:
/**
* A "real" stage performing a waiting over the specified time
*/
- class MSPersonStage_Waiting : public MSPersonStage {
+ class MSPersonStage_Waiting : public MSTransportable::Stage {
public:
/// constructor
MSPersonStage_Waiting(const MSEdge& destination,
@@ -456,7 +340,7 @@ public:
}
/// proceeds to the next step
- virtual void proceed(MSNet* net, MSPerson* person, SUMOTime now, MSEdge* previousEdge, const SUMOReal at);
+ virtual void proceed(MSNet* net, MSTransportable* person, SUMOTime now, MSEdge* previousEdge, const SUMOReal at);
/** @brief Called on writing tripinfo output
*
@@ -476,13 +360,13 @@ public:
* @param[in] os The stream to write the information into
* @exception IOError not yet implemented
*/
- virtual void beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const;
+ virtual void beginEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
/** @brief Called for writing the events output (end of an action)
* @param[in] os The stream to write the information into
* @exception IOError not yet implemented
*/
- virtual void endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const;
+ virtual void endEventOutput(const MSTransportable& p, SUMOTime t, OutputDevice& os) const;
private:
/// the time the person is waiting
@@ -510,80 +394,16 @@ public:
};
public:
- /// the structure holding the plan of a person
- typedef std::vector<MSPersonStage*> MSPersonPlan;
-
-public:
/// constructor
- MSPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPersonPlan* plan);
+ MSPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan);
/// destructor
virtual ~MSPerson();
- /// returns the person id
- const std::string& getID() const;
-
/* @brief proceeds to the next step of the route,
* @return Whether the persons plan continues */
bool proceed(MSNet* net, SUMOTime time);
- /// Returns the desired departure time.
- SUMOTime getDesiredDepart() const;
-
- /// logs end of the step
- void setDeparted(SUMOTime now);
-
- /// Returns the current destination.
- const MSEdge& getDestination() const {
- return (*myStep)->getDestination();
- }
-
- /// @brief Returns the current edge
- const MSEdge* getEdge() const {
- return (*myStep)->getEdge();
- }
-
- /// @brief Returns the departure edge
- const MSEdge* getFromEdge() const {
- return (*myStep)->getFromEdge();
- }
-
- /// @brief return the offset from the start of the current edge
- virtual SUMOReal getEdgePos() const;
-
- /// @brief return the Network coordinate of the person
- virtual Position getPosition() const;
-
- /// @brief return the current angle of the person
- virtual SUMOReal getAngle() const;
-
- /// @brief the time this person spent waiting in seconds
- virtual SUMOReal getWaitingSeconds() const;
-
- /// @brief the current speed of the person
- virtual SUMOReal getSpeed() const;
-
- ///
- StageType getCurrentStageType() const {
- return (*myStep)->getStageType();
- }
-
-
- std::string getCurrentStageDescription() const {
- return (*myStep)->getStageDescription();
- }
-
- MSPersonStage* getCurrentStage() const {
- return *myStep;
- }
-
- /** @brief Called on writing tripinfo output
- *
- * @param[in] os The stream to write the information into
- * @exception IOError not yet implemented
- */
- void tripInfoOutput(OutputDevice& os) const;
-
/** @brief Called on writing vehroute output
*
* @param[in] os The stream to write the information into
@@ -591,43 +411,8 @@ public:
*/
void routeOutput(OutputDevice& os) const;
- /// Whether the person waits for a vehicle of the line specified.
- bool isWaitingFor(const std::string& line) const {
- return (*myStep)->isWaitingFor(line);
- }
-
- /// Whether the person waits for a vehicle
- bool isWaiting4Vehicle() const {
- return (*myStep)->isWaiting4Vehicle();
- }
-
-
- const SUMOVehicleParameter& getParameter() const {
- return *myParameter;
- }
-
-
- inline const MSVehicleType& getVehicleType() const {
- return *myVType;
- }
-
-
-protected:
- /// the plan of the person
- const SUMOVehicleParameter* myParameter;
-
- /// @brief This Persons's type. (mainly used for drawing related information
- const MSVehicleType* myVType;
-
- /// the plan of the person
- MSPersonPlan* myPlan;
-
- /// the iterator over the route
- MSPersonPlan::iterator myStep;
-
- /// @brief Whether events shall be written
- bool myWriteEvents;
-
+ /// @brief return the list of internal edges if this person is walking and the pedestrian model allows it
+ const std::string& getNextEdge() const;
private:
/// @brief Invalidated copy constructor.
diff --git a/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp b/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp
index 2957649..b985821 100644
--- a/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp
+++ b/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Sept 2002
-/// @version $Id: MSActuatedTrafficLightLogic.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSActuatedTrafficLightLogic.cpp 18213 2015-04-16 11:55:42Z behrisch $
///
// An actuated (adaptive) traffic light logic
/****************************************************************************/
@@ -153,7 +153,7 @@ MSActuatedTrafficLightLogic::duration(const SUMOReal detectionGap) const {
// ensure that minimum duration is kept
SUMOTime newDuration = getCurrentPhaseDef().minDuration - actDuration;
// try to let the last detected vehicle pass the intersection (duration must be positive)
- newDuration = MAX3(newDuration, TIME2STEPS(myDetectorGap - detectionGap), 1);
+ newDuration = MAX3(newDuration, TIME2STEPS(myDetectorGap - detectionGap), SUMOTime(1));
// cut the decimal places to ensure that phases always have integer duration
if (newDuration % 1000 != 0) {
const SUMOTime totalDur = newDuration + actDuration;
diff --git a/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp b/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp
index dcb9543..2fa70d4 100644
--- a/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp
+++ b/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Friedemann Wesner
/// @date Sept 2002
-/// @version $Id: MSSimpleTrafficLightLogic.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSSimpleTrafficLightLogic.cpp 18213 2015-04-16 11:55:42Z behrisch $
///
// A fixed traffic light logic
/****************************************************************************/
@@ -160,7 +160,7 @@ MSSimpleTrafficLightLogic::getOffsetFromIndex(unsigned int index) const {
if (index == 0) {
return 0;
}
- unsigned int pos = 0;
+ SUMOTime pos = 0;
for (unsigned int i = 0; i < index; i++) {
pos += getPhase(i).duration;
}
diff --git a/src/microsim/traffic_lights/MSTLLogicControl.cpp b/src/microsim/traffic_lights/MSTLLogicControl.cpp
index 7099ad3..a237ae1 100644
--- a/src/microsim/traffic_lights/MSTLLogicControl.cpp
+++ b/src/microsim/traffic_lights/MSTLLogicControl.cpp
@@ -8,7 +8,7 @@
/// @author Michael Behrisch
/// @author Sascha Krieg
/// @date Sept 2002
-/// @version $Id: MSTLLogicControl.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSTLLogicControl.cpp 18213 2015-04-16 11:55:42Z behrisch $
///
// A class that stores and controls tls and switching of their programs
/****************************************************************************/
@@ -348,7 +348,7 @@ MSTLLogicControl::WAUTSwitchProcedure_GSP::adaptLogic(SUMOTime step) {
} else {
deltaToStretch = (cycleTimeTo - currentPosTo + gspTo);
}
- unsigned int newdur = (unsigned int) myTo->getPhase(stepTo).duration - diff + deltaToStretch;
+ const SUMOTime newdur = myTo->getPhase(stepTo).duration - diff + deltaToStretch;
myTo->changeStepAndDuration(myControl, step, stepTo, newdur);
}
@@ -424,8 +424,8 @@ MSTLLogicControl::WAUTSwitchProcedure_Stretch::cutLogic(SUMOTime step, SUMOTime
SUMOTime toCut = 0;
for (int i = 0; i < areasNo; i++) {
StretchBereichDef def = getStretchBereichDef(myTo, i + 1);
- SUMOTime begin = TIME2STEPS(def.begin);
- unsigned int end = TIME2STEPS(def.end);
+ const SUMOTime begin = TIME2STEPS(def.begin);
+ const SUMOTime end = TIME2STEPS(def.end);
size_t stepOfBegin = myTo->getIndexFromOffset(begin);
if (stepOfBegin == actStep) {
if (begin < startPos) {
diff --git a/src/microsim/trigger/MSBusStop.cpp b/src/microsim/trigger/MSBusStop.cpp
deleted file mode 100644
index f365452..0000000
--- a/src/microsim/trigger/MSBusStop.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************/
-/// @file MSBusStop.cpp
-/// @author Daniel Krajzewicz
-/// @author Michael Behrisch
-/// @date Mon, 13.12.2005
-/// @version $Id: MSBusStop.cpp 18095 2015-03-17 09:39:00Z behrisch $
-///
-// A lane area vehicles can halt at
-/****************************************************************************/
-// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
-// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors
-/****************************************************************************/
-//
-// This file is part of SUMO.
-// SUMO is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-/****************************************************************************/
-
-
-// ===========================================================================
-// included modules
-// ===========================================================================
-#ifdef _MSC_VER
-#include <windows_config.h>
-#else
-#include <config.h>
-#endif
-
-#include <cassert>
-#include "MSTrigger.h"
-#include "MSBusStop.h"
-#include <utils/vehicle/SUMOVehicle.h>
-#include <microsim/MSVehicleType.h>
-
-#ifdef CHECK_MEMORY_LEAKS
-#include <foreign/nvwa/debug_new.h>
-#endif // CHECK_MEMORY_LEAKS
-
-
-// ===========================================================================
-// method definitions
-// ===========================================================================
-MSBusStop::MSBusStop(const std::string& id,
- const std::vector<std::string>& lines,
- MSLane& lane,
- SUMOReal begPos, SUMOReal endPos)
- : Named(id), myLines(lines), myLane(lane),
- myBegPos(begPos), myEndPos(endPos), myLastFreePos(endPos) {
- computeLastFreePos();
-}
-
-
-MSBusStop::~MSBusStop() {}
-
-
-const MSLane&
-MSBusStop::getLane() const {
- return myLane;
-}
-
-
-SUMOReal
-MSBusStop::getBeginLanePosition() const {
- return myBegPos;
-}
-
-
-SUMOReal
-MSBusStop::getEndLanePosition() const {
- return myEndPos;
-}
-
-
-void
-MSBusStop::enter(SUMOVehicle* what, SUMOReal beg, SUMOReal end) {
- myEndPositions[what] = std::pair<SUMOReal, SUMOReal>(beg, end);
- computeLastFreePos();
-}
-
-
-SUMOReal
-MSBusStop::getLastFreePos(const SUMOVehicle& forVehicle) const {
- if (myLastFreePos != myEndPos) {
- return myLastFreePos - forVehicle.getVehicleType().getMinGap();
- }
- return myLastFreePos;
-}
-
-
-void
-MSBusStop::leaveFrom(SUMOVehicle* what) {
- assert(myEndPositions.find(what) != myEndPositions.end());
- myEndPositions.erase(myEndPositions.find(what));
- computeLastFreePos();
-}
-
-
-void
-MSBusStop::computeLastFreePos() {
- myLastFreePos = myEndPos;
- std::map<SUMOVehicle*, std::pair<SUMOReal, SUMOReal> >::iterator i;
- for (i = myEndPositions.begin(); i != myEndPositions.end(); i++) {
- if (myLastFreePos > (*i).second.second) {
- myLastFreePos = (*i).second.second;
- }
- }
-}
-
-
-
-/****************************************************************************/
-
diff --git a/src/microsim/trigger/MSBusStop.h b/src/microsim/trigger/MSBusStop.h
deleted file mode 100644
index 7d5bfe3..0000000
--- a/src/microsim/trigger/MSBusStop.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/****************************************************************************/
-/// @file MSBusStop.h
-/// @author Daniel Krajzewicz
-/// @author Michael Behrisch
-/// @date Mon, 13.12.2005
-/// @version $Id: MSBusStop.h 18095 2015-03-17 09:39:00Z behrisch $
-///
-// A lane area vehicles can halt at
-/****************************************************************************/
-// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
-// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors
-/****************************************************************************/
-//
-// This file is part of SUMO.
-// SUMO is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-/****************************************************************************/
-#ifndef MSBusStop_h
-#define MSBusStop_h
-
-
-// ===========================================================================
-// included modules
-// ===========================================================================
-#ifdef _MSC_VER
-#include <windows_config.h>
-#else
-#include <config.h>
-#endif
-
-#include <vector>
-#include <algorithm>
-#include <map>
-#include <string>
-#include <utils/common/Named.h>
-
-
-// ===========================================================================
-// class declarations
-// ===========================================================================
-class MSLane;
-class SUMOVehicle;
-class MSPerson;
-
-
-// ===========================================================================
-// class definitions
-// ===========================================================================
-/**
- * @class MSBusStop
- * @brief A lane area vehicles can halt at
- *
- * The bus stops tracks the last free space a vehicle may halt at by being
- * informed about a vehicle's entering and depart. It keeps the information
- * about entered vehicles' begin and end position within an internal
- * container ("myEndPositions") and is so able to compute the last free space.
- *
- * Please note that using the last free space disallows vehicles to enter a
- * free space in between other vehicles.
- */
-class MSBusStop : public Named {
-public:
- /** @brief Constructor
- *
- * @param[in] id The id of the bus stop
- * @param[in] net The net the bus stop belongs to
- * @param[in] lines Names of the bus lines that halt on this bus stop
- * @param[in] lane The lane the bus stop is placed on
- * @param[in] begPos Begin position of the bus stop on the lane
- * @param[in] endPos End position of the bus stop on the lane
- */
- MSBusStop(const std::string& id,
- const std::vector<std::string>& lines, MSLane& lane,
- SUMOReal begPos, SUMOReal endPos);
-
-
- /// @brief Destructor
- virtual ~MSBusStop();
-
-
- /** @brief Returns the lane this bus stop is located at
- *
- * @return Reference to the lane the bus stop is located at
- */
- const MSLane& getLane() const;
-
-
- /** @brief Returns the begin position of this bus stop
- *
- * @return The position the bus stop begins at
- */
- SUMOReal getBeginLanePosition() const;
-
-
- /** @brief Returns the end position of this bus stop
- *
- * @return The position the bus stop ends at
- */
- SUMOReal getEndLanePosition() const;
-
-
- /** @brief Called if a vehicle enters this stop
- *
- * Stores the position of the entering vehicle in myEndPositions.
- *
- * Recomputes the free space using "computeLastFreePos" then.
- *
- * @param[in] what The vehicle that enters the bus stop
- * @param[in] beg The begin halting position of the vehicle
- * @param[in] what The end halting position of the vehicle
- * @see computeLastFreePos
- */
- void enter(SUMOVehicle* what, SUMOReal beg, SUMOReal end);
-
-
- /** @brief Called if a vehicle leaves this stop
- *
- * Removes the position of the vehicle from myEndPositions.
- *
- * Recomputes the free space using "computeLastFreePos" then.
- *
- * @param[in] what The vehicle that leaves the bus stop
- * @see computeLastFreePos
- */
- void leaveFrom(SUMOVehicle* what);
-
-
- /** @brief Returns the last free position on this stop
- *
- * @return The last free position of this bus stop
- */
- SUMOReal getLastFreePos(const SUMOVehicle& forVehicle) const;
-
-
- /** @brief Returns the number of persons waiting on this stop
- */
- unsigned int getPersonNumber() const {
- return static_cast<unsigned int>(myWaitingPersons.size());
- }
-
- /// @brief adds a person to this stop
- void addPerson(MSPerson* p) {
- myWaitingPersons.push_back(p);
- }
-
- /// @brief Removes a person from this stop
- void removePerson(MSPerson* p) {
- std::vector<MSPerson*>::iterator i = std::find(myWaitingPersons.begin(), myWaitingPersons.end(), p);
- if (i != myWaitingPersons.end()) {
- myWaitingPersons.erase(i);
- }
- }
-
-protected:
- /** @brief Computes the last free position on this stop
- *
- * The last free position is the one, the last vehicle ends at.
- * It is stored in myLastFreePos. If no vehicle halts, the last free
- * position gets the value of myEndPos.
- */
- void computeLastFreePos();
-
-
-protected:
- /// @brief The list of lines that are assigned to this stop
- std::vector<std::string> myLines;
-
- /// @brief A map from objects (vehicles) to the areas they acquire after entering the stop
- std::map<SUMOVehicle*, std::pair<SUMOReal, SUMOReal> > myEndPositions;
-
- /// @brief The lane this bus stop is located at
- MSLane& myLane;
-
- /// @brief The begin position this bus stop is located at
- SUMOReal myBegPos;
-
- /// @brief The end position this bus stop is located at
- SUMOReal myEndPos;
-
- /// @brief The last free position at this stop (variable)
- SUMOReal myLastFreePos;
-
- /// @brief Persons waiting at this stop
- std::vector<MSPerson*> myWaitingPersons;
-
-
-private:
- /// @brief Invalidated copy constructor.
- MSBusStop(const MSBusStop&);
-
- /// @brief Invalidated assignment operator.
- MSBusStop& operator=(const MSBusStop&);
-
-
-};
-
-
-#endif
-
-/****************************************************************************/
-
diff --git a/src/microsim/trigger/MSCalibrator.cpp b/src/microsim/trigger/MSCalibrator.cpp
index 53a10fd..40c8e68 100644
--- a/src/microsim/trigger/MSCalibrator.cpp
+++ b/src/microsim/trigger/MSCalibrator.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, May 2005
-/// @version $Id: MSCalibrator.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSCalibrator.cpp 18213 2015-04-16 11:55:42Z behrisch $
///
// Calibrates the flow on an edge by removing an inserting vehicles
/****************************************************************************/
@@ -140,7 +140,7 @@ MSCalibrator::myStartElement(int element,
const SUMOSAXAttributes& attrs) {
if (element == SUMO_TAG_FLOW) {
AspiredState state;
- int lastEnd = -1;
+ SUMOTime lastEnd = -1;
if (myIntervals.size() > 0) {
lastEnd = myIntervals.back().end;
if (lastEnd == -1) {
diff --git a/src/microsim/trigger/MSChrgStn.cpp b/src/microsim/trigger/MSChrgStn.cpp
new file mode 100644
index 0000000..f3d5ccc
--- /dev/null
+++ b/src/microsim/trigger/MSChrgStn.cpp
@@ -0,0 +1,133 @@
+/****************************************************************************/
+/// @file MSChrgStn_h.h
+/// @author Daniel Krajzewicz
+/// @author Tamas Kurzveil
+/// @author Pablo Alvarez Lopez
+/// @date 20-12-13
+/// @version $Id: MSChrgStn.cpp 18762 2015-09-01 16:27:09Z behrisch $ //REVISION NEEDED
+///
+// Chargin Station for Electric vehicles //REVISION NEEDED
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+#include <cassert>
+#include <utils/vehicle/SUMOVehicle.h>
+#include <microsim/MSVehicleType.h>
+#include <microsim/MSStoppingPlace.h>
+#include "MSChrgStn.h"
+#include "MSTrigger.h"
+
+
+#ifdef CHECK_MEMORY_LEAKS
+#include <foreign/nvwa/debug_new.h>
+#endif // CHECK_MEMORY_LEAKS
+
+// ===========================================================================
+// member method definitions
+// ===========================================================================
+
+MSChrgStn::MSChrgStn(const std::string& new_ChrgStnID,
+ const std::vector<std::string>& new_lines,
+ MSLane& new_Lane, SUMOReal new_StartPos, SUMOReal new_EndPos, SUMOReal new_ChrgPower,
+ SUMOReal new_Efficency, SUMOReal new_ChargeInTransit, SUMOReal new_ChargeDelay) :
+ MSStoppingPlace(new_ChrgStnID, new_lines, new_Lane, new_StartPos, new_EndPos),
+ ChrgPower(new_ChrgPower),
+ Efficency(new_Efficency),
+ ChargeInTransit(new_ChargeInTransit),
+ ChargeDelay(new_ChargeDelay) {
+ if (getChrgPower() < 0) {
+ std::cout << std::string("Warning: Charging Station with ID = " + getID() + " doesn't have a valid charging power(" + SUMOReal_str(getChrgPower()) + ").");
+ }
+
+ if (getEfficency() < 0 || getEfficency() > 1) {
+ std::cout << std::string("Warning: Charging Station with ID = " + getID() + " doesn't have a valid Efficency (" + SUMOReal_str(getEfficency()) + ").");
+ }
+
+ if (getBeginLanePosition() > getEndLanePosition()) {
+ std::cout << std::string("Warning: Charging Station with ID = " + getID() + " doesn't have a valid range (" + SUMOReal_str(getBeginLanePosition()) + " < " + SUMOReal_str(getEndLanePosition()) + ").");
+ }
+}
+
+
+MSChrgStn::~MSChrgStn()
+{}
+
+
+// GET FUNCTIONS
+
+
+SUMOReal
+MSChrgStn::getChrgPower() const {
+ return ChrgPower;
+}
+
+SUMOReal
+MSChrgStn::getEfficency() const {
+ return Efficency;
+}
+
+SUMOReal
+MSChrgStn::getChargeInTransit() const {
+ return ChargeInTransit;
+}
+
+SUMOReal
+MSChrgStn::getChargeDelay() const {
+ return ChargeDelay;
+}
+
+
+// SET FUNCTIONS
+
+void MSChrgStn::setChrgPower(SUMOReal new_ChrgPower) {
+ ChrgPower = new_ChrgPower;
+
+ if (new_ChrgPower < 0) {
+ std::cout << std::string("Warning: Chargin Station with ID = " + getID() + " doesn't have a valid charging power(" + SUMOReal_str(getChrgPower()) + ").");
+ }
+}
+
+
+void MSChrgStn::setEfficency(SUMOReal new_Efficency) {
+ if (new_Efficency < 0 || new_Efficency > 1) {
+ std::cout << std::string("Warning: Chargin Station with ID = " + getID() + " doesn't have a valid Efficency (" + SUMOReal_str(getEfficency()) + ").");
+ }
+
+ Efficency = new_Efficency;
+}
+
+bool MSChrgStn::vehicleIsInside(const SUMOReal position) {
+ if ((position >= getBeginLanePosition()) && (position <= getEndLanePosition())) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+// Private methods
+
+std::string MSChrgStn::SUMOReal_str(const SUMOReal& var) {
+ std::ostringstream convert;
+ convert << var;
+ return convert.str();
+}
diff --git a/src/microsim/trigger/MSChrgStn.h b/src/microsim/trigger/MSChrgStn.h
new file mode 100644
index 0000000..93dba59
--- /dev/null
+++ b/src/microsim/trigger/MSChrgStn.h
@@ -0,0 +1,131 @@
+/****************************************************************************/
+/// @file MSChrgStn_h.h
+/// @author Daniel Krajzewicz
+/// @author Tamas Kurzveil
+/// @author Pablo Alvarez Lopez
+/// @date 20-12-13
+/// @version $Id: MSChrgStn.h 18762 2015-09-01 16:27:09Z behrisch $ //REVISION NEEDED
+///
+// Chargin Station for Electric vehicles //REVISION NEEDED
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+#ifndef MSChrgStn_h
+#define MSChrgStn_h
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+#include <list>
+#include <string>
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <microsim/MSStoppingPlace.h>
+
+
+#define DEFAULT_EFFICIENCY 0.95
+
+
+class OptionsCont;
+
+// ===========================================================================
+// class declarations
+// ===========================================================================
+class MSLane;
+class MSBusStop;
+
+
+// ===========================================================================
+// class definitions
+// ===========================================================================
+/**
+ * @class ChrgStn
+ * @brief Definition of charging stations
+ */
+class MSChrgStn : public MSStoppingPlace {
+public:
+
+ // CONSTRUCTORES
+
+ MSChrgStn(const std::string& new_ChrgStnID, const std::vector<std::string>& new_lines, MSLane& new_Lane,
+ SUMOReal new_StartPos, SUMOReal new_EndPos, SUMOReal new_ChrgPower, SUMOReal new_Efficency, SUMOReal new_ChargeInTransit, SUMOReal new_ChargeDelay);
+
+ virtual ~MSChrgStn();
+
+
+ // GET FUNCTIONS
+
+
+ /// @brief Get parameter 01, charging station's charging power
+ SUMOReal getChrgPower() const;
+
+ /// @brief Get parameter 02, efficiency of the charging station
+ SUMOReal getEfficency() const;
+
+ /// @brief Get parameter 03, get chargeInTransit
+ SUMOReal getChargeInTransit() const;
+
+ /// @brief Get parameter 03, get Charge Delay
+ SUMOReal getChargeDelay() const;
+
+
+ // SET FUNCTIONS
+
+ /// @brief Set parameter 05, charging station's charging power
+ inline void setChrgPower(SUMOReal new_ChrgPower);
+
+ /// @brief Set parameter 06, efficiency of the charging station
+ inline void setEfficency(SUMOReal new_Efficency);
+
+
+ // OTHER FUNCTIONS
+
+ /** @brief Check if a vehicle is inside in the Charge Station
+ * @param[in] position Position of vehicle in the LANE
+ * @return TRUE if is between StartPostion and EndPostion
+ */
+ bool vehicleIsInside(const SUMOReal position);
+
+
+private:
+
+ /// @brief Parameter 01, charging station's charging power
+ SUMOReal ChrgPower;
+
+ /// @brief Parameter 02, efficiency of the charging station
+ SUMOReal Efficency;
+
+ /// @brief Parameter 03, Allow charge in transit
+ SUMOReal ChargeInTransit;
+
+ /// @brief Parameter 03, Charge Delay
+ SUMOReal ChargeDelay;
+
+
+ /** @brief convert from SUMOReal to String
+ * @param[in] var Variable in SUMOReal format
+ * @return Variable var in String format
+ */
+ std::string SUMOReal_str(const SUMOReal& var);
+
+
+};
+
+#endif
+
diff --git a/src/microsim/trigger/MSContainerStop.cpp b/src/microsim/trigger/MSContainerStop.cpp
deleted file mode 100644
index 9f1d9a4..0000000
--- a/src/microsim/trigger/MSContainerStop.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************/
-/// @file MSContainerStop.cpp
-/// @author Daniel Krajzewicz
-/// @author Michael Behrisch
-/// @date Mon, 13.12.2005
-/// @version $Id: MSContainerStop.cpp 18096 2015-03-17 09:50:59Z behrisch $
-///
-// A lane area vehicles can halt at
-/****************************************************************************/
-// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
-// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors
-/****************************************************************************/
-//
-// This file is part of SUMO.
-// SUMO is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-/****************************************************************************/
-
-
-// ===========================================================================
-// included modules
-// ===========================================================================
-#ifdef _MSC_VER
-#include <windows_config.h>
-#else
-#include <config.h>
-#endif
-
-#include <cassert>
-//#include "MSTrigger.h"
-#include "MSContainerStop.h"
-#include <utils/vehicle/SUMOVehicle.h>
-#include <microsim/MSVehicleType.h>
-
-#ifdef CHECK_MEMORY_LEAKS
-#include <foreign/nvwa/debug_new.h>
-#endif // CHECK_MEMORY_LEAKS
-
-
-// ===========================================================================
-// method definitions
-// ===========================================================================
-MSContainerStop::MSContainerStop(const std::string& id,
- const std::vector<std::string>& lines,
- MSLane& lane,
- SUMOReal begPos, SUMOReal endPos)
- : Named(id), myLines(lines), myLane(lane),
- myBegPos(begPos), myEndPos(endPos), myLastFreePos(endPos) {
- computeLastFreePos();
-}
-
-
-MSContainerStop::~MSContainerStop() {}
-
-
-const MSLane&
-MSContainerStop::getLane() const {
- return myLane;
-}
-
-
-SUMOReal
-MSContainerStop::getBeginLanePosition() const {
- return myBegPos;
-}
-
-
-SUMOReal
-MSContainerStop::getEndLanePosition() const {
- return myEndPos;
-}
-
-
-void
-MSContainerStop::enter(SUMOVehicle* what, SUMOReal beg, SUMOReal end) {
- myEndPositions[what] = std::pair<SUMOReal, SUMOReal>(beg, end);
- computeLastFreePos();
-}
-
-
-SUMOReal
-MSContainerStop::getLastFreePos(const SUMOVehicle& forVehicle) const {
- if (myLastFreePos != myEndPos) {
- return myLastFreePos - forVehicle.getVehicleType().getMinGap();
- }
- return myLastFreePos;
-}
-
-
-void
-MSContainerStop::leaveFrom(SUMOVehicle* what) {
- assert(myEndPositions.find(what) != myEndPositions.end());
- myEndPositions.erase(myEndPositions.find(what));
- computeLastFreePos();
-}
-
-
-void
-MSContainerStop::computeLastFreePos() {
- myLastFreePos = myEndPos;
- std::map<SUMOVehicle*, std::pair<SUMOReal, SUMOReal> >::iterator i;
- for (i = myEndPositions.begin(); i != myEndPositions.end(); i++) {
- if (myLastFreePos > (*i).second.second) {
- myLastFreePos = (*i).second.second;
- }
- }
-}
-
-
-
-/****************************************************************************/
-
diff --git a/src/microsim/trigger/MSContainerStop.h b/src/microsim/trigger/MSContainerStop.h
deleted file mode 100644
index f3ec9dc..0000000
--- a/src/microsim/trigger/MSContainerStop.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/****************************************************************************/
-/// @file MSContainerStop.h
-/// @author Melanie Weber
-/// @author Andreas Kendziorra
-/// @date Mon, 13.12.2005
-/// @version $Id: MSContainerStop.h 18096 2015-03-17 09:50:59Z behrisch $
-///
-// A lane area vehicles can halt at and load and unload containers
-/****************************************************************************/
-// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
-// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors
-/****************************************************************************/
-//
-// This file is part of SUMO.
-// SUMO is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-/****************************************************************************/
-#ifndef MSContainerStop_h
-#define MSContainerStop_h
-
-
-// ===========================================================================
-// included modules
-// ===========================================================================
-#ifdef _MSC_VER
-#include <windows_config.h>
-#else
-#include <config.h>
-#endif
-
-#include <vector>
-#include <algorithm>
-#include <map>
-#include <string>
-#include <set>
-#include <utils/common/Named.h>
-
-
-// ===========================================================================
-// class declarations
-// ===========================================================================
-class MSLane;
-class SUMOVehicle;
-class MSContainer;
-
-
-// ===========================================================================
-// class definitions
-// ===========================================================================
-/**
- * @class MSContainerStop
- * @brief A lane area vehicles can halt at and load and unload containers
- *
- * A container stop tracks the last free space a vehicle may halt at by being
- * informed about a vehicle's entering and depart. It keeps the information
- * about entered vehicles' begin and end position within an internal
- * container ("myEndPositions") and is so able to compute the last free space.
- *
- * Please note that using the last free space disallows vehicles to enter a
- * free space in between other vehicles.
- */
-class MSContainerStop : public Named {
-public:
- /** @brief Constructor
- *
- * @param[in] id The id of the container stop
- * @param[in] net The net the container stop belongs to
- * @param[in] lines Names of the vehicle lines that halt on this container stop
- * @param[in] lane The lane the container stop is placed on
- * @param[in] begPos Begin position of the container stop on the lane
- * @param[in] endPos End position of the container stop on the lane
- */
- MSContainerStop(const std::string& id,
- const std::vector<std::string>& lines, MSLane& lane,
- SUMOReal begPos, SUMOReal endPos);
-
-
- /// @brief Destructor
- virtual ~MSContainerStop();
-
-
- /** @brief Returns the lane this container stop is located at
- *
- * @return Reference to the lane the container stop is located at
- */
- const MSLane& getLane() const;
-
-
- /** @brief Returns the begin position of this container stop
- *
- * @return The position the container stop begins at
- */
- SUMOReal getBeginLanePosition() const;
-
-
- /** @brief Returns the end position of this container stop
- *
- * @return The position the container stop ends at
- */
- SUMOReal getEndLanePosition() const;
-
-
- /** @brief Called if a vehicle enters this stop
- *
- * Stores the position of the entering vehicle in myEndPositions.
- *
- * Recomputes the free space using "computeLastFreePos" then.
- *
- * @param[in] what The vehicle that enters the container stop
- * @param[in] beg The begin halting position of the vehicle
- * @param[in] what The end halting position of the vehicle
- * @see computeLastFreePos
- */
- void enter(SUMOVehicle* what, SUMOReal beg, SUMOReal end);
-
-
- /** @brief Called if a vehicle leaves this stop
- *
- * Removes the position of the vehicle from myEndPositions.
- *
- * Recomputes the free space using "computeLastFreePos" then.
- *
- * @param[in] what The vehicle that leaves the container stop
- * @see computeLastFreePos
- */
- void leaveFrom(SUMOVehicle* what);
-
-
- /** @brief Returns the last free position on this stop
- *
- * @return The last free position of this container stop
- */
- SUMOReal getLastFreePos(const SUMOVehicle& forVehicle) const;
-
-
- /** @brief Returns the number of containers waiting on this stop
- */
- unsigned int getContainerNumber() const {
- return static_cast<unsigned int>(myWaitingContainers.size());
- }
-
- /// @brief Adds a container to this stop
- void addContainer(MSContainer* container) {
- myWaitingContainers.push_back(container);
- }
-
- /// @brief Removes a container from this stop
- void removeContainer(MSContainer* container) {
- std::vector<MSContainer*>::iterator i = std::find(myWaitingContainers.begin(), myWaitingContainers.end(), container);
- if (i != myWaitingContainers.end()) {
- myWaitingContainers.erase(i);
- }
- }
-
-protected:
- /** @brief Computes the last free position on this stop
- *
- * The last free position is the one, the last vehicle ends at.
- * It is stored in myLastFreePos. If no vehicle halts, the last free
- * position gets the value of myEndPos.
- */
- void computeLastFreePos();
-
-
-protected:
- /// @brief The list of lines that are assigned to this stop
- std::vector<std::string> myLines;
-
- /// @brief A map from objects (vehicles) to the areas they acquire after entering the stop
- std::map<SUMOVehicle*, std::pair<SUMOReal, SUMOReal> > myEndPositions;
-
- /// @brief The lane this stop is located at
- MSLane& myLane;
-
- /// @brief The begin position this stop is located at
- SUMOReal myBegPos;
-
- /// @brief The end position this stop is located at
- SUMOReal myEndPos;
-
- /// @brief The last free position at this stop (variable)
- SUMOReal myLastFreePos;
-
- /// @brief Containers waiting at this stop
- std::vector<MSContainer*> myWaitingContainers;
-
-
-private:
- /// @brief Invalidated copy constructor.
- MSContainerStop(const MSContainerStop&);
-
- /// @brief Invalidated assignment operator.
- MSContainerStop& operator=(const MSContainerStop&);
-
-
-};
-
-
-#endif
-
-/****************************************************************************/
-
diff --git a/src/microsim/trigger/MSTriggeredRerouter.cpp b/src/microsim/trigger/MSTriggeredRerouter.cpp
index 1e483b5..2f447b3 100644
--- a/src/microsim/trigger/MSTriggeredRerouter.cpp
+++ b/src/microsim/trigger/MSTriggeredRerouter.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Mon, 25 July 2005
-/// @version $Id: MSTriggeredRerouter.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: MSTriggeredRerouter.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Reroutes vehicles passing an edge
/****************************************************************************/
@@ -296,14 +296,19 @@ MSTriggeredRerouter::notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification
}
const MSEdge* newEdge = lastEdge;
// ok, try using a new destination
+ SUMOReal newArrivalPos = -1;
const bool destUnreachable = std::find(rerouteDef->closed.begin(), rerouteDef->closed.end(), lastEdge) != rerouteDef->closed.end();
// if we have a closingReroute, only assign new destinations to vehicles which cannot reach their original destination
if (rerouteDef->closed.size() == 0 || destUnreachable) {
newEdge = rerouteDef->edgeProbs.getOverallProb() > 0 ? rerouteDef->edgeProbs.get() : route.getLastEdge();
if (newEdge == &mySpecialDest_terminateRoute) {
newEdge = veh.getEdge();
+ newArrivalPos = veh.getPositionOnLane(); // instant arrival
} else if (newEdge == &mySpecialDest_keepDestination || newEdge == lastEdge) {
- if (destUnreachable) {
+ if (destUnreachable && rerouteDef->permissions == SVCAll) {
+ // if permissions aren't set vehicles will simply drive through
+ // the closing unless terminated. If the permissions are specified, assume that the user wants
+ // vehicles to stand and wait until the closing ends
WRITE_WARNING("Cannot keep destination for vehicle '" + veh.getID() + "' due to closed edges. Terminating route.");
newEdge = veh.getEdge();
} else {
@@ -319,6 +324,10 @@ MSTriggeredRerouter::notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification
MSNet::getInstance()->getRouterTT(rerouteDef->closed).compute(
veh.getEdge(), newEdge, &veh, MSNet::getInstance()->getCurrentTimeStep(), edges);
veh.replaceRouteEdges(edges);
+ if (newArrivalPos != -1) {
+ // must be called here because replaceRouteEdges may also set the arrivalPos
+ veh.setArrivalPos(newArrivalPos);
+ }
return false;
}
diff --git a/src/microsim/trigger/Makefile.am b/src/microsim/trigger/Makefile.am
index a6c636c..441c088 100644
--- a/src/microsim/trigger/Makefile.am
+++ b/src/microsim/trigger/Makefile.am
@@ -1,9 +1,8 @@
noinst_LIBRARIES = libmicrosimtrigger.a
-libmicrosimtrigger_a_SOURCES = MSBusStop.cpp MSBusStop.h \
-MSCalibrator.cpp MSCalibrator.h \
-MSContainerStop.cpp MSContainerStop.h \
+libmicrosimtrigger_a_SOURCES = MSCalibrator.cpp MSCalibrator.h \
MSContainerTerminal.cpp MSContainerTerminal.h \
MSLaneSpeedTrigger.cpp MSLaneSpeedTrigger.h \
MSTrigger.h MSTrigger.cpp \
+MSChrgStn.h MSChrgStn.cpp \
MSTriggeredRerouter.cpp MSTriggeredRerouter.h
diff --git a/src/microsim/trigger/Makefile.in b/src/microsim/trigger/Makefile.in
index bf2895e..edbf7c8 100644
--- a/src/microsim/trigger/Makefile.in
+++ b/src/microsim/trigger/Makefile.in
@@ -98,10 +98,10 @@ am__v_AR_0 = @echo " AR " $@;
am__v_AR_1 =
libmicrosimtrigger_a_AR = $(AR) $(ARFLAGS)
libmicrosimtrigger_a_LIBADD =
-am_libmicrosimtrigger_a_OBJECTS = MSBusStop.$(OBJEXT) \
- MSCalibrator.$(OBJEXT) MSContainerStop.$(OBJEXT) \
+am_libmicrosimtrigger_a_OBJECTS = MSCalibrator.$(OBJEXT) \
MSContainerTerminal.$(OBJEXT) MSLaneSpeedTrigger.$(OBJEXT) \
- MSTrigger.$(OBJEXT) MSTriggeredRerouter.$(OBJEXT)
+ MSTrigger.$(OBJEXT) MSChrgStn.$(OBJEXT) \
+ MSTriggeredRerouter.$(OBJEXT)
libmicrosimtrigger_a_OBJECTS = $(am_libmicrosimtrigger_a_OBJECTS)
AM_V_P = $(am__v_P_ at AM_V@)
am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
@@ -329,12 +329,11 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LIBRARIES = libmicrosimtrigger.a
-libmicrosimtrigger_a_SOURCES = MSBusStop.cpp MSBusStop.h \
-MSCalibrator.cpp MSCalibrator.h \
-MSContainerStop.cpp MSContainerStop.h \
+libmicrosimtrigger_a_SOURCES = MSCalibrator.cpp MSCalibrator.h \
MSContainerTerminal.cpp MSContainerTerminal.h \
MSLaneSpeedTrigger.cpp MSLaneSpeedTrigger.h \
MSTrigger.h MSTrigger.cpp \
+MSChrgStn.h MSChrgStn.cpp \
MSTriggeredRerouter.cpp MSTriggeredRerouter.h
all: all-am
@@ -386,9 +385,8 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSBusStop.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSCalibrator.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSContainerStop.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSChrgStn.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSContainerTerminal.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSLaneSpeedTrigger.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MSTrigger.Po at am__quote@
diff --git a/src/netbuild/NBAlgorithms.cpp b/src/netbuild/NBAlgorithms.cpp
index 3b815d3..217e64f 100644
--- a/src/netbuild/NBAlgorithms.cpp
+++ b/src/netbuild/NBAlgorithms.cpp
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Jakob Erdmann
/// @date 02. March 2012
-/// @version $Id: NBAlgorithms.cpp 18120 2015-03-20 13:44:18Z namdre $
+/// @version $Id: NBAlgorithms.cpp 18699 2015-08-24 06:54:48Z namdre $
///
// Algorithms for network computation
/****************************************************************************/
@@ -53,16 +53,20 @@
// NBTurningDirectionsComputer
// ---------------------------------------------------------------------------
void
-NBTurningDirectionsComputer::computeTurnDirections(NBNodeCont& nc) {
+NBTurningDirectionsComputer::computeTurnDirections(NBNodeCont& nc, bool warn) {
for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
- computeTurnDirectionsForNode(i->second);
+ computeTurnDirectionsForNode(i->second, warn);
}
}
void
-NBTurningDirectionsComputer::computeTurnDirectionsForNode(NBNode* node) {
+NBTurningDirectionsComputer::computeTurnDirectionsForNode(NBNode* node, bool warn) {
const std::vector<NBEdge*>& incoming = node->getIncomingEdges();
const std::vector<NBEdge*>& outgoing = node->getOutgoingEdges();
+ // reset turning directions since this may be called multiple times
+ for (std::vector<NBEdge*>::const_iterator k = incoming.begin(); k != incoming.end(); ++k) {
+ (*k)->setTurningDestination(0);
+ }
std::vector<Combination> combinations;
for (std::vector<NBEdge*>::const_iterator j = outgoing.begin(); j != outgoing.end(); ++j) {
NBEdge* outedge = *j;
@@ -103,13 +107,12 @@ NBTurningDirectionsComputer::computeTurnDirectionsForNode(NBNode* node) {
// sort combinations so that the ones with the highest angle are at the begin
std::sort(combinations.begin(), combinations.end(), combination_by_angle_sorter());
std::set<NBEdge*> seen;
- bool haveWarned = false;
for (std::vector<Combination>::const_iterator j = combinations.begin(); j != combinations.end(); ++j) {
if (seen.find((*j).from) != seen.end() || seen.find((*j).to) != seen.end()) {
// do not regard already set edges
- if ((*j).angle > 360 && !haveWarned) {
+ if ((*j).angle > 360 && warn) {
WRITE_WARNING("Ambiguity in turnarounds computation at node '" + node->getID() + "'.");
- haveWarned = true;
+ warn = false;
}
continue;
}
@@ -128,19 +131,18 @@ NBTurningDirectionsComputer::computeTurnDirectionsForNode(NBNode* node) {
// NBNodesEdgesSorter
// ---------------------------------------------------------------------------
void
-NBNodesEdgesSorter::sortNodesEdges(NBNodeCont& nc, bool leftHand, bool useNodeShape) {
+NBNodesEdgesSorter::sortNodesEdges(NBNodeCont& nc, bool useNodeShape) {
for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
- NBNode* n = (*i).second;
+ NBNode* const n = i->second;
if (n->myAllEdges.size() == 0) {
continue;
}
- EdgeVector& allEdges = (*i).second->myAllEdges;
- EdgeVector& incoming = (*i).second->myIncomingEdges;
- EdgeVector& outgoing = (*i).second->myOutgoingEdges;
- std::vector<NBNode::Crossing>& crossings = (*i).second->myCrossings;
-
+ EdgeVector& allEdges = n->myAllEdges;
+ EdgeVector& incoming = n->myIncomingEdges;
+ EdgeVector& outgoing = n->myOutgoingEdges;
+ std::vector<NBNode::Crossing>& crossings = n->myCrossings;
if (!useNodeShape || n->getShape().area() < 1) {
- // if the area is to small (i.e. for simple-continuation nodes) we better not use it
+ // if the area is too small (i.e. for simple-continuation nodes) we better not use it
// sort by the angle of the adjoining line segment of the edge geometry
// sort the edges
std::sort(allEdges.begin(), allEdges.end(), edge_by_junction_angle_sorter(n));
@@ -148,16 +150,16 @@ NBNodesEdgesSorter::sortNodesEdges(NBNodeCont& nc, bool leftHand, bool useNodeSh
std::sort(outgoing.begin(), outgoing.end(), edge_by_junction_angle_sorter(n));
std::vector<NBEdge*>::iterator j;
for (j = allEdges.begin(); j != allEdges.end() - 1 && j != allEdges.end(); ++j) {
- swapWhenReversed(n, leftHand, j, j + 1);
+ swapWhenReversed(n, j, j + 1);
}
if (allEdges.size() > 1 && j != allEdges.end()) {
- swapWhenReversed(n, leftHand, allEdges.end() - 1, allEdges.begin());
+ swapWhenReversed(n, allEdges.end() - 1, allEdges.begin());
}
} else {
NBEdge* firstOfAll = allEdges.front();
NBEdge* firstOfIncoming = incoming.size() > 0 ? incoming.front() : 0;
NBEdge* firstOfOutgoing = outgoing.size() > 0 ? outgoing.front() : 0;
- // sort by the angle between the node shape center and the point where the edge meeds the node shape
+ // sort by the angle between the node shape center and the point where the edge meets the node shape
sort(allEdges.begin(), allEdges.end(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter(n));
sort(incoming.begin(), incoming.end(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter(n));
sort(outgoing.begin(), outgoing.end(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter(n));
@@ -170,7 +172,23 @@ NBNodesEdgesSorter::sortNodesEdges(NBNodeCont& nc, bool leftHand, bool useNodeSh
rotate(outgoing.begin(), std::find(outgoing.begin(), outgoing.end(), firstOfOutgoing), outgoing.end());
}
}
-
+ // fixing some pathological all edges orderings
+ // if every of the edges a,b,c has a turning edge a',b',c' the all edges ordering should be a,a',b,b',c,c'
+ if (incoming.size() == outgoing.size() && incoming.front() == allEdges.front()) {
+ std::vector<NBEdge*>::const_iterator in, out;
+ std::vector<NBEdge*> allTmp;
+ for (in = incoming.begin(), out = outgoing.begin(); in != incoming.end(); ++in, ++out) {
+ if ((*in)->isTurningDirectionAt(*out)) {
+ allTmp.push_back(*in);
+ allTmp.push_back(*out);
+ } else {
+ break;
+ }
+ }
+ if (allTmp.size() == allEdges.size()) {
+ allEdges = allTmp;
+ }
+ }
// sort the crossings
std::sort(crossings.begin(), crossings.end(), crossing_by_junction_angle_sorter(n, allEdges));
// DEBUG
@@ -187,15 +205,11 @@ NBNodesEdgesSorter::sortNodesEdges(NBNodeCont& nc, bool leftHand, bool useNodeSh
void
-NBNodesEdgesSorter::swapWhenReversed(const NBNode* const n, bool leftHand,
+NBNodesEdgesSorter::swapWhenReversed(const NBNode* const n,
const std::vector<NBEdge*>::iterator& i1,
const std::vector<NBEdge*>::iterator& i2) {
NBEdge* e1 = *i1;
NBEdge* e2 = *i2;
- if (leftHand) {
- // @todo: check this; shouldn't it be "swap(*e1, *e2)"?
- std::swap(e1, e2);
- }
// @todo: The difference between "isTurningDirectionAt" and "isTurnaround"
// is not nice. Maybe we could get rid of it if we would always mark edges
// as turnarounds, even if they do not have to be added, as mentioned in
@@ -217,6 +231,19 @@ NBNodeTypeComputer::computeNodeTypes(NBNodeCont& nc) {
if (n->myType != NODETYPE_UNKNOWN) {
continue;
}
+ // check whether the node is a waterway node. Set to unregulated by default
+ bool waterway = true;
+ for (EdgeVector::const_iterator i = n->getEdges().begin(); i != n->getEdges().end(); ++i) {
+ if (!isWaterway((*i)->getPermissions())) {
+ waterway = false;
+ break;
+ }
+ }
+ if (waterway && n->myType == NODETYPE_UNKNOWN) {
+ n->myType = NODETYPE_NOJUNCTION;
+ continue;
+ }
+
// check whether the junction is not a real junction
if (n->myIncomingEdges.size() == 1) {
n->myType = NODETYPE_PRIORITY;
diff --git a/src/netbuild/NBAlgorithms.h b/src/netbuild/NBAlgorithms.h
index 0174d1b..efddaf9 100644
--- a/src/netbuild/NBAlgorithms.h
+++ b/src/netbuild/NBAlgorithms.h
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Jakob Erdmann
/// @date 02. March 2012
-/// @version $Id: NBAlgorithms.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: NBAlgorithms.h 18756 2015-08-31 19:16:33Z behrisch $
///
// Algorithms for network computation
/****************************************************************************/
@@ -54,14 +54,16 @@ class NBTurningDirectionsComputer {
public:
/** @brief Computes turnaround destinations for all edges (if exist)
* @param[in] nc The container of nodes to loop along
+ * @param[in] warn Whether warnings shall be issued
*/
- static void computeTurnDirections(NBNodeCont& nc);
+ static void computeTurnDirections(NBNodeCont& nc, bool warn = true);
/** @brief Computes turnaround destinations for all incoming edges of the given nodes (if any)
* @param[in] node The node for which to compute turnaround destinations
+ * @param[in] warn Whether warnings shall be issued
* @note: This is needed by NETEDIT
*/
- static void computeTurnDirectionsForNode(NBNode* node);
+ static void computeTurnDirectionsForNode(NBNode* node, bool warn);
private:
/** @struct Combination
@@ -107,10 +109,9 @@ class NBNodesEdgesSorter {
public:
/** @brief Sorts a node's edges clockwise regarding driving direction
* @param[in] nc The container of nodes to loop along
- * @param[in] leftHand Whether the network is left-handed
* @param[in] useNodeShape Whether to sort based on the node shape (instead of only the edge angle)
*/
- static void sortNodesEdges(NBNodeCont& nc, bool leftHand, bool useNodeShape = false);
+ static void sortNodesEdges(NBNodeCont& nc, bool useNodeShape = false);
/** @class crossing_by_junction_angle_sorter
* @brief Sorts crossings by minimum clockwise clockwise edge angle. Use the
@@ -146,11 +147,10 @@ public:
private:
/** @brief Assures correct order for same-angle opposite-direction edges
* @param[in] n The currently processed node
- * @param[in] leftHand Whether the network is left-handed
* @param[in] i1 Pointer to first edge
* @param[in] i2 Pointer to second edge
*/
- static void swapWhenReversed(const NBNode* const n, bool leftHand,
+ static void swapWhenReversed(const NBNode* const n,
const std::vector<NBEdge*>::iterator& i1,
const std::vector<NBEdge*>::iterator& i2);
diff --git a/src/netbuild/NBAlgorithms_Ramps.cpp b/src/netbuild/NBAlgorithms_Ramps.cpp
index 1583bbd..15c78f9 100644
--- a/src/netbuild/NBAlgorithms_Ramps.cpp
+++ b/src/netbuild/NBAlgorithms_Ramps.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date 29. March 2012
-/// @version $Id: NBAlgorithms_Ramps.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: NBAlgorithms_Ramps.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Algorithms for highway on-/off-ramps computation
/****************************************************************************/
@@ -33,6 +33,7 @@
#include <cassert>
#include <utils/options/OptionsCont.h>
#include <utils/common/MsgHandler.h>
+#include <utils/common/ToString.h>
#include "NBNetBuilder.h"
#include "NBNodeCont.h"
#include "NBNode.h"
@@ -64,28 +65,34 @@ NBRampsComputer::computeRamps(NBNetBuilder& nb, OptionsCont& oc) {
std::set<NBEdge*> incremented;
// check whether on-off ramps shall be guessed
if (oc.getBool("ramps.guess")) {
+ std::set<std::string> noramps;
+ if (oc.isSet("ramps.unset")) {
+ std::vector<std::string> edges = oc.getStringVector("ramps.unset");
+ noramps.insert(edges.begin(), edges.end());
+ }
NBNodeCont& nc = nb.getNodeCont();
NBEdgeCont& ec = nb.getEdgeCont();
NBDistrictCont& dc = nb.getDistrictCont();
- std::set<NBNode*> potOnRamps;
- std::set<NBNode*> potOffRamps;
+ // if an edge is part of two ramps, ordering is important
+ std::set<NBNode*, Named::ComparatorIdLess> potOnRamps;
+ std::set<NBNode*, Named::ComparatorIdLess> potOffRamps;
for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
NBNode* cur = (*i).second;
- if (mayNeedOnRamp(cur, minHighwaySpeed, maxRampSpeed)) {
+ if (mayNeedOnRamp(cur, minHighwaySpeed, maxRampSpeed, noramps)) {
potOnRamps.insert(cur);
}
- if (mayNeedOffRamp(cur, minHighwaySpeed, maxRampSpeed)) {
+ if (mayNeedOffRamp(cur, minHighwaySpeed, maxRampSpeed, noramps)) {
potOffRamps.insert(cur);
}
}
- for (std::set<NBNode*>::const_iterator i = potOnRamps.begin(); i != potOnRamps.end(); ++i) {
+ for (std::set<NBNode*, Named::ComparatorIdLess>::const_iterator i = potOnRamps.begin(); i != potOnRamps.end(); ++i) {
buildOnRamp(*i, nc, ec, dc, rampLength, dontSplit, incremented);
}
- for (std::set<NBNode*>::const_iterator i = potOffRamps.begin(); i != potOffRamps.end(); ++i) {
+ for (std::set<NBNode*, Named::ComparatorIdLess>::const_iterator i = potOffRamps.begin(); i != potOffRamps.end(); ++i) {
buildOffRamp(*i, nc, ec, dc, rampLength, dontSplit, incremented);
}
}
- // check whether on-off ramps shall be guessed
+ // check whether on-off ramps are specified
if (oc.isSet("ramps.set")) {
std::vector<std::string> edges = oc.getStringVector("ramps.set");
NBNodeCont& nc = nb.getNodeCont();
@@ -117,26 +124,26 @@ NBRampsComputer::computeRamps(NBNetBuilder& nb, OptionsCont& oc) {
bool
-NBRampsComputer::mayNeedOnRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed) {
+NBRampsComputer::mayNeedOnRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed, const std::set<std::string>& noramps) {
if (cur->getOutgoingEdges().size() != 1 || cur->getIncomingEdges().size() != 2) {
return false;
}
NBEdge* potHighway, *potRamp, *cont;
getOnRampEdges(cur, &potHighway, &potRamp, &cont);
// may be an on-ramp
- return fulfillsRampConstraints(potHighway, potRamp, cont, minHighwaySpeed, maxRampSpeed);
+ return fulfillsRampConstraints(potHighway, potRamp, cont, minHighwaySpeed, maxRampSpeed, noramps);
}
bool
-NBRampsComputer::mayNeedOffRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed) {
+NBRampsComputer::mayNeedOffRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed, const std::set<std::string>& noramps) {
if (cur->getIncomingEdges().size() != 1 || cur->getOutgoingEdges().size() != 2) {
return false;
}
// may be an off-ramp
NBEdge* potHighway, *potRamp, *prev;
getOffRampEdges(cur, &potHighway, &potRamp, &prev);
- return fulfillsRampConstraints(potHighway, potRamp, prev, minHighwaySpeed, maxRampSpeed);
+ return fulfillsRampConstraints(potHighway, potRamp, prev, minHighwaySpeed, maxRampSpeed, noramps);
}
@@ -268,12 +275,12 @@ NBRampsComputer::buildOffRamp(NBNode* cur, NBNodeCont& nc, NBEdgeCont& ec, NBDis
Position pos = curr->getGeometry().positionAtOffset(curr->getGeometry().length() - (rampLength - currLength));
NBNode* rn = new NBNode(curr->getID() + "-AddedOffRampNode", pos);
if (!nc.insert(rn)) {
- throw ProcessError("Ups - could not build on-ramp for edge '" + curr->getID() + "' (node could not be build)!");
+ throw ProcessError("Ups - could not build off-ramp for edge '" + curr->getID() + "' (node could not be build)!");
}
std::string name = curr->getID();
bool ok = ec.splitAt(dc, curr, rn, curr->getID(), curr->getID() + "-AddedOffRampEdge", curr->getNumLanes(), curr->getNumLanes() + toAdd);
if (!ok) {
- WRITE_ERROR("Ups - could not build on-ramp for edge '" + curr->getID() + "'!");
+ WRITE_ERROR("Ups - could not build off-ramp for edge '" + curr->getID() + "'!");
return;
}
curr = ec.retrieve(name + "-AddedOffRampEdge");
@@ -401,7 +408,8 @@ NBRampsComputer::getOffRampEdges(NBNode* n, NBEdge** potHighway, NBEdge** potRam
bool
NBRampsComputer::fulfillsRampConstraints(
- NBEdge* potHighway, NBEdge* potRamp, NBEdge* other, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed) {
+ NBEdge* potHighway, NBEdge* potRamp, NBEdge* other, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed,
+ const std::set<std::string>& noramps) {
// do not build ramps on rail edges
if (isRailway(potHighway->getPermissions()) || isRailway(potRamp->getPermissions())) {
return false;
@@ -442,6 +450,9 @@ NBRampsComputer::fulfillsRampConstraints(
if (maxRampSpeed > 0 && maxRampSpeed < potRamp->getSpeed()) {
return false;
}
+ if (noramps.find(other->getID()) != noramps.end()) {
+ return false;
+ }
return true;
}
diff --git a/src/netbuild/NBAlgorithms_Ramps.h b/src/netbuild/NBAlgorithms_Ramps.h
index 7b4615f..e4f4517 100644
--- a/src/netbuild/NBAlgorithms_Ramps.h
+++ b/src/netbuild/NBAlgorithms_Ramps.h
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Jakob Erdmann
/// @date 29. March 2012
-/// @version $Id: NBAlgorithms_Ramps.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NBAlgorithms_Ramps.h 18756 2015-08-31 19:16:33Z behrisch $
///
// Algorithms for highway on-/off-ramps computation
/****************************************************************************/
@@ -69,18 +69,22 @@ private:
* @param[in] cur The node to check
* @param[in] minHighwaySpeed The minimum speed limit a highway must have for being a highway
* @param[in] maxRampSpeed The maximum speed limit a ramp must have for being a ramp
+ * @param[in] noramps Edges that shall not be treated as ramps
* @return Whether the node is assumed to be an on-ramp begin
*/
- static bool mayNeedOnRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed);
+ static bool mayNeedOnRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed,
+ const std::set<std::string>& noramps);
/** @brief Determines whether the given node may be an off-ramp end
* @param[in] cur The node to check
* @param[in] minHighwaySpeed The minimum speed limit a highway must have for being a highway
* @param[in] maxRampSpeed The maximum speed limit a ramp must have for being a ramp
+ * @param[in] noramps Edges that shall not be treated as ramps
* @return Whether the node is assumed to be an off-ramp end
*/
- static bool mayNeedOffRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed);
+ static bool mayNeedOffRamp(NBNode* cur, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed,
+ const std::set<std::string>& noramps);
/** @brief Builds an on-ramp starting at the given node
@@ -122,9 +126,11 @@ private:
* @param[in] other The successor/predecessor edge
* @param[in] minHighwaySpeed The minimum speed limit a highway must have for being a highway
* @param[in] maxRampSpeed The maximum speed limit a ramp must have for being a ramp
+ * @param[in] noramps Edges that shall not be treated as ramps
* @return Whether a ramp can be built here
*/
- static bool fulfillsRampConstraints(NBEdge* potHighway, NBEdge* potRamp, NBEdge* other, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed);
+ static bool fulfillsRampConstraints(NBEdge* potHighway, NBEdge* potRamp, NBEdge* other, SUMOReal minHighwaySpeed, SUMOReal maxRampSpeed,
+ const std::set<std::string>& noramps);
/** @brief Moves the ramp to the right, as new lanes were added
diff --git a/src/netbuild/NBConnection.cpp b/src/netbuild/NBConnection.cpp
index 8497aa4..705126d 100644
--- a/src/netbuild/NBConnection.cpp
+++ b/src/netbuild/NBConnection.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: NBConnection.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NBConnection.cpp 18282 2015-04-23 11:08:45Z namdre $
///
// The class holds a description of a connection between two edges
/****************************************************************************/
@@ -119,7 +119,7 @@ NBConnection::replaceFrom(NBEdge* which, NBEdge* by) {
bool
NBConnection::replaceFrom(NBEdge* which, int whichLane,
NBEdge* by, int byLane) {
- if (myFrom == which && (myFromLane == (int) whichLane || myFromLane < 0)) {
+ if (myFrom == which && (myFromLane == whichLane || myFromLane < 0 || whichLane < 0)) {
myFrom = by;
myFromID = myFrom->getID();
myFromLane = byLane;
@@ -143,7 +143,7 @@ NBConnection::replaceTo(NBEdge* which, NBEdge* by) {
bool
NBConnection::replaceTo(NBEdge* which, int whichLane,
NBEdge* by, int byLane) {
- if (myTo == which && (myToLane == (int) whichLane || myFromLane < 0)) {
+ if (myTo == which && (myToLane == whichLane || myFromLane < 0 || whichLane < 0)) {
myTo = by;
myToID = myTo->getID();
myToLane = byLane;
diff --git a/src/netbuild/NBContHelper.cpp b/src/netbuild/NBContHelper.cpp
index e5a2130..5f64891 100644
--- a/src/netbuild/NBContHelper.cpp
+++ b/src/netbuild/NBContHelper.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 20 Nov 2001
-/// @version $Id: NBContHelper.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: NBContHelper.cpp 18566 2015-07-14 12:46:29Z behrisch $
///
// Some methods for traversing lists of edges
/****************************************************************************/
@@ -267,14 +267,24 @@ NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter::operator()(const NBEdge
const bool sameDir = ((e1->getFromNode() == myNode && e2->getFromNode() == myNode)
|| (e1->getToNode() == myNode && e2->getToNode() == myNode));
if (sameDir) {
- // put edges that allow pedestrians on the 'outside'
+ // put edges that allow pedestrians on the 'outside', but be aware if both allow / disallow
if (e1->getToNode() == myNode) {
- return (e1->getPermissions() & SVC_PEDESTRIAN) != 0;
+ if ((e1->getPermissions() & SVC_PEDESTRIAN) != 0) {
+ if ((e2->getPermissions() & SVC_PEDESTRIAN) == 0) {
+ return true;
+ }
+ }
} else {
- return (e1->getPermissions() & SVC_PEDESTRIAN) == 0;
+ if ((e1->getPermissions() & SVC_PEDESTRIAN) == 0) {
+ if ((e2->getPermissions() & SVC_PEDESTRIAN) != 0) {
+ return true;
+ }
+ }
}
+ // break ties to ensure strictly weak ordering
+ return e1->getID() < e2->getID();
} else {
- // sort incoming before outgoing
+ // sort incoming before outgoing, no need to break ties here
return e1->getToNode() == myNode;
}
}
diff --git a/src/netbuild/NBDistrict.cpp b/src/netbuild/NBDistrict.cpp
index 576e0e0..c2b739f 100644
--- a/src/netbuild/NBDistrict.cpp
+++ b/src/netbuild/NBDistrict.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: NBDistrict.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NBDistrict.cpp 18639 2015-08-17 13:59:19Z namdre $
///
// A class representing a single district
/****************************************************************************/
@@ -70,6 +70,13 @@ NBDistrict::reshiftPosition(SUMOReal xoff, SUMOReal yoff) {
}
+void
+NBDistrict::mirrorX() {
+ myPosition.mul(1, -1);
+ myShape.mirrorX();
+}
+
+
bool
NBDistrict::addSource(NBEdge* const source, SUMOReal weight) {
EdgeVector::iterator i = find(mySources.begin(), mySources.end(), source);
diff --git a/src/netbuild/NBDistrict.h b/src/netbuild/NBDistrict.h
index 9faa9ed..dd5d822 100644
--- a/src/netbuild/NBDistrict.h
+++ b/src/netbuild/NBDistrict.h
@@ -4,7 +4,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: NBDistrict.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NBDistrict.h 18639 2015-08-17 13:59:19Z namdre $
///
// A class representing a single district
/****************************************************************************/
@@ -233,6 +233,9 @@ public:
* @param[in] yoff The y-offset to apply
*/
void reshiftPosition(SUMOReal xoff, SUMOReal yoff);
+
+ /// @brief mirror coordinates along the x-axis
+ void mirrorX();
/// @}
diff --git a/src/netbuild/NBEdge.cpp b/src/netbuild/NBEdge.cpp
index f0f60f4..0575632 100644
--- a/src/netbuild/NBEdge.cpp
+++ b/src/netbuild/NBEdge.cpp
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Tue, 20 Nov 2001
-/// @version $Id: NBEdge.cpp 18122 2015-03-20 16:03:12Z namdre $
+/// @version $Id: NBEdge.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Methods for the representation of a single edge
/****************************************************************************/
@@ -58,6 +58,8 @@
#include <foreign/nvwa/debug_new.h>
#endif // CHECK_MEMORY_LEAKS
+#define DEBUGID "disabled"
+
// ===========================================================================
// static members
// ===========================================================================
@@ -194,7 +196,7 @@ NBEdge::NBEdge(const std::string& id, NBNode* from, NBNode* to,
myPossibleTurnDestination(0),
myFromJunctionPriority(-1), myToJunctionPriority(-1),
myLaneSpreadFunction(spread), myEndOffset(offset), myLaneWidth(laneWidth),
- myLoadedLength(UNSPECIFIED_LOADED_LENGTH), myAmLeftHand(false),
+ myLoadedLength(UNSPECIFIED_LOADED_LENGTH),
myAmInnerEdge(false), myAmMacroscopicConnector(false),
myStreetName(streetName),
mySignalOffset(UNSPECIFIED_SIGNAL_OFFSET) {
@@ -218,7 +220,7 @@ NBEdge::NBEdge(const std::string& id, NBNode* from, NBNode* to,
myPossibleTurnDestination(0),
myFromJunctionPriority(-1), myToJunctionPriority(-1),
myGeom(geom), myLaneSpreadFunction(spread), myEndOffset(offset), myLaneWidth(laneWidth),
- myLoadedLength(UNSPECIFIED_LOADED_LENGTH), myAmLeftHand(false),
+ myLoadedLength(UNSPECIFIED_LOADED_LENGTH),
myAmInnerEdge(false), myAmMacroscopicConnector(false),
myStreetName(streetName),
mySignalOffset(UNSPECIFIED_SIGNAL_OFFSET) {
@@ -241,7 +243,6 @@ NBEdge::NBEdge(const std::string& id, NBNode* from, NBNode* to, NBEdge* tpl, con
myEndOffset(tpl->getEndOffset()),
myLaneWidth(tpl->getLaneWidth()),
myLoadedLength(UNSPECIFIED_LOADED_LENGTH),
- myAmLeftHand(false),
myAmInnerEdge(false),
myAmMacroscopicConnector(false),
myStreetName(tpl->getStreetName()),
@@ -386,6 +387,20 @@ NBEdge::reshiftPosition(SUMOReal xoff, SUMOReal yoff) {
}
+void
+NBEdge::mirrorX() {
+ myGeom.mirrorX();
+ for (unsigned int i = 0; i < myLanes.size(); i++) {
+ myLanes[i].shape.mirrorX();
+ }
+ for (std::vector<Connection>::iterator i = myConnections.begin(); i != myConnections.end(); ++i) {
+ (*i).shape.mirrorX();
+ (*i).viaShape.mirrorX();
+ }
+ computeAngle(); // update angles because they are numerically sensitive (especially where based on centroids)
+}
+
+
// ----------- Edge geometry access and computation
const PositionVector
NBEdge::getInnerGeometry() const {
@@ -423,36 +438,42 @@ NBEdge::setGeometry(const PositionVector& s, bool inner) {
}
+PositionVector
+NBEdge::cutAtIntersection(const PositionVector& old) const {
+ PositionVector shape = old;
+ shape = startShapeAt(shape, myFrom);
+ if (shape.size() >= 2) {
+ shape = startShapeAt(shape.reverse(), myTo).reverse();
+ }
+ // sanity checks
+ if (shape.length() < POSITION_EPS) {
+ if (old.length() < 2 * POSITION_EPS) {
+ shape = old;
+ } else {
+ const SUMOReal midpoint = old.length() / 2;
+ // EPS*2 because otherwhise shape has only a single point
+ shape = old.getSubpart(midpoint - POSITION_EPS, midpoint + POSITION_EPS);
+ assert(shape.size() >= 2);
+ assert(shape.length() > 0);
+ }
+ } else {
+ // @note If the node shapes are overlapping we may get a shape which goes in the wrong direction
+ // in this case the result shape should shortened
+ Line lc(shape[0], shape[-1]);
+ Line lo(old[0], old[-1]);
+ if (135 < GeomHelper::getMinAngleDiff(lc.atan2DegreeAngle(), lo.atan2DegreeAngle())) {
+ shape = shape.reverse();
+ shape = shape.getSubpart(0, 2 * POSITION_EPS); // *2 because otherwhise shape has only a single point
+ }
+ }
+ return shape;
+}
+
+
void
NBEdge::computeEdgeShape() {
for (unsigned int i = 0; i < myLanes.size(); i++) {
- PositionVector& shape = myLanes[i].shape;
- PositionVector old = shape;
- shape = startShapeAt(shape, myFrom);
- if (shape.size() >= 2) {
- shape = startShapeAt(shape.reverse(), myTo).reverse();
- }
- // sanity checks
- if (shape.length() < POSITION_EPS) {
- if (old.length() < 2 * POSITION_EPS) {
- shape = old;
- } else {
- const SUMOReal midpoint = old.length() / 2;
- // EPS*2 because otherwhise shape has only a single point
- shape = old.getSubpart(midpoint - POSITION_EPS, midpoint + POSITION_EPS);
- assert(shape.size() >= 2);
- assert(shape.length() > 0);
- }
- } else {
- // @note If the node shapes are overlapping we may get a shape which goes in the wrong direction
- // in this case the result shape should shortened
- Line lc(shape[0], shape[-1]);
- Line lo(old[0], old[-1]);
- if (135 < GeomHelper::getMinAngleDiff(lc.atan2DegreeAngle(), lo.atan2DegreeAngle())) {
- shape = shape.reverse();
- shape = shape.getSubpart(0, 2 * POSITION_EPS); // *2 because otherwhise shape has only a single point
- }
- }
+ myLanes[i].shape = cutAtIntersection(myLanes[i].shape);
}
// recompute edge's length as the average of lane lenghts
SUMOReal avgLength = 0;
@@ -649,7 +670,8 @@ bool
NBEdge::addLane2LaneConnection(unsigned int from, NBEdge* dest,
unsigned int toLane, Lane2LaneInfoType type,
bool mayUseSameDestination,
- bool mayDefinitelyPass) {
+ bool mayDefinitelyPass,
+ bool keepClear) {
if (myStep == INIT_REJECT_CONNECTIONS) {
return true;
}
@@ -662,7 +684,7 @@ NBEdge::addLane2LaneConnection(unsigned int from, NBEdge* dest,
if (!addEdge2EdgeConnection(dest)) {
return false;
}
- setConnection(from, dest, toLane, type, mayUseSameDestination, mayDefinitelyPass);
+ setConnection(from, dest, toLane, type, mayUseSameDestination, mayDefinitelyPass, keepClear);
return true;
}
@@ -688,7 +710,8 @@ void
NBEdge::setConnection(unsigned int lane, NBEdge* destEdge,
unsigned int destLane, Lane2LaneInfoType type,
bool mayUseSameDestination,
- bool mayDefinitelyPass) {
+ bool mayDefinitelyPass,
+ bool keepClear) {
if (myStep == INIT_REJECT_CONNECTIONS) {
return;
}
@@ -726,6 +749,7 @@ NBEdge::setConnection(unsigned int lane, NBEdge* destEdge,
if (mayDefinitelyPass) {
myConnections.back().mayDefinitelyPass = true;
}
+ myConnections.back().keepClear = keepClear;
if (type == L2L_USER) {
myStep = LANES2LANES_USER;
} else {
@@ -906,11 +930,11 @@ NBEdge::invalidateConnections(bool reallowSetting) {
void
NBEdge::replaceInConnections(NBEdge* which, NBEdge* by, unsigned int laneOff) {
- UNUSED_PARAMETER(laneOff);
// replace in "_connectedEdges"
for (std::vector<Connection>::iterator i = myConnections.begin(); i != myConnections.end(); ++i) {
if ((*i).toEdge == which) {
(*i).toEdge = by;
+ (*i).toLane += laneOff;
}
}
// check whether it was the turn destination
@@ -981,30 +1005,20 @@ NBEdge::copyConnectionsFrom(NBEdge* src) {
bool
-NBEdge::canMoveConnection(const Connection& con, unsigned int newFromLane, const bool buildCrossingsAndWalkingAreas) const {
+NBEdge::canMoveConnection(const Connection& con, unsigned int newFromLane) const {
// only allow using newFromLane if at least 1 vClass is permitted to use
// this connection. If the connection shall be moved to a sidewalk, only create the connection if there is no walking area
const SVCPermissions common = (getPermissions(newFromLane) & con.toEdge->getPermissions(con.toLane));
- return (common > 0 && (!buildCrossingsAndWalkingAreas || common != SVC_PEDESTRIAN));
+ return (common > 0 && common != SVC_PEDESTRIAN);
}
void
-NBEdge::moveConnectionToLeft(unsigned int lane, const bool buildCrossingsAndWalkingAreas) {
+NBEdge::moveConnectionToLeft(unsigned int lane) {
unsigned int index = 0;
- if (myAmLeftHand) {
- for (int i = (int) myConnections.size() - 1; i >= 0; --i) {
- if (myConnections[i].fromLane == (int)lane
- && getTurnDestination() != myConnections[i].toEdge
- && canMoveConnection(myConnections[i], lane + 1, buildCrossingsAndWalkingAreas)) {
- index = i;
- }
- }
- } else {
- for (unsigned int i = 0; i < myConnections.size(); ++i) {
- if (myConnections[i].fromLane == (int)(lane) && canMoveConnection(myConnections[i], lane + 1, buildCrossingsAndWalkingAreas)) {
- index = i;
- }
+ for (unsigned int i = 0; i < myConnections.size(); ++i) {
+ if (myConnections[i].fromLane == (int)(lane) && canMoveConnection(myConnections[i], lane + 1)) {
+ index = i;
}
}
std::vector<Connection>::iterator i = myConnections.begin() + index;
@@ -1015,24 +1029,13 @@ NBEdge::moveConnectionToLeft(unsigned int lane, const bool buildCrossingsAndWalk
void
-NBEdge::moveConnectionToRight(unsigned int lane, const bool buildCrossingsAndWalkingAreas) {
- if (myAmLeftHand) {
- for (int i = (int) myConnections.size() - 1; i >= 0; --i) {
- if (myConnections[i].fromLane == (int)lane && getTurnDestination() != myConnections[i].toEdge && canMoveConnection(myConnections[i], lane - 1, buildCrossingsAndWalkingAreas)) {
- Connection c = myConnections[i];
- myConnections.erase(myConnections.begin() + i);
- setConnection(lane - 1, c.toEdge, c.toLane, L2L_VALIDATED, false);
- return;
- }
- }
- } else {
- for (std::vector<Connection>::iterator i = myConnections.begin(); i != myConnections.end(); ++i) {
- if ((*i).fromLane == (int)lane && canMoveConnection(*i, lane - 1, buildCrossingsAndWalkingAreas)) {
- Connection c = *i;
- i = myConnections.erase(i);
- setConnection(lane - 1, c.toEdge, c.toLane, L2L_VALIDATED, false);
- return;
- }
+NBEdge::moveConnectionToRight(unsigned int lane) {
+ for (std::vector<Connection>::iterator i = myConnections.begin(); i != myConnections.end(); ++i) {
+ if ((*i).fromLane == (int)lane && canMoveConnection(*i, lane - 1)) {
+ Connection c = *i;
+ i = myConnections.erase(i);
+ setConnection(lane - 1, c.toEdge, c.toLane, L2L_VALIDATED, false);
+ return;
}
}
}
@@ -1103,7 +1106,7 @@ NBEdge::buildInnerEdges(const NBNode& n, unsigned int noInternalNoSplits, unsign
}
}
}
- const bool rightTurnConflict = n.rightTurnConflict(
+ const bool rightTurnConflict = NBNode::rightTurnConflict(
this, con.toEdge, con.fromLane, (*i2), (*k2).toEdge, (*k2).fromLane);
// compute foe internal lanes
if (n.foes(this, con.toEdge, *i2, (*k2).toEdge) || rightTurnConflict) {
@@ -1312,9 +1315,6 @@ NBEdge::computeLaneShapes() {
}
for (unsigned int i = 0; i < myLanes.size(); ++i) {
offsets[i] += offset;
- if (myAmLeftHand) {
- offsets[i] *= -1.;
- }
}
// build the shape of each lane
@@ -1330,21 +1330,21 @@ NBEdge::computeLaneShapes() {
PositionVector
-NBEdge::computeLaneShape(unsigned int lane, SUMOReal offset) {
+NBEdge::computeLaneShape(unsigned int lane, SUMOReal offset) const {
PositionVector shape;
bool haveWarned = false;
for (int i = 0; i < (int) myGeom.size(); i++) {
if (i == 0) {
Position from = myGeom[i];
Position to = myGeom[i + 1];
- std::pair<SUMOReal, SUMOReal> offsets = laneOffset(from, to, offset, false);
+ std::pair<SUMOReal, SUMOReal> offsets = laneOffset(from, to, offset);
shape.push_back(
// (methode umbenennen; was heisst hier "-")
Position(from.x() - offsets.first, from.y() - offsets.second, from.z()));
} else if (i == static_cast<int>(myGeom.size() - 1)) {
Position from = myGeom[i - 1];
Position to = myGeom[i];
- std::pair<SUMOReal, SUMOReal> offsets = laneOffset(from, to, offset, false);
+ std::pair<SUMOReal, SUMOReal> offsets = laneOffset(from, to, offset);
shape.push_back(
// (methode umbenennen; was heisst hier "-")
Position(to.x() - offsets.first, to.y() - offsets.second, to.z()));
@@ -1352,8 +1352,8 @@ NBEdge::computeLaneShape(unsigned int lane, SUMOReal offset) {
Position from = myGeom[i - 1];
Position me = myGeom[i];
Position to = myGeom[i + 1];
- std::pair<SUMOReal, SUMOReal> offsets = laneOffset(from, me, offset, false);
- std::pair<SUMOReal, SUMOReal> offsets2 = laneOffset(me, to, offset, false);
+ std::pair<SUMOReal, SUMOReal> offsets = laneOffset(from, me, offset);
+ std::pair<SUMOReal, SUMOReal> offsets2 = laneOffset(me, to, offset);
Line l1(
Position(from.x() - offsets.first, from.y() - offsets.second),
Position(me.x() - offsets.first, me.y() - offsets.second));
@@ -1384,20 +1384,10 @@ NBEdge::computeLaneShape(unsigned int lane, SUMOReal offset) {
}
-/*std::pair<SUMOReal, SUMOReal>
-NBEdge::laneOffset(const Position& from, const Position& to, SUMOReal laneCenterOffset) {
- return laneOffset(from, to, laneCenterOffset, myAmLeftHand);
-}
-*/
-
std::pair<SUMOReal, SUMOReal>
-NBEdge::laneOffset(const Position& from, const Position& to, SUMOReal laneCenterOffset, bool leftHand) {
+NBEdge::laneOffset(const Position& from, const Position& to, SUMOReal laneCenterOffset) {
std::pair<SUMOReal, SUMOReal> offsets = GeomHelper::getNormal90D_CW(from, to, laneCenterOffset);
- if (leftHand) {
- return std::pair<SUMOReal, SUMOReal>(-offsets.first, -offsets.second);
- } else {
- return std::pair<SUMOReal, SUMOReal>(offsets.first, offsets.second);
- }
+ return std::pair<SUMOReal, SUMOReal>(offsets.first, offsets.second);
}
@@ -1443,7 +1433,7 @@ NBEdge::computeAngle() {
bool
-NBEdge::hasRestrictions() const {
+NBEdge::hasPermissions() const {
for (std::vector<Lane>::const_iterator i = myLanes.begin(); i != myLanes.end(); ++i) {
if ((*i).permissions != SVCAll) {
return true;
@@ -1502,7 +1492,7 @@ NBEdge::hasLaneSpecificEndOffset() const {
bool
NBEdge::needsLaneSpecificOutput() const {
- return hasRestrictions() || hasLaneSpecificSpeed() || hasLaneSpecificWidth() || hasLaneSpecificEndOffset();
+ return hasLaneSpecificPermissions() || hasLaneSpecificSpeed() || hasLaneSpecificWidth() || hasLaneSpecificEndOffset();
}
@@ -1529,7 +1519,7 @@ NBEdge::computeEdge2Edges(bool noLeftMovers) {
bool
-NBEdge::computeLanes2Edges(const bool buildCrossingsAndWalkingAreas) {
+NBEdge::computeLanes2Edges() {
// return if this relationship has been build in previous steps or
// during the import
if (myStep >= LANES2EDGES) {
@@ -1544,7 +1534,7 @@ NBEdge::computeLanes2Edges(const bool buildCrossingsAndWalkingAreas) {
myConnections.clear();
} else {
// divide the lanes on reachable edges
- divideOnEdges(edges, buildCrossingsAndWalkingAreas);
+ divideOnEdges(edges);
}
delete edges;
myStep = LANES2EDGES;
@@ -1553,7 +1543,7 @@ NBEdge::computeLanes2Edges(const bool buildCrossingsAndWalkingAreas) {
bool
-NBEdge::recheckLanes(const bool buildCrossingsAndWalkingAreas) {
+NBEdge::recheckLanes() {
std::vector<unsigned int> connNumbersPerLane(myLanes.size(), 0);
for (std::vector<Connection>::iterator i = myConnections.begin(); i != myConnections.end();) {
if ((*i).toEdge == 0 || (*i).fromLane < 0 || (*i).toLane < 0) {
@@ -1574,10 +1564,55 @@ NBEdge::recheckLanes(const bool buildCrossingsAndWalkingAreas) {
for (unsigned int i = 0; i < myLanes.size(); i++) {
if (connNumbersPerLane[i] == 0 && !isForbidden(getPermissions((int)i))) {
if (i > 0 && connNumbersPerLane[i - 1] > 1) {
- moveConnectionToLeft(i - 1, buildCrossingsAndWalkingAreas);
+ moveConnectionToLeft(i - 1);
} else if (i < myLanes.size() - 1 && connNumbersPerLane[i + 1] > 1) {
- moveConnectionToRight(i + 1, buildCrossingsAndWalkingAreas);
+ moveConnectionToRight(i + 1);
+ }
+ }
+ }
+ // check restrictions
+ for (std::vector<Connection>::iterator i = myConnections.begin(); i != myConnections.end();) {
+ Connection& c = *i;
+ const SVCPermissions common = getPermissions(c.fromLane) & c.toEdge->getPermissions(c.toLane);
+ if (common == SVC_PEDESTRIAN || getPermissions(c.fromLane) == SVC_PEDESTRIAN) {
+ // these are computed in NBNode::buildWalkingAreas
+ i = myConnections.erase(i);
+ } else if (common == 0) {
+ // no common permissions.
+ // try to find a suitable target lane to the right
+ const int origToLane = c.toLane;
+ c.toLane = -1; // ignore this connection when calling hasConnectionTo
+ int toLane = origToLane;
+ while (toLane > 0
+ && (getPermissions(c.fromLane) & c.toEdge->getPermissions(toLane)) == 0
+ && !hasConnectionTo(c.toEdge, toLane)
+ ) {
+ toLane--;
}
+ if ((getPermissions(c.fromLane) & c.toEdge->getPermissions(toLane)) != 0
+ && !hasConnectionTo(c.toEdge, toLane)) {
+ c.toLane = toLane;
+ ++i;
+ } else {
+ // try to find a suitable target lane to the left
+ int toLane = origToLane;
+ while (toLane < (int)c.toEdge->getNumLanes() - 1
+ && (getPermissions(c.fromLane) & c.toEdge->getPermissions(toLane)) == 0
+ && !hasConnectionTo(c.toEdge, toLane)
+ ) {
+ toLane++;
+ }
+ if ((getPermissions(c.fromLane) & c.toEdge->getPermissions(toLane)) != 0
+ && !hasConnectionTo(c.toEdge, toLane)) {
+ c.toLane = toLane;
+ ++i;
+ } else {
+ // no alternative target found
+ i = myConnections.erase(i);
+ }
+ }
+ } else {
+ ++i;
}
}
}
@@ -1590,7 +1625,7 @@ NBEdge::recheckLanes(const bool buildCrossingsAndWalkingAreas) {
void
-NBEdge::divideOnEdges(const EdgeVector* outgoing, const bool buildCrossingsAndWalkingAreas) {
+NBEdge::divideOnEdges(const EdgeVector* outgoing) {
if (outgoing->size() == 0) {
// we have to do this, because the turnaround may have been added before
myConnections.clear();
@@ -1599,27 +1634,73 @@ NBEdge::divideOnEdges(const EdgeVector* outgoing, const bool buildCrossingsAndWa
// precompute edge priorities; needed as some kind of assumptions for
// priorities of directions (see preparePriorities)
std::vector<unsigned int>* priorities = prepareEdgePriorities(outgoing);
- // compute the sum of priorities (needed for normalisation)
- unsigned int prioSum = computePrioritySum(priorities);
// compute the indices of lanes that should have connections (excluding
// forbidden lanes and pedestrian lanes that will be connected via walkingAreas)
+
+
+ // build connections for miv lanes
std::vector<int> availableLanes;
for (int i = 0; i < (int)myLanes.size(); ++i) {
const SVCPermissions perms = getPermissions(i);
- if ((perms == SVC_PEDESTRIAN && buildCrossingsAndWalkingAreas) || isForbidden(perms)) {
+ if ((perms & ~(SVC_PEDESTRIAN | SVC_BICYCLE | SVC_BUS)) == 0 || isForbidden(perms)) {
+ continue;
+ }
+ availableLanes.push_back(i);
+ }
+ if (availableLanes.size() > 0) {
+ divideSelectedLanesOnEdges(outgoing, availableLanes, priorities);
+ }
+ // build connections for busses (possibly combined with bicycles)
+ availableLanes.clear();
+ for (int i = 0; i < (int)myLanes.size(); ++i) {
+ const SVCPermissions perms = getPermissions(i);
+ if (perms != SVC_BUS && perms != (SVC_BUS | SVC_BICYCLE)) {
+ continue;
+ }
+ availableLanes.push_back(i);
+ }
+ if (availableLanes.size() > 0) {
+ divideSelectedLanesOnEdges(outgoing, availableLanes, priorities);
+ }
+ // build connections for bicycles (possibly combined with pedestrians)
+ availableLanes.clear();
+ for (int i = 0; i < (int)myLanes.size(); ++i) {
+ const SVCPermissions perms = getPermissions(i);
+ if (perms != SVC_BICYCLE && perms != (SVC_BICYCLE | SVC_PEDESTRIAN)) {
continue;
}
availableLanes.push_back(i);
}
+ if (availableLanes.size() > 0) {
+ divideSelectedLanesOnEdges(outgoing, availableLanes, priorities);
+ }
+ // clean up unassigned fromLanes
+ for (std::vector<Connection>::iterator i = myConnections.begin(); i != myConnections.end();) {
+ if ((*i).fromLane == -1) {
+ i = myConnections.erase(i);
+ } else {
+ ++i;
+ }
+ }
+ sortOutgoingConnectionsByIndex();
+
+ delete priorities;
+}
+
+
+void
+NBEdge::divideSelectedLanesOnEdges(const EdgeVector* outgoing, const std::vector<int>& availableLanes, const std::vector<unsigned int>* priorities) {
+ //std::cout << "divideSelectedLanesOnEdges " << getID() << " out=" << toString(*outgoing) << " prios=" << toString(*priorities) << " avail=" << toString(availableLanes) << "\n";
+ // compute the sum of priorities (needed for normalisation)
+ unsigned int prioSum = computePrioritySum(*priorities);
// compute the resulting number of lanes that should be used to
// reach the following edge
- unsigned int size = (unsigned int) outgoing->size();
+ const int numOutgoing = (int) outgoing->size();
std::vector<SUMOReal> resultingLanes;
- resultingLanes.reserve(size);
- SUMOReal sumResulting = 0; // the sum of resulting lanes
- SUMOReal minResulting = 10000; // the least number of lanes to reach an edge
- unsigned int i;
- for (i = 0; i < size; i++) {
+ resultingLanes.reserve(numOutgoing);
+ SUMOReal sumResulting = 0.; // the sum of resulting lanes
+ SUMOReal minResulting = 10000.; // the least number of lanes to reach an edge
+ for (int i = 0; i < numOutgoing; i++) {
// res will be the number of lanes which are meant to reach the
// current outgoing edge
SUMOReal res =
@@ -1639,49 +1720,66 @@ NBEdge::divideOnEdges(const EdgeVector* outgoing, const bool buildCrossingsAndWa
}
// compute the number of virtual edges
// a virtual edge is used as a replacement for a real edge from now on
- // it shall ollow to divide the existing lanes on this structure without
+ // it shall allow to divide the existing lanes on this structure without
// regarding the structure of outgoing edges
- sumResulting += minResulting / (SUMOReal) 2.;
- unsigned int noVirtual = (unsigned int)(sumResulting / minResulting);
+ const int numVirtual = (int)(sumResulting / minResulting + 0.5);
// compute the transition from virtual to real edges
EdgeVector transition;
- transition.reserve(size);
- for (i = 0; i < size; i++) {
+ transition.reserve(numOutgoing);
+ for (int i = 0; i < numOutgoing; i++) {
// tmpNo will be the number of connections from this edge
// to the next edge
- assert(i < resultingLanes.size());
- SUMOReal tmpNo = (SUMOReal) resultingLanes[i] / (SUMOReal) minResulting;
- for (SUMOReal j = 0; j < tmpNo; j++) {
- assert(outgoing->size() > i);
+ assert(i < (int)resultingLanes.size());
+ const SUMOReal tmpNum = resultingLanes[i] / minResulting;
+ for (SUMOReal j = 0; j < tmpNum; j++) {
transition.push_back((*outgoing)[i]);
}
}
// assign lanes to edges
// (conversion from virtual to real edges is done)
ToEdgeConnectionsAdder adder(transition);
- Bresenham::compute(&adder, static_cast<unsigned int>(availableLanes.size()), noVirtual);
+ Bresenham::compute(&adder, static_cast<unsigned int>(availableLanes.size()), numVirtual);
const std::map<NBEdge*, std::vector<unsigned int> >& l2eConns = adder.getBuiltConnections();
- myConnections.clear();
for (std::map<NBEdge*, std::vector<unsigned int> >::const_iterator i = l2eConns.begin(); i != l2eConns.end(); ++i) {
+ NBEdge* target = (*i).first;
const std::vector<unsigned int> lanes = (*i).second;
for (std::vector<unsigned int>::const_iterator j = lanes.begin(); j != lanes.end(); ++j) {
const int fromIndex = availableLanes[*j];
- if ((getPermissions(fromIndex) & (*i).first->getPermissions()) == 0) {
+ if ((getPermissions(fromIndex) & target->getPermissions()) == 0) {
// exclude connection if fromLane and toEdge have no common permissions
continue;
}
- if (buildCrossingsAndWalkingAreas && (getPermissions(fromIndex) & (*i).first->getPermissions()) == SVC_PEDESTRIAN) {
- // exclude connection if the only commonly permitted class are pedestrians and there is already a walkingArea
+ if ((getPermissions(fromIndex) & target->getPermissions()) == SVC_PEDESTRIAN) {
+ // exclude connection if the only commonly permitted class are pedestrians
+ // these connections are later built in NBNode::buildWalkingAreas
continue;
}
- if (myAmLeftHand) {
- myConnections.push_back(Connection(int(myLanes.size() - 1 - fromIndex), (*i).first, -1));
- } else {
- myConnections.push_back(Connection(fromIndex, (*i).first, -1));
+ // avoid building more connections than the edge has viable lanes (earlier
+ // ones have precedence). This is necessary when running divideSelectedLanesOnEdges more than once.
+ // @todo To decide which target lanes are still available we need to do a
+ // preliminary lane-to-lane assignment in regard to permisions (rather than to ordering)
+ const int numConsToTarget = (int)count_if(myConnections.begin(), myConnections.end(), connections_toedge_finder(target, true));
+ int targetLanes = (int)target->getNumLanes();
+ if (target->getPermissions(0) == SVC_PEDESTRIAN) {
+ --targetLanes;
+ }
+ if (numConsToTarget >= targetLanes) {
+ // let bicycles move onto the road to allow continuation
+ // the speed limit is taken from rural roads (which allow cycles)
+ // (pending implementation of #1859)
+ if (getPermissions(fromIndex) == SVC_BICYCLE && getSpeed() <= (101 / 3.6)) {
+ for (unsigned int ii = 0; ii < myLanes.size(); ++ii) {
+ if (myLanes[ii].permissions != SVC_PEDESTRIAN) {
+ myLanes[ii].permissions |= SVC_BICYCLE;
+ }
+ }
+ }
+ continue;
}
+
+ myConnections.push_back(Connection(fromIndex, target, -1));
}
}
- delete priorities;
}
@@ -1710,17 +1808,21 @@ NBEdge::prepareEdgePriorities(const EdgeVector* outgoing) {
unsigned int dist = (unsigned int) distance(outgoing->begin(), i);
if (dist != 0 && !mainDirections.includes(MainDirections::DIR_RIGHTMOST)) {
assert(priorities->size() > 0);
- (*priorities)[0] = (*priorities)[0] / 2;
+ (*priorities)[0] /= 2;
}
// HEURISTIC:
// when no higher priority exists, let the forward direction be
// the main direction
if (mainDirections.empty()) {
assert(dist < priorities->size());
- (*priorities)[dist] = (*priorities)[dist] * 2;
+ (*priorities)[dist] *= 2;
}
- if (mainDirections.includes(MainDirections::DIR_FORWARD) && myLanes.size() > 2) {
- (*priorities)[dist] = (*priorities)[dist] * 2;
+ if (mainDirections.includes(MainDirections::DIR_FORWARD)) {
+ if (myLanes.size() > 2) {
+ (*priorities)[dist] *= 2;
+ } else {
+ (*priorities)[dist] *= 3;
+ }
}
// return
return priorities;
@@ -1728,10 +1830,10 @@ NBEdge::prepareEdgePriorities(const EdgeVector* outgoing) {
unsigned int
-NBEdge::computePrioritySum(std::vector<unsigned int>* priorities) {
+NBEdge::computePrioritySum(const std::vector<unsigned int>& priorities) {
unsigned int sum = 0;
- for (std::vector<unsigned int>::iterator i = priorities->begin(); i != priorities->end(); i++) {
- sum += int(*i);
+ for (std::vector<unsigned int>::const_iterator i = priorities.begin(); i != priorities.end(); i++) {
+ sum += (int) * i;
}
return sum;
}
@@ -1907,11 +2009,11 @@ NBEdge::getCWBoundaryLine(const NBNode& n) const {
SUMOReal width;
if (myFrom == (&n)) {
// outgoing
- ret = !myAmLeftHand ? myLanes[0].shape : myLanes.back().shape;
+ ret = myLanes[0].shape;
width = getLaneWidth(0);
} else {
// incoming
- ret = !myAmLeftHand ? myLanes.back().shape.reverse() : myLanes[0].shape.reverse();
+ ret = myLanes.back().shape.reverse();
width = getLaneWidth((int)getNumLanes() - 1);
}
ret.move2side(width * 0.5);
@@ -1925,11 +2027,11 @@ NBEdge::getCCWBoundaryLine(const NBNode& n) const {
SUMOReal width;
if (myFrom == (&n)) {
// outgoing
- ret = !myAmLeftHand ? myLanes.back().shape : myLanes[0].shape;
+ ret = myLanes.back().shape;
width = getLaneWidth((int)getNumLanes() - 1);
} else {
// incoming
- ret = !myAmLeftHand ? myLanes[0].shape.reverse() : myLanes.back().shape.reverse();
+ ret = myLanes[0].shape.reverse();
width = getLaneWidth(0);
}
ret.move2side(-width * 0.5);
@@ -1951,6 +2053,15 @@ NBEdge::expandableBy(NBEdge* possContinuation) const {
if (mySpeed != possContinuation->mySpeed) {
return false;
}
+ // spreadtype should match or it will look ugly
+ if (myLaneSpreadFunction != possContinuation->myLaneSpreadFunction) {
+ return false;
+ }
+ // do not create self loops
+ if (myFrom == possContinuation->myTo) {
+ return false;
+ }
+
// the vehicle class constraints, too
/*!!!
if (myAllowedOnLanes!=possContinuation->myAllowedOnLanes
@@ -2071,6 +2182,14 @@ NBEdge::incLaneNo(unsigned int by) {
while (myLanes.size() < newLaneNo) {
myLanes.push_back(Lane(this));
}
+ // copy attributes
+ if (myLanes.size() > 1) {
+ myLanes.back().speed = myLanes[myLanes.size() - 2].speed;
+ myLanes.back().permissions = myLanes[myLanes.size() - 2].permissions;
+ myLanes.back().preferred = myLanes[myLanes.size() - 2].preferred;
+ myLanes.back().endOffset = myLanes[myLanes.size() - 2].endOffset;
+ myLanes.back().width = myLanes[myLanes.size() - 2].width;
+ }
computeLaneShapes();
const EdgeVector& incs = myFrom->getIncomingEdges();
for (EdgeVector::const_iterator i = incs.begin(); i != incs.end(); ++i) {
@@ -2335,10 +2454,23 @@ NBEdge::getFirstNonPedestrianLane(int direction) const {
return myLanes[index];
}
+
void
NBEdge::addSidewalk(SUMOReal width) {
- if (myLanes[0].permissions == SVC_PEDESTRIAN) {
- WRITE_WARNING("Edge '" + getID() + "' already has a sidewalk. Not adding another one.");
+ addRestrictedLane(width, SVC_PEDESTRIAN);
+}
+
+
+void
+NBEdge::addBikeLane(SUMOReal width) {
+ addRestrictedLane(width, SVC_BICYCLE);
+}
+
+
+void
+NBEdge::addRestrictedLane(SUMOReal width, SUMOVehicleClass vclass) {
+ if (myLanes[0].permissions == vclass) {
+ WRITE_WARNING("Edge '" + getID() + "' already has a dedicated lane for " + toString(vclass) + "s. Not adding another one.");
return;
}
if (myLaneSpreadFunction == LANESPREAD_CENTER) {
@@ -2346,10 +2478,10 @@ NBEdge::addSidewalk(SUMOReal width) {
}
// disallow pedestrians on all lanes to ensure that sidewalks are used and
// crossings can be guessed
- disallowVehicleClass(-1, SVC_PEDESTRIAN);
+ disallowVehicleClass(-1, vclass);
// add new lane
myLanes.insert(myLanes.begin(), Lane(this));
- myLanes[0].permissions = SVC_PEDESTRIAN;
+ myLanes[0].permissions = vclass;
myLanes[0].width = width;
// shift outgoing connections to the left
for (std::vector<Connection>::iterator it = myConnections.begin(); it != myConnections.end(); ++it) {
@@ -2388,7 +2520,7 @@ NBEdge::shiftPositionAtNode(NBNode* node, NBEdge* other) {
const SUMOReal dist = myGeom[i].distanceTo2D(node->getPosition());
const SUMOReal neededOffset = (getTotalWidth() + getNumLanes() * SUMO_const_laneOffset) / 2;
const SUMOReal dist2 = MIN2(myGeom.distance(other->getGeometry()[i2]),
- other->getGeometry().distance(myGeom[i]));
+ other->getGeometry().distance(myGeom[i]));
const SUMOReal neededOffset2 = neededOffset + (other->getTotalWidth() + other->getNumLanes() * SUMO_const_laneOffset) / 2;
if (dist < neededOffset && dist2 < neededOffset2) {
PositionVector tmp = myGeom;
diff --git a/src/netbuild/NBEdge.h b/src/netbuild/NBEdge.h
index 0742224..8ab9ff8 100644
--- a/src/netbuild/NBEdge.h
+++ b/src/netbuild/NBEdge.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 20 Nov 2001
-/// @version $Id: NBEdge.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: NBEdge.h 18756 2015-08-31 19:16:33Z behrisch $
///
// The representation of a single edge during network building
/****************************************************************************/
@@ -153,7 +153,7 @@ public:
*/
Connection(int fromLane_, NBEdge* toEdge_, int toLane_)
: fromLane(fromLane_), toEdge(toEdge_), toLane(toLane_),
- mayDefinitelyPass(false), haveVia(false) { }
+ mayDefinitelyPass(false), keepClear(true), haveVia(false) { }
~Connection() { }
@@ -170,6 +170,8 @@ public:
unsigned int tlLinkNo;
/// @brief Information about being definitely free to drive (on-ramps)
bool mayDefinitelyPass;
+ /// @brief whether the junction must be kept clear when using this connection
+ bool keepClear;
std::string origID;
@@ -195,7 +197,7 @@ public:
/// Computes the offset from the edge shape on the current segment
static std::pair<SUMOReal, SUMOReal> laneOffset(const Position& from,
- const Position& to, SUMOReal laneCenterOffset, bool leftHand);
+ const Position& to, SUMOReal laneCenterOffset);
/// @brief unspecified lane width
static const SUMOReal UNSPECIFIED_WIDTH;
@@ -327,16 +329,10 @@ public:
* @param[in] yoff The y-offset to apply
*/
void reshiftPosition(SUMOReal xoff, SUMOReal yoff);
- /// @}
-
-
-
- /** @brief Marks this edge to be left-handed
- */
- void setLeftHanded() {
- myAmLeftHand = true;
- }
+ /// @brief mirror coordinates along the x-axis
+ void mirrorX();
+ /// @}
/// @name Atomar getter methods
//@{
@@ -496,14 +492,6 @@ public:
mySignalOffset = offset;
}
- /** @brief Returns the type name
- * @return The name of this edge's type
- */
- const std::string& getTypeName() const {
- return myType;
- }
-
-
/** @brief Returns the lane definitions
* @return The stored lane definitions
*/
@@ -680,7 +668,8 @@ public:
bool addLane2LaneConnection(unsigned int fromLane, NBEdge* dest,
unsigned int toLane, Lane2LaneInfoType type,
bool mayUseSameDestination = false,
- bool mayDefinitelyPass = false);
+ bool mayDefinitelyPass = false,
+ bool keepClear = true);
/** @brief Builds no connections starting at the given lanes
@@ -720,7 +709,8 @@ public:
unsigned int destLane,
Lane2LaneInfoType type,
bool mayUseSameDestination = false,
- bool mayDefinitelyPass = false);
+ bool mayDefinitelyPass = false,
+ bool keepClear = true);
@@ -910,7 +900,7 @@ public:
bool needsLaneSpecificOutput() const;
/// @brief whether at least one lane has restrictions
- bool hasRestrictions() const;
+ bool hasPermissions() const;
/// @brief whether lanes differ in allowed vehicle classes
bool hasLaneSpecificPermissions() const;
@@ -928,11 +918,11 @@ public:
bool computeEdge2Edges(bool noLeftMovers);
/// computes the edge, step2: computation of which lanes approach the edges)
- bool computeLanes2Edges(const bool buildCrossingsAndWalkingAreas);
+ bool computeLanes2Edges();
/** recheck whether all lanes within the edge are all right and
optimises the connections once again */
- bool recheckLanes(const bool buildCrossingsAndWalkingAreas);
+ bool recheckLanes();
/** @brief Add a connection to the previously computed turnaround, if wished
*
@@ -1026,6 +1016,9 @@ public:
/// add a pedestrian sidewalk of the given width and shift existing connctions
void addSidewalk(SUMOReal width);
+ /// add a bicycle lane of the given width and shift existing connctions
+ void addBikeLane(SUMOReal width);
+
/// @brief set allowed/disallowed classes for the given lane or for all lanes if -1 is given
void setPermissions(SVCPermissions permissions, int lane = -1);
@@ -1086,6 +1079,8 @@ public:
mySigns.push_back(sign);
}
+ /// @brief cut shape at the intersection shapes
+ PositionVector cutAtIntersection(const PositionVector& old) const;
private:
/**
@@ -1168,7 +1163,7 @@ private:
};
/// Computes the shape for the given lane
- PositionVector computeLaneShape(unsigned int lane, SUMOReal offset);
+ PositionVector computeLaneShape(unsigned int lane, SUMOReal offset) const;
/// Computes the offset from the edge shape on the current segment
//std::pair<SUMOReal, SUMOReal> laneOffset(const Position& from, const Position& to, SUMOReal laneCenterOffset);
@@ -1197,7 +1192,9 @@ private:
/** divides the lanes on the outgoing edges */
- void divideOnEdges(const EdgeVector* outgoing, const bool buildCrossingsAndWalkingAreas);
+ void divideOnEdges(const EdgeVector* outgoing);
+ void divideSelectedLanesOnEdges(const EdgeVector* outgoing, const std::vector<int>& availableLanes,
+ const std::vector<unsigned int>* priorities);
/** recomputes the edge priorities and manipulates them for a distribution
of lanes on edges which is more like in real-life */
@@ -1205,7 +1202,7 @@ private:
const EdgeVector* outgoing);
/** computes the sum of the given list's entries (sic!) */
- unsigned int computePrioritySum(std::vector<unsigned int>* priorities);
+ static unsigned int computePrioritySum(const std::vector<unsigned int>& priorities);
/// @name Setting and getting connections
@@ -1213,14 +1210,14 @@ private:
/** moves a connection one place to the left;
Attention! no checking for field validity */
- void moveConnectionToLeft(unsigned int lane, const bool buildCrossingsAndWalkingAreas);
+ void moveConnectionToLeft(unsigned int lane);
/** moves a connection one place to the right;
Attention! no checking for field validity */
- void moveConnectionToRight(unsigned int lane, const bool buildCrossingsAndWalkingAreas);
+ void moveConnectionToRight(unsigned int lane);
/// @brief whether the connection can originate on newFromLane
- bool canMoveConnection(const Connection& con, unsigned int newFromLane, const bool buildCrossingsAndWalkingAreas) const;
+ bool canMoveConnection(const Connection& con, unsigned int newFromLane) const;
/// @}
@@ -1238,6 +1235,10 @@ private:
* geometries considering their rspective widths */
static SUMOReal firstIntersection(const PositionVector& v1, const PositionVector& v2, SUMOReal width2);
+
+ /// add a lane of the given width, restricted to the given class and shift existing connctions
+ void addRestrictedLane(SUMOReal width, SUMOVehicleClass vclass);
+
private:
/** @brief The building step
* @see EdgeBuildingStep
@@ -1304,10 +1305,6 @@ private:
/// @brief An optional length to use (-1 if not valid)
SUMOReal myLoadedLength;
- /// @brief Whether this edge is a left-hand edge
- bool myAmLeftHand;
-
-
/// @brief Information whether this is a junction-inner edge
bool myAmInnerEdge;
@@ -1372,13 +1369,16 @@ public:
class connections_toedge_finder {
public:
/// constructor
- connections_toedge_finder(NBEdge* const edge2find) : myEdge2Find(edge2find) { }
+ connections_toedge_finder(NBEdge* const edge2find, bool hasFromLane = false) :
+ myHasFromLane(hasFromLane),
+ myEdge2Find(edge2find) { }
bool operator()(const Connection& c) const {
- return c.toEdge == myEdge2Find;
+ return c.toEdge == myEdge2Find && (!myHasFromLane || c.fromLane != -1);
}
private:
+ const bool myHasFromLane;
NBEdge* const myEdge2Find;
private:
diff --git a/src/netbuild/NBEdgeCont.cpp b/src/netbuild/NBEdgeCont.cpp
index e1eff94..e62ac71 100644
--- a/src/netbuild/NBEdgeCont.cpp
+++ b/src/netbuild/NBEdgeCont.cpp
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Tue, 20 Nov 2001
-/// @version $Id: NBEdgeCont.cpp 18172 2015-03-27 17:02:39Z behrisch $
+/// @version $Id: NBEdgeCont.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Storage for edges, including some functionality operating on multiple edges
/****************************************************************************/
@@ -44,6 +44,7 @@
#include <utils/common/MsgHandler.h>
#include <utils/common/ToString.h>
#include <utils/common/TplConvert.h>
+#include <utils/common/StringUtils.h>
#include <utils/options/OptionsCont.h>
#include "NBNetBuilder.h"
#include "NBEdgeCont.h"
@@ -82,11 +83,10 @@ NBEdgeCont::~NBEdgeCont() {
void
NBEdgeCont::applyOptions(OptionsCont& oc) {
- myAmLeftHanded = oc.getBool("lefthand");
// set edges dismiss/accept options
myEdgesMinSpeed = oc.isSet("keep-edges.min-speed") ? oc.getFloat("keep-edges.min-speed") : -1;
myRemoveEdgesAfterJoining = oc.exists("keep-edges.postload") && oc.getBool("keep-edges.postload");
- // we possibly have to load the edges to keep
+ // we possibly have to load the edges to keep/remove
if (oc.isSet("keep-edges.input-file")) {
std::ifstream strm(oc.getString("keep-edges.input-file").c_str());
if (!strm.good()) {
@@ -96,6 +96,25 @@ NBEdgeCont::applyOptions(OptionsCont& oc) {
std::string name;
strm >> name;
myEdges2Keep.insert(name);
+ // maybe we're loading an edge-selection
+ if (StringUtils::startsWith(name, "edge:")) {
+ myEdges2Keep.insert(name.substr(5));
+ }
+ }
+ }
+ if (oc.isSet("remove-edges.input-file")) {
+ std::ifstream strm(oc.getString("remove-edges.input-file").c_str());
+ if (!strm.good()) {
+ throw ProcessError("Could not load names of edges too remove from '" + oc.getString("remove-edges.input-file") + "'.");
+ }
+ while (strm.good()) {
+ std::string name;
+ strm >> name;
+ myEdges2Remove.insert(name);
+ // maybe we're loading an edge-selection
+ if (StringUtils::startsWith(name, "edge:")) {
+ myEdges2Remove.insert(name.substr(5));
+ }
}
}
if (oc.isSet("keep-edges.explicit")) {
@@ -168,9 +187,6 @@ NBEdgeCont::clear() {
// ----- edge access methods
bool
NBEdgeCont::insert(NBEdge* edge, bool ignorePrunning) {
- if (myAmLeftHanded) {
- edge->setLeftHanded();
- }
if (myEdges.count(edge->getID())) {
return false;
}
@@ -270,7 +286,8 @@ NBEdgeCont::retrieve(const std::string& id, bool retrieveExtracted) const {
return (*i).second;
}
-
+// FIXME: This can't work
+/*
NBEdge*
NBEdgeCont::retrievePossiblySplit(const std::string& id, bool downstream) const {
NBEdge* edge = retrieve(id);
@@ -287,6 +304,24 @@ NBEdgeCont::retrievePossiblySplit(const std::string& id, bool downstream) const
candidates = downstream ? &edge->getToNode()->getOutgoingEdges() : &edge->getFromNode()->getIncomingEdges();
}
return edge;
+}*/
+
+NBEdge*
+NBEdgeCont::retrievePossiblySplit(const std::string& id, bool downstream) const {
+ NBEdge* edge = retrieve(id);
+ if (edge != 0) {
+ return edge;
+ }
+ // NOTE: (TODO) for multiply split edges (e.g. 15[0][0]) one could try recursion
+ if ((retrieve(id + "[0]") != 0) && (retrieve(id + "[1]") != 0)) {
+ // Edge was split during the netbuilding process
+ if (downstream == true) {
+ return retrieve(id + "[1]");
+ } else {
+ return retrieve(id + "[0]");
+ }
+ }
+ return edge;
}
@@ -583,17 +618,17 @@ NBEdgeCont::computeEdge2Edges(bool noLeftMovers) {
void
-NBEdgeCont::computeLanes2Edges(const bool buildCrossingsAndWalkingAreas) {
+NBEdgeCont::computeLanes2Edges() {
for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); i++) {
- (*i).second->computeLanes2Edges(buildCrossingsAndWalkingAreas);
+ (*i).second->computeLanes2Edges();
}
}
void
-NBEdgeCont::recheckLanes(const bool buildCrossingsAndWalkingAreas) {
+NBEdgeCont::recheckLanes() {
for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); i++) {
- (*i).second->recheckLanes(buildCrossingsAndWalkingAreas);
+ (*i).second->recheckLanes();
}
}
@@ -695,7 +730,7 @@ NBEdgeCont::joinSameNodeConnectingEdges(NBDistrictCont& dc,
newEdge->addEdge2EdgeConnection(*j);
}
}
- // move lane2lane-connections
+ // copy outgoing connections to the new edge
unsigned int currLane = 0;
for (i = edges.begin(); i != edges.end(); i++) {
newEdge->moveOutgoingConnectionsFrom(*i, currLane);
@@ -739,8 +774,8 @@ NBEdgeCont::recheckLaneSpread() {
// ----- other
void
-NBEdgeCont::addPostProcessConnection(const std::string& from, int fromLane, const std::string& to, int toLane, bool mayDefinitelyPass) {
- myConnections.push_back(PostProcessConnection(from, fromLane, to, toLane, mayDefinitelyPass));
+NBEdgeCont::addPostProcessConnection(const std::string& from, int fromLane, const std::string& to, int toLane, bool mayDefinitelyPass, bool keepClear) {
+ myConnections.push_back(PostProcessConnection(from, fromLane, to, toLane, mayDefinitelyPass, keepClear));
}
@@ -750,7 +785,7 @@ NBEdgeCont::recheckPostProcessConnections() {
NBEdge* from = retrievePossiblySplit((*i).from, true);
NBEdge* to = retrievePossiblySplit((*i).to, false);
if (from != 0 && to != 0) {
- if (!from->addLane2LaneConnection((*i).fromLane, to, (*i).toLane, NBEdge::L2L_USER, false, (*i).mayDefinitelyPass)) {
+ if (!from->addLane2LaneConnection((*i).fromLane, to, (*i).toLane, NBEdge::L2L_USER, false, (*i).mayDefinitelyPass, (*i).keepClear)) {
WRITE_WARNING("Could not insert connection between '" + (*i).from + "' and '" + (*i).to + "' after build.");
}
}
diff --git a/src/netbuild/NBEdgeCont.h b/src/netbuild/NBEdgeCont.h
index f5ae273..545bfa9 100644
--- a/src/netbuild/NBEdgeCont.h
+++ b/src/netbuild/NBEdgeCont.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 20 Nov 2001
-/// @version $Id: NBEdgeCont.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: NBEdgeCont.h 18647 2015-08-18 07:09:50Z namdre $
///
// Storage for edges, including some functionality operating on multiple edges
/****************************************************************************/
@@ -371,7 +371,7 @@ public:
* @todo Recheck whether a visitor-pattern should be used herefor
* @see NBEdge::computeLanes2Edges
*/
- void computeLanes2Edges(const bool buildCrossingsAndWalkingAreas);
+ void computeLanes2Edges();
/** @brief Rechecks whether all lanes have a successor for each of the stored edges
@@ -381,7 +381,7 @@ public:
* @todo Recheck whether a visitor-pattern should be used herefor
* @see NBEdge::recheckLanes
*/
- void recheckLanes(const bool buildCrossingsAndWalkingAreas);
+ void recheckLanes();
/** @brief Appends turnarounds to all edges stored in the container
@@ -457,14 +457,6 @@ public:
void guessRoundabouts();
- /** @brief Returns whether the built edges are left-handed
- * @return Whether this edge container is left-handed
- */
- bool isLeftHanded() const {
- return myAmLeftHanded;
- }
-
-
/** @brief Returns whether the edge with the id was ignored during parsing
* @return Whether the edge with the id was ignored during parsing
*/
@@ -494,8 +486,9 @@ public:
* @param[in] to The id of the edge the connection ends at
* @param[in] toLane The number of the lane the connection ends at
* @param[in] mayDefinitelyPass Whether the connection may be passed without braking
+ * @param[in] keepClear Whether the connection must check to keep the junction clear
*/
- void addPostProcessConnection(const std::string& from, int fromLane, const std::string& to, int toLane, bool mayDefinitelyPass);
+ void addPostProcessConnection(const std::string& from, int fromLane, const std::string& to, int toLane, bool mayDefinitelyPass, bool keepClear);
/** @brief Try to set any stored connections
@@ -550,8 +543,8 @@ private:
* @param[in] toLane The number of the lane the connection ends at
* @param[in] mayDefinitelyPass Whether the connection may be passed without braking
*/
- PostProcessConnection(const std::string& from_, int fromLane_, const std::string& to_, int toLane_, bool mayDefinitelyPass_)
- : from(from_), fromLane(fromLane_), to(to_), toLane(toLane_), mayDefinitelyPass(mayDefinitelyPass_)
+ PostProcessConnection(const std::string& from_, int fromLane_, const std::string& to_, int toLane_, bool mayDefinitelyPass_, bool keepClear_)
+ : from(from_), fromLane(fromLane_), to(to_), toLane(toLane_), mayDefinitelyPass(mayDefinitelyPass_), keepClear(keepClear_)
{ }
/// @brief The id of the edge the connection starts at
std::string from;
@@ -563,6 +556,8 @@ private:
int toLane;
/// @brief Whether the connection may be passed without braking
bool mayDefinitelyPass;
+ /// @brief Whether the connection may be passed without braking
+ bool keepClear;
};
/// @brief The list of connections to recheck
@@ -584,10 +579,6 @@ private:
/// @brief the number of splits of edges during the building
unsigned int myEdgesSplit;
- /// @brief Whether the network is left-handed
- bool myAmLeftHanded;
-
-
/// @name Settings for accepting/dismissing edges
/// @{
diff --git a/src/netbuild/NBFrame.cpp b/src/netbuild/NBFrame.cpp
index 108e19b..2f715b5 100644
--- a/src/netbuild/NBFrame.cpp
+++ b/src/netbuild/NBFrame.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date 09.05.2011
-/// @version $Id: NBFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NBFrame.cpp 18478 2015-06-07 08:02:47Z namdre $
///
// Sets and checks options for netbuild
/****************************************************************************/
@@ -76,6 +76,9 @@ NBFrame::fillOptions(bool forNetgen) {
oc.doRegister("default.sidewalk-width", new Option_Float((SUMOReal) 2.0));
oc.addDescription("default.sidewalk-width", "Building Defaults", "The default width of added sidewalks");
+ oc.doRegister("default.junctions.keep-clear", new Option_Bool(true));
+ oc.addDescription("default.junctions.keep-clear", "Building Defaults", "Whether junctions should be kept clear by default");
+
// register the data processing options
oc.doRegister("no-internal-links", new Option_Bool(false)); // !!! not described
oc.addDescription("no-internal-links", "Processing", "Omits internal links");
@@ -225,15 +228,15 @@ NBFrame::fillOptions(bool forNetgen) {
oc.addDescription("tls.join", "TLS Building", "Tries to cluster tls-controlled nodes"); // !!! describe
oc.doRegister("tls.join-dist", new Option_Float(20));
- oc.addDescription("tls.join-dist", "Processing",
+ oc.addDescription("tls.join-dist", "TLS Building",
"Determines the maximal distance for joining traffic lights (defaults to 20)");
if (!forNetgen) {
oc.doRegister("tls.guess-signals", new Option_Bool(false));
- oc.addDescription("tls.guess-signals", "Processing", "Interprets tls nodes surrounding an intersection as signal positions for a larger TLS. This is typical pattern for OSM-derived networks");
+ oc.addDescription("tls.guess-signals", "TLS Building", "Interprets tls nodes surrounding an intersection as signal positions for a larger TLS. This is typical pattern for OSM-derived networks");
oc.doRegister("tls.guess-signals.dist", new Option_Float(25));
- oc.addDescription("tls.guess-signals.dist", "Processing", "Distance for interpreting nodes as signal locations");
+ oc.addDescription("tls.guess-signals.dist", "TLS Building", "Distance for interpreting nodes as signal locations");
}
@@ -282,7 +285,10 @@ NBFrame::fillOptions(bool forNetgen) {
oc.addDescription("keep-edges.explicit", "Edge Removal", "Only keep edges in STR");
oc.doRegister("keep-edges.input-file", new Option_FileName());
- oc.addDescription("keep-edges.input-file", "Edge Removal", "Only keep edges in FILE");
+ oc.addDescription("keep-edges.input-file", "Edge Removal", "Only keep edges in FILE (Each id on a single line. Selection files from SUMO-GUI are also supported)");
+
+ oc.doRegister("remove-edges.input-file", new Option_FileName());
+ oc.addDescription("remove-edges.input-file", "Edge Removal", "Remove edges in FILE. (Each id on a single line. Selection files from SUMO-GUI are also supported)");
if (!forNetgen) {
oc.doRegister("keep-edges.postload", new Option_Bool(false));
@@ -311,6 +317,7 @@ NBFrame::fillOptions(bool forNetgen) {
oc.doRegister("remove-edges.isolated", new Option_Bool(false));
oc.addSynonyme("remove-edges.isolated", "remove-isolated", true);
oc.addDescription("remove-edges.isolated", "Edge Removal", "Removes isolated edges");
+
}
@@ -351,6 +358,9 @@ NBFrame::fillOptions(bool forNetgen) {
oc.addSynonyme("ramps.set", "ramp-guess.explicite", true);
oc.addDescription("ramps.set", "Ramp Guessing", "Tries to handle the given edges as ramps");
+ oc.doRegister("ramps.unset", new Option_String());
+ oc.addDescription("ramps.unset", "Ramp Guessing", "Do not consider the given edges as ramps");
+
oc.doRegister("ramps.no-split", new Option_Bool(false));
oc.addSynonyme("ramps.no-split", "ramp-guess.no-split", true);
oc.addDescription("ramps.no-split", "Ramp Guessing", "Avoids edge splitting");
@@ -377,6 +387,10 @@ NBFrame::checkOptions() {
WRITE_ERROR("only one of the options 'keep-edges.in-boundary' or 'keep-edges.in-geo-boundary' may be given");
ok = false;
}
+ if (oc.getBool("no-internal-links") && oc.getBool("crossings.guess")) {
+ WRITE_ERROR("only one of the options 'no-internal-links' or 'crossings.guess' may be given");
+ ok = false;
+ }
return ok;
}
diff --git a/src/netbuild/NBHeightMapper.cpp b/src/netbuild/NBHeightMapper.cpp
index 2191066..a2670c2 100644
--- a/src/netbuild/NBHeightMapper.cpp
+++ b/src/netbuild/NBHeightMapper.cpp
@@ -4,7 +4,7 @@
/// @author Laura Bieker
/// @author Michael Behrisch
/// @date Sept 2011
-/// @version $Id: NBHeightMapper.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NBHeightMapper.cpp 18752 2015-08-30 19:09:05Z namdre $
///
// Set z-values for all network positions based on data from a height map
/****************************************************************************/
@@ -166,8 +166,13 @@ NBHeightMapper::loadIfSet(OptionsCont& oc) {
int
NBHeightMapper::loadShapeFile(const std::string& file) {
#ifdef HAVE_GDAL
+#if GDAL_VERSION_MAJOR < 2
OGRRegisterAll();
OGRDataSource* ds = OGRSFDriverRegistrar::Open(file.c_str(), FALSE);
+#else
+ GDALAllRegister();
+ GDALDataset* ds = (GDALDataset*) GDALOpen(file.c_str(), GA_ReadOnly);
+#endif
if (ds == NULL) {
throw ProcessError("Could not open shape file '" + file + "'.");
}
@@ -242,7 +247,11 @@ NBHeightMapper::loadShapeFile(const std::string& file) {
*/
OGRFeature::DestroyFeature(feature);
}
+#if GDAL_VERSION_MAJOR < 2
OGRDataSource::DestroyDataSource(ds);
+#else
+ GDALClose(ds);
+#endif
OCTDestroyCoordinateTransformation(toWGS84);
OGRCleanupAll();
return numFeatures;
diff --git a/src/netbuild/NBLoadedSUMOTLDef.cpp b/src/netbuild/NBLoadedSUMOTLDef.cpp
index 4b91785..11214f2 100644
--- a/src/netbuild/NBLoadedSUMOTLDef.cpp
+++ b/src/netbuild/NBLoadedSUMOTLDef.cpp
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Mar 2011
-/// @version $Id: NBLoadedSUMOTLDef.cpp 18156 2015-03-26 11:58:37Z namdre $
+/// @version $Id: NBLoadedSUMOTLDef.cpp 18495 2015-06-17 23:31:46Z namdre $
///
// A complete traffic light logic loaded from a sumo-net. (opted to reimplement
// since NBLoadedTLDef is quite vissim specific)
@@ -76,10 +76,10 @@ NBLoadedSUMOTLDef::~NBLoadedSUMOTLDef() {
NBTrafficLightLogic*
-NBLoadedSUMOTLDef::myCompute(const NBEdgeCont& ec, unsigned int brakingTime) {
+NBLoadedSUMOTLDef::myCompute(const NBEdgeCont& ec, unsigned int brakingTimeSeconds) {
// @todo what to do with those parameters?
UNUSED_PARAMETER(ec);
- UNUSED_PARAMETER(brakingTime);
+ UNUSED_PARAMETER(brakingTimeSeconds);
myTLLogic->closeBuilding();
patchIfCrossingsAdded();
return new NBTrafficLightLogic(myTLLogic);
@@ -138,7 +138,12 @@ NBLoadedSUMOTLDef::remapRemoved(NBEdge*, const EdgeVector&, const EdgeVector&) {
void
-NBLoadedSUMOTLDef::replaceRemoved(NBEdge*, int, NBEdge*, int) {}
+NBLoadedSUMOTLDef::replaceRemoved(NBEdge* removed, int removedLane, NBEdge* by, int byLane) {
+ for (NBConnectionVector::iterator it = myControlledLinks.begin(); it != myControlledLinks.end(); ++it) {
+ (*it).replaceFrom(removed, removedLane, by, byLane);
+ (*it).replaceTo(removed, removedLane, by, byLane);
+ }
+}
void
@@ -299,7 +304,14 @@ void
NBLoadedSUMOTLDef::patchIfCrossingsAdded() {
// XXX what to do if crossings are removed during network building?
const unsigned int size = myTLLogic->getNumLinks();
- unsigned int noLinksAll = size;
+ unsigned int noLinksAll = 0;
+ for (NBConnectionVector::const_iterator it = myControlledLinks.begin(); it != myControlledLinks.end(); it++) {
+ const NBConnection& c = *it;
+ if (c.getTLIndex() != NBConnection::InvalidTlIndex) {
+ noLinksAll = MAX2(noLinksAll, (unsigned int)c.getTLIndex() + 1);
+ }
+ }
+ int oldCrossings = 0;
// collect crossings
std::vector<NBNode::Crossing> crossings;
for (std::vector<NBNode*>::iterator i = myControlledNodes.begin(); i != myControlledNodes.end(); i++) {
@@ -308,8 +320,10 @@ NBLoadedSUMOTLDef::patchIfCrossingsAdded() {
(*i)->setCrossingTLIndices(noLinksAll);
copy(c.begin(), c.end(), std::back_inserter(crossings));
noLinksAll += (unsigned int)c.size();
+ oldCrossings += (*i)->numCrossingsFromSumoNet();
}
- if (crossings.size() > 0) {
+ const int newCrossings = (int)crossings.size() - oldCrossings;
+ if (newCrossings > 0) {
// collect edges
assert(size > 0);
EdgeVector fromEdges(size, 0);
@@ -322,8 +336,7 @@ NBLoadedSUMOTLDef::patchIfCrossingsAdded() {
toEdges[c.getTLIndex()] = c.getTo();
}
}
- /// XXX handle the case where some crossings are already loaded
- const std::string crossingDefaultState(crossings.size(), 'r');
+ const std::string crossingDefaultState(newCrossings, 'r');
// rebuild the logic (see NBOwnTLDef.cpp::myCompute)
const std::vector<NBTrafficLightLogic::PhaseDefinition> phases = myTLLogic->getPhases();
diff --git a/src/netbuild/NBLoadedSUMOTLDef.h b/src/netbuild/NBLoadedSUMOTLDef.h
index 66656d0..c3ba64b 100644
--- a/src/netbuild/NBLoadedSUMOTLDef.h
+++ b/src/netbuild/NBLoadedSUMOTLDef.h
@@ -3,7 +3,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Mar 2011
-/// @version $Id: NBLoadedSUMOTLDef.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NBLoadedSUMOTLDef.h 18279 2015-04-23 09:27:34Z namdre $
///
// A complete traffic light logic loaded from a sumo-net. (opted to reimplement
// since NBLoadedTLDef is quite vissim specific)
@@ -143,11 +143,11 @@ protected:
/** @brief Computes the traffic light logic finally in dependence to the type
* @param[in] ec The edge container
- * @param[in] brakingTime Duration a vehicle needs for braking in front of the tls
+ * @param[in] brakingTime Duration a vehicle needs for braking in front of the tls in seconds
* @return The computed logic
*/
NBTrafficLightLogic* myCompute(const NBEdgeCont& ec,
- unsigned int brakingTime);
+ unsigned int brakingTimeSeconds);
bool amInvalid() const;
diff --git a/src/netbuild/NBLoadedTLDef.cpp b/src/netbuild/NBLoadedTLDef.cpp
index 9a4b2cc..68fa9f6 100644
--- a/src/netbuild/NBLoadedTLDef.cpp
+++ b/src/netbuild/NBLoadedTLDef.cpp
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Tue, 29.05.2005
-/// @version $Id: NBLoadedTLDef.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NBLoadedTLDef.cpp 18279 2015-04-23 09:27:34Z namdre $
///
// A loaded (complete) traffic light logic
/****************************************************************************/
@@ -85,12 +85,12 @@ NBLoadedTLDef::SignalGroup::sortPhases() {
void
-NBLoadedTLDef::SignalGroup::patchTYellow(SUMOTime tyellow, bool forced) {
+NBLoadedTLDef::SignalGroup::patchTYellow(unsigned int tyellow, bool forced) {
if (myTYellow < 0) {
// was not set before (was not loaded)
myTYellow = tyellow;
} else if (forced && myTYellow < tyellow) {
- WRITE_WARNING("TYellow of signal group '" + getID() + "' was less than the computed one; patched (was:" + toString<SUMOTime>(myTYellow) + ", is:" + toString<int>(tyellow) + ")");
+ WRITE_WARNING("TYellow of signal group '" + getID() + "' was less than the computed one; patched (was:" + toString(myTYellow) + ", is:" + toString(tyellow) + ")");
myTYellow = tyellow;
}
}
@@ -289,7 +289,7 @@ NBLoadedTLDef::~NBLoadedTLDef() {
NBTrafficLightLogic*
-NBLoadedTLDef::myCompute(const NBEdgeCont& ec, unsigned int brakingTime) {
+NBLoadedTLDef::myCompute(const NBEdgeCont& ec, unsigned int brakingTimeSeconds) {
MsgHandler::getWarningInstance()->clear(); // !!!
NBLoadedTLDef::SignalGroupCont::const_iterator i;
// compute the switching times
@@ -299,7 +299,7 @@ NBLoadedTLDef::myCompute(const NBEdgeCont& ec, unsigned int brakingTime) {
// needed later
group->sortPhases();
// patch the yellow time for this group
- group->patchTYellow(brakingTime, OptionsCont::getOptions().getBool("tls.yellow.patch-small"));
+ group->patchTYellow(brakingTimeSeconds, OptionsCont::getOptions().getBool("tls.yellow.patch-small"));
// copy the now valid times into the container
// both the given red and green phases are added and also the
// yellow times
diff --git a/src/netbuild/NBLoadedTLDef.h b/src/netbuild/NBLoadedTLDef.h
index fc37970..ef6e692 100644
--- a/src/netbuild/NBLoadedTLDef.h
+++ b/src/netbuild/NBLoadedTLDef.h
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Sascha Krieg
/// @date Fri, 29.04.2005
-/// @version $Id: NBLoadedTLDef.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NBLoadedTLDef.h 18279 2015-04-23 09:27:34Z namdre $
///
// A loaded (complete) traffic light logic
/****************************************************************************/
@@ -142,10 +142,10 @@ public:
const NBConnection& getConnection(unsigned int pos) const;
/** @brief Sets the yellow time
- * @param[in] tyellow The yellow time to set
+ * @param[in] tyellow The yellow time to set in seconds
* @param[in] forced Whether resetting tyellow was forced by the user by setting "tls.yellow.patch-small"
*/
- void patchTYellow(SUMOTime tyellow, bool forced);
+ void patchTYellow(unsigned int tyellow, bool forced);
/** @brief Replaces a removed edge/lane
* @param[in] removed The edge to replace
@@ -320,12 +320,12 @@ protected:
/** @brief Computes the traffic light logic finally in dependence to the type
* @param[in] ec The edge container
- * @param[in] brakingTime Duration a vehicle needs for braking in front of the tls
+ * @param[in] brakingTime Duration a vehicle needs for braking in front of the tls in seconds
* @return The computed logic
* @see NBTrafficLightDefinition::myCompute
*/
NBTrafficLightLogic* myCompute(const NBEdgeCont& ec,
- unsigned int brakingTime);
+ unsigned int brakingTimeSeconds);
/** @brief Collects the nodes participating in this traffic light
diff --git a/src/netbuild/NBNetBuilder.cpp b/src/netbuild/NBNetBuilder.cpp
index bb9431a..ef7ea87 100644
--- a/src/netbuild/NBNetBuilder.cpp
+++ b/src/netbuild/NBNetBuilder.cpp
@@ -7,7 +7,7 @@
/// @author Michael Behrisch
/// @author Walter Bamberger
/// @date 20 Nov 2001
-/// @version $Id: NBNetBuilder.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NBNetBuilder.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Instance responsible for building networks
/****************************************************************************/
@@ -63,7 +63,8 @@
// method definitions
// ===========================================================================
NBNetBuilder::NBNetBuilder() :
- myEdgeCont(myTypeCont)
+ myEdgeCont(myTypeCont),
+ myHaveLoadedNetworkWithoutInternalEdges(false)
{}
@@ -88,6 +89,10 @@ NBNetBuilder::compute(OptionsCont& oc,
GeoConvHelper& geoConvHelper = GeoConvHelper::getProcessing();
+ if (oc.getBool("lefthand")) {
+ mirrorX();
+ };
+
// MODIFYING THE SETS OF NODES AND EDGES
// Removes edges that are connecting the same node
@@ -118,9 +123,9 @@ NBNetBuilder::compute(OptionsCont& oc,
// preliminary geometry computations to determine the length of edges
// This depends on turning directions and sorting of edge list
// in case junctions are joined geometry computations have to be repeated
- NBTurningDirectionsComputer::computeTurnDirections(myNodeCont);
- NBNodesEdgesSorter::sortNodesEdges(myNodeCont, oc.getBool("lefthand"));
- myNodeCont.computeNodeShapes(oc.getBool("lefthand"));
+ NBTurningDirectionsComputer::computeTurnDirections(myNodeCont, false);
+ NBNodesEdgesSorter::sortNodesEdges(myNodeCont);
+ myNodeCont.computeNodeShapes();
myEdgeCont.computeEdgeShapes();
// preliminary roundabout computations to avoid destroying roundabouts
if (oc.getBool("roundabouts.guess")) {
@@ -149,6 +154,8 @@ NBNetBuilder::compute(OptionsCont& oc,
unsigned int no = 0;
const bool removeGeometryNodes = oc.exists("geometry.remove") && oc.getBool("geometry.remove");
PROGRESS_BEGIN_MESSAGE("Removing empty nodes" + std::string(removeGeometryNodes ? " and geometry nodes" : ""));
+ // removeUnwishedNodes needs turnDirections. @todo: try to call this less often
+ NBTurningDirectionsComputer::computeTurnDirections(myNodeCont, false);
no = myNodeCont.removeUnwishedNodes(myDistrictCont, myEdgeCont, myJoinedEdges, myTLLCont, removeGeometryNodes);
PROGRESS_DONE_MESSAGE();
WRITE_MESSAGE(" " + toString(no) + " nodes removed.");
@@ -198,7 +205,7 @@ NBNetBuilder::compute(OptionsCont& oc,
// guess ramps
if ((oc.exists("ramps.guess") && oc.getBool("ramps.guess")) || (oc.exists("ramps.set") && oc.isSet("ramps.set"))) {
PROGRESS_BEGIN_MESSAGE("Guessing and setting on-/off-ramps");
- NBNodesEdgesSorter::sortNodesEdges(myNodeCont, oc.getBool("lefthand"));
+ NBNodesEdgesSorter::sortNodesEdges(myNodeCont);
NBRampsComputer::computeRamps(*this, oc);
PROGRESS_DONE_MESSAGE();
}
@@ -224,15 +231,15 @@ NBNetBuilder::compute(OptionsCont& oc,
// GEOMETRY COMPUTATION
//
PROGRESS_BEGIN_MESSAGE("Sorting nodes' edges");
- NBNodesEdgesSorter::sortNodesEdges(myNodeCont, oc.getBool("lefthand"));
+ NBNodesEdgesSorter::sortNodesEdges(myNodeCont);
PROGRESS_DONE_MESSAGE();
myEdgeCont.computeLaneShapes();
//
PROGRESS_BEGIN_MESSAGE("Computing node shapes");
if (oc.exists("geometry.junction-mismatch-threshold")) {
- myNodeCont.computeNodeShapes(oc.getBool("lefthand"), oc.getFloat("geometry.junction-mismatch-threshold"));
+ myNodeCont.computeNodeShapes(oc.getFloat("geometry.junction-mismatch-threshold"));
} else {
- myNodeCont.computeNodeShapes(oc.getBool("lefthand"));
+ myNodeCont.computeNodeShapes();
}
PROGRESS_DONE_MESSAGE();
//
@@ -240,8 +247,8 @@ NBNetBuilder::compute(OptionsCont& oc,
myEdgeCont.computeEdgeShapes();
PROGRESS_DONE_MESSAGE();
// resort edges based on the node and edge shapes
- NBNodesEdgesSorter::sortNodesEdges(myNodeCont, oc.getBool("lefthand"), true);
- NBTurningDirectionsComputer::computeTurnDirections(myNodeCont);
+ NBNodesEdgesSorter::sortNodesEdges(myNodeCont, true);
+ NBTurningDirectionsComputer::computeTurnDirections(myNodeCont, false);
// APPLY SPEED MODIFICATIONS
if (oc.exists("speed.offset")) {
@@ -262,24 +269,29 @@ NBNetBuilder::compute(OptionsCont& oc,
NBNodeTypeComputer::computeNodeTypes(myNodeCont);
PROGRESS_DONE_MESSAGE();
//
- bool buildCrossingsAndWalkingAreas = false;
+ bool haveCrossings = false;
if (oc.getBool("crossings.guess")) {
- buildCrossingsAndWalkingAreas = true;
+ haveCrossings = true;
int crossings = 0;
for (std::map<std::string, NBNode*>::const_iterator i = myNodeCont.begin(); i != myNodeCont.end(); ++i) {
crossings += (*i).second->guessCrossings();
}
WRITE_MESSAGE("Guessed " + toString(crossings) + " pedestrian crossings.");
}
- if (!oc.getBool("no-internal-links") && !buildCrossingsAndWalkingAreas) {
+ if (!haveCrossings) {
// recheck whether we had crossings in the input
for (std::map<std::string, NBNode*>::const_iterator i = myNodeCont.begin(); i != myNodeCont.end(); ++i) {
if (i->second->getCrossings().size() > 0) {
- buildCrossingsAndWalkingAreas = true;
+ haveCrossings = true;
break;
}
}
}
+
+ if (oc.isDefault("no-internal-links") && !haveCrossings && myHaveLoadedNetworkWithoutInternalEdges) {
+ oc.set("no-internal-links", "true");
+ }
+
//
PROGRESS_BEGIN_MESSAGE("Computing priorities");
NBEdgePriorityComputer::computeEdgePriorities(myNodeCont);
@@ -297,11 +309,11 @@ NBNetBuilder::compute(OptionsCont& oc,
myEdgeCont.markRoundabouts();
//
PROGRESS_BEGIN_MESSAGE("Computing approaching lanes");
- myEdgeCont.computeLanes2Edges(buildCrossingsAndWalkingAreas);
+ myEdgeCont.computeLanes2Edges();
PROGRESS_DONE_MESSAGE();
//
PROGRESS_BEGIN_MESSAGE("Dividing of lanes on approached lanes");
- myNodeCont.computeLanes2Lanes(buildCrossingsAndWalkingAreas);
+ myNodeCont.computeLanes2Lanes();
myEdgeCont.sortOutgoingLanesConnections();
PROGRESS_DONE_MESSAGE();
//
@@ -314,9 +326,14 @@ NBNetBuilder::compute(OptionsCont& oc,
PROGRESS_DONE_MESSAGE();
//
PROGRESS_BEGIN_MESSAGE("Rechecking of lane endings");
- myEdgeCont.recheckLanes(buildCrossingsAndWalkingAreas);
+ myEdgeCont.recheckLanes();
PROGRESS_DONE_MESSAGE();
+ if (haveCrossings) {
+ for (std::map<std::string, NBNode*>::const_iterator i = myNodeCont.begin(); i != myNodeCont.end(); ++i) {
+ i->second->buildCrossingsAndWalkingAreas();
+ }
+ }
// GUESS TLS POSITIONS
PROGRESS_BEGIN_MESSAGE("Assigning nodes to traffic lights");
@@ -375,11 +392,13 @@ NBNetBuilder::compute(OptionsCont& oc,
}
// walking areas shall only be built if crossings are wished as well
for (std::map<std::string, NBNode*>::const_iterator i = myNodeCont.begin(); i != myNodeCont.end(); ++i) {
- (*i).second->buildInnerEdges(buildCrossingsAndWalkingAreas);
+ (*i).second->buildInnerEdges();
}
PROGRESS_DONE_MESSAGE();
}
-
+ if (oc.getBool("lefthand")) {
+ mirrorX();
+ };
// report
WRITE_MESSAGE("-----------------------------------------------------");
@@ -405,6 +424,9 @@ NBNetBuilder::moveToOrigin(GeoConvHelper& geoConvHelper) {
Boundary boundary = geoConvHelper.getConvBoundary();
const SUMOReal x = -boundary.xmin();
const SUMOReal y = -boundary.ymin();
+ //if (lefthand) {
+ // y = boundary.ymax();
+ //}
for (std::map<std::string, NBNode*>::const_iterator i = myNodeCont.begin(); i != myNodeCont.end(); ++i) {
(*i).second->reshiftPosition(x, y);
}
@@ -419,6 +441,21 @@ NBNetBuilder::moveToOrigin(GeoConvHelper& geoConvHelper) {
}
+void
+NBNetBuilder::mirrorX() {
+ // mirror the network along the X-axis
+ for (std::map<std::string, NBNode*>::const_iterator i = myNodeCont.begin(); i != myNodeCont.end(); ++i) {
+ (*i).second->mirrorX();
+ }
+ for (std::map<std::string, NBEdge*>::const_iterator i = myEdgeCont.begin(); i != myEdgeCont.end(); ++i) {
+ (*i).second->mirrorX();
+ }
+ for (std::map<std::string, NBDistrict*>::const_iterator i = myDistrictCont.begin(); i != myDistrictCont.end(); ++i) {
+ (*i).second->mirrorX();
+ }
+}
+
+
bool
NBNetBuilder::transformCoordinates(Position& from, bool includeInBoundary, GeoConvHelper* from_srs) {
Position orig(from);
diff --git a/src/netbuild/NBNetBuilder.h b/src/netbuild/NBNetBuilder.h
index 66749dd..bda7a69 100644
--- a/src/netbuild/NBNetBuilder.h
+++ b/src/netbuild/NBNetBuilder.h
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Fri, 29.04.2005
-/// @version $Id: NBNetBuilder.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NBNetBuilder.h 18639 2015-08-17 13:59:19Z namdre $
///
// Instance responsible for building networks
/****************************************************************************/
@@ -196,6 +196,11 @@ public:
/// @}
+ /// @brief notify about style of loaded network
+ void haveLoadedNetworkWithoutInternalEdges() {
+ myHaveLoadedNetworkWithoutInternalEdges = true;
+ }
+
/**
* @brief transforms loaded coordinates
* handles projections, offsets (using GeoConvHelper) and import of height data (using NBHeightMapper)
@@ -243,10 +248,16 @@ protected:
/// @brief Map of joined edges
NBJoinedEdgesMap myJoinedEdges;
+ /// @brief whether a .net.xml without internal edges was loaded
+ bool myHaveLoadedNetworkWithoutInternalEdges;
+
private:
/// @brief shift network so its lower left corner is at 0,0
void moveToOrigin(GeoConvHelper& geoConvHelper);
+ /// @brief mirror the network along the X-axis
+ void mirrorX();
+
private:
/// @brief invalidated copy constructor
NBNetBuilder(const NBNetBuilder& s);
diff --git a/src/netbuild/NBNode.cpp b/src/netbuild/NBNode.cpp
index 2676fd1..ce4af8f 100644
--- a/src/netbuild/NBNode.cpp
+++ b/src/netbuild/NBNode.cpp
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Tue, 20 Nov 2001
-/// @version $Id: NBNode.cpp 18167 2015-03-27 11:26:11Z namdre $
+/// @version $Id: NBNode.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// The representation of a single node
/****************************************************************************/
@@ -97,7 +97,7 @@ const SUMOReal NBNode::DEFAULT_RADIUS = 1.5;
* NBNode::ApproachingDivider-methods
* ----------------------------------------------------------------------- */
NBNode::ApproachingDivider::ApproachingDivider(
- EdgeVector* approaching, NBEdge* currentOutgoing, const bool buildCrossingsAndWalkingAreas) :
+ EdgeVector* approaching, NBEdge* currentOutgoing) :
myApproaching(approaching), myCurrentOutgoing(currentOutgoing) {
// check whether origin lanes have been given
assert(myApproaching != 0);
@@ -116,7 +116,7 @@ NBNode::ApproachingDivider::ApproachingDivider(
// if the lane is targeted by an explicitly set connection we need
// to make it available anyway
for (int i = 0; i < (int)currentOutgoing->getNumLanes(); ++i) {
- if (((buildCrossingsAndWalkingAreas && currentOutgoing->getPermissions(i) == SVC_PEDESTRIAN)
+ if ((currentOutgoing->getPermissions(i) == SVC_PEDESTRIAN
|| isForbidden(currentOutgoing->getPermissions(i)))
&& approachedLanes.count(i) == 0) {
continue;
@@ -147,7 +147,6 @@ NBNode::ApproachingDivider::execute(const unsigned int src, const unsigned int d
assert(approachedLanes->size() > i);
assert(approachingLanes.size() > i);
unsigned int approached = myAvailableLanes[(*approachedLanes)[i]];
- //std::cout << "setting connection from " << incomingEdge->getID() << "_" << approachingLanes[i] << " to " << myCurrentOutgoing->getID() << "_" << approached << "\n";
incomingEdge->setConnection((unsigned int) approachingLanes[i], myCurrentOutgoing,
approached, NBEdge::L2L_COMPUTED);
}
@@ -237,7 +236,10 @@ NBNode::NBNode(const std::string& id, const Position& position,
myDistrict(0),
myHaveCustomPoly(false),
myRequest(0),
- myRadius(UNSPECIFIED_RADIUS)
+ myRadius(UNSPECIFIED_RADIUS),
+ myKeepClear(OptionsCont::getOptions().getBool("default.junctions.keep-clear")),
+ myDiscardAllCrossings(false),
+ myCrossingsLoadedFromSumoNet(0)
{ }
@@ -248,7 +250,10 @@ NBNode::NBNode(const std::string& id, const Position& position, NBDistrict* dist
myDistrict(district),
myHaveCustomPoly(false),
myRequest(0),
- myRadius(UNSPECIFIED_RADIUS)
+ myRadius(UNSPECIFIED_RADIUS),
+ myKeepClear(OptionsCont::getOptions().getBool("default.junctions.keep-clear")),
+ myDiscardAllCrossings(false),
+ myCrossingsLoadedFromSumoNet(0)
{ }
@@ -290,6 +295,13 @@ NBNode::reshiftPosition(SUMOReal xoff, SUMOReal yoff) {
}
+void
+NBNode::mirrorX() {
+ myPosition.mul(1, -1);
+ myPoly.mirrorX();
+}
+
+
// ----------- Methods for dealing with assigned traffic lights
void
NBNode::addTrafficLight(NBTrafficLightDefinition* tlDef) {
@@ -340,8 +352,8 @@ NBNode::invalidateTLS(NBTrafficLightLogicCont& tlCont) {
NBTrafficLightDefinition* newDef = new NBOwnTLDef(orig->getID(), orig->getOffset(), orig->getType());
const std::vector<NBNode*>& nodes = orig->getNodes();
while (!nodes.empty()) {
- nodes.front()->removeTrafficLight(orig);
newDef->addNode(nodes.front());
+ nodes.front()->removeTrafficLight(orig);
}
tlCont.removeFully(orig->getID());
tlCont.insert(newDef);
@@ -463,9 +475,11 @@ NBNode::computeSmoothShape(const PositionVector& begShape,
const Position end = endShape.front();
PositionVector ret;
PositionVector init;
- unsigned int noInitialPoints = 0;
+ unsigned int numInitialPoints = 0;
bool noSpline = false;
- if (beg.distanceTo(end) <= POSITION_EPS) {
+ Line begL = begShape.getEndLine();
+ Line endL = endShape.getBegLine();
+ if (beg.distanceTo(end) <= POSITION_EPS || begL.length() < POSITION_EPS || endL.length() < POSITION_EPS) {
noSpline = true;
} else {
if (isTurnaround) {
@@ -473,7 +487,7 @@ NBNode::computeSmoothShape(const PositionVector& begShape,
// - end of incoming lane
// - position between incoming/outgoing end/begin shifted by the distance orthogonally
// - begin of outgoing lane
- noInitialPoints = 3;
+ numInitialPoints = 3;
init.push_back(beg);
Line straightConn(begShape[-1], endShape[0]);
Position straightCenter = straightConn.getPositionAtDistance((SUMOReal) straightConn.length() / (SUMOReal) 2.);
@@ -485,14 +499,12 @@ NBNode::computeSmoothShape(const PositionVector& begShape,
init.push_back(center);
init.push_back(end);
} else {
- const SUMOReal angle = fabs(begShape.getEndLine().atan2Angle() - endShape.getBegLine().atan2Angle());
+ const SUMOReal angle = fabs(begL.atan2Angle() - endL.atan2Angle());
if (angle < M_PI / 4. || angle > 7. / 4.*M_PI) {
// very low angle: almost straight
- noInitialPoints = 4;
+ numInitialPoints = 4;
init.push_back(beg);
- Line begL = begShape.getEndLine();
begL.extrapolateSecondBy(100);
- Line endL = endShape.getBegLine();
endL.extrapolateFirstBy(100);
SUMOReal distance = beg.distanceTo(end);
if (distance > 10) {
@@ -518,18 +530,11 @@ NBNode::computeSmoothShape(const PositionVector& begShape,
// - intersection of the extrapolated lanes
// - begin of outgoing lane
// attention: if there is no intersection, use a straight line
- noInitialPoints = 3;
+ numInitialPoints = 3;
init.push_back(beg);
- Line begL = begShape.getEndLine();
- Line endL = endShape.getBegLine();
- bool check = !begL.p1().almostSame(begL.p2()) && !endL.p1().almostSame(endL.p2());
- if (check) {
- begL.extrapolateSecondBy(100);
- endL.extrapolateFirstBy(100);
- } else {
- WRITE_WARNING("Could not use edge geometry for internal lane, node '" + getID() + "'.");
- }
- if (!check || !begL.intersects(endL)) {
+ begL.extrapolateSecondBy(100);
+ endL.extrapolateFirstBy(100);
+ if (!begL.intersects(endL)) {
noSpline = true;
} else {
init.push_back(begL.intersectsAt(endL));
@@ -543,7 +548,7 @@ NBNode::computeSmoothShape(const PositionVector& begShape,
ret.push_back(begShape.back());
ret.push_back(endShape.front());
} else {
- SUMOReal* def = new SUMOReal[1 + noInitialPoints * 3];
+ SUMOReal* def = new SUMOReal[1 + numInitialPoints * 3];
for (int i = 0; i < (int) init.size(); ++i) {
// starts at index 1
def[i * 3 + 1] = init[i].x();
@@ -551,7 +556,7 @@ NBNode::computeSmoothShape(const PositionVector& begShape,
def[i * 3 + 3] = init[i].y();
}
SUMOReal* ret_buf = new SUMOReal[numPoints * 3 + 1];
- bezier(noInitialPoints, def, numPoints, ret_buf);
+ bezier(numInitialPoints, def, numPoints, ret_buf);
delete[] def;
Position prev;
for (int i = 0; i < (int) numPoints; i++) {
@@ -620,7 +625,7 @@ NBNode::needsCont(const NBEdge* fromE, const NBEdge* otherFromE,
LinkDirection d1 = getDirection(fromE, toE);
const bool thisRight = (d1 == LINKDIR_RIGHT || d1 == LINKDIR_PARTRIGHT);
const bool rightTurnConflict = (thisRight &&
- myRequest->rightTurnConflict(fromE, toE, c.fromLane, otherFromE, otherToE, otherC.fromLane));
+ NBNode::rightTurnConflict(fromE, toE, c.fromLane, otherFromE, otherToE, otherC.fromLane));
if (thisRight && !rightTurnConflict) {
return false;
}
@@ -682,16 +687,21 @@ NBNode::computeLogic(const NBEdgeCont& ec, OptionsCont& oc) {
unsigned int numConnections = numNormalConnections();
if (numConnections >= MAX_CONNECTIONS) {
// yep -> make it untcontrolled, warn
- WRITE_WARNING("Junction '" + getID() + "' is too complicated (#links>64); will be set to unregulated.");
delete myRequest;
myRequest = 0;
- myType = NODETYPE_NOJUNCTION;
+ if (myType == NODETYPE_TRAFFIC_LIGHT) {
+ myType = NODETYPE_TRAFFIC_LIGHT_NOJUNCTION;
+ } else {
+ myType = NODETYPE_NOJUNCTION;
+ }
+ WRITE_WARNING("Junction '" + getID() + "' is too complicated (" + toString(numConnections)
+ + " connections, max 64); will be set to " + toString(myType));
} else if (numConnections == 0) {
delete myRequest;
myRequest = 0;
myType = NODETYPE_DEAD_END;
} else {
- myRequest->buildBitfieldLogic(ec.isLeftHanded());
+ myRequest->buildBitfieldLogic();
}
}
}
@@ -708,7 +718,7 @@ NBNode::writeLogic(OutputDevice& into, const bool checkLaneFoes) const {
void
-NBNode::computeNodeShape(bool leftHand, SUMOReal mismatchThreshold) {
+NBNode::computeNodeShape(SUMOReal mismatchThreshold) {
if (myHaveCustomPoly) {
return;
}
@@ -720,7 +730,7 @@ NBNode::computeNodeShape(bool leftHand, SUMOReal mismatchThreshold) {
}
try {
NBNodeShapeComputer computer(*this);
- myPoly = computer.compute(leftHand);
+ myPoly = computer.compute();
if (myPoly.size() > 0) {
PositionVector tmp = myPoly;
tmp.push_back_noDoublePos(tmp[0]); // need closed shape
@@ -740,27 +750,29 @@ NBNode::computeNodeShape(bool leftHand, SUMOReal mismatchThreshold) {
void
-NBNode::computeLanes2Lanes(const bool buildCrossingsAndWalkingAreas) {
+NBNode::computeLanes2Lanes() {
// special case a):
// one in, one out, the outgoing has one lane more
- if (myIncomingEdges.size() == 1 && myOutgoingEdges.size() == 1
- && myIncomingEdges[0]->getStep() <= NBEdge::LANES2EDGES
- && myIncomingEdges[0]->getNumLanes() == myOutgoingEdges[0]->getNumLanes() - 1
- && myIncomingEdges[0] != myOutgoingEdges[0]
- && myIncomingEdges[0]->isConnectedTo(myOutgoingEdges[0])) {
-
- NBEdge* incoming = myIncomingEdges[0];
- NBEdge* outgoing = myOutgoingEdges[0];
+ if (myIncomingEdges.size() == 1 && myOutgoingEdges.size() == 1) {
+ NBEdge* in = myIncomingEdges[0];
+ NBEdge* out = myOutgoingEdges[0];
// check if it's not the turnaround
- if (incoming->getTurnDestination() == outgoing) {
+ if (in->getTurnDestination() == out) {
// will be added later or not...
return;
}
- for (int i = 0; i < (int) incoming->getNumLanes(); ++i) {
- incoming->setConnection(i, outgoing, i + 1, NBEdge::L2L_COMPUTED);
+ const int inOffset = MAX2(0, in->getFirstNonPedestrianLaneIndex(FORWARD, true));
+ const int outOffset = MAX2(0, out->getFirstNonPedestrianLaneIndex(FORWARD, true));
+ if (in->getStep() <= NBEdge::LANES2EDGES
+ && in->getNumLanes() - inOffset == out->getNumLanes() - outOffset - 1
+ && in != out
+ && in->isConnectedTo(out)) {
+ for (int i = inOffset; i < (int) in->getNumLanes(); ++i) {
+ in->setConnection(i, out, i + 1, NBEdge::L2L_COMPUTED);
+ }
+ in->setConnection(inOffset, out, outOffset, NBEdge::L2L_COMPUTED);
+ return;
}
- incoming->setConnection(0, outgoing, 0, NBEdge::L2L_COMPUTED);
- return;
}
// special case b):
// two in, one out, the outgoing has the same number of lanes as the sum of the incoming
@@ -769,7 +781,10 @@ NBNode::computeLanes2Lanes(const bool buildCrossingsAndWalkingAreas) {
NBEdge* out = myOutgoingEdges[0];
NBEdge* in1 = myIncomingEdges[0];
NBEdge* in2 = myIncomingEdges[1];
- if (in1->getNumLanes() + in2->getNumLanes() == out->getNumLanes()
+ const int outOffset = MAX2(0, out->getFirstNonPedestrianLaneIndex(FORWARD, true));
+ int in1Offset = MAX2(0, in1->getFirstNonPedestrianLaneIndex(FORWARD, true));
+ int in2Offset = MAX2(0, in2->getFirstNonPedestrianLaneIndex(FORWARD, true));
+ if (in1->getNumLanes() + in2->getNumLanes() - in1Offset - in2Offset == out->getNumLanes() - outOffset
&& (in1->getStep() <= NBEdge::LANES2EDGES)
&& (in2->getStep() <= NBEdge::LANES2EDGES)
&& in1 != out
@@ -783,10 +798,8 @@ NBNode::computeLanes2Lanes(const bool buildCrossingsAndWalkingAreas) {
SUMOReal cw = GeomHelper::getCWAngleDiff(a1, a2);
if (ccw > cw) {
std::swap(in1, in2);
+ std::swap(in1Offset, in2Offset);
}
- const int outOffset = MAX2(0, out->getFirstNonPedestrianLaneIndex(FORWARD, true));
- const int in1Offset = MAX2(0, in1->getFirstNonPedestrianLaneIndex(FORWARD, true));
- const int in2Offset = MAX2(0, in2->getFirstNonPedestrianLaneIndex(FORWARD, true));
in1->addLane2LaneConnections(in1Offset, out, outOffset, in1->getNumLanes() - in1Offset, NBEdge::L2L_VALIDATED, true, true);
in2->addLane2LaneConnections(in2Offset, out, in1->getNumLanes() + outOffset - in1Offset, in2->getNumLanes() - in2Offset, NBEdge::L2L_VALIDATED, true, true);
return;
@@ -799,7 +812,10 @@ NBNode::computeLanes2Lanes(const bool buildCrossingsAndWalkingAreas) {
NBEdge* in = myIncomingEdges[0];
NBEdge* out1 = myOutgoingEdges[0];
NBEdge* out2 = myOutgoingEdges[1];
- if (in->getNumLanes() == out2->getNumLanes() + out1->getNumLanes()
+ const int inOffset = MAX2(0, in->getFirstNonPedestrianLaneIndex(FORWARD, true));
+ int out1Offset = MAX2(0, out1->getFirstNonPedestrianLaneIndex(FORWARD, true));
+ int out2Offset = MAX2(0, out2->getFirstNonPedestrianLaneIndex(FORWARD, true));
+ if (in->getNumLanes() - inOffset == out2->getNumLanes() + out1->getNumLanes() - out1Offset - out2Offset
&& (in->getStep() <= NBEdge::LANES2EDGES)
&& in != out1
&& in != out2
@@ -808,10 +824,8 @@ NBNode::computeLanes2Lanes(const bool buildCrossingsAndWalkingAreas) {
// for internal: check which one is the rightmost
if (NBContHelper::relative_outgoing_edge_sorter(in)(out2, out1)) {
std::swap(out1, out2);
+ std::swap(out1Offset, out2Offset);
}
- const int inOffset = MAX2(0, in->getFirstNonPedestrianLaneIndex(FORWARD, true));
- const int out1Offset = MAX2(0, out1->getFirstNonPedestrianLaneIndex(FORWARD, true));
- const int out2Offset = MAX2(0, out2->getFirstNonPedestrianLaneIndex(FORWARD, true));
in->addLane2LaneConnections(inOffset, out1, out1Offset, out1->getNumLanes() - out1Offset, NBEdge::L2L_VALIDATED, true, true);
in->addLane2LaneConnections(out1->getNumLanes() + inOffset - out1Offset, out2, out2Offset, out2->getNumLanes() - out2Offset, NBEdge::L2L_VALIDATED, false, true);
return;
@@ -829,7 +843,7 @@ NBNode::computeLanes2Lanes(const bool buildCrossingsAndWalkingAreas) {
EdgeVector* approaching = getEdgesThatApproach(currentOutgoing);
const unsigned int numApproaching = (unsigned int)approaching->size();
if (numApproaching != 0) {
- ApproachingDivider divider(approaching, currentOutgoing, buildCrossingsAndWalkingAreas);
+ ApproachingDivider divider(approaching, currentOutgoing);
Bresenham::compute(÷r, numApproaching, divider.numAvailableLanes());
}
delete approaching;
@@ -1179,14 +1193,54 @@ NBNode::mustBrake(const NBEdge* const from, const NBEdge* const to, int fromLane
bool
NBNode::mustBrakeForCrossing(const NBEdge* const from, const NBEdge* const to, const NBNode::Crossing& crossing) const {
- return myRequest->mustBrakeForCrossing(from, to, crossing);
+ return NBRequest::mustBrakeForCrossing(this, from, to, crossing);
}
bool
NBNode::rightTurnConflict(const NBEdge* from, const NBEdge* to, int fromLane,
- const NBEdge* prohibitorFrom, const NBEdge* prohibitorTo, int prohibitorFromLane) const {
- return myRequest->rightTurnConflict(from, to, fromLane, prohibitorFrom, prohibitorTo, prohibitorFromLane);
+ const NBEdge* prohibitorFrom, const NBEdge* prohibitorTo, int prohibitorFromLane,
+ bool lefthand) {
+ if (from != prohibitorFrom) {
+ return false;
+ }
+ if (from->isTurningDirectionAt(to)
+ || prohibitorFrom->isTurningDirectionAt(prohibitorTo)) {
+ // XXX should warn if there are any non-turning connections left of this
+ return false;
+ }
+ // conflict if to is between prohibitorTo and from when going clockwise
+ if (to->getStartAngle() == prohibitorTo->getStartAngle()) {
+ // reduce rounding errors
+ return false;
+ }
+ const LinkDirection d1 = from->getToNode()->getDirection(from, to);
+ // must be a right turn to qualify as rightTurnConflict
+ if (d1 == LINKDIR_STRAIGHT) {
+ // no conflict for straight going connections
+ // XXX actually this should check the main direction (which could also
+ // be a turn)
+ return false;
+ } else {
+ const LinkDirection d2 = prohibitorFrom->getToNode()->getDirection(prohibitorFrom, prohibitorTo);
+ if (d1 == LINKDIR_LEFT || d1 == LINKDIR_PARTLEFT) {
+ // check for leftTurnConflicht
+ lefthand = !lefthand;
+ if (d2 == LINKDIR_RIGHT || d1 == LINKDIR_PARTRIGHT) {
+ // assume that the left-turning bicycle goes straight at first
+ // and thus gets precedence over a right turning vehicle
+ return false;
+ }
+ }
+ if ((!lefthand && fromLane <= prohibitorFromLane) ||
+ (lefthand && fromLane >= prohibitorFromLane)) {
+ return false;
+ }
+ const SUMOReal toAngleAtNode = fmod(to->getStartAngle() + 180, (SUMOReal)360.0);
+ const SUMOReal prohibitorToAngleAtNode = fmod(prohibitorTo->getStartAngle() + 180, (SUMOReal)360.0);
+ return (lefthand != (GeomHelper::getCWAngleDiff(from->getEndAngle(), toAngleAtNode) <
+ GeomHelper::getCWAngleDiff(from->getEndAngle(), prohibitorToAngleAtNode)));
+ }
}
@@ -1308,14 +1362,14 @@ NBNode::remapRemoved(NBTrafficLightLogicCont& tc,
LinkDirection
-NBNode::getDirection(const NBEdge* const incoming, const NBEdge* const outgoing) const {
+NBNode::getDirection(const NBEdge* const incoming, const NBEdge* const outgoing, bool leftHand) const {
// ok, no connection at all -> dead end
if (outgoing == 0) {
return LINKDIR_NODIR;
}
// turning direction
if (incoming->isTurningDirectionAt(outgoing)) {
- return LINKDIR_TURN;
+ return leftHand ? LINKDIR_TURN_LEFTHAND : LINKDIR_TURN;
}
// get the angle between incoming/outgoing at the junction
SUMOReal angle =
@@ -1330,24 +1384,42 @@ NBNode::getDirection(const NBEdge* const incoming, const NBEdge* const outgoing)
// check whether any other edge goes further to the right
EdgeVector::const_iterator i =
find(myAllEdges.begin(), myAllEdges.end(), outgoing);
- NBContHelper::nextCW(myAllEdges, i);
+ if (leftHand) {
+ NBContHelper::nextCCW(myAllEdges, i);
+ } else {
+ NBContHelper::nextCW(myAllEdges, i);
+ }
while ((*i) != incoming) {
- if ((*i)->getFromNode() == this) {
+ if ((*i)->getFromNode() == this && !incoming->isTurningDirectionAt(*i)) {
+ //std::cout << incoming->getID() << " -> " << outgoing->getID() << " partRight because auf " << (*i)->getID() << "\n";
return LINKDIR_PARTRIGHT;
}
- NBContHelper::nextCW(myAllEdges, i);
+ if (leftHand) {
+ NBContHelper::nextCCW(myAllEdges, i);
+ } else {
+ NBContHelper::nextCW(myAllEdges, i);
+ }
}
return LINKDIR_RIGHT;
}
// check whether any other edge goes further to the left
EdgeVector::const_iterator i =
find(myAllEdges.begin(), myAllEdges.end(), outgoing);
- NBContHelper::nextCCW(myAllEdges, i);
+ if (leftHand) {
+ NBContHelper::nextCW(myAllEdges, i);
+ } else {
+ NBContHelper::nextCCW(myAllEdges, i);
+ }
while ((*i) != incoming) {
if ((*i)->getFromNode() == this && !incoming->isTurningDirectionAt(*i)) {
+ //std::cout << incoming->getID() << " -> " << outgoing->getID() << " partLeft because auf " << (*i)->getID() << "\n";
return LINKDIR_PARTLEFT;
}
- NBContHelper::nextCCW(myAllEdges, i);
+ if (leftHand) {
+ NBContHelper::nextCW(myAllEdges, i);
+ } else {
+ NBContHelper::nextCCW(myAllEdges, i);
+ }
}
return LINKDIR_LEFT;
}
@@ -1378,8 +1450,8 @@ NBNode::getLinkState(const NBEdge* incoming, NBEdge* outgoing, int fromlane,
bool
NBNode::checkIsRemovable() const {
- // check whether this node is included in a traffic light
- if (myTrafficLights.size() != 0) {
+ // check whether this node is included in a traffic light or crossing
+ if (myTrafficLights.size() != 0 || myCrossings.size() != 0) {
return false;
}
EdgeVector::const_iterator i;
@@ -1390,7 +1462,7 @@ NBNode::checkIsRemovable() const {
return false;
}
//
- return myIncomingEdges[0]->getFromNode() != myOutgoingEdges[0]->getToNode();
+ return myIncomingEdges[0]->getTurnDestination(true) != myOutgoingEdges[0];
}
// two in, two out -> may be something else
if (myOutgoingEdges.size() == 2 && myIncomingEdges.size() == 2) {
@@ -1405,19 +1477,13 @@ NBNode::checkIsRemovable() const {
// check whether this node is an intermediate node of
// a two-directional street
for (i = myIncomingEdges.begin(); i != myIncomingEdges.end(); i++) {
- // try to find the opposite direction
- NBNode* origin = (*i)->getFromNode();
- // find the back direction of the current edge
- EdgeVector::const_iterator j =
- find_if(myOutgoingEdges.begin(), myOutgoingEdges.end(),
- NBContHelper::edge_with_destination_finder(origin));
- // check whether the back direction exists
- if (j != myOutgoingEdges.end()) {
- // check whether the edge from the backdirection (must be
- // the counter-clockwise one) may be joined with the current
- NBContHelper::nextCCW(myOutgoingEdges, j);
+ // each of the edges must have an opposite direction edge
+ NBEdge* opposite = (*i)->getTurnDestination(true);
+ if (opposite != 0) {
+ // the other outgoing edges must be the continuation of the current
+ NBEdge* continuation = opposite == myOutgoingEdges.front() ? myOutgoingEdges.back() : myOutgoingEdges.front();
// check whether the types allow joining
- if (!(*i)->expandableBy(*j)) {
+ if (!(*i)->expandableBy(continuation)) {
return false;
}
} else {
@@ -1446,12 +1512,11 @@ NBNode::getEdgesToJoin() const {
}
// two in, two out-case
for (EdgeVector::const_iterator i = myIncomingEdges.begin(); i != myIncomingEdges.end(); i++) {
- NBNode* origin = (*i)->getFromNode();
- EdgeVector::const_iterator j =
- find_if(myOutgoingEdges.begin(), myOutgoingEdges.end(),
- NBContHelper::edge_with_destination_finder(origin));
- NBContHelper::nextCCW(myOutgoingEdges, j);
- ret.push_back(std::pair<NBEdge*, NBEdge*>(*i, *j));
+ // join with the edge that is not a turning direction
+ NBEdge* opposite = (*i)->getTurnDestination(true);
+ assert(opposite != 0);
+ NBEdge* continuation = opposite == myOutgoingEdges.front() ? myOutgoingEdges.back() : myOutgoingEdges.front();
+ ret.push_back(std::pair<NBEdge*, NBEdge*>(*i, continuation));
}
return ret;
}
@@ -1532,7 +1597,7 @@ int
NBNode::guessCrossings() {
//gDebugFlag1 = getID() == DEBUGID;
int numGuessed = 0;
- if (myCrossings.size() > 0) {
+ if (myCrossings.size() > 0 || myDiscardAllCrossings) {
// user supplied crossings, do not guess
return numGuessed;
}
@@ -1563,6 +1628,8 @@ NBNode::guessCrossings() {
break;
}
}
+ int hadCandidates = 0;
+ std::vector<int> connectedCandidates; // number of crossings that were built for each connected candidate
if (firstSidewalk != -1) {
// rotate lanes to ensure that the first one allows pedestrians
std::vector<std::pair<NBEdge*, bool> > tmp;
@@ -1571,7 +1638,6 @@ NBNode::guessCrossings() {
normalizedLanes = tmp;
// find candidates
EdgeVector candidates;
- bool hadCandidates = false;
for (int i = 0; i < (int)normalizedLanes.size(); ++i) {
NBEdge* edge = normalizedLanes[i].first;
const bool allowsPed = normalizedLanes[i].second;
@@ -1582,20 +1648,49 @@ NBNode::guessCrossings() {
candidates.push_back(edge);
} else if (allowsPed) {
if (candidates.size() > 0) {
- if (hadCandidates || forbidsPedestriansAfter(normalizedLanes, i)) {
- hadCandidates = true;
- numGuessed += checkCrossing(candidates);
+ if (hadCandidates > 0 || forbidsPedestriansAfter(normalizedLanes, i)) {
+ hadCandidates++;
+ const int n = checkCrossing(candidates);
+ numGuessed += n;
+ if (n > 0) {
+ connectedCandidates.push_back(n);
+ }
}
candidates.clear();
}
}
}
- if (hadCandidates) {
+ if (hadCandidates > 0 && candidates.size() > 0) {
// avoid wrapping around to the same sidewalk
- numGuessed += checkCrossing(candidates);
+ hadCandidates++;
+ const int n = checkCrossing(candidates);
+ numGuessed += n;
+ if (n > 0) {
+ connectedCandidates.push_back(n);
+ }
+ }
+ }
+ // Avoid duplicate crossing between the same pair of walkingareas
+ if (gDebugFlag1) {
+ std::cout << " hadCandidates=" << hadCandidates << " connectedCandidates=" << toString(connectedCandidates) << "\n";
+ }
+ if (hadCandidates == 2 && connectedCandidates.size() == 2) {
+ // One or both of them might be split: remove the one with less splits
+ if (connectedCandidates.back() <= connectedCandidates.front()) {
+ numGuessed -= connectedCandidates.back();
+ myCrossings.erase(myCrossings.end() - connectedCandidates.back(), myCrossings.end());
+ } else {
+ numGuessed -= connectedCandidates.front();
+ myCrossings.erase(myCrossings.begin(), myCrossings.begin() + connectedCandidates.front());
}
}
std::sort(myCrossings.begin(), myCrossings.end(), NBNodesEdgesSorter::crossing_by_junction_angle_sorter(this, myAllEdges));
+ if (gDebugFlag1) {
+ std::cout << "guessedCrossings:\n";
+ for (std::vector<Crossing>::iterator it = myCrossings.begin(); it != myCrossings.end(); it++) {
+ std::cout << " edges=" << toString((*it).edges) << "\n";
+ }
+ }
return numGuessed;
}
@@ -1703,20 +1798,23 @@ NBNode::forbidsPedestriansAfter(std::vector<std::pair<NBEdge*, bool> > normalize
void
-NBNode::buildInnerEdges(bool buildCrossingsAndWalkingAreas) {
- if (buildCrossingsAndWalkingAreas) {
- buildCrossings();
- buildWalkingAreas(OptionsCont::getOptions().getInt("junctions.corner-detail"));
- // ensure that all crossings are properly connected
- for (std::vector<Crossing>::iterator it = myCrossings.begin(); it != myCrossings.end(); it++) {
- if ((*it).prevWalkingArea == "" || (*it).nextWalkingArea == "") {
- // there is no way to check this apart from trying to build all
- // walkingAreas and there is no way to recover because the junction
- // logic assumes that the crossing can be built.
- throw ProcessError("Invalid crossing '" + (*it).id + "' at node '" + getID() + "' with edges '" + toString((*it).edges) + "'.");
- }
+NBNode::buildCrossingsAndWalkingAreas() {
+ buildCrossings();
+ buildWalkingAreas(OptionsCont::getOptions().getInt("junctions.corner-detail"));
+ // ensure that all crossings are properly connected
+ for (std::vector<Crossing>::iterator it = myCrossings.begin(); it != myCrossings.end();) {
+ if ((*it).prevWalkingArea == "" || (*it).nextWalkingArea == "") {
+ WRITE_WARNING("Discarding Invalid crossing '" + (*it).id + "' at node '" + getID() + "' with edges '" + toString((*it).edges) + "'.");
+ it = myCrossings.erase(it);
+ } else {
+ ++it;
}
}
+}
+
+
+void
+NBNode::buildInnerEdges() {
// build inner edges for vehicle movements across the junction
unsigned int noInternalNoSplits = 0;
for (EdgeVector::const_iterator i = myIncomingEdges.begin(); i != myIncomingEdges.end(); i++) {
@@ -1751,9 +1849,16 @@ NBNode::buildCrossings() {
if (gDebugFlag1) {
std::cout << "build crossings for " << getID() << ":\n";
}
+ if (myDiscardAllCrossings) {
+ myCrossings.clear();
+ }
unsigned int index = 0;
- for (std::vector<Crossing>::iterator it = myCrossings.begin(); it != myCrossings.end(); it++) {
+ for (std::vector<Crossing>::iterator it = myCrossings.begin(); it != myCrossings.end();) {
(*it).id = ":" + getID() + "_c" + toString(index++);
+ // reset fields, so repeated computation (Netedit) will sucessfully perform the checks
+ // in buildWalkingAreas (split crossings) and buildInnerEdges (sanity check)
+ (*it).nextWalkingArea = "";
+ (*it).prevWalkingArea = "";
EdgeVector& edges = (*it).edges;
if (gDebugFlag1) {
std::cout << " crossing=" << (*it).id << " edges=" << toString(edges);
@@ -1797,16 +1902,24 @@ NBNode::buildCrossings() {
(*it).shape.clear();
const int begDir = (edges.front()->getFromNode() == this ? FORWARD : BACKWARD);
const int endDir = (edges.back()->getToNode() == this ? FORWARD : BACKWARD);
- NBEdge::Lane crossingBeg = edges.front()->getFirstNonPedestrianLane(begDir);
- NBEdge::Lane crossingEnd = edges.back()->getFirstNonPedestrianLane(endDir);
- crossingBeg.width = (crossingBeg.width == NBEdge::UNSPECIFIED_WIDTH ? SUMO_const_laneWidth : crossingBeg.width);
- crossingEnd.width = (crossingEnd.width == NBEdge::UNSPECIFIED_WIDTH ? SUMO_const_laneWidth : crossingEnd.width);
- crossingBeg.shape.move2side(begDir * crossingBeg.width / 2);
- crossingEnd.shape.move2side(endDir * crossingEnd.width / 2);
- crossingBeg.shape.extrapolate((*it).width / 2);
- crossingEnd.shape.extrapolate((*it).width / 2);
- (*it).shape.push_back(crossingBeg.shape[begDir == FORWARD ? 0 : -1]);
- (*it).shape.push_back(crossingEnd.shape[endDir == FORWARD ? -1 : 0]);
+ if (edges.front()->getFirstNonPedestrianLaneIndex(begDir) < 0
+ || edges.back()->getFirstNonPedestrianLaneIndex(endDir) < 0) {
+ // invalid crossing
+ WRITE_WARNING("Discarding Invalid crossing '" + (*it).id + "' at node '" + getID() + "' with edges '" + toString((*it).edges) + "'.");
+ it = myCrossings.erase(it);
+ } else {
+ NBEdge::Lane crossingBeg = edges.front()->getFirstNonPedestrianLane(begDir);
+ NBEdge::Lane crossingEnd = edges.back()->getFirstNonPedestrianLane(endDir);
+ crossingBeg.width = (crossingBeg.width == NBEdge::UNSPECIFIED_WIDTH ? SUMO_const_laneWidth : crossingBeg.width);
+ crossingEnd.width = (crossingEnd.width == NBEdge::UNSPECIFIED_WIDTH ? SUMO_const_laneWidth : crossingEnd.width);
+ crossingBeg.shape.move2side(begDir * crossingBeg.width / 2);
+ crossingEnd.shape.move2side(endDir * crossingEnd.width / 2);
+ crossingBeg.shape.extrapolate((*it).width / 2);
+ crossingEnd.shape.extrapolate((*it).width / 2);
+ (*it).shape.push_back(crossingBeg.shape[begDir == FORWARD ? 0 : -1]);
+ (*it).shape.push_back(crossingEnd.shape[endDir == FORWARD ? -1 : 0]);
+ ++it;
+ }
}
return index;
}
@@ -1847,7 +1960,7 @@ NBNode::buildWalkingAreas(int cornerDetail) {
}
}
//if (gDebugFlag1) std::cout << " normalizedLanes=" << normalizedLanes.size() << "\n";
- // collect [start,cound[ indices in normalizedLanes that belong to a walkingArea
+ // collect [start,count[ indices in normalizedLanes that belong to a walkingArea
std::vector<std::pair<int, int> > waIndices;
int start = -1;
NBEdge* prevEdge = normalizedLanes.back().first;
@@ -1959,9 +2072,6 @@ NBNode::buildWalkingAreas(int cornerDetail) {
startCrossingShape = (*it).shape;
wa.width = MAX2(wa.width, startCrossingWidth);
connectsCrossing = true;
- if (isTLControlled()) {
- wa.tlID = (*getControllingTLS().begin())->getID();
- }
connectedPoints.push_back((*it).shape[0]);
if (gDebugFlag1) {
std::cout << " crossing " << (*it).id << " starts\n";
@@ -2102,9 +2212,6 @@ NBNode::buildWalkingAreas(int cornerDetail) {
prev.nextWalkingArea = wa.id;
wa.nextCrossing = next.id;
next.prevWalkingArea = wa.id;
- if (isTLControlled()) {
- wa.tlID = (*getControllingTLS().begin())->getID();
- }
// back of previous crossing
PositionVector tmp = prev.shape;
tmp.move2side(-prev.width / 2);
@@ -2195,8 +2302,11 @@ NBNode::setRoundabout() {
void
-NBNode::addCrossing(EdgeVector edges, SUMOReal width, bool priority) {
+NBNode::addCrossing(EdgeVector edges, SUMOReal width, bool priority, bool fromSumoNet) {
myCrossings.push_back(Crossing(this, edges, width, priority));
+ if (fromSumoNet) {
+ myCrossingsLoadedFromSumoNet += 1;
+ }
}
diff --git a/src/netbuild/NBNode.h b/src/netbuild/NBNode.h
index 746aa8f..cfe6f08 100644
--- a/src/netbuild/NBNode.h
+++ b/src/netbuild/NBNode.h
@@ -5,7 +5,7 @@
/// @author Yun-Pang Floetteroed
/// @author Michael Behrisch
/// @date Tue, 20 Nov 2001
-/// @version $Id: NBNode.h 18167 2015-03-27 11:26:11Z namdre $
+/// @version $Id: NBNode.h 18756 2015-08-31 19:16:33Z behrisch $
///
// The representation of a single node
/****************************************************************************/
@@ -109,8 +109,7 @@ public:
* @param[in] approaching The list of the edges that approach the outgoing edge
* @param[in] currentOutgoing The outgoing edge
*/
- ApproachingDivider(EdgeVector* approaching,
- NBEdge* currentOutgoing, const bool buildCrossingsAndWalkingAreas);
+ ApproachingDivider(EdgeVector* approaching, NBEdge* currentOutgoing);
/// @brief Destructor
~ApproachingDivider();
@@ -163,8 +162,7 @@ public:
WalkingArea(const std::string& _id, SUMOReal _width) :
id(_id),
width(_width),
- nextCrossing(""),
- tlID("")
+ nextCrossing("")
{}
/// @brief the (edge)-id of this walkingArea
std::string id;
@@ -176,8 +174,6 @@ public:
PositionVector shape;
/// @brief the lane-id of the next crossing
std::string nextCrossing;
- /// @brief the traffic light id of the next crossing or ""
- std::string tlID;
/// @brief the lane-id of the next sidewalk lane or ""
std::vector<std::string> nextSidewalks;
/// @brief the lane-id of the previous sidewalk lane or ""
@@ -283,6 +279,12 @@ public:
SUMOReal getRadius() const {
return myRadius;
}
+
+ /** @brief Returns the keepClear flag
+ */
+ bool getKeepClear() const {
+ return myKeepClear;
+ }
/// @}
@@ -359,6 +361,9 @@ public:
* @param[in] yoff The y-offset to apply
*/
void reshiftPosition(SUMOReal xoff, SUMOReal yoff);
+
+ /// @brief mirror coordinates along the x-axis
+ void mirrorX();
/// @}
@@ -373,7 +378,7 @@ public:
/// computes the connections of lanes to edges
- void computeLanes2Lanes(const bool buildCrossingsAndWalkingAreas);
+ void computeLanes2Lanes();
/// computes the node's type, logic and traffic light
void computeLogic(const NBEdgeCont& ec, OptionsCont& oc);
@@ -450,8 +455,8 @@ public:
/** @brief return whether the given laneToLane connection is a right turn which must yield to a bicycle crossings
*/
- bool rightTurnConflict(const NBEdge* from, const NBEdge* to, int fromLane,
- const NBEdge* prohibitorFrom, const NBEdge* prohibitorTo, int prohibitorFromLane) const;
+ static bool rightTurnConflict(const NBEdge* from, const NBEdge* to, int fromLane,
+ const NBEdge* prohibitorFrom, const NBEdge* prohibitorTo, int prohibitorFromLane, bool lefthand = false);
/** @brief Returns the information whether "prohibited" flow must let "prohibitor" flow pass
* @param[in] possProhibitedFrom The maybe prohibited connection's begin
@@ -480,18 +485,18 @@ public:
/** @brief Returns the representation of the described stream's direction
* @param[in] incoming The edge the stream starts at
* @param[in] outgoing The edge the stream ends at
+ * @param[in] leftHand Whether a lefthand network is being built. Should only be set at writing time
* @return The direction of the stream
*/
- LinkDirection getDirection(const NBEdge* const incoming, const NBEdge* const outgoing) const;
+ LinkDirection getDirection(const NBEdge* const incoming, const NBEdge* const outgoing, bool leftHand = false) const;
LinkState getLinkState(const NBEdge* incoming, NBEdge* outgoing,
int fromLane, bool mayDefinitelyPass, const std::string& tlID) const;
/** @brief Compute the junction shape for this node
- * @param[in] lefhand Whether the network uses left-hand traffic
* @param[in] mismatchThreshold The threshold for warning about shapes which are away from myPosition
*/
- void computeNodeShape(bool leftHand, SUMOReal mismatchThreshold);
+ void computeNodeShape(SUMOReal mismatchThreshold);
/// @brief retrieve the junction shape
const PositionVector& getShape() const;
@@ -512,6 +517,11 @@ public:
myRadius = radius;
}
+ /// @brief set the keepClear flag
+ void setKeepClear(bool keepClear) {
+ myKeepClear = keepClear;
+ }
+
/// @brief return whether the shape was set by the user
bool hasCustomShape() const {
return myHaveCustomPoly;
@@ -585,7 +595,7 @@ public:
int checkCrossing(EdgeVector candidates);
/// @brief build internal lanes, pedestrian crossings and walking areas
- void buildInnerEdges(bool buildCrossingsAndWalkingAreas);
+ void buildInnerEdges();
/* @brief build pedestrian crossings
* @return The next index for creating internal lanes
@@ -597,6 +607,10 @@ public:
* */
void buildWalkingAreas(int cornerDetail);
+ /* @brief build crossings, and walkingareas. Also removes invalid loaded
+ * crossings*/
+ void buildCrossingsAndWalkingAreas();
+
/// @brief return all edges that lie clockwise between the given edges
EdgeVector edgesBetween(const NBEdge* e1, const NBEdge* e2) const;
@@ -615,11 +629,19 @@ public:
void setRoundabout();
/// @brief add a pedestrian crossing to this node
- void addCrossing(EdgeVector edges, SUMOReal width, bool priority);
+ void addCrossing(EdgeVector edges, SUMOReal width, bool priority, bool fromSumoNet = false);
/// @brief remove a pedestrian crossing from this node (identified by its edges)
void removeCrossing(const EdgeVector& edges);
+ void discardAllCrossings() {
+ myDiscardAllCrossings = true;
+ }
+
+ int numCrossingsFromSumoNet() const {
+ return myCrossingsLoadedFromSumoNet;
+ }
+
/// @brief return this junctions pedestrian crossings
inline const std::vector<Crossing>& getCrossings() const {
return myCrossings;
@@ -751,8 +773,17 @@ private:
/// @brief the turning radius (for all corners) at this node in m.
SUMOReal myRadius;
+ /// @brief whether the junction area must be kept clear
+ bool myKeepClear;
+
CustomShapeMap myCustomLaneShapes;
+ /// @brief whether to discard all pedestrian crossings
+ bool myDiscardAllCrossings;
+
+ /// @brief number of crossings loaded from a sumo net
+ int myCrossingsLoadedFromSumoNet;
+
private:
/// @brief invalidated copy constructor
NBNode(const NBNode& s);
diff --git a/src/netbuild/NBNodeCont.cpp b/src/netbuild/NBNodeCont.cpp
index 09661e7..42823f4 100644
--- a/src/netbuild/NBNodeCont.cpp
+++ b/src/netbuild/NBNodeCont.cpp
@@ -8,7 +8,7 @@
/// @author Michael Behrisch
/// @author Sascha Krieg
/// @date Tue, 20 Nov 2001
-/// @version $Id: NBNodeCont.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NBNodeCont.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Container for nodes during the netbuilding process
/****************************************************************************/
@@ -179,7 +179,7 @@ void
NBNodeCont::joinSimilarEdges(NBDistrictCont& dc, NBEdgeCont& ec, NBTrafficLightLogicCont& tlc) {
// magic values
SUMOReal distanceThreshold = 7; // don't merge edges further apart
- SUMOReal lengthThreshold = 0.05; // don't merge edges with higher relative length-difference
+ SUMOReal lengthThreshold = 0.10; // don't merge edges with higher relative length-difference
for (NodeCont::iterator i = myNodes.begin(); i != myNodes.end(); i++) {
// count the edges to other nodes outgoing from the current node
@@ -209,8 +209,8 @@ NBNodeCont::joinSimilarEdges(NBDistrictCont& dc, NBEdgeCont& ec, NBTrafficLightL
const SUMOReal relativeLengthDifference = fabs(first->getLoadedLength() - (*jci)->getLoadedLength()) / first->getLoadedLength();
if ((!first->isNearEnough2BeJoined2(*jci, distanceThreshold)) ||
(relativeLengthDifference > lengthThreshold) ||
- (first->getSpeed() != (*jci)->getSpeed())
- // @todo check vclass
+ (fabs(first->getSpeed() - (*jci)->getSpeed()) >= 0.01) || // output accuracy
+ (first->getPermissions() != (*jci)->getPermissions())
) {
break;
}
@@ -335,7 +335,7 @@ NBNodeCont::removeUnwishedNodes(NBDistrictCont& dc, NBEdgeCont& ec,
remove = true;
}
// check for nodes which are only geometry nodes
- if (removeGeometryNodes) {
+ if (removeGeometryNodes && mySplit.count(current) == 0) {
if ((current->getOutgoingEdges().size() == 1 && current->getIncomingEdges().size() == 1)
||
(current->getOutgoingEdges().size() == 2 && current->getIncomingEdges().size() == 2)) {
@@ -358,14 +358,14 @@ NBNodeCont::removeUnwishedNodes(NBDistrictCont& dc, NBEdgeCont& ec,
continuation->getToNode()->replaceIncoming(continuation, begin, 0);
tlc.replaceRemoved(continuation, -1, begin, -1);
je.appended(begin->getID(), continuation->getID());
- ec.erase(dc, continuation);
+ ec.extract(dc, continuation, true);
}
toRemove.push_back(current);
no++;
}
// erase all
for (std::vector<NBNode*>::iterator j = toRemove.begin(); j != toRemove.end(); ++j) {
- erase(*j);
+ extract(*j, true);
}
return no;
}
@@ -383,14 +383,16 @@ void
NBNodeCont::generateNodeClusters(SUMOReal maxDist, NodeClusters& into) const {
std::set<NBNode*> visited;
for (NodeCont::const_iterator i = myNodes.begin(); i != myNodes.end(); i++) {
- std::vector<NBNode*> toProc;
+ std::vector<NodeAndDist> toProc;
if (visited.find((*i).second) != visited.end()) {
continue;
}
- toProc.push_back((*i).second);
+ toProc.push_back(std::make_pair((*i).second, 0));
std::set<NBNode*> c;
while (!toProc.empty()) {
- NBNode* n = toProc.back();
+ NodeAndDist nodeAndDist = toProc.back();
+ NBNode* n = nodeAndDist.first;
+ SUMOReal dist = nodeAndDist.second;
toProc.pop_back();
if (visited.find(n) != visited.end()) {
continue;
@@ -401,6 +403,9 @@ NBNodeCont::generateNodeClusters(SUMOReal maxDist, NodeClusters& into) const {
for (EdgeVector::const_iterator j = edges.begin(); j != edges.end(); ++j) {
NBEdge* e = *j;
NBNode* s = 0;
+ if (e->getPermissions() == SVC_PEDESTRIAN) {
+ continue; // do not join pedestrian stuff
+ }
if (n->hasIncoming(e)) {
s = e->getFromNode();
} else {
@@ -409,8 +414,12 @@ NBNodeCont::generateNodeClusters(SUMOReal maxDist, NodeClusters& into) const {
if (visited.find(s) != visited.end()) {
continue;
}
- if (e->getLoadedLength() < maxDist) {
- toProc.push_back(s);
+ if (e->getLoadedLength() + dist < maxDist) {
+ if (s->geometryLike()) {
+ toProc.push_back(std::make_pair(s, dist + e->getLoadedLength()));
+ } else {
+ toProc.push_back(std::make_pair(s, 0));
+ }
}
}
}
@@ -503,14 +512,32 @@ NBNodeCont::joinJunctions(SUMOReal maxDist, NBDistrictCont& dc, NBEdgeCont& ec,
std::set<NBNode*>::iterator check = j;
NBNode* n = *check;
++j;
+
+ // compute clusterDist for node (length of shortest edge which connects this node to the cluster)
+ SUMOReal clusterDist = std::numeric_limits<SUMOReal>::max();
+ for (EdgeVector::const_iterator it_edge = n->getOutgoingEdges().begin(); it_edge != n->getOutgoingEdges().end(); ++it_edge) {
+ NBNode* neighbor = (*it_edge)->getToNode();
+ if (cluster.count(neighbor) != 0) {
+ clusterDist = MIN2(clusterDist, (*it_edge)->getLoadedLength());
+ }
+ }
+ for (EdgeVector::const_iterator it_edge = n->getIncomingEdges().begin(); it_edge != n->getIncomingEdges().end(); ++it_edge) {
+ NBNode* neighbor = (*it_edge)->getFromNode();
+ if (cluster.count(neighbor) != 0) {
+ clusterDist = MIN2(clusterDist, (*it_edge)->getLoadedLength());
+ }
+ }
// remove geometry-like nodes at fringe of the cluster
// (they have 1 neighbor in the cluster and at most 1 neighbor outside the cluster)
std::set<NBNode*> neighbors;
std::set<NBNode*> clusterNeigbors;
+ const SUMOReal pedestrianFringeThreshold = 1.0;
for (EdgeVector::const_iterator it_edge = n->getOutgoingEdges().begin(); it_edge != n->getOutgoingEdges().end(); ++it_edge) {
NBNode* neighbor = (*it_edge)->getToNode();
if (cluster.count(neighbor) == 0) {
- neighbors.insert(neighbor);
+ if ((*it_edge)->getPermissions() != SVC_PEDESTRIAN || clusterDist < pedestrianFringeThreshold) {
+ neighbors.insert(neighbor);
+ }
} else {
clusterNeigbors.insert(neighbor);
}
@@ -518,7 +545,9 @@ NBNodeCont::joinJunctions(SUMOReal maxDist, NBDistrictCont& dc, NBEdgeCont& ec,
for (EdgeVector::const_iterator it_edge = n->getIncomingEdges().begin(); it_edge != n->getIncomingEdges().end(); ++it_edge) {
NBNode* neighbor = (*it_edge)->getFromNode();
if (cluster.count(neighbor) == 0) {
- neighbors.insert(neighbor);
+ if ((*it_edge)->getPermissions() != SVC_PEDESTRIAN || clusterDist < pedestrianFringeThreshold) {
+ neighbors.insert(neighbor);
+ }
} else {
clusterNeigbors.insert(neighbor);
}
@@ -546,96 +575,98 @@ NBNodeCont::joinJunctions(SUMOReal maxDist, NBDistrictCont& dc, NBEdgeCont& ec,
for (std::set<NBNode*>::iterator j = toRemove.begin(); j != toRemove.end(); ++j) {
cluster.erase(*j);
}
- if (cluster.size() > 1) {
- // check for clusters which are to complex and probably won't work very well
- // we count the incoming edges of the final junction
- std::map<std::string, SUMOReal> finalIncomingAngles;
- std::map<std::string, SUMOReal> finalOutgoingAngles;
- std::vector<std::string> nodeIDs;
- for (std::set<NBNode*>::const_iterator j = cluster.begin(); j != cluster.end(); ++j) {
- nodeIDs.push_back((*j)->getID());
- for (EdgeVector::const_iterator it_edge = (*j)->getIncomingEdges().begin(); it_edge != (*j)->getIncomingEdges().end(); ++it_edge) {
- NBEdge* edge = *it_edge;
- if (cluster.count(edge->getFromNode()) == 0) {
- // incoming edge, does not originate in the cluster
- finalIncomingAngles[edge->getID()] = edge->getAngleAtNode(edge->getToNode());
- }
+ if (cluster.size() < 2) {
+ continue;
+ }
+ // check for clusters which are to complex and probably won't work very well
+ // we count the incoming edges of the final junction
+ std::map<std::string, SUMOReal> finalIncomingAngles;
+ std::map<std::string, SUMOReal> finalOutgoingAngles;
+ std::vector<std::string> nodeIDs;
+ for (std::set<NBNode*>::const_iterator j = cluster.begin(); j != cluster.end(); ++j) {
+ nodeIDs.push_back((*j)->getID());
+ for (EdgeVector::const_iterator it_edge = (*j)->getIncomingEdges().begin(); it_edge != (*j)->getIncomingEdges().end(); ++it_edge) {
+ NBEdge* edge = *it_edge;
+ if (cluster.count(edge->getFromNode()) == 0 && edge->getPermissions() != SVC_PEDESTRIAN) {
+ // incoming edge, does not originate in the cluster
+ finalIncomingAngles[edge->getID()] = edge->getAngleAtNode(edge->getToNode());
}
- for (EdgeVector::const_iterator it_edge = (*j)->getOutgoingEdges().begin(); it_edge != (*j)->getOutgoingEdges().end(); ++it_edge) {
- NBEdge* edge = *it_edge;
- if (cluster.count(edge->getToNode()) == 0) {
- // outgoing edge, does not end in the cluster
- finalOutgoingAngles[edge->getID()] = edge->getAngleAtNode(edge->getFromNode());
- }
+ }
+ for (EdgeVector::const_iterator it_edge = (*j)->getOutgoingEdges().begin(); it_edge != (*j)->getOutgoingEdges().end(); ++it_edge) {
+ NBEdge* edge = *it_edge;
+ if (cluster.count(edge->getToNode()) == 0 && edge->getPermissions() != SVC_PEDESTRIAN) {
+ // outgoing edge, does not end in the cluster
+ finalOutgoingAngles[edge->getID()] = edge->getAngleAtNode(edge->getFromNode());
}
+ }
+ }
+ if (finalIncomingAngles.size() > 4) {
+ std::sort(nodeIDs.begin(), nodeIDs.end());
+ WRITE_WARNING("Not joining junctions " + joinToStringSorting(nodeIDs, ',') + " because the cluster is too complex (" + toString(finalIncomingAngles.size()) + " incoming edges)");
+ continue;
+ }
+ // check for incoming parallel edges
+ const SUMOReal PARALLEL_INCOMING_THRESHOLD = 10.0;
+ bool foundParallel = false;
+ for (std::map<std::string, SUMOReal>::const_iterator j = finalIncomingAngles.begin(); j != finalIncomingAngles.end() && !foundParallel; ++j) {
+ std::map<std::string, SUMOReal>::const_iterator k = j;
+ for (++k; k != finalIncomingAngles.end() && !foundParallel; ++k) {
+ if (fabs(j->second - k->second) < PARALLEL_INCOMING_THRESHOLD) {
+ WRITE_WARNING("Not joining junctions " + joinToStringSorting(nodeIDs, ',') + " because the cluster is too complex (parallel incoming "
+ + j->first + "," + k->first + ")");
+ foundParallel = true;
+ }
}
- if (finalIncomingAngles.size() > 4) {
- std::sort(nodeIDs.begin(), nodeIDs.end());
- WRITE_WARNING("Not joining junctions " + joinToStringSorting(nodeIDs, ',') + " because the cluster is too complex (" + toString(finalIncomingAngles.size()) + " incoming edges)");
- } else {
- // check for incoming parallel edges
- const SUMOReal PARALLEL_INCOMING_THRESHOLD = 10.0;
- bool foundParallel = false;
- for (std::map<std::string, SUMOReal>::const_iterator j = finalIncomingAngles.begin(); j != finalIncomingAngles.end() && !foundParallel; ++j) {
- std::map<std::string, SUMOReal>::const_iterator k = j;
- for (++k; k != finalIncomingAngles.end() && !foundParallel; ++k) {
- if (fabs(j->second - k->second) < PARALLEL_INCOMING_THRESHOLD) {
- WRITE_WARNING("Not joining junctions " + joinToStringSorting(nodeIDs, ',') + " because the cluster is too complex (parallel incoming "
- + j->first + "," + k->first + ")");
- foundParallel = true;
- }
- }
+ }
+ // check for outgoing parallel edges
+ for (std::map<std::string, SUMOReal>::const_iterator j = finalOutgoingAngles.begin(); j != finalOutgoingAngles.end() && !foundParallel; ++j) {
+ std::map<std::string, SUMOReal>::const_iterator k = j;
+ for (++k; k != finalOutgoingAngles.end() && !foundParallel; ++k) {
+ if (fabs(j->second - k->second) < PARALLEL_INCOMING_THRESHOLD) {
+ WRITE_WARNING("Not joining junctions " + joinToStringSorting(nodeIDs, ',') + " because the cluster is too complex (parallel outgoing "
+ + j->first + "," + k->first + ")");
+ foundParallel = true;
}
- // check for outgoing parallel edges
- for (std::map<std::string, SUMOReal>::const_iterator j = finalOutgoingAngles.begin(); j != finalOutgoingAngles.end() && !foundParallel; ++j) {
- std::map<std::string, SUMOReal>::const_iterator k = j;
- for (++k; k != finalOutgoingAngles.end() && !foundParallel; ++k) {
- if (fabs(j->second - k->second) < PARALLEL_INCOMING_THRESHOLD) {
- WRITE_WARNING("Not joining junctions " + joinToStringSorting(nodeIDs, ',') + " because the cluster is too complex (parallel outgoing "
- + j->first + "," + k->first + ")");
- foundParallel = true;
- }
+ }
+ }
+ if (foundParallel) {
+ continue;
+ }
+ // compute all connected components of this cluster
+ // (may be more than 1 if intermediate nodes were removed)
+ NodeClusters components;
+ for (std::set<NBNode*>::iterator j = cluster.begin(); j != cluster.end(); ++j) {
+ // merge all connected components into newComp
+ std::set<NBNode*> newComp;
+ NBNode* current = *j;
+ //std::cout << "checking connectivity for " << current->getID() << "\n";
+ newComp.insert(current);
+ for (NodeClusters::iterator it_comp = components.begin(); it_comp != components.end();) {
+ NodeClusters::iterator check = it_comp;
+ //std::cout << " connected with " << toString(*check) << "?\n";
+ bool connected = false;
+ for (std::set<NBNode*>::iterator k = (*check).begin(); k != (*check).end(); ++k) {
+ if (current->getConnectionTo(*k) != 0 || (*k)->getConnectionTo(current) != 0) {
+ //std::cout << "joining with connected component " << toString(*check) << "\n";
+ newComp.insert((*check).begin(), (*check).end());
+ it_comp = components.erase(check);
+ connected = true;
+ break;
}
}
- if (!foundParallel && cluster.size() > 1) {
- // compute all connected components of this cluster
- // (may be more than 1 if intermediate nodes were removed)
- NodeClusters components;
- for (std::set<NBNode*>::iterator j = cluster.begin(); j != cluster.end(); ++j) {
- // merge all connected components into newComp
- std::set<NBNode*> newComp;
- NBNode* current = *j;
- //std::cout << "checking connectivity for " << current->getID() << "\n";
- newComp.insert(current);
- for (NodeClusters::iterator it_comp = components.begin(); it_comp != components.end();) {
- NodeClusters::iterator check = it_comp;
- //std::cout << " connected with " << toString(*check) << "?\n";
- bool connected = false;
- for (std::set<NBNode*>::iterator k = (*check).begin(); k != (*check).end(); ++k) {
- if (current->getConnectionTo(*k) != 0 || (*k)->getConnectionTo(current) != 0) {
- //std::cout << "joining with connected component " << toString(*check) << "\n";
- newComp.insert((*check).begin(), (*check).end());
- it_comp = components.erase(check);
- connected = true;
- break;
- }
- }
- if (!connected) {
- it_comp++;
- }
- }
- //std::cout << "adding new component " << toString(newComp) << "\n";
- components.push_back(newComp);
- }
- for (NodeClusters::iterator it_comp = components.begin(); it_comp != components.end(); ++it_comp) {
- if ((*it_comp).size() > 1) {
- //std::cout << "adding cluster " << toString(*it_comp) << "\n";
- clusters.push_back(*it_comp);
- }
- }
+ if (!connected) {
+ it_comp++;
}
}
+ //std::cout << "adding new component " << toString(newComp) << "\n";
+ components.push_back(newComp);
+ }
+ for (NodeClusters::iterator it_comp = components.begin(); it_comp != components.end(); ++it_comp) {
+ if ((*it_comp).size() > 1) {
+ //std::cout << "adding cluster " << toString(*it_comp) << "\n";
+ clusters.push_back(*it_comp);
+ }
}
}
joinNodeClusters(clusters, dc, ec, tlc);
@@ -839,6 +870,7 @@ NBNodeCont::guessTLs(OptionsCont& oc, NBTrafficLightLogicCont& tlc) {
for (std::map<std::string, NBNode*>::const_iterator i = myNodes.begin(); i != myNodes.end(); ++i) {
NBNode* node = i->second;
const EdgeVector& incoming = node->getIncomingEdges();
+ const EdgeVector& outgoing = node->getOutgoingEdges();
if (!node->isTLControlled() && incoming.size() > 1 && !node->geometryLike()) {
std::vector<NBNode*> signals;
bool isTLS = true;
@@ -852,10 +884,19 @@ NBNodeCont::guessTLs(OptionsCont& oc, NBTrafficLightLogicCont& tlc) {
signals.push_back(inEdge->getFromNode());
}
}
+ // outgoing edges may be tagged with pedestrian crossings. These
+ // should also be morged into the main TLS
+ for (EdgeVector::const_iterator it_i = outgoing.begin(); it_i != outgoing.end(); ++it_i) {
+ const NBEdge* outEdge = *it_i;
+ NBNode* cand = outEdge->getToNode();
+ if (cand->isTLControlled() && cand->geometryLike() && outEdge->getLength() <= signalDist) {
+ signals.push_back(cand);
+ }
+ }
if (isTLS) {
for (std::vector<NBNode*>::iterator j = signals.begin(); j != signals.end(); ++j) {
std::set<NBTrafficLightDefinition*> tls = (*j)->getControllingTLS();
- (*j)->removeTrafficLights();
+ (*j)->reinit((*j)->getPosition(), NODETYPE_PRIORITY);
for (std::set<NBTrafficLightDefinition*>::iterator k = tls.begin(); k != tls.end(); ++k) {
tlc.removeFully((*j)->getID());
}
@@ -1005,9 +1046,9 @@ NBNodeCont::setAsTLControlled(NBNode* node, NBTrafficLightLogicCont& tlc,
// -----------
void
-NBNodeCont::computeLanes2Lanes(const bool buildCrossingsAndWalkingAreas) {
+NBNodeCont::computeLanes2Lanes() {
for (NodeCont::iterator i = myNodes.begin(); i != myNodes.end(); i++) {
- (*i).second->computeLanes2Lanes(buildCrossingsAndWalkingAreas);
+ (*i).second->computeLanes2Lanes();
}
}
@@ -1044,9 +1085,9 @@ NBNodeCont::getFreeID() {
void
-NBNodeCont::computeNodeShapes(bool leftHand, SUMOReal mismatchThreshold) {
+NBNodeCont::computeNodeShapes(SUMOReal mismatchThreshold) {
for (NodeCont::iterator i = myNodes.begin(); i != myNodes.end(); i++) {
- (*i).second->computeNodeShape(leftHand, mismatchThreshold);
+ (*i).second->computeNodeShape(mismatchThreshold);
}
}
diff --git a/src/netbuild/NBNodeCont.h b/src/netbuild/NBNodeCont.h
index 4edc1ac..2a32abb 100644
--- a/src/netbuild/NBNodeCont.h
+++ b/src/netbuild/NBNodeCont.h
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Walter Bamberger
/// @date Tue, 20 Nov 2001
-/// @version $Id: NBNodeCont.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NBNodeCont.h 18708 2015-08-24 12:44:21Z namdre $
///
// Container for nodes during the netbuilding process
/****************************************************************************/
@@ -262,7 +262,7 @@ public:
/// divides the incoming lanes on outgoing lanes
- void computeLanes2Lanes(const bool buildCrossingsAndWalkingAreas);
+ void computeLanes2Lanes();
/// build the list of outgoing edges and lanes
void computeLogics(const NBEdgeCont& ec, OptionsCont& oc);
@@ -282,10 +282,9 @@ public:
std::string getFreeID();
/** @brief Compute the junction shape for this node
- * @param[in] lefhand Whether the network uses left-hand traffic
* @param[in] mismatchThreshold The threshold for warning about shapes which are away from myPosition
*/
- void computeNodeShapes(bool leftHand, SUMOReal mismatchThreshold = -1);
+ void computeNodeShapes(SUMOReal mismatchThreshold = -1);
/** @brief Prints statistics about built nodes
*
@@ -323,12 +322,18 @@ public:
*/
void discardTrafficLights(NBTrafficLightLogicCont& tlc, bool geometryLike, bool guessSignals);
+ /// @brief mark a node as being created form a split
+ void markAsSplit(const NBNode* node) {
+ mySplit.insert(node);
+ }
+
private:
/// @name Helper methods for for joining nodes
/// @{
/// @brief Definition of a node cluster container
typedef std::vector<std::set<NBNode*> > NodeClusters;
+ typedef std::pair<NBNode*, SUMOReal> NodeAndDist;
/** @brief Builds node clusters
@@ -384,6 +389,9 @@ private:
/// @brief ids found in loaded join clusters used for error checking
std::set<std::string> myJoined;
+ /// @brief nodes that were created when splitting an edge
+ std::set<const NBNode*> mySplit;
+
/// @brief node positions for faster lookup
NamedRTree myRTree;
diff --git a/src/netbuild/NBNodeShapeComputer.cpp b/src/netbuild/NBNodeShapeComputer.cpp
index 129a508..7d25042 100644
--- a/src/netbuild/NBNodeShapeComputer.cpp
+++ b/src/netbuild/NBNodeShapeComputer.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: NBNodeShapeComputer.cpp 18169 2015-03-27 13:40:16Z behrisch $
+/// @version $Id: NBNodeShapeComputer.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// This class computes shapes of junctions
/****************************************************************************/
@@ -59,8 +59,7 @@ NBNodeShapeComputer::~NBNodeShapeComputer() {}
PositionVector
-NBNodeShapeComputer::compute(bool leftHand) {
- UNUSED_PARAMETER(leftHand);
+NBNodeShapeComputer::compute() {
PositionVector ret;
// check whether the node is a dead end node or a node where only turning is possible
// in this case, we will use "computeNodeShapeSmall"
@@ -290,10 +289,10 @@ NBNodeShapeComputer::computeNodeShapeDefault(bool simpleContinuation) {
}
for (i = newAll.begin(); i != newAll.end(); ++i) {
- if (distances.find(*i) == distances.end()) {
- assert(false);
- distances[*i] = 100;
- }
+ if (distances.find(*i) == distances.end()) {
+ assert(false);
+ distances[*i] = 100;
+ }
}
// build
@@ -333,7 +332,7 @@ NBNodeShapeComputer::computeNodeShapeDefault(bool simpleContinuation) {
}
-SUMOReal
+SUMOReal
NBNodeShapeComputer::closestIntersection(const PositionVector& geom1, const PositionVector& geom2, SUMOReal offset) {
std::vector<SUMOReal> intersections = geom1.intersectsAtLengths2D(geom2);
SUMOReal result = intersections[0];
@@ -432,9 +431,9 @@ NBNodeShapeComputer::joinSameDirectionEdges(std::map<NBEdge*, std::set<NBEdge*>
Line l1 = g1.lineAt(0);
Line l2 = g2.lineAt(0);
const SUMOReal angle1further = (g1.size() > 2 && l1.length2D() < angleChangeLookahead ?
- g1.lineAt(1).atan2DegreeAngle() : l1.atan2DegreeAngle());
+ g1.lineAt(1).atan2DegreeAngle() : l1.atan2DegreeAngle());
const SUMOReal angle2further = (g2.size() > 2 && l2.length2D() < angleChangeLookahead ?
- g2.lineAt(1).atan2DegreeAngle() : l2.atan2DegreeAngle());
+ g2.lineAt(1).atan2DegreeAngle() : l2.atan2DegreeAngle());
const SUMOReal angleDiff = NBHelpers::relAngle(l1.atan2DegreeAngle(), l2.atan2DegreeAngle());
const SUMOReal angleDiffFurther = NBHelpers::relAngle(angle1further, angle2further);
const bool ambiguousGeometry = ((angleDiff > 0 && angleDiffFurther < 0) || (angleDiff < 0 && angleDiffFurther > 0));
@@ -472,9 +471,9 @@ NBNodeShapeComputer::joinSameDirectionEdges(std::map<NBEdge*, std::set<NBEdge*>
bool
-NBNodeShapeComputer::badIntersection(const NBEdge* e1, const NBEdge* e2,
- const PositionVector& e1cw, const PositionVector& e2ccw,
- SUMOReal distance) {
+NBNodeShapeComputer::badIntersection(const NBEdge* e1, const NBEdge* e2,
+ const PositionVector& e1cw, const PositionVector& e2ccw,
+ SUMOReal distance) {
// check whether the two edges are on top of each other. In that case they should be joined
// also, if they never touch along their common length
const SUMOReal commonLength = MIN3(distance, e1->getGeometry().length(), e2->getGeometry().length());
diff --git a/src/netbuild/NBNodeShapeComputer.h b/src/netbuild/NBNodeShapeComputer.h
index 9104bf6..cff7192 100644
--- a/src/netbuild/NBNodeShapeComputer.h
+++ b/src/netbuild/NBNodeShapeComputer.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date 2004-01-12
-/// @version $Id: NBNodeShapeComputer.h 18169 2015-03-27 13:40:16Z behrisch $
+/// @version $Id: NBNodeShapeComputer.h 18756 2015-08-31 19:16:33Z behrisch $
///
// This class computes shapes of junctions
/****************************************************************************/
@@ -58,7 +58,7 @@ public:
~NBNodeShapeComputer();
/// Computes the shape of the assigned junction
- PositionVector compute(bool leftHand);
+ PositionVector compute();
private:
typedef std::map<NBEdge*, PositionVector> GeomsMap;
@@ -141,8 +141,8 @@ private:
SUMOReal& ccad);
/// @return whether trying to intersect these edges would probably fail
- bool badIntersection(const NBEdge* e1, const NBEdge* e2,
- const PositionVector& e1cw, const PositionVector& e2ccw, SUMOReal distance);
+ bool badIntersection(const NBEdge* e1, const NBEdge* e2,
+ const PositionVector& e1cw, const PositionVector& e2ccw, SUMOReal distance);
/// @brief return the intersection point closest to the given offset
SUMOReal closestIntersection(const PositionVector& geom1, const PositionVector& geom2, SUMOReal offset);
diff --git a/src/netbuild/NBOwnTLDef.cpp b/src/netbuild/NBOwnTLDef.cpp
index d4056ae..cccc2d9 100644
--- a/src/netbuild/NBOwnTLDef.cpp
+++ b/src/netbuild/NBOwnTLDef.cpp
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Tue, 29.05.2005
-/// @version $Id: NBOwnTLDef.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: NBOwnTLDef.cpp 18673 2015-08-20 19:22:23Z behrisch $
///
// A traffic light logics which must be computed (only nodes/edges are given)
/****************************************************************************/
@@ -93,9 +93,8 @@ NBOwnTLDef::getDirectionalWeight(LinkDirection dir) {
case LINKDIR_LEFT:
case LINKDIR_RIGHT:
return .5;
- case LINKDIR_NODIR:
- case LINKDIR_TURN:
- return 0;
+ default:
+ break;
}
return 0;
}
@@ -245,7 +244,7 @@ NBOwnTLDef::computeLogicAndConts(unsigned int brakingTimeSeconds, bool onlyConts
if (incoming.size() == 2) {
// if there are only 2 incoming edges we need to decide whether they are a crossing or a "continuation"
// @node: this heuristic could be extended to also check the number of outgoing edges
- SUMOReal angle = fabs(NBHelpers::relAngle(toProc[0]->getAngleAtNode(toProc[0]->getToNode()), toProc[1]->getAngleAtNode(toProc[1]->getToNode())));
+ SUMOReal angle = fabs(NBHelpers::relAngle(incoming[0]->getAngleAtNode(incoming[0]->getToNode()), incoming[1]->getAngleAtNode(incoming[1]->getToNode())));
// angle would be 180 for straight opposing incoming edges
if (angle < 135) {
chosen = std::pair<NBEdge*, NBEdge*>(toProc[0], static_cast<NBEdge*>(0));
@@ -303,7 +302,7 @@ NBOwnTLDef::computeLogicAndConts(unsigned int brakingTimeSeconds, bool onlyConts
}
for (unsigned int i2 = 0; i2 < pos; ++i2) {
if ((state[i2] == 'G' || state[i2] == 'g')) {
- if (fromEdges[i2]->getToNode()->rightTurnConflict(
+ if (NBNode::rightTurnConflict(
fromEdges[i1], toEdges[i1], fromLanes[i1], fromEdges[i2], toEdges[i2], fromLanes[i2])) {
rightTurnConflicts[i1] = true;
}
diff --git a/src/netbuild/NBRequest.cpp b/src/netbuild/NBRequest.cpp
index edfc45c..88ae287 100644
--- a/src/netbuild/NBRequest.cpp
+++ b/src/netbuild/NBRequest.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Tue, 20 Nov 2001
-/// @version $Id: NBRequest.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: NBRequest.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// This class computes the logic of a junction
/****************************************************************************/
@@ -153,12 +153,12 @@ NBRequest::~NBRequest() {}
void
-NBRequest::buildBitfieldLogic(bool leftHanded) {
+NBRequest::buildBitfieldLogic() {
EdgeVector::const_iterator i, j;
for (i = myIncoming.begin(); i != myIncoming.end(); i++) {
for (j = myOutgoing.begin(); j != myOutgoing.end(); j++) {
- computeRightOutgoingLinkCrossings(leftHanded, *i, *j);
- computeLeftOutgoingLinkCrossings(leftHanded, *i, *j);
+ computeRightOutgoingLinkCrossings(*i, *j);
+ computeLeftOutgoingLinkCrossings(*i, *j);
}
}
// reset signalised/non-signalised dependencies
@@ -169,7 +169,7 @@ NBRequest::buildBitfieldLogic(bool leftHanded) {
void
-NBRequest::computeRightOutgoingLinkCrossings(bool leftHanded, NBEdge* from, NBEdge* to) {
+NBRequest::computeRightOutgoingLinkCrossings(NBEdge* from, NBEdge* to) {
EdgeVector::const_iterator pfrom = find(myAll.begin(), myAll.end(), from);
while (*pfrom != to) {
NBContHelper::nextCCW(myAll, pfrom);
@@ -177,7 +177,7 @@ NBRequest::computeRightOutgoingLinkCrossings(bool leftHanded, NBEdge* from, NBEd
EdgeVector::const_iterator pto = find(myAll.begin(), myAll.end(), to);
while (*pto != from) {
if (!((*pto)->getToNode() == myJunction)) {
- setBlocking(leftHanded, from, to, *pfrom, *pto);
+ setBlocking(from, to, *pfrom, *pto);
}
NBContHelper::nextCCW(myAll, pto);
}
@@ -187,7 +187,7 @@ NBRequest::computeRightOutgoingLinkCrossings(bool leftHanded, NBEdge* from, NBEd
void
-NBRequest::computeLeftOutgoingLinkCrossings(bool leftHanded, NBEdge* from, NBEdge* to) {
+NBRequest::computeLeftOutgoingLinkCrossings(NBEdge* from, NBEdge* to) {
EdgeVector::const_iterator pfrom = find(myAll.begin(), myAll.end(), from);
while (*pfrom != to) {
NBContHelper::nextCW(myAll, pfrom);
@@ -195,7 +195,7 @@ NBRequest::computeLeftOutgoingLinkCrossings(bool leftHanded, NBEdge* from, NBEdg
EdgeVector::const_iterator pto = find(myAll.begin(), myAll.end(), to);
while (*pto != from) {
if (!((*pto)->getToNode() == myJunction)) {
- setBlocking(leftHanded, from, to, *pfrom, *pto);
+ setBlocking(from, to, *pfrom, *pto);
}
NBContHelper::nextCW(myAll, pto);
}
@@ -205,8 +205,7 @@ NBRequest::computeLeftOutgoingLinkCrossings(bool leftHanded, NBEdge* from, NBEdg
void
-NBRequest::setBlocking(bool leftHanded,
- NBEdge* from1, NBEdge* to1,
+NBRequest::setBlocking(NBEdge* from1, NBEdge* to1,
NBEdge* from2, NBEdge* to2) {
// check whether one of the links has a dead end
if (to1 == 0 || to2 == 0) {
@@ -287,11 +286,7 @@ NBRequest::setBlocking(bool leftHanded,
while (*c1 != from1 && *c1 != from2) {
if (*c1 == to2) {
// if we encounter to2 the second one prohibits the first
- if (!leftHanded) {
- myForbids[idx2][idx1] = true;
- } else {
- myForbids[idx1][idx2] = true;
- }
+ myForbids[idx2][idx1] = true;
return;
}
NBContHelper::nextCW(myAll, c1);
@@ -303,11 +298,7 @@ NBRequest::setBlocking(bool leftHanded,
while (*c2 != from2 && *c2 != from1) {
if (*c2 == to1) {
// if we encounter to1 the second one prohibits the first
- if (!leftHanded) {
- myForbids[idx1][idx2] = true;
- } else {
- myForbids[idx2][idx1] = true;
- }
+ myForbids[idx1][idx2] = true;
return;
}
NBContHelper::nextCW(myAll, c2);
@@ -519,7 +510,7 @@ NBRequest::writeCrossingResponse(OutputDevice& od, const NBNode::Crossing& cross
}
}
foes += foe ? '1' : '0';
- response += mustBrakeForCrossing(from, to, crossing) || !foe ? '0' : '1';
+ response += mustBrakeForCrossing(myJunction, from, to, crossing) || !foe ? '0' : '1';
}
}
}
@@ -536,6 +527,7 @@ NBRequest::writeCrossingResponse(OutputDevice& od, const NBNode::Crossing& cross
std::string
NBRequest::getResponseString(const NBEdge* const from, const NBEdge* const to,
int fromLane, int toLane, bool mayDefinitelyPass, const bool checkLaneFoes) const {
+ const bool lefthand = OptionsCont::getOptions().getBool("lefthand");
int idx = 0;
if (to != 0) {
idx = getIndex(from, to);
@@ -543,7 +535,7 @@ NBRequest::getResponseString(const NBEdge* const from, const NBEdge* const to,
std::string result;
// crossings
for (std::vector<NBNode::Crossing>::const_reverse_iterator i = myCrossings.rbegin(); i != myCrossings.rend(); i++) {
- result += mustBrakeForCrossing(from, to, *i) ? '1' : '0';
+ result += mustBrakeForCrossing(myJunction, from, to, *i) ? '1' : '0';
}
// normal connections
for (EdgeVector::const_reverse_iterator i = myIncoming.rbegin(); i != myIncoming.rend(); i++) {
@@ -566,7 +558,7 @@ NBRequest::getResponseString(const NBEdge* const from, const NBEdge* const to,
// check whether the connection is prohibited by another one
if ((myForbids[getIndex(*i, connected[k].toEdge)][idx] &&
(!checkLaneFoes || laneConflict(from, to, toLane, *i, connected[k].toEdge, connected[k].toLane)))
- || rightTurnConflict(from, to, fromLane, *i, connected[k].toEdge, connected[k].fromLane)) {
+ || NBNode::rightTurnConflict(from, to, fromLane, *i, connected[k].toEdge, connected[k].fromLane, lefthand)) {
result += '1';
} else {
result += '0';
@@ -607,7 +599,7 @@ NBRequest::getFoesString(NBEdge* from, NBEdge* to, int fromLane, int toLane, con
for (int k = size; k-- > 0;) {
if ((foes(from, to, (*i), connected[k].toEdge) &&
(!checkLaneFoes || laneConflict(from, to, toLane, *i, connected[k].toEdge, connected[k].toLane)))
- || rightTurnConflict(from, to, fromLane, *i, connected[k].toEdge, connected[k].fromLane)) {
+ || NBNode::rightTurnConflict(from, to, fromLane, *i, connected[k].toEdge, connected[k].fromLane)) {
result += '1';
} else {
result += '0';
@@ -641,34 +633,6 @@ NBRequest::laneConflict(const NBEdge* from, const NBEdge* to, int toLane,
}
-bool
-NBRequest::rightTurnConflict(const NBEdge* from, const NBEdge* to, int fromLane,
- const NBEdge* prohibitorFrom, const NBEdge* prohibitorTo, int prohibitorFromLane) const {
- if (from != prohibitorFrom) {
- return false;
- }
- if (from->isTurningDirectionAt(to)
- || prohibitorFrom->isTurningDirectionAt(prohibitorTo)) {
- // XXX should warn if there are any non-turning connections left of this
- return false;
- }
- const bool lefthand = OptionsCont::getOptions().getBool("lefthand");
- if ((!lefthand && fromLane <= prohibitorFromLane) ||
- (lefthand && fromLane >= prohibitorFromLane)) {
- return false;
- }
- // conflict if to is between prohibitorTo and from when going clockwise
- if (to->getStartAngle() == prohibitorTo->getStartAngle()) {
- // reduce rounding errors
- return false;
- }
- const SUMOReal toAngleAtNode = fmod(to->getStartAngle() + 180, (SUMOReal)360.0);
- const SUMOReal prohibitorToAngleAtNode = fmod(prohibitorTo->getStartAngle() + 180, (SUMOReal)360.0);
- return (lefthand != (GeomHelper::getCWAngleDiff(from->getEndAngle(), toAngleAtNode) <
- GeomHelper::getCWAngleDiff(from->getEndAngle(), prohibitorToAngleAtNode)));
-}
-
-
int
NBRequest::getIndex(const NBEdge* const from, const NBEdge* const to) const {
EdgeVector::const_iterator fp = find(myIncoming.begin(), myIncoming.end(), from);
@@ -723,7 +687,7 @@ NBRequest::mustBrake(const NBEdge* const from, const NBEdge* const to, int fromL
// maybe we need to brake for a pedestrian crossing
if (includePedCrossings) {
for (std::vector<NBNode::Crossing>::const_reverse_iterator i = myCrossings.rbegin(); i != myCrossings.rend(); i++) {
- if (mustBrakeForCrossing(from, to, *i)) {
+ if (mustBrakeForCrossing(myJunction, from, to, *i)) {
return true;
}
}
@@ -734,8 +698,8 @@ NBRequest::mustBrake(const NBEdge* const from, const NBEdge* const to, int fromL
if (dir == LINKDIR_RIGHT || dir == LINKDIR_PARTRIGHT) {
const std::vector<NBEdge::Connection>& cons = from->getConnections();
for (std::vector<NBEdge::Connection>::const_iterator i = cons.begin(); i != cons.end(); i++) {
- if (rightTurnConflict(from, to, fromLane,
- from, (*i).toEdge, (*i).fromLane)) {
+ if (NBNode::rightTurnConflict(from, to, fromLane,
+ from, (*i).toEdge, (*i).fromLane)) {
return true;
}
}
@@ -744,8 +708,8 @@ NBRequest::mustBrake(const NBEdge* const from, const NBEdge* const to, int fromL
}
bool
-NBRequest::mustBrakeForCrossing(const NBEdge* const from, const NBEdge* const to, const NBNode::Crossing& crossing) const {
- const LinkDirection dir = myJunction->getDirection(from, to);
+NBRequest::mustBrakeForCrossing(const NBNode* node, const NBEdge* const from, const NBEdge* const to, const NBNode::Crossing& crossing) {
+ const LinkDirection dir = node->getDirection(from, to);
const bool mustYield = dir == LINKDIR_LEFT || dir == LINKDIR_RIGHT;
if (crossing.priority || mustYield) {
for (EdgeVector::const_iterator it_e = crossing.edges.begin(); it_e != crossing.edges.end(); ++it_e) {
diff --git a/src/netbuild/NBRequest.h b/src/netbuild/NBRequest.h
index 808efb1..bd07033 100644
--- a/src/netbuild/NBRequest.h
+++ b/src/netbuild/NBRequest.h
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Tue, 20 Nov 2001
-/// @version $Id: NBRequest.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: NBRequest.h 18647 2015-08-18 07:09:50Z namdre $
///
// This class computes the logic of a junction
/****************************************************************************/
@@ -81,7 +81,7 @@ public:
~NBRequest();
/** builds the bitset-representation of the logic */
- void buildBitfieldLogic(bool leftHanded);
+ void buildBitfieldLogic();
/** @brief returns the number of the junction's lanes and the number
of the junction's links in respect. @note: only connected lanes are counted */
@@ -108,12 +108,13 @@ public:
bool mustBrake(const NBEdge* const from, const NBEdge* const to, int fromLane, bool includePedCrossings) const;
/** @brief Returns the information whether the described flow must brake for the given crossing
+ * @param[in] node The parent node of this request
* @param[in] from The connection's start edge
* @param[in] to The connection's end edge
* @param[in] crossing The pedestrian crossing to check
* @return Whether the described connection must brake (has higher priorised foes)
*/
- bool mustBrakeForCrossing(const NBEdge* const from, const NBEdge* const to, const NBNode::Crossing& crossing) const;
+ static bool mustBrakeForCrossing(const NBNode* node, const NBEdge* const from, const NBEdge* const to, const NBNode::Crossing& crossing);
/** @brief Returns the information whether the given flows cross
* @param[in] from1 The starting edge of the first stream
@@ -145,10 +146,6 @@ public:
/// prints the request
friend std::ostream& operator<<(std::ostream& os, const NBRequest& r);
- /** @brief return whether the given laneToLane connection is a right turn which must yield to a bicycle crossings
- */
- bool rightTurnConflict(const NBEdge* from, const NBEdge* to, int fromLane, const NBEdge* prohibitorFrom, const NBEdge* prohibitorTo, int prohibitorFromLane) const;
-
/// reports warnings if any occured
static void reportWarnings();
@@ -156,7 +153,7 @@ public:
private:
/** sets the information that the edge from1->to1 blocks the edge
from2->to2 (is higher priorised than this) */
- void setBlocking(bool leftHanded, NBEdge* from1, NBEdge* to1, NBEdge* from2, NBEdge* to2);
+ void setBlocking(NBEdge* from1, NBEdge* to1, NBEdge* from2, NBEdge* to2);
/** @brief writes the response of a certain lane
Returns the next link index within the junction */
@@ -211,11 +208,11 @@ private:
/** computes the relationships between links outgoing right of the given
link */
- void computeRightOutgoingLinkCrossings(bool leftHanded, NBEdge* from, NBEdge* to);
+ void computeRightOutgoingLinkCrossings(NBEdge* from, NBEdge* to);
/** computes the relationships between links outgoing left of the given
link */
- void computeLeftOutgoingLinkCrossings(bool leftHanded, NBEdge* from, NBEdge* to);
+ void computeLeftOutgoingLinkCrossings(NBEdge* from, NBEdge* to);
void resetSignalised();
diff --git a/src/netbuild/NBTypeCont.cpp b/src/netbuild/NBTypeCont.cpp
index 7c0d5d4..96d7f0e 100644
--- a/src/netbuild/NBTypeCont.cpp
+++ b/src/netbuild/NBTypeCont.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Walter Bamberger
/// @date Tue, 20 Nov 2001
-/// @version $Id: NBTypeCont.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NBTypeCont.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// A storage for the available types of an edge
/****************************************************************************/
@@ -36,6 +36,7 @@
#include <iostream>
#include <utils/common/MsgHandler.h>
#include <utils/common/ToString.h>
+#include <utils/iodevices/OutputDevice.h>
#include "NBTypeCont.h"
#ifdef CHECK_MEMORY_LEAKS
@@ -47,56 +48,132 @@
// method definitions
// ===========================================================================
void
-NBTypeCont::setDefaults(int defaultNoLanes,
+NBTypeCont::setDefaults(int defaultNumLanes,
SUMOReal defaultSpeed,
int defaultPriority) {
- myDefaultType.noLanes = defaultNoLanes;
+ myDefaultType.numLanes = defaultNumLanes;
myDefaultType.speed = defaultSpeed;
myDefaultType.priority = defaultPriority;
}
+void
+NBTypeCont::insert(const std::string& id, int numLanes, SUMOReal maxSpeed, int prio,
+ SVCPermissions permissions, SUMOReal width, bool oneWayIsDefault, SUMOReal sidewalkWidth, SUMOReal bikeLaneWidth) {
+
+ TypeDefinition newType(numLanes, maxSpeed, prio, width, permissions, oneWayIsDefault, sidewalkWidth, bikeLaneWidth);
+ TypesCont::iterator old = myTypes.find(id);
+ if (old != myTypes.end()) {
+ newType.restrictions.insert(old->second.restrictions.begin(), old->second.restrictions.end());
+ newType.attrs.insert(old->second.attrs.begin(), old->second.attrs.end());
+ }
+ myTypes[id] = newType;
+}
+
+
bool
-NBTypeCont::insert(const std::string& id, int noLanes, SUMOReal maxSpeed, int prio,
- SUMOReal width, SUMOVehicleClass vClass, bool oneWayIsDefault, SUMOReal sidewalkWidth) {
- SVCPermissions permissions = (vClass == SVC_IGNORING ? SVCAll : vClass);
- return insert(id, noLanes, maxSpeed, prio, permissions, width, oneWayIsDefault, sidewalkWidth);
+NBTypeCont::knows(const std::string& type) const {
+ return myTypes.find(type) != myTypes.end();
}
bool
-NBTypeCont::insert(const std::string& id, int noLanes, SUMOReal maxSpeed, int prio,
- SVCPermissions permissions, SUMOReal width, bool oneWayIsDefault, SUMOReal sidewalkWidth) {
+NBTypeCont::markAsToDiscard(const std::string& id) {
TypesCont::iterator i = myTypes.find(id);
- if (i != myTypes.end()) {
+ if (i == myTypes.end()) {
return false;
}
- myTypes[id] = TypeDefinition(noLanes, maxSpeed, prio, width, permissions, oneWayIsDefault, sidewalkWidth);
+ (*i).second.discard = true;
return true;
}
bool
-NBTypeCont::knows(const std::string& type) const {
- return myTypes.find(type) != myTypes.end();
+NBTypeCont::markAsSet(const std::string& id, const SumoXMLAttr attr) {
+ TypesCont::iterator i = myTypes.find(id);
+ if (i == myTypes.end()) {
+ return false;
+ }
+ (*i).second.attrs.insert(attr);
+ return true;
}
bool
-NBTypeCont::markAsToDiscard(const std::string& id) {
+NBTypeCont::addRestriction(const std::string& id, const SUMOVehicleClass svc, const SUMOReal speed) {
TypesCont::iterator i = myTypes.find(id);
if (i == myTypes.end()) {
return false;
}
- (*i).second.discard = true;
+ (*i).second.restrictions[svc] = speed;
+ return true;
+}
+
+
+bool
+NBTypeCont::copyRestrictionsAndAttrs(const std::string& fromId, const std::string& toId) {
+ TypesCont::iterator from = myTypes.find(fromId);
+ TypesCont::iterator to = myTypes.find(toId);
+ if (from == myTypes.end() || to == myTypes.end()) {
+ return false;
+ }
+ to->second.restrictions.insert(from->second.restrictions.begin(), from->second.restrictions.end());
+ to->second.attrs.insert(from->second.attrs.begin(), from->second.attrs.end());
return true;
}
+void
+NBTypeCont::writeTypes(OutputDevice& into) const {
+ for (TypesCont::const_iterator i = myTypes.begin(); i != myTypes.end(); ++i) {
+ into.openTag(SUMO_TAG_TYPE);
+ into.writeAttr(SUMO_ATTR_ID, i->first);
+ const NBTypeCont::TypeDefinition& type = i->second;
+ if (type.attrs.count(SUMO_ATTR_PRIORITY) > 0) {
+ into.writeAttr(SUMO_ATTR_PRIORITY, type.priority);
+ }
+ if (type.attrs.count(SUMO_ATTR_NUMLANES) > 0) {
+ into.writeAttr(SUMO_ATTR_NUMLANES, type.numLanes);
+ }
+ if (type.attrs.count(SUMO_ATTR_SPEED) > 0) {
+ into.writeAttr(SUMO_ATTR_SPEED, type.speed);
+ }
+ if (type.attrs.count(SUMO_ATTR_DISALLOW) > 0 || type.attrs.count(SUMO_ATTR_ALLOW) > 0) {
+ writePermissions(into, type.permissions);
+ }
+ if (type.attrs.count(SUMO_ATTR_ONEWAY) > 0) {
+ into.writeAttr(SUMO_ATTR_ONEWAY, type.oneWay);
+ }
+ if (type.attrs.count(SUMO_ATTR_DISCARD) > 0) {
+ into.writeAttr(SUMO_ATTR_DISCARD, type.discard);
+ }
+ if (type.attrs.count(SUMO_ATTR_WIDTH) > 0) {
+ into.writeAttr(SUMO_ATTR_WIDTH, type.width);
+ }
+ if (type.attrs.count(SUMO_ATTR_SIDEWALKWIDTH) > 0) {
+ into.writeAttr(SUMO_ATTR_SIDEWALKWIDTH, type.sidewalkWidth);
+ }
+ if (type.attrs.count(SUMO_ATTR_BIKELANEWIDTH) > 0) {
+ into.writeAttr(SUMO_ATTR_BIKELANEWIDTH, type.bikeLaneWidth);
+ }
+ for (std::map<SUMOVehicleClass, SUMOReal>::const_iterator j = type.restrictions.begin(); j != type.restrictions.end(); ++j) {
+ into.openTag(SUMO_TAG_RESTRICTION);
+ into.writeAttr(SUMO_ATTR_VCLASS, getVehicleClassNames(j->first));
+ into.writeAttr(SUMO_ATTR_SPEED, j->second);
+ into.closeTag();
+ }
+ into.closeTag();
+ }
+ if (!myTypes.empty()) {
+ into.lf();
+ }
+}
+
+
// ------------ Type-dependant Retrieval methods
int
NBTypeCont::getNumLanes(const std::string& type) const {
- return getType(type).noLanes;
+ return getType(type).numLanes;
}
@@ -124,6 +201,12 @@ NBTypeCont::getShallBeDiscarded(const std::string& type) const {
}
+bool
+NBTypeCont::wasSet(const std::string& type, const SumoXMLAttr attr) const {
+ return getType(type).attrs.count(attr) > 0;
+}
+
+
SVCPermissions
NBTypeCont::getPermissions(const std::string& type) const {
return getType(type).permissions;
@@ -142,6 +225,12 @@ NBTypeCont::getSidewalkWidth(const std::string& type) const {
}
+SUMOReal
+NBTypeCont::getBikeLaneWidth(const std::string& type) const {
+ return getType(type).bikeLaneWidth;
+}
+
+
const NBTypeCont::TypeDefinition&
NBTypeCont::getType(const std::string& name) const {
TypesCont::const_iterator i = myTypes.find(name);
diff --git a/src/netbuild/NBTypeCont.h b/src/netbuild/NBTypeCont.h
index 70cc383..8bdfc1d 100644
--- a/src/netbuild/NBTypeCont.h
+++ b/src/netbuild/NBTypeCont.h
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Walter Bamberger
/// @date Tue, 20 Nov 2001
-/// @version $Id: NBTypeCont.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NBTypeCont.h 18590 2015-08-03 11:17:45Z namdre $
///
// A storage for available types of edges
/****************************************************************************/
@@ -36,8 +36,14 @@
#include <string>
#include <map>
-#include "NBNode.h"
#include <utils/common/SUMOVehicleClass.h>
+#include <netbuild/NBEdge.h>
+
+
+// ===========================================================================
+// class declarations
+// ===========================================================================
+class OutputDevice;
// ===========================================================================
@@ -64,32 +70,17 @@ public:
/** @brief Sets the default values
- * @param[in] defaultNoLanes The default number of lanes an edge has
+ * @param[in] defaultNumLanes The default number of lanes an edge has
* @param[in] defaultSpeed The default speed allowed on an edge
* @param[in] defaultPriority The default priority of an edge
*/
- void setDefaults(int defaultNoLanes,
+ void setDefaults(int defaultNumLanes,
SUMOReal defaultSpeed, int defaultPriority);
- /** @brief Adds a type into the list. This is a simplified convenience form
- * of insert, if only one allowed vehicle class is necessary.
- * @param[in] id The id of the type
- * @param[in] noLanes The number of lanes an edge of this type has
- * @param[in] maxSpeed The speed allowed on an edge of this type
- * @param[in] prio The priority of an edge of this type
- * @param[in] width The width of lanes of edgesof this type
- * @param[in] vClasses The vehicle classes allowed on an edge of this type
- * @param[in] oneWayIsDefault Whether edges of this type are one-way per default
- * @return Whether the type could be added (no type with the same id existed)
- */
- bool insert(const std::string& id, int noLanes, SUMOReal maxSpeed, int prio,
- SUMOReal width, SUMOVehicleClass vClasses = SVC_IGNORING, bool oneWayIsDefault = false,
- SUMOReal sidewalkWidth = NBEdge::UNSPECIFIED_WIDTH);
-
/** @brief Adds a type into the list
* @param[in] id The id of the type
- * @param[in] noLanes The number of lanes an edge of this type has
+ * @param[in] numLanes The number of lanes an edge of this type has
* @param[in] maxSpeed The speed allowed on an edge of this type
* @param[in] prio The priority of an edge of this type
* @param[in] permissions The encoding of vehicle classes allowed on an edge of this type
@@ -97,11 +88,12 @@ public:
* @param[in] oneWayIsDefault Whether edges of this type are one-way per default
* @return Whether the type could be added (no type with the same id existed)
*/
- bool insert(const std::string& id, int noLanes,
+ void insert(const std::string& id, int numLanes,
SUMOReal maxSpeed, int prio,
SVCPermissions permissions,
SUMOReal width, bool oneWayIsDefault,
- SUMOReal sidewalkWidth);
+ SUMOReal sidewalkWidth,
+ SUMOReal bikeLaneWidth);
/** @brief Returns the number of known types
* @return The number of known edge types (excluding the default)
@@ -122,7 +114,27 @@ public:
*/
bool markAsToDiscard(const std::string& id);
+ /** @brief Marks an attribute of a type as set
+ * @param[in] id The id of the type
+ * @param[in] attr The id of the attribute
+ */
+ bool markAsSet(const std::string& id, const SumoXMLAttr attr);
+ /** @brief Adds a restriction to a type
+ * @param[in] id The id of the type
+ * @param[in] svc The vehicle class the restriction refers to
+ * @param[in] speed The restricted speed
+ */
+ bool addRestriction(const std::string& id, const SUMOVehicleClass svc, const SUMOReal speed);
+
+ /** @brief Copy restrictions to a type
+ * @param[in] fromId The id of the source type
+ * @param[in] toId The id of the destination type
+ */
+ bool copyRestrictionsAndAttrs(const std::string& fromId, const std::string& toId);
+
+ /// @brief writes all types a s XML
+ void writeTypes(OutputDevice& into) const;
/// @name Type-dependant Retrieval methods
/// @{
@@ -167,11 +179,20 @@ public:
/** @brief Returns the information whether edges of this type shall be discarded.
*
* Returns false if the type is not known.
+ * @param[in] type The id of the type
* @return Whether edges of this type shall be discarded.
*/
bool getShallBeDiscarded(const std::string& type) const;
+ /** @brief Returns whether an attribute of a type was set
+ * @param[in] type The id of the type
+ * @param[in] attr The id of the attribute
+ * @return Whether the attribute was set
+ */
+ bool wasSet(const std::string& type, const SumoXMLAttr attr) const;
+
+
/** @brief Returns allowed vehicle classes for the given type
*
* If the named type is not known, the default is returned
@@ -197,6 +218,15 @@ public:
* @return The width of lanes of edges of this type
*/
SUMOReal getSidewalkWidth(const std::string& type) const;
+
+
+ /** @brief Returns the lane width for a bike lane to be added [m]
+ *
+ * If the named type is not known, the default is returned
+ * @param[in] type The name of the type to return the width for
+ * @return The width of lanes of edges of this type
+ */
+ SUMOReal getBikeLaneWidth(const std::string& type) const;
/// @}
@@ -204,25 +234,28 @@ private:
struct TypeDefinition {
/// @brief Constructor
TypeDefinition() :
- noLanes(1), speed((SUMOReal) 13.9), priority(-1),
- permissions(SVCAll),
+ numLanes(1), speed((SUMOReal) 13.9), priority(-1),
+ permissions(SVC_UNSPECIFIED),
oneWay(true), discard(false),
width(NBEdge::UNSPECIFIED_WIDTH),
- sidewalkWidth(NBEdge::UNSPECIFIED_WIDTH)
+ sidewalkWidth(NBEdge::UNSPECIFIED_WIDTH),
+ bikeLaneWidth(NBEdge::UNSPECIFIED_WIDTH)
{ }
/// @brief Constructor
- TypeDefinition(int _noLanes, SUMOReal _speed, int _priority,
+ TypeDefinition(int _numLanes, SUMOReal _speed, int _priority,
SUMOReal _width, SVCPermissions _permissions, bool _oneWay,
- SUMOReal _sideWalkWidth) :
- noLanes(_noLanes), speed(_speed), priority(_priority),
+ SUMOReal _sideWalkWidth,
+ SUMOReal _bikeLaneWidth) :
+ numLanes(_numLanes), speed(_speed), priority(_priority),
permissions(_permissions),
oneWay(_oneWay), discard(false), width(_width),
- sidewalkWidth(_sideWalkWidth)
+ sidewalkWidth(_sideWalkWidth),
+ bikeLaneWidth(_bikeLaneWidth)
{ }
/// @brief The number of lanes of an edge
- int noLanes;
+ int numLanes;
/// @brief The maximal velocity on an edge in m/s
SUMOReal speed;
/// @brief The priority of an edge
@@ -238,6 +271,13 @@ private:
/* @brief The width of the sidewalk that should be added as an additional lane
* a value of NBEdge::UNSPECIFIED_WIDTH indicates that no sidewalk should be added */
SUMOReal sidewalkWidth;
+ /* @brief The width of the bike lane that should be added as an additional lane
+ * a value of NBEdge::UNSPECIFIED_WIDTH indicates that no bike lane should be added */
+ SUMOReal bikeLaneWidth;
+ /// @brief The vehicle class specific speed restrictions
+ std::map<SUMOVehicleClass, SUMOReal> restrictions;
+ /// @brief The attributes which have been set
+ std::set<SumoXMLAttr> attrs;
};
diff --git a/src/netconvert_main.cpp b/src/netconvert_main.cpp
index ce119be..061ad24 100644
--- a/src/netconvert_main.cpp
+++ b/src/netconvert_main.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 20 Nov 2001
-/// @version $Id: netconvert_main.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: netconvert_main.cpp 18486 2015-06-11 11:10:09Z behrisch $
///
// Main for NETCONVERT
/****************************************************************************/
@@ -109,7 +109,8 @@ main(int argc, char** argv) {
try {
XMLSubSys::init();
fillOptions();
- OptionsIO::getOptions(true, argc, argv);
+ OptionsIO::setArgs(argc, argv);
+ OptionsIO::getOptions();
if (oc.processMetaOptions(argc < 2)) {
SystemFrame::close();
return 0;
diff --git a/src/netgen/NGFrame.cpp b/src/netgen/NGFrame.cpp
index e7698b5..6d771bb 100644
--- a/src/netgen/NGFrame.cpp
+++ b/src/netgen/NGFrame.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date 06.05.2011
-/// @version $Id: NGFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NGFrame.cpp 18503 2015-06-25 10:33:47Z namdre $
///
// Sets and checks options for netgen
/****************************************************************************/
@@ -134,57 +134,57 @@ NGFrame::fillOptions() {
oc.doRegister("rand.max-distance", new Option_Float(250));
oc.addSynonyme("rand.max-distance", "rand-max-distance", true);
oc.addSynonyme("rand.max-distance", "max-dist");
- oc.addDescription("rand.max-distance", "Random Network", "");
+ oc.addDescription("rand.max-distance", "Random Network", "The maximum distance for each edge");
oc.doRegister("rand.min-distance", new Option_Float(100));
oc.addSynonyme("rand.min-distance", "rand-min-distance", true);
oc.addSynonyme("rand.min-distance", "min-dist");
- oc.addDescription("rand.min-distance", "Random Network", "");
+ oc.addDescription("rand.min-distance", "Random Network", "The minimum distance for each edge");
oc.doRegister("rand.min-angle", new Option_Float(DEG2RAD(45.0)));
oc.addSynonyme("rand.min-angle", "rand-min-anglee", true);
oc.addSynonyme("rand.min-angle", "min-angle");
- oc.addDescription("rand.min-angle", "Random Network", "");
+ oc.addDescription("rand.min-angle", "Random Network", "The minimum angle for each pair of (bidirectional) roads");
oc.doRegister("rand.num-tries", new Option_Integer(50));
oc.addSynonyme("rand.num-tries", "rand-num-tries", true);
oc.addSynonyme("rand.num-tries", "num-tries");
- oc.addDescription("rand.num-tries", "Random Network", "");
+ oc.addDescription("rand.num-tries", "Random Network", "The number of tries for creating each node");
oc.doRegister("rand.connectivity", new Option_Float((SUMOReal) 0.95));
oc.addSynonyme("rand.connectivity", "rand-connectivity", true);
oc.addSynonyme("rand.connectivity", "connectivity");
- oc.addDescription("rand.connectivity", "Random Network", "");
+ oc.addDescription("rand.connectivity", "Random Network", "Probability for roads to continue at each node");
oc.doRegister("rand.neighbor-dist1", new Option_Float(0));
oc.addSynonyme("rand.neighbor-dist1", "rand-neighbor-dist1", true);
oc.addSynonyme("rand.neighbor-dist1", "dist1");
- oc.addDescription("rand.neighbor-dist1", "Random Network", "");
+ oc.addDescription("rand.neighbor-dist1", "Random Network", "Probability for a node having exactly 1 neighbor");
oc.doRegister("rand.neighbor-dist2", new Option_Float(0));
oc.addSynonyme("rand.neighbor-dist2", "rand-neighbor-dist2", true);
oc.addSynonyme("rand.neighbor-dist2", "dist2");
- oc.addDescription("rand.neighbor-dist2", "Random Network", "");
+ oc.addDescription("rand.neighbor-dist2", "Random Network", "Probability for a node having exactly 2 neighbors");
oc.doRegister("rand.neighbor-dist3", new Option_Float(10));
oc.addSynonyme("rand.neighbor-dist3", "rand-neighbor-dist3", true);
oc.addSynonyme("rand.neighbor-dist3", "dist3");
- oc.addDescription("rand.neighbor-dist3", "Random Network", "");
+ oc.addDescription("rand.neighbor-dist3", "Random Network", "Probability for a node having exactly 3 neighbors");
oc.doRegister("rand.neighbor-dist4", new Option_Float(10));
oc.addSynonyme("rand.neighbor-dist4", "rand-neighbor-dist4", true);
oc.addSynonyme("rand.neighbor-dist4", "dist4");
- oc.addDescription("rand.neighbor-dist4", "Random Network", "");
+ oc.addDescription("rand.neighbor-dist4", "Random Network", "Probability for a node having exactly 4 neighbors");
oc.doRegister("rand.neighbor-dist5", new Option_Float(2));
oc.addSynonyme("rand.neighbor-dist5", "rand-neighbor-dist5", true);
oc.addSynonyme("rand.neighbor-dist5", "dist5");
- oc.addDescription("rand.neighbor-dist5", "Random Network", "");
+ oc.addDescription("rand.neighbor-dist5", "Random Network", "Probability for a node having exactly 5 neighbors");
oc.doRegister("rand.neighbor-dist6", new Option_Float(1));
oc.addSynonyme("rand.neighbor-dist6", "rand-neighbor-dist6", true);
oc.addSynonyme("rand.neighbor-dist6", "dist6");
- oc.addDescription("rand.neighbor-dist6", "Random Network", "");
+ oc.addDescription("rand.neighbor-dist6", "Random Network", "Probability for a node having exactly 6 neighbors");
}
diff --git a/src/netgen/netgen_main.cpp b/src/netgen/netgen_main.cpp
index 60af3db..13eb7c5 100644
--- a/src/netgen/netgen_main.cpp
+++ b/src/netgen/netgen_main.cpp
@@ -5,7 +5,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Mar, 2003
-/// @version $Id: netgen_main.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: netgen_main.cpp 18486 2015-06-11 11:10:09Z behrisch $
///
// Main for NETGENERATE
/****************************************************************************/
@@ -211,7 +211,8 @@ main(int argc, char** argv) {
// initialise the application system (messaging, xml, options)
XMLSubSys::init();
fillOptions();
- OptionsIO::getOptions(true, argc, argv);
+ OptionsIO::setArgs(argc, argv);
+ OptionsIO::getOptions();
if (oc.processMetaOptions(argc < 2)) {
SystemFrame::close();
return 0;
diff --git a/src/netimport/Makefile.am b/src/netimport/Makefile.am
index 8f49426..a44e47a 100644
--- a/src/netimport/Makefile.am
+++ b/src/netimport/Makefile.am
@@ -21,3 +21,7 @@ NINavTeqHelper.cpp NINavTeqHelper.h
SUBDIRS = vissim
+BUILT_SOURCES = typemap.h
+EXTRA_DIST = typemap.h
+typemap.h:
+ ../../tools/build/typemap.py
diff --git a/src/netimport/Makefile.in b/src/netimport/Makefile.in
index ac4bc14..9ea1bd1 100644
--- a/src/netimport/Makefile.in
+++ b/src/netimport/Makefile.in
@@ -397,7 +397,10 @@ NIXMLTrafficLightsHandler.cpp NIXMLTrafficLightsHandler.h \
NINavTeqHelper.cpp NINavTeqHelper.h
SUBDIRS = vissim
-all: all-recursive
+BUILT_SOURCES = typemap.h
+EXTRA_DIST = typemap.h
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
.SUFFIXES: .cpp .lo .o .obj
@@ -647,11 +650,13 @@ distdir: $(DISTFILES)
fi; \
done
check-am: all-am
-check: check-recursive
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-recursive
all-am: Makefile $(LIBRARIES)
installdirs: installdirs-recursive
installdirs-am:
-install: install-recursive
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
@@ -681,6 +686,7 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-recursive
clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
@@ -752,7 +758,8 @@ ps-am:
uninstall-am:
-.MAKE: $(am__recursive_targets) install-am install-strip
+.MAKE: $(am__recursive_targets) all check install install-am \
+ install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic clean-libtool \
@@ -769,6 +776,8 @@ uninstall-am:
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am
+typemap.h:
+ ../../tools/build/typemap.py
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/netimport/NIFrame.cpp b/src/netimport/NIFrame.cpp
index 0bf34b1..d7c7b05 100644
--- a/src/netimport/NIFrame.cpp
+++ b/src/netimport/NIFrame.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 20 Nov 2001
-/// @version $Id: NIFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIFrame.cpp 18531 2015-07-07 07:30:33Z behrisch $
///
// Sets and checks options for netimport
/****************************************************************************/
@@ -38,7 +38,6 @@
#include <utils/options/OptionsIO.h>
#include <utils/common/MsgHandler.h>
#include <utils/common/ToString.h>
-#include "NIFrame.h"
#include <utils/common/FileHelpers.h>
#include <utils/common/UtilExceptions.h>
#include <utils/common/RandHelper.h>
@@ -46,6 +45,7 @@
#include <netwrite/NWFrame.h>
#include <utils/common/SystemFrame.h>
#include "NIImporter_DlrNavteq.h"
+#include "NIFrame.h"
#ifdef CHECK_MEMORY_LEAKS
#include <foreign/nvwa/debug_new.h>
@@ -251,9 +251,6 @@ NIFrame::fillOptions() {
oc.doRegister("osm.skip-duplicates-check", new Option_Bool(false));
oc.addDescription("osm.skip-duplicates-check", "Processing", "Skips the check for duplicate nodes and edges");
- oc.doRegister("osm.railway.oneway-default", new Option_Bool(true));
- oc.addDescription("osm.railway.oneway-default", "Processing", "Imports railway edges as one-way by default");
-
oc.doRegister("osm.elevation", new Option_Bool(false));
oc.addDescription("osm.elevation", "Processing", "Imports elevation data");
@@ -263,9 +260,6 @@ NIFrame::fillOptions() {
oc.doRegister("opendrive.ignore-widths", new Option_Bool(false));
oc.addDescription("opendrive.ignore-widths", "Processing", "Whether lane widths shall be ignored.");
-
-
-
// register some additional options
oc.doRegister("tls.discard-loaded", new Option_Bool(false));
oc.addDescription("tls.discard-loaded", "TLS Building", "Does not instatiate traffic lights loaded from other formats than XML");
@@ -307,6 +301,22 @@ NIFrame::checkOptions() {
oc.set("offset.disable-normalization", "true");
}
}
+ if (!oc.isSet("type-files")) {
+ const char* sumoPath = std::getenv("SUMO_HOME");
+ if (sumoPath == 0) {
+ WRITE_WARNING("Environment variable SUMO_HOME is not set, using built in type maps.");
+ } else {
+ const std::string path = sumoPath + std::string("/data/typemap/");
+ if (oc.isSet("osm-files")) {
+ oc.unSet("type-files");
+ oc.set("type-files", path + "osmNetconvert.typ.xml");
+ }
+ if (oc.isSet("opendrive-files")) {
+ oc.unSet("type-files");
+ oc.set("type-files", path + "opendriveNetconvert.typ.xml");
+ }
+ }
+ }
return ok;
}
diff --git a/src/netimport/NIImporter_ArcView.cpp b/src/netimport/NIImporter_ArcView.cpp
index e3056c3..62d2aea 100644
--- a/src/netimport/NIImporter_ArcView.cpp
+++ b/src/netimport/NIImporter_ArcView.cpp
@@ -6,7 +6,7 @@
/// @author Thimor Bohn
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: NIImporter_ArcView.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIImporter_ArcView.cpp 18752 2015-08-30 19:09:05Z namdre $
///
// Importer for networks stored in ArcView-shape format
/****************************************************************************/
@@ -125,8 +125,13 @@ void
NIImporter_ArcView::load() {
#ifdef HAVE_GDAL
PROGRESS_BEGIN_MESSAGE("Loading data from '" + mySHPName + "'");
+#if GDAL_VERSION_MAJOR < 2
OGRRegisterAll();
OGRDataSource* poDS = OGRSFDriverRegistrar::Open(mySHPName.c_str(), FALSE);
+#else
+ GDALAllRegister();
+ GDALDataset* poDS = (GDALDataset*) GDALOpen(mySHPName.c_str(), GA_ReadOnly);
+#endif
if (poDS == NULL) {
WRITE_ERROR("Could not open shape description '" + mySHPName + "'.");
return;
diff --git a/src/netimport/NIImporter_OpenDrive.cpp b/src/netimport/NIImporter_OpenDrive.cpp
index 31fa934..e457aa2 100644
--- a/src/netimport/NIImporter_OpenDrive.cpp
+++ b/src/netimport/NIImporter_OpenDrive.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Mon, 14.04.2008
-/// @version $Id: NIImporter_OpenDrive.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIImporter_OpenDrive.cpp 18747 2015-08-28 06:38:38Z namdre $
///
// Importer for networks stored in openDrive format
/****************************************************************************/
@@ -152,17 +152,9 @@ NIImporter_OpenDrive::loadNetwork(const OptionsCont& oc, NBNetBuilder& nb) {
myImportAllTypes = oc.getBool("opendrive.import-all-lanes");
myImportWidths = !oc.getBool("opendrive.ignore-widths");
NBTypeCont& tc = nb.getTypeCont();
- const SUMOReal WIDTH(3.65); // as wanted
- const SVCPermissions defaultPermissions = SVCAll & ~SVC_PEDESTRIAN;
- tc.insert("driving", 1, (SUMOReal)(80. / 3.6), 1, defaultPermissions, WIDTH, true, NBEdge::UNSPECIFIED_WIDTH);
- tc.insert("mwyEntry", 1, (SUMOReal)(80. / 3.6), 1, defaultPermissions, WIDTH, true, NBEdge::UNSPECIFIED_WIDTH);
- tc.insert("mwyExit", 1, (SUMOReal)(80. / 3.6), 1, defaultPermissions, WIDTH, true, NBEdge::UNSPECIFIED_WIDTH);
- tc.insert("stop", 1, (SUMOReal)(80. / 3.6), 1, defaultPermissions, WIDTH, true, NBEdge::UNSPECIFIED_WIDTH);
- tc.insert("special1", 1, (SUMOReal)(80. / 3.6), 1, defaultPermissions, WIDTH, true, NBEdge::UNSPECIFIED_WIDTH);
- tc.insert("parking", 1, (SUMOReal)(5. / 3.6), 1, defaultPermissions, WIDTH, true, NBEdge::UNSPECIFIED_WIDTH);
// build the handler
std::map<std::string, OpenDriveEdge*> edges;
- NIImporter_OpenDrive handler(tc, edges);
+ NIImporter_OpenDrive handler(nb.getTypeCont(), edges);
// parse file(s)
std::vector<std::string> files = oc.getStringVector("opendrive-files");
for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
@@ -332,7 +324,9 @@ NIImporter_OpenDrive::loadNetwork(const OptionsCont& oc, NBNetBuilder& nb) {
int priorityL = e->getPriority(OPENDRIVE_TAG_LEFT);
SUMOReal sB = 0;
SUMOReal sE = e->length;
- SUMOReal cF = e->length / e->geom.length2D();
+ // 0-length geometries are possible if only the inner points are represented
+ const SUMOReal length2D = e->geom.length2D();
+ SUMOReal cF = length2D == 0 ? 1 : e->length / length2D;
NBEdge* prevRight = 0;
NBEdge* prevLeft = 0;
diff --git a/src/netimport/NIImporter_OpenStreetMap.cpp b/src/netimport/NIImporter_OpenStreetMap.cpp
index 06d6bb7..8ad5f66 100644
--- a/src/netimport/NIImporter_OpenStreetMap.cpp
+++ b/src/netimport/NIImporter_OpenStreetMap.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Walter Bamberger
/// @date Mon, 14.04.2008
-/// @version $Id: NIImporter_OpenStreetMap.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: NIImporter_OpenStreetMap.cpp 18611 2015-08-06 14:49:39Z namdre $
///
// Importer for networks stored in OpenStreetMap format
/****************************************************************************/
@@ -66,7 +66,7 @@
// ---------------------------------------------------------------------------
const SUMOReal NIImporter_OpenStreetMap::MAXSPEED_UNGIVEN = -1;
-const SUMOLong NIImporter_OpenStreetMap::INVALID_ID = std::numeric_limits<SUMOLong>::max();
+const long long int NIImporter_OpenStreetMap::INVALID_ID = std::numeric_limits<long long int>::max();
// ===========================================================================
// Private classes
@@ -121,7 +121,7 @@ NIImporter_OpenStreetMap::~NIImporter_OpenStreetMap() {
delete *i;
}
// delete edges
- for (std::map<SUMOLong, Edge*>::iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
+ for (std::map<long long int, Edge*>::iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
delete(*i).second;
}
}
@@ -133,49 +133,6 @@ NIImporter_OpenStreetMap::load(const OptionsCont& oc, NBNetBuilder& nb) {
if (!oc.isSet("osm-files")) {
return;
}
- // preset types
- // for highways
- NBTypeCont& tc = nb.getTypeCont();
- SUMOReal const WIDTH = NBEdge::UNSPECIFIED_WIDTH;
- tc.insert("highway.motorway", 2, (SUMOReal)(160. / 3.6), 13, WIDTH, SVC_IGNORING, true);
- tc.insert("highway.motorway_link", 1, (SUMOReal)(80. / 3.6), 12, WIDTH, SVC_IGNORING, true);
- tc.insert("highway.trunk", 2, (SUMOReal)(100. / 3.6), 11, WIDTH); // !!! 130km/h?
- tc.insert("highway.trunk_link", 1, (SUMOReal)(80. / 3.6), 10, WIDTH);
- tc.insert("highway.primary", 2, (SUMOReal)(100. / 3.6), 9, WIDTH);
- tc.insert("highway.primary_link", 1, (SUMOReal)(80. / 3.6), 8, WIDTH);
- tc.insert("highway.secondary", 2, (SUMOReal)(100. / 3.6), 7, WIDTH);
- tc.insert("highway.secondary_link", 1, (SUMOReal)(80. / 3.6), 6, WIDTH);
- tc.insert("highway.tertiary", 1, (SUMOReal)(80. / 3.6), 6, WIDTH);
- tc.insert("highway.tertiary_link", 1, (SUMOReal)(80. / 3.6), 5, WIDTH);
- tc.insert("highway.unclassified", 1, (SUMOReal)(80. / 3.6), 5, WIDTH);
- tc.insert("highway.residential", 1, (SUMOReal)(50. / 3.6), 4, WIDTH); // actually, maybe one lane for parking would be nice...
- tc.insert("highway.living_street", 1, (SUMOReal)(10. / 3.6), 3, WIDTH);
- tc.insert("highway.service", 1, (SUMOReal)(20. / 3.6), 2, WIDTH, SVC_DELIVERY);
- tc.insert("highway.track", 1, (SUMOReal)(20. / 3.6), 1, WIDTH);
- tc.insert("highway.services", 1, (SUMOReal)(30. / 3.6), 1, WIDTH); // service area i.e. on a motorway
- tc.insert("highway.unsurfaced", 1, (SUMOReal)(30. / 3.6), 1, WIDTH); // unofficial value, used outside germany
-
- tc.insert("highway.pedestrian", 1, (SUMOReal)(30. / 3.6), 1, WIDTH, SVC_PEDESTRIAN, true);
- tc.insert("highway.path", 1, (SUMOReal)(10. / 3.6), 1, WIDTH, SVC_PEDESTRIAN, true);
- tc.insert("highway.bridleway", 1, (SUMOReal)(10. / 3.6), 1, WIDTH, SVC_BICYCLE); // no horse stuff
- tc.insert("highway.cycleway", 1, (SUMOReal)(20. / 3.6), 1, WIDTH, SVC_BICYCLE);
- tc.insert("highway.footway", 1, (SUMOReal)(10. / 3.6), 1, WIDTH, SVC_PEDESTRIAN, true);
- tc.insert("highway.step", 1, (SUMOReal)(5. / 3.6), 1, WIDTH, SVC_PEDESTRIAN, true); // additional
- tc.insert("highway.steps", 1, (SUMOReal)(5. / 3.6), 1, WIDTH, SVC_PEDESTRIAN, true); // :-) do not run too fast
- tc.insert("highway.stairs", 1, (SUMOReal)(5. / 3.6), 1, WIDTH, SVC_PEDESTRIAN, true); // additional
- tc.insert("highway.bus_guideway", 1, (SUMOReal)(30. / 3.6), 1, WIDTH, SVC_BUS);
- tc.insert("highway.raceway", 2, (SUMOReal)(300. / 3.6), 14, WIDTH, SVC_VIP);
- tc.insert("highway.ford", 1, (SUMOReal)(10. / 3.6), 1, WIDTH, SVC_ARMY);
-
- // for railways
- const bool oneWay = oc.getBool("osm.railway.oneway-default");
- tc.insert("railway.rail", 1, (SUMOReal)(300. / 3.6), 15, WIDTH, SVC_RAIL, oneWay);
- tc.insert("railway.tram", 1, (SUMOReal)(100. / 3.6), 15, WIDTH, SVC_TRAM, oneWay);
- tc.insert("railway.light_rail", 1, (SUMOReal)(100. / 3.6), 15, WIDTH, SVC_RAIL_URBAN, oneWay); // might also correspond to higher standard trams
- tc.insert("railway.subway", 1, (SUMOReal)(100. / 3.6), 15, WIDTH, SVC_RAIL_URBAN, oneWay);
- tc.insert("railway.preserved", 1, (SUMOReal)(100. / 3.6), 15, WIDTH, SVC_RAIL, oneWay);
-
-
/* Parse file(s)
* Each file is parsed twice: first for nodes, second for edges. */
std::vector<std::string> files = oc.getStringVector("osm-files");
@@ -209,7 +166,7 @@ NIImporter_OpenStreetMap::load(const OptionsCont& oc, NBNetBuilder& nb) {
PROGRESS_BEGIN_MESSAGE("Removing duplicate edges");
if (myEdges.size() > 1) {
std::set<const Edge*, CompareEdges> dupsFinder;
- for (std::map<SUMOLong, Edge*>::iterator it = myEdges.begin(); it != myEdges.end();) {
+ for (std::map<long long int, Edge*>::iterator it = myEdges.begin(); it != myEdges.end();) {
if (dupsFinder.count(it->second) > 0) {
WRITE_MESSAGE("Found duplicate edges. Removing " + toString(it->first));
delete it->second;
@@ -226,12 +183,12 @@ NIImporter_OpenStreetMap::load(const OptionsCont& oc, NBNetBuilder& nb) {
/* Mark which nodes are used (by edges or traffic lights).
* This is necessary to detect which OpenStreetMap nodes are for
* geometry only */
- std::map<SUMOLong, int> nodeUsage;
+ std::map<long long int, int> nodeUsage;
// Mark which nodes are used by edges (begin and end)
- for (std::map<SUMOLong, Edge*>::const_iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
+ for (std::map<long long int, Edge*>::const_iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
Edge* e = (*i).second;
assert(e->myCurrentIsRoad);
- for (std::vector<SUMOLong>::const_iterator j = e->myCurrentNodes.begin(); j != e->myCurrentNodes.end(); ++j) {
+ for (std::vector<long long int>::const_iterator j = e->myCurrentNodes.begin(); j != e->myCurrentNodes.end(); ++j) {
if (nodeUsage.find(*j) == nodeUsage.end()) {
nodeUsage[*j] = 0;
}
@@ -239,7 +196,7 @@ NIImporter_OpenStreetMap::load(const OptionsCont& oc, NBNetBuilder& nb) {
}
}
// Mark which nodes are used by traffic lights
- for (std::map<SUMOLong, NIOSMNode*>::const_iterator nodesIt = myOSMNodes.begin(); nodesIt != myOSMNodes.end(); ++nodesIt) {
+ for (std::map<long long int, NIOSMNode*>::const_iterator nodesIt = myOSMNodes.begin(); nodesIt != myOSMNodes.end(); ++nodesIt) {
if (nodesIt->second->tlsControlled) {
// If the key is not found in the map, the value is automatically
// initialized with 0.
@@ -251,7 +208,7 @@ NIImporter_OpenStreetMap::load(const OptionsCont& oc, NBNetBuilder& nb) {
* one edge are instantiated. Other nodes are considered as geometry nodes. */
NBNodeCont& nc = nb.getNodeCont();
NBTrafficLightLogicCont& tlsc = nb.getTLLogicCont();
- for (std::map<SUMOLong, Edge*>::iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
+ for (std::map<long long int, Edge*>::iterator i = myEdges.begin(); i != myEdges.end(); ++i) {
Edge* e = (*i).second;
assert(e->myCurrentIsRoad);
if (e->myCurrentNodes.size() < 2) {
@@ -265,8 +222,8 @@ NIImporter_OpenStreetMap::load(const OptionsCont& oc, NBNetBuilder& nb) {
NBNode* currentFrom = insertNodeChecking(*e->myCurrentNodes.begin(), nc, tlsc);
NBNode* last = insertNodeChecking(*(e->myCurrentNodes.end() - 1), nc, tlsc);
int running = 0;
- std::vector<SUMOLong> passed;
- for (std::vector<SUMOLong>::iterator j = e->myCurrentNodes.begin(); j != e->myCurrentNodes.end(); ++j) {
+ std::vector<long long int> passed;
+ for (std::vector<long long int>::iterator j = e->myCurrentNodes.begin(); j != e->myCurrentNodes.end(); ++j) {
passed.push_back(*j);
if (nodeUsage[*j] > 1 && j != e->myCurrentNodes.end() - 1 && j != e->myCurrentNodes.begin()) {
NBNode* currentTo = insertNodeChecking(*j, nc, tlsc);
@@ -295,7 +252,7 @@ NIImporter_OpenStreetMap::load(const OptionsCont& oc, NBNetBuilder& nb) {
NBNode*
-NIImporter_OpenStreetMap::insertNodeChecking(SUMOLong id, NBNodeCont& nc, NBTrafficLightLogicCont& tlsc) {
+NIImporter_OpenStreetMap::insertNodeChecking(long long int id, NBNodeCont& nc, NBTrafficLightLogicCont& tlsc) {
NBNode* node = nc.retrieve(toString(id));
if (node == 0) {
NIOSMNode* n = myOSMNodes.find(id)->second;
@@ -330,7 +287,7 @@ NIImporter_OpenStreetMap::insertNodeChecking(SUMOLong id, NBNodeCont& nc, NBTraf
int
NIImporter_OpenStreetMap::insertEdge(Edge* e, int index, NBNode* from, NBNode* to,
- const std::vector<SUMOLong>& passed, NBNetBuilder& nb) {
+ const std::vector<long long int>& passed, NBNetBuilder& nb) {
NBNodeCont& nc = nb.getNodeCont();
NBEdgeCont& ec = nb.getEdgeCont();
NBTypeCont& tc = nb.getTypeCont();
@@ -349,7 +306,7 @@ NIImporter_OpenStreetMap::insertEdge(Edge* e, int index, NBNode* from, NBNode* t
if (from == to) {
// in the special case of a looped way split again using passed
assert(passed.size() >= 2);
- std::vector<SUMOLong> geom(passed);
+ std::vector<long long int> geom(passed);
geom.pop_back(); // remove to-node
NBNode* intermediate = insertNodeChecking(geom.back(), nc, tlsc);
index = insertEdge(e, index, from, intermediate, geom, nb);
@@ -361,7 +318,7 @@ NIImporter_OpenStreetMap::insertEdge(Edge* e, int index, NBNode* from, NBNode* t
// convert the shape
PositionVector shape;
shape.push_back(from->getPosition());
- for (std::vector<SUMOLong>::const_iterator i = passed.begin(); i != passed.end(); ++i) {
+ for (std::vector<long long int>::const_iterator i = passed.begin(); i != passed.end(); ++i) {
NIOSMNode* n = myOSMNodes.find(*i)->second;
Position pos(n->lon, n->lat, n->ele);
if (!NBNetBuilder::transformCoordinates(pos, true)) {
@@ -409,6 +366,7 @@ NIImporter_OpenStreetMap::insertEdge(Edge* e, int index, NBNode* from, NBNode* t
int prio = 0;
SUMOReal width = NBEdge::UNSPECIFIED_WIDTH;
SUMOReal sidewalkWidth = NBEdge::UNSPECIFIED_WIDTH;
+ SUMOReal bikelaneWidth = NBEdge::UNSPECIFIED_WIDTH;
bool defaultIsOneWay = false;
SVCPermissions permissions = 0;
bool discard = true;
@@ -421,6 +379,7 @@ NIImporter_OpenStreetMap::insertEdge(Edge* e, int index, NBNode* from, NBNode* t
permissions |= tc.getPermissions(*it);
width = MAX2(width, tc.getWidth(*it));
sidewalkWidth = MAX2(sidewalkWidth, tc.getSidewalkWidth(*it));
+ bikelaneWidth = MAX2(bikelaneWidth, tc.getBikeLaneWidth(*it));
discard = false;
}
}
@@ -433,7 +392,12 @@ NIImporter_OpenStreetMap::insertEdge(Edge* e, int index, NBNode* from, NBNode* t
return newIndex;
} else {
WRITE_MESSAGE("Adding new type \"" + type + "\" (first occurence for edge \"" + id + "\").");
- tc.insert(newType, numLanes, maxSpeed, prio, permissions, width, defaultIsOneWay, sidewalkWidth);
+ tc.insert(newType, numLanes, maxSpeed, prio, permissions, width, defaultIsOneWay, sidewalkWidth, bikelaneWidth);
+ for (std::vector<std::string>::iterator it = types.begin(); it != types.end(); it++) {
+ if (!tc.getShallBeDiscarded(*it)) {
+ tc.copyRestrictionsAndAttrs(*it, newType);
+ }
+ }
myKnownCompoundTypes[type] = newType;
type = newType;
}
@@ -448,8 +412,12 @@ NIImporter_OpenStreetMap::insertEdge(Edge* e, int index, NBNode* from, NBNode* t
int numLanesBackward = tc.getNumLanes(type);
SUMOReal speed = tc.getSpeed(type);
bool defaultsToOneWay = tc.getIsOneWay(type);
- SVCPermissions permissions = tc.getPermissions(type);
+ SVCPermissions forwardPermissions = tc.getPermissions(type);
+ SVCPermissions backwardPermissions = tc.getPermissions(type);
+ SUMOReal forwardWidth = tc.getWidth(type);
+ SUMOReal backwardWidth = tc.getWidth(type);
const bool addSidewalk = (tc.getSidewalkWidth(type) != NBEdge::UNSPECIFIED_WIDTH);
+ const bool addBikeLane = (tc.getBikeLaneWidth(type) != NBEdge::UNSPECIFIED_WIDTH);
// check directions
bool addForward = true;
bool addBackward = true;
@@ -496,13 +464,50 @@ NIImporter_OpenStreetMap::insertEdge(Edge* e, int index, NBNode* from, NBNode* t
WRITE_WARNING("Skipping edge '" + id + "' because it has speed " + toString(speed));
ok = false;
}
+ // deal with cycleways that run in the opposite direction of a one-way street
+ if (addBikeLane) {
+ if (!addForward && (e->myCyclewayType & WAY_FORWARD) != 0) {
+ addForward = true;
+ forwardPermissions = SVC_BICYCLE;
+ forwardWidth = tc.getBikeLaneWidth(type);
+ numLanesForward = 1;
+ // do not add an additional cycle lane
+ e->myCyclewayType = (WayType)(e->myCyclewayType & !WAY_FORWARD);
+ }
+ if (!addBackward && (e->myCyclewayType & WAY_BACKWARD) != 0) {
+ addBackward = true;
+ backwardPermissions = SVC_BICYCLE;
+ backwardWidth = tc.getBikeLaneWidth(type);
+ numLanesBackward = 1;
+ // do not add an additional cycle lane
+ e->myCyclewayType = (WayType)(e->myCyclewayType & !WAY_BACKWARD);
+ }
+ }
+ // deal with busways that run in the opposite direction of a one-way street
+ if (!addForward && (e->myBuswayType & WAY_FORWARD) != 0) {
+ addForward = true;
+ forwardPermissions = SVC_BUS;
+ numLanesForward = 1;
+ }
+ if (!addBackward && (e->myBuswayType & WAY_BACKWARD) != 0) {
+ addBackward = true;
+ backwardPermissions = SVC_BUS;
+ numLanesBackward = 1;
+ }
+
if (ok) {
LaneSpreadFunction lsf = addBackward ? LANESPREAD_RIGHT : LANESPREAD_CENTER;
if (addForward) {
assert(numLanesForward > 0);
NBEdge* nbe = new NBEdge(StringUtils::escapeXML(id), from, to, type, speed, numLanesForward, tc.getPriority(type),
- tc.getWidth(type), NBEdge::UNSPECIFIED_OFFSET, shape, StringUtils::escapeXML(e->streetName), lsf, true);
- nbe->setPermissions(permissions);
+ forwardWidth, NBEdge::UNSPECIFIED_OFFSET, shape, StringUtils::escapeXML(e->streetName), lsf, true);
+ nbe->setPermissions(forwardPermissions);
+ if ((e->myBuswayType & WAY_FORWARD) != 0) {
+ nbe->setPermissions(SVC_BUS, 0);
+ }
+ if (addBikeLane && (e->myCyclewayType == WAY_UNKNOWN || (e->myCyclewayType & WAY_FORWARD) != 0)) {
+ nbe->addBikeLane(tc.getBikeLaneWidth(type));
+ }
if (addSidewalk) {
nbe->addSidewalk(tc.getSidewalkWidth(type));
}
@@ -515,8 +520,14 @@ NIImporter_OpenStreetMap::insertEdge(Edge* e, int index, NBNode* from, NBNode* t
if (addBackward) {
assert(numLanesBackward > 0);
NBEdge* nbe = new NBEdge(StringUtils::escapeXML(id), to, from, type, speed, numLanesBackward, tc.getPriority(type),
- tc.getWidth(type), NBEdge::UNSPECIFIED_OFFSET, shape.reverse(), StringUtils::escapeXML(e->streetName), lsf, true);
- nbe->setPermissions(permissions);
+ backwardWidth, NBEdge::UNSPECIFIED_OFFSET, shape.reverse(), StringUtils::escapeXML(e->streetName), lsf, true);
+ nbe->setPermissions(backwardPermissions);
+ if ((e->myBuswayType & WAY_BACKWARD) != 0) {
+ nbe->setPermissions(SVC_BUS, 0);
+ }
+ if (addBikeLane && (e->myCyclewayType == WAY_UNKNOWN || (e->myCyclewayType & WAY_BACKWARD) != 0)) {
+ nbe->addBikeLane(tc.getBikeLaneWidth(type));
+ }
if (addSidewalk) {
nbe->addSidewalk(tc.getSidewalkWidth(type));
}
@@ -534,7 +545,7 @@ NIImporter_OpenStreetMap::insertEdge(Edge* e, int index, NBNode* from, NBNode* t
// definitions of NIImporter_OpenStreetMap::NodesHandler-methods
// ---------------------------------------------------------------------------
NIImporter_OpenStreetMap::NodesHandler::NodesHandler(
- std::map<SUMOLong, NIOSMNode*>& toFill,
+ std::map<long long int, NIOSMNode*>& toFill,
std::set<NIOSMNode*, CompareNodes>& uniqueNodes,
bool importElevation) :
SUMOSAXHandler("osm - file"),
@@ -556,10 +567,10 @@ NIImporter_OpenStreetMap::NodesHandler::myStartElement(int element, const SUMOSA
if (element == SUMO_TAG_NODE) {
bool ok = true;
if (myHierarchyLevel != 2) {
- WRITE_ERROR("Node element on wrong XML hierarchy level (id='" + toString(attrs.get<SUMOLong>(SUMO_ATTR_ID, 0, ok)) + "', level='" + toString(myHierarchyLevel) + "').");
+ WRITE_ERROR("Node element on wrong XML hierarchy level (id='" + toString(attrs.get<long long int>(SUMO_ATTR_ID, 0, ok)) + "', level='" + toString(myHierarchyLevel) + "').");
return;
}
- SUMOLong id = attrs.get<SUMOLong>(SUMO_ATTR_ID, 0, ok);
+ long long int id = attrs.get<long long int>(SUMO_ATTR_ID, 0, ok);
std::string action = attrs.hasAttribute("action") ? attrs.getStringSecure("action", "") : "";
if (action == "delete") {
return;
@@ -614,10 +625,12 @@ NIImporter_OpenStreetMap::NodesHandler::myStartElement(int element, const SUMOSA
bool ok = true;
std::string key = attrs.get<std::string>(SUMO_ATTR_K, toString(myLastNodeID).c_str(), ok, false);
// we check whether the key is relevant (and we really need to transcode the value) to avoid hitting #1636
- if (key == "highway" || key == "ele") {
+ if (key == "highway" || key == "ele" || key == "crossing") {
std::string value = attrs.get<std::string>(SUMO_ATTR_V, toString(myLastNodeID).c_str(), ok, false);
if (key == "highway" && value.find("traffic_signal") != std::string::npos) {
myToFill[myLastNodeID]->tlsControlled = true;
+ } else if (key == "crossing" && value.find("traffic_signals") != std::string::npos) {
+ myToFill[myLastNodeID]->tlsControlled = true;
} else if (myImportElevation && key == "ele") {
try {
myToFill[myLastNodeID]->ele = TplConvert::_2SUMOReal(value.c_str());
@@ -645,8 +658,8 @@ NIImporter_OpenStreetMap::NodesHandler::myEndElement(int element) {
// definitions of NIImporter_OpenStreetMap::EdgesHandler-methods
// ---------------------------------------------------------------------------
NIImporter_OpenStreetMap::EdgesHandler::EdgesHandler(
- const std::map<SUMOLong, NIOSMNode*>& osmNodes,
- std::map<SUMOLong, Edge*>& toFill) :
+ const std::map<long long int, NIOSMNode*>& osmNodes,
+ std::map<long long int, Edge*>& toFill) :
SUMOSAXHandler("osm - file"),
myOSMNodes(osmNodes),
myEdgeMap(toFill) {
@@ -672,7 +685,7 @@ NIImporter_OpenStreetMap::EdgesHandler::myStartElement(int element,
// parse "way" elements
if (element == SUMO_TAG_WAY) {
bool ok = true;
- SUMOLong id = attrs.get<SUMOLong>(SUMO_ATTR_ID, 0, ok);
+ long long int id = attrs.get<long long int>(SUMO_ATTR_ID, 0, ok);
std::string action = attrs.hasAttribute("action") ? attrs.getStringSecure("action", "") : "";
if (action == "delete") {
myCurrentEdge = 0;
@@ -687,9 +700,9 @@ NIImporter_OpenStreetMap::EdgesHandler::myStartElement(int element,
// parse "nd" (node) elements
if (element == SUMO_TAG_ND) {
bool ok = true;
- SUMOLong ref = attrs.get<SUMOLong>(SUMO_ATTR_REF, 0, ok);
+ long long int ref = attrs.get<long long int>(SUMO_ATTR_REF, 0, ok);
if (ok) {
- std::map<SUMOLong, NIOSMNode*>::const_iterator node = myOSMNodes.find(ref);
+ std::map<long long int, NIOSMNode*>::const_iterator node = myOSMNodes.find(ref);
if (node == myOSMNodes.end()) {
WRITE_WARNING("The referenced geometry information (ref='" + toString(ref) + "') is not known");
return;
@@ -709,22 +722,79 @@ NIImporter_OpenStreetMap::EdgesHandler::myStartElement(int element,
}
bool ok = true;
std::string key = attrs.get<std::string>(SUMO_ATTR_K, toString(myCurrentEdge->id).c_str(), ok, false);
+ if (key.size() > 8 && StringUtils::startsWith(key, "cycleway:")) {
+ // handle special busway keys
+ const std::string cyclewaySpec = key.substr(9);
+ key = "cycleway";
+ if (cyclewaySpec == "right") {
+ myCurrentEdge->myCyclewayType = (WayType)(myCurrentEdge->myCyclewayType | WAY_FORWARD);
+ } else if (cyclewaySpec == "left") {
+ myCurrentEdge->myCyclewayType = (WayType)(myCurrentEdge->myCyclewayType | WAY_BACKWARD);
+ } else if (cyclewaySpec == "both") {
+ myCurrentEdge->myCyclewayType = (WayType)(myCurrentEdge->myCyclewayType | WAY_BOTH);
+ } else {
+ key = "ignore";
+ }
+ if ((myCurrentEdge->myCyclewayType & WAY_BOTH) != 0) {
+ // now we have some info on directionality
+ myCurrentEdge->myCyclewayType = (WayType)(myCurrentEdge->myCyclewayType & !WAY_UNKNOWN);
+ }
+ } else if (key.size() > 6 && StringUtils::startsWith(key, "busway:")) {
+ // handle special busway keys
+ const std::string buswaySpec = key.substr(7);
+ key = "busway";
+ if (buswaySpec == "right") {
+ myCurrentEdge->myBuswayType = (WayType)(myCurrentEdge->myBuswayType | WAY_FORWARD);
+ } else if (buswaySpec == "left") {
+ myCurrentEdge->myBuswayType = (WayType)(myCurrentEdge->myBuswayType | WAY_BACKWARD);
+ } else if (buswaySpec == "both") {
+ myCurrentEdge->myBuswayType = (WayType)(myCurrentEdge->myBuswayType | WAY_BOTH);
+ } else {
+ key = "ignore";
+ }
+ }
+
// we check whether the key is relevant (and we really need to transcode the value) to avoid hitting #1636
if (!StringUtils::endsWith(key, "way") && !StringUtils::startsWith(key, "lanes") && key != "maxspeed" && key != "junction" && key != "name" && key != "tracks") {
return;
}
std::string value = attrs.get<std::string>(SUMO_ATTR_V, toString(myCurrentEdge->id).c_str(), ok, false);
- if (key == "highway" || key == "railway" || key == "waterway") {
+ if (key == "highway" || key == "railway" || key == "waterway" || key == "cycleway" || key == "busway") {
+ myCurrentEdge->myCurrentIsRoad = true;
+ // special cycleway stuff
+ if (key == "cycleway") {
+ if (value == "no") {
+ return;
+ } else if (value == "opposite_track") {
+ myCurrentEdge->myCyclewayType = WAY_BACKWARD;
+ } else if (value == "opposite_lane") {
+ myCurrentEdge->myCyclewayType = WAY_BACKWARD;
+ }
+ }
+ // special busway stuff
+ if (key == "busway") {
+ if (value == "no") {
+ return;
+ } else if (value == "opposite_track") {
+ myCurrentEdge->myBuswayType = WAY_BACKWARD;
+ } else if (value == "opposite_lane") {
+ myCurrentEdge->myBuswayType = WAY_BACKWARD;
+ }
+ // no need to extend the type id
+ return;
+ }
+ // build type id
const std::string singleTypeID = key + "." + value;
if (myCurrentEdge->myHighWayType != "") {
// osm-ways may be used by more than one mode (eg railway.tram + highway.residential. this is relevant for multimodal traffic)
// we create a new type for this kind of situation which must then be resolved in insertEdge()
- myCurrentEdge->myHighWayType = myCurrentEdge->myHighWayType + compoundTypeSeparator + singleTypeID;
+ std::vector<std::string> types = StringTokenizer(myCurrentEdge->myHighWayType, compoundTypeSeparator).getVector();
+ types.push_back(singleTypeID);
+ myCurrentEdge->myHighWayType = joinToStringSorting(types, compoundTypeSeparator);
} else {
myCurrentEdge->myHighWayType = singleTypeID;
}
- myCurrentEdge->myCurrentIsRoad = true;
} else if (key == "lanes") {
try {
myCurrentEdge->myNoLanes = TplConvert::_2int(value.c_str());
@@ -825,8 +895,8 @@ NIImporter_OpenStreetMap::EdgesHandler::myEndElement(int element) {
// definitions of NIImporter_OpenStreetMap::RelationHandler-methods
// ---------------------------------------------------------------------------
NIImporter_OpenStreetMap::RelationHandler::RelationHandler(
- const std::map<SUMOLong, NIOSMNode*>& osmNodes,
- const std::map<SUMOLong, Edge*>& osmEdges) :
+ const std::map<long long int, NIOSMNode*>& osmNodes,
+ const std::map<long long int, Edge*>& osmEdges) :
SUMOSAXHandler("osm - file"),
myOSMNodes(osmNodes),
myOSMEdges(osmEdges) {
@@ -855,7 +925,7 @@ NIImporter_OpenStreetMap::RelationHandler::myStartElement(int element,
// parse "way" elements
if (element == SUMO_TAG_RELATION) {
bool ok = true;
- myCurrentRelation = attrs.get<SUMOLong>(SUMO_ATTR_ID, 0, ok);
+ myCurrentRelation = attrs.get<long long int>(SUMO_ATTR_ID, 0, ok);
std::string action = attrs.hasAttribute("action") ? attrs.getStringSecure("action", "") : "";
if (action == "delete" || !ok) {
myCurrentRelation = INVALID_ID;
@@ -868,7 +938,7 @@ NIImporter_OpenStreetMap::RelationHandler::myStartElement(int element,
if (element == SUMO_TAG_MEMBER) {
bool ok = true;
std::string role = attrs.hasAttribute("role") ? attrs.getStringSecure("role", "") : "";
- SUMOLong ref = attrs.get<SUMOLong>(SUMO_ATTR_REF, 0, ok);
+ long long int ref = attrs.get<long long int>(SUMO_ATTR_REF, 0, ok);
if (role == "via") {
// u-turns for divided ways may be given with 2 via-nodes or 1 via-way
std::string memberType = attrs.get<std::string>(SUMO_ATTR_TYPE, 0, ok);
@@ -917,7 +987,7 @@ NIImporter_OpenStreetMap::RelationHandler::myStartElement(int element,
bool
-NIImporter_OpenStreetMap::RelationHandler::checkEdgeRef(SUMOLong ref) const {
+NIImporter_OpenStreetMap::RelationHandler::checkEdgeRef(long long int ref) const {
if (myOSMEdges.find(ref) != myOSMEdges.end()) {
return true;
} else {
@@ -994,7 +1064,7 @@ NIImporter_OpenStreetMap::RelationHandler::applyRestriction() const {
NBEdge*
-NIImporter_OpenStreetMap::RelationHandler::findEdgeRef(SUMOLong wayRef, const std::vector<NBEdge*>& candidates) const {
+NIImporter_OpenStreetMap::RelationHandler::findEdgeRef(long long int wayRef, const std::vector<NBEdge*>& candidates) const {
const std::string prefix = toString(wayRef);
const std::string backPrefix = "-" + prefix;
NBEdge* result = 0;
diff --git a/src/netimport/NIImporter_OpenStreetMap.h b/src/netimport/NIImporter_OpenStreetMap.h
index 6c4ec31..726b0f3 100644
--- a/src/netimport/NIImporter_OpenStreetMap.h
+++ b/src/netimport/NIImporter_OpenStreetMap.h
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Walter Bamberger
/// @date Mon, 14.04.2008
-/// @version $Id: NIImporter_OpenStreetMap.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIImporter_OpenStreetMap.h 18674 2015-08-20 19:42:08Z behrisch $
///
// Importer for networks stored in OpenStreetMap format
/****************************************************************************/
@@ -80,11 +80,11 @@ protected:
/** @brief An internal representation of an OSM-node
*/
struct NIOSMNode {
- NIOSMNode(SUMOLong _id, double _lon, double _lat) :
+ NIOSMNode(long long int _id, double _lon, double _lat) :
id(_id), lon(_lon), lat(_lat), ele(0), tlsControlled(false), node(0) {}
/// @brief The node's id
- const SUMOLong id;
+ const long long int id;
/// @brief The longitude the node is located at
const SUMOReal lon;
/// @brief The latitude the node is located at
@@ -102,17 +102,30 @@ protected:
};
+ /** @enum CycleWayType
+ * @brief details on the kind of cycleway along this road
+ */
+ enum WayType {
+ WAY_NONE = 0,
+ WAY_FORWARD = 1,
+ WAY_BACKWARD = 2,
+ WAY_BOTH = WAY_FORWARD | WAY_BACKWARD,
+ WAY_UNKNOWN = 4
+ };
+
/** @brief An internal definition of a loaded edge
*/
struct Edge {
- Edge(SUMOLong _id) :
+ Edge(long long int _id) :
id(_id), myNoLanes(-1), myNoLanesForward(0), myMaxSpeed(MAXSPEED_UNGIVEN),
+ myCyclewayType(WAY_UNKNOWN), // building of extra lane depends on bikelaneWidth of loaded typemap
+ myBuswayType(WAY_NONE), // buslanes are always built when declared
myCurrentIsRoad(false) {}
/// @brief The edge's id
- const SUMOLong id;
+ const long long int id;
/// @brief The edge's street name
std::string streetName;
/// @brief number of lanes, or -1 if unknown
@@ -125,8 +138,12 @@ protected:
std::string myHighWayType;
/// @brief Information whether this is an one-way road
std::string myIsOneWay;
+ /// @brief Information about the kind of cycleway along this road
+ WayType myCyclewayType;
+ /// @brief Information about the kind of busway along this road
+ WayType myBuswayType;
/// @brief The list of nodes this edge is made of
- std::vector<SUMOLong> myCurrentNodes;
+ std::vector<long long int> myCurrentNodes;
/// @brief Information whether this is a road
bool myCurrentIsRoad;
@@ -163,14 +180,14 @@ private:
/** @brief the map from OSM node ids to actual nodes
* @note: NIOSMNodes may appear multiple times due to substition
*/
- std::map<SUMOLong, NIOSMNode*> myOSMNodes;
+ std::map<long long int, NIOSMNode*> myOSMNodes;
/// @brief the set of unique nodes used in NodesHandler, used when freeing memory
std::set<NIOSMNode*, CompareNodes> myUniqueNodes;
/** @brief the map from OSM way ids to edge objects */
- std::map<SUMOLong, Edge*> myEdges;
+ std::map<long long int, Edge*> myEdges;
/// @brief The compounds types that do not contain known types
std::set<std::string> myUnusableTypes;
@@ -192,7 +209,7 @@ private:
* @return The built/found node
* @exception ProcessError If the tls could not be added to the container
*/
- NBNode* insertNodeChecking(SUMOLong id, NBNodeCont& nc, NBTrafficLightLogicCont& tlsc);
+ NBNode* insertNodeChecking(long long int id, NBNodeCont& nc, NBTrafficLightLogicCont& tlsc);
/** @brief Builds an NBEdge
@@ -208,12 +225,12 @@ private:
* @exception ProcessError If the edge could not be added to the container
*/
int insertEdge(Edge* e, int index, NBNode* from, NBNode* to,
- const std::vector<SUMOLong>& passed, NBNetBuilder& nb);
+ const std::vector<long long int>& passed, NBNetBuilder& nb);
protected:
static const SUMOReal MAXSPEED_UNGIVEN;
- static const SUMOLong INVALID_ID;
+ static const long long int INVALID_ID;
/**
* @class NodesHandler
@@ -227,7 +244,7 @@ protected:
* @param[in, out] uniqueNodes The nodes container for ensuring uniqueness
* @param[in] options The options to use
*/
- NodesHandler(std::map<SUMOLong, NIOSMNode*>& toFill,
+ NodesHandler(std::map<long long int, NIOSMNode*>& toFill,
std::set<NIOSMNode*, CompareNodes>& uniqueNodes,
bool importElevation);
@@ -263,10 +280,10 @@ protected:
private:
/// @brief The nodes container to fill
- std::map<SUMOLong, NIOSMNode*>& myToFill;
+ std::map<long long int, NIOSMNode*>& myToFill;
/// @brief ID of the currently parsed node, for reporting mainly
- SUMOLong myLastNodeID;
+ long long int myLastNodeID;
/// @brief Hierarchy helper for parsing a node's tags
bool myIsInValidNodeTag;
@@ -303,8 +320,8 @@ protected:
* @param[in] osmNodes The previously parsed (osm-)nodes
* @param[in, out] toFill The edges container to fill with read edges
*/
- EdgesHandler(const std::map<SUMOLong, NIOSMNode*>& osmNodes,
- std::map<SUMOLong, Edge*>& toFill);
+ EdgesHandler(const std::map<long long int, NIOSMNode*>& osmNodes,
+ std::map<long long int, Edge*>& toFill);
/// @brief Destructor
@@ -337,10 +354,10 @@ protected:
private:
/// @brief The previously parsed nodes
- const std::map<SUMOLong, NIOSMNode*>& myOSMNodes;
+ const std::map<long long int, NIOSMNode*>& myOSMNodes;
/// @brief A map of built edges
- std::map<SUMOLong, Edge*>& myEdgeMap;
+ std::map<long long int, Edge*>& myEdgeMap;
/// @brief The currently built edge
Edge* myCurrentEdge;
@@ -372,8 +389,8 @@ protected:
* @param[in] osmNodes The previously parsed OSM-nodes
* @param[in] osmEdges The previously parse OSM-edges
*/
- RelationHandler(const std::map<SUMOLong, NIOSMNode*>& osmNodes,
- const std::map<SUMOLong, Edge*>& osmEdges);
+ RelationHandler(const std::map<long long int, NIOSMNode*>& osmNodes,
+ const std::map<long long int, Edge*>& osmEdges);
/// @brief Destructor
@@ -406,13 +423,13 @@ protected:
private:
/// @brief The previously parsed nodes
- const std::map<SUMOLong, NIOSMNode*>& myOSMNodes;
+ const std::map<long long int, NIOSMNode*>& myOSMNodes;
/// @brief The previously parsed edges
- const std::map<SUMOLong, Edge*>& myOSMEdges;
+ const std::map<long long int, Edge*>& myOSMEdges;
/// @brief The currently parsed relation
- SUMOLong myCurrentRelation;
+ long long int myCurrentRelation;
/// @brief The element stack
std::vector<int> myParentElements;
@@ -421,14 +438,14 @@ protected:
bool myIsRestriction;
/// @brief the origination way for the current restriction
- SUMOLong myFromWay;
+ long long int myFromWay;
/// @brief the destination way for the current restriction
- SUMOLong myToWay;
+ long long int myToWay;
/// @brief the via node/way for the current restriction
- SUMOLong myViaNode;
- SUMOLong myViaWay;
+ long long int myViaNode;
+ long long int myViaWay;
/** @enum RestrictionType
@@ -448,13 +465,13 @@ protected:
void resetValues();
/// @brief check whether a referenced way has a corresponding edge
- bool checkEdgeRef(SUMOLong ref) const;
+ bool checkEdgeRef(long long int ref) const;
/// @brief try to apply the parsed restriction and return whether successful
bool applyRestriction() const;
/// @brief try to find the way segment among candidates
- NBEdge* findEdgeRef(SUMOLong wayRef, const std::vector<NBEdge*>& candidates) const;
+ NBEdge* findEdgeRef(long long int wayRef, const std::vector<NBEdge*>& candidates) const;
private:
/** @brief invalidated copy constructor */
diff --git a/src/netimport/NIImporter_SUMO.cpp b/src/netimport/NIImporter_SUMO.cpp
index bd75e05..5b44e06 100644
--- a/src/netimport/NIImporter_SUMO.cpp
+++ b/src/netimport/NIImporter_SUMO.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Mon, 14.04.2008
-/// @version $Id: NIImporter_SUMO.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIImporter_SUMO.cpp 18647 2015-08-18 07:09:50Z namdre $
///
// Importer for networks stored in SUMO format
/****************************************************************************/
@@ -184,7 +184,7 @@ NIImporter_SUMO::_loadNetwork(OptionsCont& oc) {
}
nbe->addLane2LaneConnection(
fromLaneIndex, toEdge, c.toLaneIdx, NBEdge::L2L_VALIDATED,
- true, c.mayDefinitelyPass);
+ true, c.mayDefinitelyPass, c.keepClear);
// maybe we have a tls-controlled connection
if (c.tlID != "" && myRailSignals.count(c.tlID) == 0) {
@@ -231,8 +231,8 @@ NIImporter_SUMO::_loadNetwork(OptionsCont& oc) {
NBConnection(prohibitedFrom, myEdges[it->prohibitedTo]->builtEdge));
}
}
- if (!myHaveSeenInternalEdge && oc.isDefault("no-internal-links")) {
- oc.set("no-internal-links", "true");
+ if (!myHaveSeenInternalEdge) {
+ myNetBuilder.haveLoadedNetworkWithoutInternalEdges();
}
if (!deprecatedVehicleClassesSeen.empty()) {
WRITE_WARNING("Deprecated vehicle class(es) '" + toString(deprecatedVehicleClassesSeen) + "' in input network.");
@@ -252,7 +252,7 @@ NIImporter_SUMO::_loadNetwork(OptionsCont& oc) {
}
}
if (edges.size() > 0) {
- node->addCrossing(edges, crossing.width, crossing.priority);
+ node->addCrossing(edges, crossing.width, crossing.priority, true);
}
}
}
@@ -551,6 +551,7 @@ NIImporter_SUMO::addConnection(const SUMOSAXAttributes& attrs) {
conn.toLaneIdx = attrs.get<int>(SUMO_ATTR_TO_LANE, 0, ok);
conn.tlID = attrs.getOpt<std::string>(SUMO_ATTR_TLID, 0, ok, "");
conn.mayDefinitelyPass = attrs.getOpt<bool>(SUMO_ATTR_PASS, 0, ok, false);
+ conn.keepClear = attrs.getOpt<bool>(SUMO_ATTR_KEEP_CLEAR, 0, ok, true);
if (conn.tlID != "") {
conn.tlLinkNo = attrs.get<int>(SUMO_ATTR_TLLINKINDEX, 0, ok);
}
@@ -681,8 +682,8 @@ NIImporter_SUMO::reconstructEdgeShape(const EdgeAttrs* edge, const Position& fro
Position from = firstLane[i - 1];
Position me = firstLane[i];
Position to = firstLane[i + 1];
- std::pair<SUMOReal, SUMOReal> offsets = NBEdge::laneOffset(from, me, offset, false);
- std::pair<SUMOReal, SUMOReal> offsets2 = NBEdge::laneOffset(me, to, offset, false);
+ std::pair<SUMOReal, SUMOReal> offsets = NBEdge::laneOffset(from, me, offset);
+ std::pair<SUMOReal, SUMOReal> offsets2 = NBEdge::laneOffset(me, to, offset);
Line l1(
Position(from.x() + offsets.first, from.y() + offsets.second),
diff --git a/src/netimport/NIImporter_SUMO.h b/src/netimport/NIImporter_SUMO.h
index 8e9f388..a19c62c 100644
--- a/src/netimport/NIImporter_SUMO.h
+++ b/src/netimport/NIImporter_SUMO.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Mon, 14.04.2008
-/// @version $Id: NIImporter_SUMO.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIImporter_SUMO.h 18319 2015-04-29 06:49:01Z namdre $
///
// Importer for networks stored in SUMO format
/****************************************************************************/
@@ -189,6 +189,8 @@ private:
unsigned int tlLinkNo;
/// @brief Information about being definitely free to drive (on-ramps)
bool mayDefinitelyPass;
+ /// @brief Whether the junction must be kept clear coming from this connection
+ bool keepClear;
};
diff --git a/src/netimport/NIImporter_VISUM.cpp b/src/netimport/NIImporter_VISUM.cpp
index 3ff8d50..90a927e 100644
--- a/src/netimport/NIImporter_VISUM.cpp
+++ b/src/netimport/NIImporter_VISUM.cpp
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Fri, 19 Jul 2002
-/// @version $Id: NIImporter_VISUM.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIImporter_VISUM.cpp 18590 2015-08-03 11:17:45Z namdre $
///
// A VISUM network importer
/****************************************************************************/
@@ -230,14 +230,17 @@ NIImporter_VISUM::parse_Types() {
// get the id
myCurrentID = NBHelpers::normalIDRepresentation(myLineParser.get("Nr"));
// get the maximum speed
- SUMOReal speed = getNamedFloat("v0-IV", "V0IV");
+ const SUMOReal speed = getNamedFloat("v0-IV", "V0IV");
// get the priority
- int priority = 1000 - TplConvert::_2int(myLineParser.get("Rang").c_str());
+ const int priority = 1000 - TplConvert::_2int(myLineParser.get("Rang").c_str());
// try to retrieve the number of lanes
- SUMOReal cap = getNamedFloat("Kap-IV", "KAPIV");
- int nolanes = myCapacity2Lanes.get(cap);
+ const int numLanes = myCapacity2Lanes.get(getNamedFloat("Kap-IV", "KAPIV"));
// insert the type
- myNetBuilder.getTypeCont().insert(myCurrentID, nolanes, speed / (SUMOReal) 3.6, priority, -1);
+ myNetBuilder.getTypeCont().insert(myCurrentID, numLanes, speed / (SUMOReal) 3.6, priority, SVCAll, NBEdge::UNSPECIFIED_WIDTH, false, NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_WIDTH);
+ myNetBuilder.getTypeCont().markAsSet(myCurrentID, SUMO_ATTR_NUMLANES);
+ myNetBuilder.getTypeCont().markAsSet(myCurrentID, SUMO_ATTR_SPEED);
+ myNetBuilder.getTypeCont().markAsSet(myCurrentID, SUMO_ATTR_PRIORITY);
+ myNetBuilder.getTypeCont().markAsSet(myCurrentID, SUMO_ATTR_ONEWAY);
}
@@ -284,7 +287,7 @@ NIImporter_VISUM::parse_Districts() {
return;
}
if (myLineParser.know("FLAECHEID")) {
- SUMOLong flaecheID = TplConvert::_2long(myLineParser.get("FLAECHEID").c_str());
+ long long int flaecheID = TplConvert::_2long(myLineParser.get("FLAECHEID").c_str());
myShapeDistrictMap[flaecheID] = district;
}
}
@@ -292,7 +295,7 @@ NIImporter_VISUM::parse_Districts() {
void
NIImporter_VISUM::parse_Point() {
- SUMOLong id = TplConvert::_2long(myLineParser.get("ID").c_str());
+ long long int id = TplConvert::_2long(myLineParser.get("ID").c_str());
SUMOReal x = TplConvert::_2SUMOReal(myLineParser.get("XKOORD").c_str());
SUMOReal y = TplConvert::_2SUMOReal(myLineParser.get("YKOORD").c_str());
Position pos(x, y);
@@ -412,19 +415,19 @@ NIImporter_VISUM::parse_Edges() {
void
NIImporter_VISUM::parse_Kante() {
- SUMOLong id = TplConvert::_2long(myLineParser.get("ID").c_str());
- SUMOLong from = TplConvert::_2long(myLineParser.get("VONPUNKTID").c_str());
- SUMOLong to = TplConvert::_2long(myLineParser.get("NACHPUNKTID").c_str());
+ long long int id = TplConvert::_2long(myLineParser.get("ID").c_str());
+ long long int from = TplConvert::_2long(myLineParser.get("VONPUNKTID").c_str());
+ long long int to = TplConvert::_2long(myLineParser.get("NACHPUNKTID").c_str());
myEdges[id] = std::make_pair(from, to);
}
void
NIImporter_VISUM::parse_PartOfArea() {
- SUMOLong flaecheID = TplConvert::_2long(myLineParser.get("FLAECHEID").c_str());
- SUMOLong flaechePartID = TplConvert::_2long(myLineParser.get("TFLAECHEID").c_str());
+ long long int flaecheID = TplConvert::_2long(myLineParser.get("FLAECHEID").c_str());
+ long long int flaechePartID = TplConvert::_2long(myLineParser.get("TFLAECHEID").c_str());
if (mySubPartsAreas.find(flaechePartID) == mySubPartsAreas.end()) {
- mySubPartsAreas[flaechePartID] = std::vector<SUMOLong>();
+ mySubPartsAreas[flaechePartID] = std::vector<long long int>();
}
mySubPartsAreas[flaechePartID].push_back(flaecheID);
}
@@ -865,8 +868,8 @@ NIImporter_VISUM::parse_TurnsToSignalGroups() {
void
NIImporter_VISUM::parse_AreaSubPartElement() {
- SUMOLong id = TplConvert::_2long(myLineParser.get("TFLAECHEID").c_str());
- SUMOLong edgeid = TplConvert::_2long(myLineParser.get("KANTEID").c_str());
+ long long int id = TplConvert::_2long(myLineParser.get("TFLAECHEID").c_str());
+ long long int edgeid = TplConvert::_2long(myLineParser.get("KANTEID").c_str());
if (myEdges.find(edgeid) == myEdges.end()) {
WRITE_ERROR("Unknown edge in TEILFLAECHENELEMENT");
return;
@@ -892,8 +895,8 @@ NIImporter_VISUM::parse_AreaSubPartElement() {
return;
}
- const std::vector<SUMOLong>& areas = mySubPartsAreas.find(id)->second;
- for (std::vector<SUMOLong>::const_iterator i = areas.begin(); i != areas.end(); ++i) {
+ const std::vector<long long int>& areas = mySubPartsAreas.find(id)->second;
+ for (std::vector<long long int>::const_iterator i = areas.begin(); i != areas.end(); ++i) {
NBDistrict* d = myShapeDistrictMap[*i];
if (d == 0) {
continue;
diff --git a/src/netimport/NIImporter_VISUM.h b/src/netimport/NIImporter_VISUM.h
index 6bfdad9..6ddbd74 100644
--- a/src/netimport/NIImporter_VISUM.h
+++ b/src/netimport/NIImporter_VISUM.h
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date Fri, 19 Jul 2002
-/// @version $Id: NIImporter_VISUM.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIImporter_VISUM.h 18239 2015-04-20 11:37:12Z behrisch $
///
// A VISUM network importer
/****************************************************************************/
@@ -502,16 +502,16 @@ private:
/// @brief A map of point ids to positions
- std::map<SUMOLong, Position> myPoints;
+ std::map<long long int, Position> myPoints;
/// @brief A map of edge (not road, but "edge" in this case) ids to from/to-points
- std::map<SUMOLong, std::pair<SUMOLong, SUMOLong> > myEdges;
+ std::map<long long int, std::pair<long long int, long long int> > myEdges;
/// @brief A map from district shape definition name to the district
- std::map<SUMOLong, NBDistrict*> myShapeDistrictMap;
+ std::map<long long int, NBDistrict*> myShapeDistrictMap;
/// @brief A map from area parts to area ids
- std::map<SUMOLong, std::vector<SUMOLong> > mySubPartsAreas;
+ std::map<long long int, std::vector<long long int> > mySubPartsAreas;
/// @brief A temporary storage for district shapes as they are filled incrementally
std::map<NBDistrict*, PositionVector> myDistrictShapes;
diff --git a/src/netimport/NILoader.cpp b/src/netimport/NILoader.cpp
index b7de105..84434bb 100644
--- a/src/netimport/NILoader.cpp
+++ b/src/netimport/NILoader.cpp
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Tue, 20 Nov 2001
-/// @version $Id: NILoader.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NILoader.cpp 18531 2015-07-07 07:30:33Z behrisch $
///
// Perfoms network import
/****************************************************************************/
@@ -39,12 +39,16 @@
#include <utils/common/FileHelpers.h>
#include <utils/common/StringUtils.h>
#include <utils/common/ToString.h>
+#include <utils/common/TplConvert.h>
+#include <utils/geom/GeoConvHelper.h>
+#include <utils/xml/SUMOSAXHandler.h>
+#include <utils/xml/SUMOSAXReader.h>
+#include <utils/xml/XMLSubSys.h>
#include <netbuild/NBTypeCont.h>
#include <netbuild/NBNodeCont.h>
#include <netbuild/NBEdgeCont.h>
+#include <netbuild/NBHeightMapper.h>
#include <netbuild/NBNetBuilder.h>
-#include <utils/xml/SUMOSAXHandler.h>
-#include <utils/xml/SUMOSAXReader.h>
#include <netimport/NIXMLEdgesHandler.h>
#include <netimport/NIXMLNodesHandler.h>
#include <netimport/NIXMLTrafficLightsHandler.h>
@@ -60,11 +64,8 @@
#include <netimport/NIImporter_OpenDrive.h>
#include <netimport/NIImporter_MATSim.h>
#include <netimport/NIImporter_ITSUMO.h>
-#include <utils/xml/XMLSubSys.h>
+#include "typemap.h"
#include "NILoader.h"
-#include <utils/common/TplConvert.h>
-#include <utils/geom/GeoConvHelper.h>
-#include <netbuild/NBHeightMapper.h>
#ifdef CHECK_MEMORY_LEAKS
#include <foreign/nvwa/debug_new.h>
@@ -86,7 +87,18 @@ NILoader::load(OptionsCont& oc) {
// load types first
NIXMLTypesHandler* handler =
new NIXMLTypesHandler(myNetBuilder.getTypeCont());
- loadXMLType(handler, oc.getStringVector("type-files"), "types");
+ if (!oc.isSet("type-files")) {
+ std::vector<std::string> files;
+ if (oc.isSet("osm-files")) {
+ files.push_back(osmTypemap);
+ }
+ if (oc.isSet("opendrive-files")) {
+ files.push_back(opendriveTypemap);
+ }
+ loadXMLType(handler, files, "types", true);
+ } else {
+ loadXMLType(handler, oc.getStringVector("type-files"), "types");
+ }
// try to load height data so it is ready for use by other importers
NBHeightMapper::loadIfSet(oc);
// try to load using different methods
@@ -167,12 +179,19 @@ NILoader::loadXML(OptionsCont& oc) {
void
NILoader::loadXMLType(SUMOSAXHandler* handler, const std::vector<std::string>& files,
- const std::string& type) {
+ const std::string& type, const bool stringParse) {
// build parser
std::string exceptMsg = "";
// start the parsing
try {
for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
+ if (stringParse) {
+ handler->setFileName("built in type map");
+ SUMOSAXReader* reader = XMLSubSys::getSAXReader(*handler);
+ reader->parseString(*file);
+ delete reader;
+ continue;
+ }
if (!FileHelpers::isReadable(*file)) {
WRITE_ERROR("Could not open " + type + "-file '" + *file + "'.");
exceptMsg = "Process Error";
diff --git a/src/netimport/NILoader.h b/src/netimport/NILoader.h
index c2ab03d..9601873 100644
--- a/src/netimport/NILoader.h
+++ b/src/netimport/NILoader.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 20 Nov 2001
-/// @version $Id: NILoader.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NILoader.h 18756 2015-08-31 19:16:33Z behrisch $
///
// Perfoms network import
/****************************************************************************/
@@ -79,8 +79,8 @@ private:
void loadXML(OptionsCont& oc);
/** loads data from the list of xml-files of certain type */
- void loadXMLType(SUMOSAXHandler* handler,
- const std::vector<std::string>& files, const std::string& type);
+ void loadXMLType(SUMOSAXHandler* handler, const std::vector<std::string>& files,
+ const std::string& type, const bool stringParse = false);
private:
/// @brief The network builder to fill with loaded data
diff --git a/src/netimport/NIXMLConnectionsHandler.cpp b/src/netimport/NIXMLConnectionsHandler.cpp
index 5aa3386..fcf2d8d 100644
--- a/src/netimport/NIXMLConnectionsHandler.cpp
+++ b/src/netimport/NIXMLConnectionsHandler.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Thu, 17 Oct 2002
-/// @version $Id: NIXMLConnectionsHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIXMLConnectionsHandler.cpp 18495 2015-06-17 23:31:46Z namdre $
///
// Importer for edge connections stored in XML
/****************************************************************************/
@@ -215,6 +215,7 @@ NIXMLConnectionsHandler::parseLaneBound(const SUMOSAXAttributes& attrs, NBEdge*
}
bool ok = true;
const bool mayDefinitelyPass = attrs.getOpt<bool>(SUMO_ATTR_PASS, 0, ok, false);
+ const bool keepClear = attrs.getOpt<bool>(SUMO_ATTR_KEEP_CLEAR, 0, ok, true);
if (!ok) {
return;
}
@@ -240,7 +241,7 @@ NIXMLConnectionsHandler::parseLaneBound(const SUMOSAXAttributes& attrs, NBEdge*
if (from->hasConnectionTo(to, toLane)) {
WRITE_WARNING("Target lane '" + to->getLaneID(toLane) + "' is already connected from '" + from->getID() + "'.");
}
- if (!from->addLane2LaneConnection(fromLane, to, toLane, NBEdge::L2L_USER, true, mayDefinitelyPass)) {
+ if (!from->addLane2LaneConnection(fromLane, to, toLane, NBEdge::L2L_USER, true, mayDefinitelyPass, keepClear)) {
NBEdge* nFrom = from;
while (nFrom->getToNode()->getOutgoingEdges().size() == 1) {
NBEdge* t = nFrom->getToNode()->getOutgoingEdges()[0];
@@ -249,12 +250,12 @@ NIXMLConnectionsHandler::parseLaneBound(const SUMOSAXAttributes& attrs, NBEdge*
}
nFrom = t;
}
- if (nFrom == 0 || !nFrom->addLane2LaneConnection(fromLane, to, toLane, NBEdge::L2L_USER, false, mayDefinitelyPass)) {
+ if (nFrom == 0 || !nFrom->addLane2LaneConnection(fromLane, to, toLane, NBEdge::L2L_USER, false, mayDefinitelyPass, keepClear)) {
if (OptionsCont::getOptions().getBool("show-errors.connections-first-try")) {
WRITE_WARNING("Could not set loaded connection from '" + from->getLaneID(fromLane) + "' to '" + to->getLaneID(toLane) + "'.");
}
// set as to be re-applied after network processing
- myEdgeCont.addPostProcessConnection(nFrom->getID(), fromLane, to->getID(), toLane, mayDefinitelyPass);
+ myEdgeCont.addPostProcessConnection(nFrom->getID(), fromLane, to->getID(), toLane, mayDefinitelyPass, keepClear);
} else {
from = nFrom;
}
@@ -325,7 +326,22 @@ NIXMLConnectionsHandler::addCrossing(const SUMOSAXAttributes& attrs) {
EdgeVector edges;
const std::string nodeID = attrs.get<std::string>(SUMO_ATTR_NODE, 0, ok);
const SUMOReal width = attrs.getOpt<SUMOReal>(SUMO_ATTR_WIDTH, nodeID.c_str(), ok, NBNode::DEFAULT_CROSSING_WIDTH, true);
+ const bool discard = attrs.getOpt<bool>(SUMO_ATTR_DISCARD, nodeID.c_str(), ok, false, true);
std::vector<std::string> edgeIDs;
+ if (!attrs.hasAttribute(SUMO_ATTR_EDGES)) {
+ if (discard) {
+ node = myNodeCont.retrieve(nodeID);
+ if (node == 0) {
+ WRITE_ERROR("Node '" + nodeID + "' in crossing is not known.");
+ return;
+ }
+ node->discardAllCrossings();
+ return;
+ } else {
+ WRITE_ERROR("No edges specified for crossing at node '" + nodeID + "'.");
+ return;
+ }
+ }
SUMOSAXAttributes::parseStringVector(attrs.get<std::string>(SUMO_ATTR_EDGES, 0, ok), edgeIDs);
if (!ok) {
return;
@@ -359,7 +375,11 @@ NIXMLConnectionsHandler::addCrossing(const SUMOSAXAttributes& attrs) {
WRITE_WARNING("Crossing at controlled node '" + nodeID + "' must be prioritized");
priority = true;
}
- node->addCrossing(edges, width, priority);
+ if (discard) {
+ node->removeCrossing(edges);
+ } else {
+ node->addCrossing(edges, width, priority);
+ }
}
diff --git a/src/netimport/NIXMLEdgesHandler.cpp b/src/netimport/NIXMLEdgesHandler.cpp
index 91f390d..873468c 100644
--- a/src/netimport/NIXMLEdgesHandler.cpp
+++ b/src/netimport/NIXMLEdgesHandler.cpp
@@ -6,7 +6,7 @@
/// @author Walter Bamberger
/// @author Laura Bieker
/// @date Tue, 20 Nov 2001
-/// @version $Id: NIXMLEdgesHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIXMLEdgesHandler.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Importer for network edges stored in XML
/****************************************************************************/
@@ -52,6 +52,7 @@
#include <utils/common/ToString.h>
#include <utils/options/OptionsCont.h>
#include <utils/geom/GeoConvHelper.h>
+#include "NIXMLNodesHandler.h"
#include "NIXMLEdgesHandler.h"
#ifdef CHECK_MEMORY_LEAKS
@@ -81,6 +82,7 @@ NIXMLEdgesHandler::NIXMLEdgesHandler(NBNodeCont& nc,
myDistrictCont(dc),
myTLLogicCont(tlc),
myCurrentEdge(0), myHaveReportedAboutOverwriting(false),
+ myHaveReportedAboutTypeOverride(false),
myHaveWarnedAboutDeprecatedLaneId(false),
myKeepEdgeShape(!options.getBool("plain.extend-edge-shape"))
{}
@@ -134,6 +136,7 @@ NIXMLEdgesHandler::addEdge(const SUMOSAXAttributes& attrs) {
myCurrentEndOffset = NBEdge::UNSPECIFIED_OFFSET;
if (myCurrentEdge != 0) {
// update existing edge. only update lane-specific settings when explicitly requested
+ myIsUpdate = true;
myCurrentSpeed = NBEdge::UNSPECIFIED_SPEED;
myPermissions = SVC_UNSPECIFIED;
myCurrentWidth = NBEdge::UNSPECIFIED_WIDTH;
@@ -150,6 +153,7 @@ NIXMLEdgesHandler::addEdge(const SUMOSAXAttributes& attrs) {
myCurrentStreetName = "";
myReinitKeepEdgeShape = false;
mySidewalkWidth = NBEdge::UNSPECIFIED_WIDTH;
+ myBikeLaneWidth = NBEdge::UNSPECIFIED_WIDTH;
// check whether a type's values shall be used
if (attrs.hasAttribute(SUMO_ATTR_TYPE)) {
myCurrentType = attrs.get<std::string>(SUMO_ATTR_TYPE, myCurrentID.c_str(), ok);
@@ -166,14 +170,20 @@ NIXMLEdgesHandler::addEdge(const SUMOSAXAttributes& attrs) {
myPermissions = myTypeCont.getPermissions(myCurrentType);
myCurrentWidth = myTypeCont.getWidth(myCurrentType);
mySidewalkWidth = myTypeCont.getSidewalkWidth(myCurrentType);
+ myBikeLaneWidth = myTypeCont.getBikeLaneWidth(myCurrentType);
}
// use values from the edge to overwrite if existing, then
- if (myCurrentEdge != 0) {
- myIsUpdate = true;
+ if (myIsUpdate) {
if (!myHaveReportedAboutOverwriting) {
- WRITE_MESSAGE("Duplicate edge id occured ('" + myCurrentID + "'); assuming overwriting is wished.");
+ WRITE_MESSAGE("Duplicate edge id occurred ('" + myCurrentID + "'); assuming overwriting is wished.");
myHaveReportedAboutOverwriting = true;
}
+ if (attrs.hasAttribute(SUMO_ATTR_TYPE) && myCurrentType != myCurrentEdge->getTypeID()) {
+ if (!myHaveReportedAboutTypeOverride) {
+ WRITE_MESSAGE("Edge '" + myCurrentID + "' changed it's type; assuming type override is wished.");
+ myHaveReportedAboutTypeOverride = true;
+ }
+ }
if (attrs.getOpt<bool>(SUMO_ATTR_REMOVE, myCurrentID.c_str(), ok, false)) {
myEdgeCont.erase(myDistrictCont, myCurrentEdge);
myCurrentEdge = 0;
@@ -181,7 +191,6 @@ NIXMLEdgesHandler::addEdge(const SUMOSAXAttributes& attrs) {
}
myCurrentPriority = myCurrentEdge->getPriority();
myCurrentLaneNo = myCurrentEdge->getNumLanes();
- myCurrentType = myCurrentEdge->getTypeID();
if (!myCurrentEdge->hasDefaultGeometry()) {
myShape = myCurrentEdge->getGeometry();
myReinitKeepEdgeShape = true;
@@ -242,8 +251,10 @@ NIXMLEdgesHandler::addEdge(const SUMOSAXAttributes& attrs) {
myLanesSpread = tryGetLaneSpread(attrs);
// try to get the length
myLength = attrs.getOpt<SUMOReal>(SUMO_ATTR_LENGTH, myCurrentID.c_str(), ok, myLength);
- // tro to get the sidewalkWidth
+ // try to get the sidewalkWidth
mySidewalkWidth = attrs.getOpt<SUMOReal>(SUMO_ATTR_SIDEWALKWIDTH, myCurrentID.c_str(), ok, mySidewalkWidth);
+ // try to get the bikeLaneWidth
+ myBikeLaneWidth = attrs.getOpt<SUMOReal>(SUMO_ATTR_BIKELANEWIDTH, myCurrentID.c_str(), ok, myBikeLaneWidth);
// insert the parsed edge into the edges map
if (!ok) {
return;
@@ -344,7 +355,7 @@ void NIXMLEdgesHandler::addSplit(const SUMOSAXAttributes& attrs) {
WRITE_ERROR("Edge '" + myCurrentID + "' has already a split at position " + toString(e.pos) + ".");
return;
}
- e.nameid = (int)e.pos;
+ const std::string nameid = toString((int)e.pos);
if (e.pos < 0) {
e.pos += myCurrentEdge->getGeometry().length();
}
@@ -372,6 +383,10 @@ void NIXMLEdgesHandler::addSplit(const SUMOSAXAttributes& attrs) {
if (!ok) {
return;
}
+ e.node = new NBNode(myCurrentID + "." + nameid,
+ myCurrentEdge->getGeometry().positionAtOffset(e.pos));
+ NIXMLNodesHandler::processNodeType(attrs, e.node, e.node->getID(), e.node->getPosition(), false,
+ myNodeCont, myTLLogicCont);
mySplits.push_back(e);
}
}
@@ -473,6 +488,10 @@ NIXMLEdgesHandler::deleteEdge(const SUMOSAXAttributes& attrs) {
void
NIXMLEdgesHandler::myEndElement(int element) {
if (element == SUMO_TAG_EDGE && myCurrentEdge != 0) {
+ // add bike lane, wait until lanes are loaded to avoid building if it already exists
+ if (myBikeLaneWidth != NBEdge::UNSPECIFIED_WIDTH) {
+ myCurrentEdge->addBikeLane(myBikeLaneWidth);
+ }
// add sidewalk, wait until lanes are loaded to avoid building if it already exists
if (mySidewalkWidth != NBEdge::UNSPECIFIED_WIDTH) {
myCurrentEdge->addSidewalk(mySidewalkWidth);
@@ -497,7 +516,6 @@ NIXMLEdgesHandler::myEndElement(int element) {
unsigned int noLanesMax = e->getNumLanes();
// compute the node positions and sort the lanes
for (i = mySplits.begin(); i != mySplits.end(); ++i) {
- (*i).gpos = e->getGeometry().positionAtOffset((*i).pos);
sort((*i).lanes.begin(), (*i).lanes.end());
noLanesMax = MAX2(noLanesMax, (unsigned int)(*i).lanes.size());
}
@@ -521,18 +539,16 @@ NIXMLEdgesHandler::myEndElement(int element) {
const Split& exp = *i;
assert(exp.lanes.size() != 0);
if (exp.pos > 0 && e->getGeometry().length() + seen > exp.pos && exp.pos > seen) {
- std::string nid = edgeid + "." + toString(exp.nameid);
- NBNode* rn = new NBNode(nid, exp.gpos);
- if (myNodeCont.insert(rn)) {
+ if (myNodeCont.insert(exp.node)) {
+ myNodeCont.markAsSplit(exp.node);
// split the edge
- std::string nid = myCurrentID + "." + toString(exp.nameid);
std::string pid = e->getID();
- myEdgeCont.splitAt(myDistrictCont, e, exp.pos - seen, rn,
- pid, nid, e->getNumLanes(), (unsigned int) exp.lanes.size(), exp.speed);
+ myEdgeCont.splitAt(myDistrictCont, e, exp.pos - seen, exp.node,
+ pid, exp.node->getID(), e->getNumLanes(), (unsigned int) exp.lanes.size(), exp.speed);
seen = exp.pos;
std::vector<int> newLanes = exp.lanes;
NBEdge* pe = myEdgeCont.retrieve(pid);
- NBEdge* ne = myEdgeCont.retrieve(nid);
+ NBEdge* ne = myEdgeCont.retrieve(exp.node->getID());
// reconnect lanes
pe->invalidateConnections(true);
// new on right
diff --git a/src/netimport/NIXMLEdgesHandler.h b/src/netimport/NIXMLEdgesHandler.h
index 35d261d..399a5e2 100644
--- a/src/netimport/NIXMLEdgesHandler.h
+++ b/src/netimport/NIXMLEdgesHandler.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 20 Nov 2001
-/// @version $Id: NIXMLEdgesHandler.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIXMLEdgesHandler.h 18667 2015-08-20 07:05:07Z namdre $
///
// Importer for network edges stored in XML
/****************************************************************************/
@@ -190,6 +190,9 @@ private:
/// @brief The width of the sidewalk that shall be added to the current edge
SUMOReal mySidewalkWidth;
+ /// @brief The width of the bike lane that shall be added to the current edge
+ SUMOReal myBikeLaneWidth;
+
/// @}
@@ -231,10 +234,8 @@ private:
SUMOReal pos;
/// @brief The speed after this change
SUMOReal speed;
- /// @brief A numerical id
- int nameid;
- /// @brief A 2D-position (for the node to insert at this place)
- Position gpos;
+ /// @brief The new node that is created for this split
+ NBNode* node;
};
/// @brief The list of this edge's splits
@@ -280,6 +281,9 @@ private:
/// @brief Information whether at least one edge's attributes were overwritten
bool myHaveReportedAboutOverwriting;
+ /// @brief Information whether at least one edge's type was changed
+ bool myHaveReportedAboutTypeOverride;
+
bool myHaveWarnedAboutDeprecatedLaneId;
/// @brief Whether the edge shape shall be kept generally
diff --git a/src/netimport/NIXMLNodesHandler.cpp b/src/netimport/NIXMLNodesHandler.cpp
index 9bf4b02..b8089b7 100644
--- a/src/netimport/NIXMLNodesHandler.cpp
+++ b/src/netimport/NIXMLNodesHandler.cpp
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Tue, 20 Nov 2001
-/// @version $Id: NIXMLNodesHandler.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: NIXMLNodesHandler.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Importer for network nodes stored in XML
/****************************************************************************/
@@ -146,12 +146,21 @@ NIXMLNodesHandler::addNode(const SUMOSAXAttributes& attrs) {
if (myOptions.getBool("flip-y-axis")) {
myPosition.mul(1.0, -1.0);
}
+ processNodeType(attrs, node, myID, myPosition, updateEdgeGeometries, myNodeCont, myTLLogicCont);
+}
+
+
+void
+NIXMLNodesHandler::processNodeType(const SUMOSAXAttributes& attrs, NBNode* node, const std::string& nodeID, const Position& position,
+ bool updateEdgeGeometries,
+ NBNodeCont& nc, NBTrafficLightLogicCont& tlc) {
+ bool ok = true;
// get the type
SumoXMLNodeType type = NODETYPE_UNKNOWN;
if (node != 0) {
type = node->getType();
}
- std::string typeS = attrs.getOpt<std::string>(SUMO_ATTR_TYPE, myID.c_str(), ok, "");
+ std::string typeS = attrs.getOpt<std::string>(SUMO_ATTR_TYPE, nodeID.c_str(), ok, "");
if (SUMOXMLDefinitions::NodeTypes.hasString(typeS)) {
type = SUMOXMLDefinitions::NodeTypes.get(typeS);
if (type == NODETYPE_DEAD_END_DEPRECATED || type == NODETYPE_DEAD_END) {
@@ -162,9 +171,9 @@ NIXMLNodesHandler::addNode(const SUMOSAXAttributes& attrs) {
}
// check whether a prior node shall be modified
if (node == 0) {
- node = new NBNode(myID, myPosition, type);
- if (!myNodeCont.insert(node)) {
- throw ProcessError("Could not insert node though checked this before (id='" + myID + "').");
+ node = new NBNode(nodeID, position, type);
+ if (!nc.insert(node)) {
+ throw ProcessError("Could not insert node though checked this before (id='" + nodeID + "').");
}
} else {
// remove previously set tls if this node is not controlled by a tls
@@ -172,20 +181,20 @@ NIXMLNodesHandler::addNode(const SUMOSAXAttributes& attrs) {
node->removeTrafficLights();
for (std::set<NBTrafficLightDefinition*>::iterator i = tls.begin(); i != tls.end(); ++i) {
if ((*i)->getNodes().size() == 0) {
- myTLLogicCont.removeFully((*i)->getID());
+ tlc.removeFully((*i)->getID());
}
}
// patch information
- node->reinit(myPosition, type, updateEdgeGeometries);
+ node->reinit(position, type, updateEdgeGeometries);
}
// process traffic light definition
if (type == NODETYPE_TRAFFIC_LIGHT || type == NODETYPE_TRAFFIC_LIGHT_NOJUNCTION) {
- processTrafficLightDefinitions(attrs, node);
+ processTrafficLightDefinitions(attrs, node, tlc);
}
// set optional shape
PositionVector shape;
if (attrs.hasAttribute(SUMO_ATTR_SHAPE)) {
- shape = attrs.getOpt<PositionVector>(SUMO_ATTR_SHAPE, myID.c_str(), ok, PositionVector());
+ shape = attrs.getOpt<PositionVector>(SUMO_ATTR_SHAPE, nodeID.c_str(), ok, PositionVector());
if (shape.size() > 2) {
shape.closePolygon();
}
@@ -193,7 +202,11 @@ NIXMLNodesHandler::addNode(const SUMOSAXAttributes& attrs) {
}
// set optional radius
if (attrs.hasAttribute(SUMO_ATTR_RADIUS)) {
- node->setRadius(attrs.get<SUMOReal>(SUMO_ATTR_RADIUS, myID.c_str(), ok));
+ node->setRadius(attrs.get<SUMOReal>(SUMO_ATTR_RADIUS, nodeID.c_str(), ok));
+ }
+ // set optional keepClear flag
+ if (attrs.hasAttribute(SUMO_ATTR_KEEP_CLEAR)) {
+ node->setKeepClear(attrs.get<bool>(SUMO_ATTR_KEEP_CLEAR, nodeID.c_str(), ok));
}
}
@@ -241,7 +254,7 @@ NIXMLNodesHandler::addJoinExclusion(const SUMOSAXAttributes& attrs) {
void
NIXMLNodesHandler::processTrafficLightDefinitions(const SUMOSAXAttributes& attrs,
- NBNode* currentNode) {
+ NBNode* currentNode, NBTrafficLightLogicCont& tlc) {
// try to get the tl-id
// if a tl-id is given, we will look whether this tl already exists
// if so, we will add the node to it (and to all programs with this id), otherwise allocate a new one with this id
@@ -255,12 +268,12 @@ NIXMLNodesHandler::processTrafficLightDefinitions(const SUMOSAXAttributes& attrs
if (SUMOXMLDefinitions::TrafficLightTypes.hasString(typeS)) {
type = SUMOXMLDefinitions::TrafficLightTypes.get(typeS);
} else {
- WRITE_ERROR("Unknown traffic light type '" + typeS + "' for node '" + myID + "'.");
+ WRITE_ERROR("Unknown traffic light type '" + typeS + "' for node '" + currentNode->getID() + "'.");
return;
}
- if (tlID != "" && myTLLogicCont.getPrograms(tlID).size() > 0) {
+ if (tlID != "" && tlc.getPrograms(tlID).size() > 0) {
// we already have definitions for this tlID
- const std::map<std::string, NBTrafficLightDefinition*>& programs = myTLLogicCont.getPrograms(tlID);
+ const std::map<std::string, NBTrafficLightDefinition*>& programs = tlc.getPrograms(tlID);
std::map<std::string, NBTrafficLightDefinition*>::const_iterator it;
for (it = programs.begin(); it != programs.end(); it++) {
if (it->second->getType() != type) {
@@ -273,12 +286,12 @@ NIXMLNodesHandler::processTrafficLightDefinitions(const SUMOSAXAttributes& attrs
}
} else {
// we need to add a new defition
- tlID = (tlID == "" ? myID : tlID);
+ tlID = (tlID == "" ? currentNode->getID() : tlID);
NBTrafficLightDefinition* tlDef = new NBOwnTLDef(tlID, currentNode, 0, type);
- if (!myTLLogicCont.insert(tlDef)) {
+ if (!tlc.insert(tlDef)) {
// actually, nothing should fail here
delete tlDef;
- throw ProcessError("Could not allocate tls '" + myID + "'.");
+ throw ProcessError("Could not allocate tls '" + currentNode->getID() + "'.");
}
tlDefs.insert(tlDef);
}
diff --git a/src/netimport/NIXMLNodesHandler.h b/src/netimport/NIXMLNodesHandler.h
index 4ce2d3e..397b1e2 100644
--- a/src/netimport/NIXMLNodesHandler.h
+++ b/src/netimport/NIXMLNodesHandler.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 20 Nov 2001
-/// @version $Id: NIXMLNodesHandler.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIXMLNodesHandler.h 18756 2015-08-31 19:16:33Z behrisch $
///
// Importer for network nodes stored in XML
/****************************************************************************/
@@ -75,6 +75,11 @@ public:
/// @brief Destructor
~NIXMLNodesHandler();
+ /** @brief parses node attributes (not related to positioning)
+ */
+ static void processNodeType(const SUMOSAXAttributes& attrs, NBNode* node, const std::string& nodeID, const Position& position,
+ bool updateEdgeGeometries,
+ NBNodeCont& nc, NBTrafficLightLogicCont& tlc);
protected:
/// @name inherited from GenericSAXHandler
@@ -119,13 +124,14 @@ private:
*/
void addJoinExclusion(const SUMOSAXAttributes& attrs);
+
/** @brief Builds the defined traffic light or adds a node to it
*
* @param[in] attrs Attributes within the currently opened node
* @param[in] currentNode The built node to add the tls information to
*/
- void processTrafficLightDefinitions(const SUMOSAXAttributes& attrs,
- NBNode* currentNode);
+ static void processTrafficLightDefinitions(const SUMOSAXAttributes& attrs,
+ NBNode* currentNode, NBTrafficLightLogicCont& tlc);
private:
diff --git a/src/netimport/NIXMLTrafficLightsHandler.cpp b/src/netimport/NIXMLTrafficLightsHandler.cpp
index 6c4b6a3..53ceb5f 100644
--- a/src/netimport/NIXMLTrafficLightsHandler.cpp
+++ b/src/netimport/NIXMLTrafficLightsHandler.cpp
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date 2011-10-05
-/// @version $Id: NIXMLTrafficLightsHandler.cpp 18169 2015-03-27 13:40:16Z behrisch $
+/// @version $Id: NIXMLTrafficLightsHandler.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Importer for traffic lights stored in XML
/****************************************************************************/
@@ -156,11 +156,11 @@ NIXMLTrafficLightsHandler::initTrafficLightLogic(const SUMOSAXAttributes& attrs,
if (oldDef == 0) {
// case 2
NBTrafficLightDefinition* newDef = dynamic_cast<NBOwnTLDef*>(myTLLCont.getDefinition(
- id, NBTrafficLightDefinition::DefaultProgramID));
+ id, NBTrafficLightDefinition::DefaultProgramID));
if (newDef == 0) {
// the default program may have already been replaced with a loaded program
newDef = dynamic_cast<NBLoadedSUMOTLDef*>(myTLLCont.getDefinition(
- id, NBTrafficLightDefinition::DefaultProgramID));
+ id, NBTrafficLightDefinition::DefaultProgramID));
if (newDef == 0) {
WRITE_ERROR("Cannot load traffic light program for unknown id '" + id + "', programID '" + programID + "'.");
return 0;
@@ -186,10 +186,10 @@ NIXMLTrafficLightsHandler::initTrafficLightLogic(const SUMOSAXAttributes& attrs,
} else {
// case 3
NBTrafficLightLogic* oldLogic = oldDef->getLogic();
- NBTrafficLightLogic* newLogic = new NBTrafficLightLogic(id, programID,
+ NBTrafficLightLogic* newLogic = new NBTrafficLightLogic(id, programID,
oldLogic->getNumLinks(), offset, type);
loadedDef = new NBLoadedSUMOTLDef(oldDef, newLogic);
- // copy nodes
+ // copy nodes
std::vector<NBNode*> nodes = oldDef->getNodes();
for (std::vector<NBNode*>::iterator it = nodes.begin(); it != nodes.end(); it++) {
loadedDef->addNode(*it);
diff --git a/src/netimport/NIXMLTypesHandler.cpp b/src/netimport/NIXMLTypesHandler.cpp
index d8827c7..6db7b27 100644
--- a/src/netimport/NIXMLTypesHandler.cpp
+++ b/src/netimport/NIXMLTypesHandler.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Walter Bamberger
/// @date Tue, 20 Nov 2001
-/// @version $Id: NIXMLTypesHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIXMLTypesHandler.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Importer for edge type information stored in XML
/****************************************************************************/
@@ -37,14 +37,15 @@
#include <xercesc/sax/AttributeList.hpp>
#include <xercesc/sax/SAXParseException.hpp>
#include <xercesc/sax/SAXException.hpp>
-#include "NIXMLTypesHandler.h"
-#include <netbuild/NBTypeCont.h>
#include <utils/xml/SUMOSAXHandler.h>
#include <utils/xml/SUMOXMLDefinitions.h>
#include <utils/common/TplConvert.h>
#include <utils/common/MsgHandler.h>
#include <utils/common/ToString.h>
#include <utils/common/SUMOVehicleClass.h>
+#include <netbuild/NBEdge.h>
+#include <netbuild/NBTypeCont.h>
+#include "NIXMLTypesHandler.h"
#ifdef CHECK_MEMORY_LEAKS
#include <foreign/nvwa/debug_new.h>
@@ -65,33 +66,57 @@ NIXMLTypesHandler::~NIXMLTypesHandler() {}
void
NIXMLTypesHandler::myStartElement(int element,
const SUMOSAXAttributes& attrs) {
- if (element != SUMO_TAG_TYPE) {
- return;
- }
- bool ok = true;
- // get the id, report a warning if not given or empty...
- std::string id = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
- int priority = attrs.getOpt<int>(SUMO_ATTR_PRIORITY, id.c_str(), ok, myTypeCont.getPriority(""));
- int noLanes = myTypeCont.getNumLanes("");
- noLanes = attrs.getOpt<int>(SUMO_ATTR_NUMLANES, id.c_str(), ok, noLanes);
- SUMOReal speed = attrs.getOpt<SUMOReal>(SUMO_ATTR_SPEED, id.c_str(), ok, (SUMOReal) myTypeCont.getSpeed(""));
- std::string allowS = attrs.getOpt<std::string>(SUMO_ATTR_ALLOW, id.c_str(), ok, "");
- std::string disallowS = attrs.getOpt<std::string>(SUMO_ATTR_DISALLOW, id.c_str(), ok, "");
- bool oneway = attrs.getOpt<bool>(SUMO_ATTR_ONEWAY, id.c_str(), ok, false);
- bool discard = attrs.getOpt<bool>(SUMO_ATTR_DISCARD, id.c_str(), ok, false);
- SUMOReal width = attrs.getOpt<SUMOReal>(SUMO_ATTR_WIDTH, id.c_str(), ok, NBEdge::UNSPECIFIED_WIDTH);
- SUMOReal sidewalkWidth = attrs.getOpt<SUMOReal>(SUMO_ATTR_SIDEWALKWIDTH, id.c_str(), ok, NBEdge::UNSPECIFIED_WIDTH);
- if (!ok) {
- return;
- }
- // build the type
- SVCPermissions permissions = parseVehicleClasses(allowS, disallowS);
- if (!myTypeCont.insert(id, noLanes, speed, priority, permissions, width, oneway, sidewalkWidth)) {
- WRITE_ERROR("Duplicate type occured. ID='" + id + "'");
- } else {
- if (discard) {
- myTypeCont.markAsToDiscard(id);
+ switch (element) {
+ case SUMO_TAG_TYPE: {
+ bool ok = true;
+ // get the id, report a warning if not given or empty...
+ myCurrentTypeID = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
+ const char* const id = myCurrentTypeID.c_str();
+ const std::string defType = myTypeCont.knows(myCurrentTypeID) ? myCurrentTypeID : "";
+ const int priority = attrs.getOpt<int>(SUMO_ATTR_PRIORITY, id, ok, myTypeCont.getPriority(defType));
+ const int numLanes = attrs.getOpt<int>(SUMO_ATTR_NUMLANES, id, ok, myTypeCont.getNumLanes(defType));
+ const SUMOReal speed = attrs.getOpt<SUMOReal>(SUMO_ATTR_SPEED, id, ok, myTypeCont.getSpeed(defType));
+ const std::string allowS = attrs.getOpt<std::string>(SUMO_ATTR_ALLOW, id, ok, "");
+ const std::string disallowS = attrs.getOpt<std::string>(SUMO_ATTR_DISALLOW, id, ok, "");
+ const bool oneway = attrs.getOpt<bool>(SUMO_ATTR_ONEWAY, id, ok, myTypeCont.getIsOneWay(defType));
+ const bool discard = attrs.getOpt<bool>(SUMO_ATTR_DISCARD, id, ok, false);
+ const SUMOReal width = attrs.getOpt<SUMOReal>(SUMO_ATTR_WIDTH, id, ok, myTypeCont.getWidth(defType));
+ const SUMOReal sidewalkWidth = attrs.getOpt<SUMOReal>(SUMO_ATTR_SIDEWALKWIDTH, id, ok, myTypeCont.getSidewalkWidth(defType));
+ const SUMOReal bikeLaneWidth = attrs.getOpt<SUMOReal>(SUMO_ATTR_BIKELANEWIDTH, id, ok, myTypeCont.getBikeLaneWidth(defType));
+ if (!ok) {
+ return;
+ }
+ // build the type
+ SVCPermissions permissions = myTypeCont.getPermissions(defType);
+ if (allowS != "" || disallowS != "") {
+ permissions = parseVehicleClasses(allowS, disallowS);
+ }
+ myTypeCont.insert(myCurrentTypeID, numLanes, speed, priority, permissions, width, oneway, sidewalkWidth, bikeLaneWidth);
+ if (discard) {
+ myTypeCont.markAsToDiscard(myCurrentTypeID);
+ }
+ SumoXMLAttr myAttrs[] = {SUMO_ATTR_PRIORITY, SUMO_ATTR_NUMLANES, SUMO_ATTR_SPEED,
+ SUMO_ATTR_ALLOW, SUMO_ATTR_DISALLOW, SUMO_ATTR_ONEWAY,
+ SUMO_ATTR_DISCARD, SUMO_ATTR_WIDTH, SUMO_ATTR_SIDEWALKWIDTH, SUMO_ATTR_BIKELANEWIDTH
+ };
+ for (int i = 0; i < 10; i++) {
+ if (attrs.hasAttribute(myAttrs[i])) {
+ myTypeCont.markAsSet(myCurrentTypeID, myAttrs[i]);
+ }
+ }
+ break;
+ }
+ case SUMO_TAG_RESTRICTION: {
+ bool ok = true;
+ const SUMOVehicleClass svc = getVehicleClassID(attrs.get<std::string>(SUMO_ATTR_VCLASS, myCurrentTypeID.c_str(), ok));
+ const SUMOReal speed = attrs.get<SUMOReal>(SUMO_ATTR_SPEED, myCurrentTypeID.c_str(), ok);
+ if (ok) {
+ myTypeCont.addRestriction(myCurrentTypeID, svc, speed);
+ }
+ break;
}
+ default:
+ break;
}
}
diff --git a/src/netimport/NIXMLTypesHandler.h b/src/netimport/NIXMLTypesHandler.h
index c6e4367..bf525a6 100644
--- a/src/netimport/NIXMLTypesHandler.h
+++ b/src/netimport/NIXMLTypesHandler.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 20 Nov 2001
-/// @version $Id: NIXMLTypesHandler.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIXMLTypesHandler.h 18432 2015-05-21 13:04:55Z behrisch $
///
// Importer for edge type information stored in XML
/****************************************************************************/
@@ -88,6 +88,9 @@ private:
/// @brief The type container to fill
NBTypeCont& myTypeCont;
+ /// @brief The currently parsed type
+ std::string myCurrentTypeID;
+
private:
/** @brief invalid copy constructor */
diff --git a/src/netimport/typemap.h b/src/netimport/typemap.h
new file mode 100644
index 0000000..fb73cd7
--- /dev/null
+++ b/src/netimport/typemap.h
@@ -0,0 +1,52 @@
+const std::string opendriveTypemap =
+"<types xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/types_file.xsd\">\n"
+" <type id=\"driving\" priority=\"1\" speed=\"22.22\" disallow=\"pedestrian\" width=\"3.65\"/>\n"
+" <type id=\"mwyEntry\" priority=\"1\" speed=\"22.22\" disallow=\"pedestrian\" width=\"3.65\"/>\n"
+" <type id=\"mwyExit\" priority=\"1\" speed=\"22.22\" disallow=\"pedestrian\" width=\"3.65\"/>\n"
+" <type id=\"parking\" priority=\"1\" speed=\"1.39\" disallow=\"pedestrian\" width=\"3.65\"/>\n"
+" <type id=\"special1\" priority=\"1\" speed=\"22.22\" disallow=\"pedestrian\" width=\"3.65\"/>\n"
+" <type id=\"stop\" priority=\"1\" speed=\"22.22\" disallow=\"pedestrian\" width=\"3.65\"/>\n"
+"</types>\n"
+;
+const std::string osmTypemap =
+"<types xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/types_file.xsd\">\n"
+" <type id=\"highway.motorway\" numLanes=\"2\" speed=\"44.44\" priority=\"13\" oneway=\"true\" disallow=\"pedestrian bicycle moped rail rail_urban rail_electric tram ship\"/>\n"
+" <type id=\"highway.motorway_link\" numLanes=\"1\" speed=\"22.22\" priority=\"12\" oneway=\"true\" disallow=\"pedestrian bicycle moped rail rail_urban rail_electric tram ship\"/>\n"
+" <type id=\"highway.trunk\" numLanes=\"2\" speed=\"27.78\" priority=\"11\" oneway=\"false\" disallow=\"pedestrian bicycle rail rail_urban rail_electric tram ship\"/>\n"
+" <type id=\"highway.trunk_link\" numLanes=\"1\" speed=\"22.22\" priority=\"10\" oneway=\"false\" disallow=\"pedestrian bicycle rail rail_urban rail_electric tram ship\"/>\n"
+" <type id=\"highway.primary\" numLanes=\"2\" speed=\"27.78\" priority=\"9\" oneway=\"false\" disallow=\"rail rail_urban rail_electric tram ship\"/>\n"
+" <type id=\"highway.primary_link\" numLanes=\"1\" speed=\"22.22\" priority=\"8\" oneway=\"false\" disallow=\"rail rail_urban rail_electric tram ship\"/>\n"
+" <type id=\"highway.secondary\" numLanes=\"2\" speed=\"27.78\" priority=\"7\" oneway=\"false\" disallow=\"rail rail_urban rail_electric tram ship\"/>\n"
+" <type id=\"highway.secondary_link\" numLanes=\"1\" speed=\"22.22\" priority=\"6\" oneway=\"false\" disallow=\"rail rail_urban rail_electric tram ship\"/>\n"
+" <type id=\"highway.tertiary\" numLanes=\"1\" speed=\"22.22\" priority=\"6\" oneway=\"false\" disallow=\"rail rail_urban rail_electric tram ship\"/>\n"
+" <type id=\"highway.tertiary_link\" numLanes=\"1\" speed=\"22.22\" priority=\"5\" oneway=\"false\" disallow=\"rail rail_urban rail_electric tram ship\"/>\n"
+" <type id=\"highway.unclassified\" numLanes=\"1\" speed=\"13.89\" priority=\"5\" oneway=\"false\" disallow=\"rail rail_urban rail_electric tram ship\"/>\n"
+" <type id=\"highway.residential\" numLanes=\"1\" speed=\"13.89\" priority=\"4\" oneway=\"false\" disallow=\"rail rail_urban rail_electric tram ship\"/>\n"
+" <type id=\"highway.living_street\" numLanes=\"1\" speed=\"2.78\" priority=\"3\" oneway=\"false\" disallow=\"rail rail_urban rail_electric tram ship\"/>\n"
+" <type id=\"highway.service\" numLanes=\"1\" speed=\"5.56\" priority=\"2\" oneway=\"false\" allow=\"delivery pedestrian bicycle\"/>\n"
+" <type id=\"highway.track\" numLanes=\"1\" speed=\"5.56\" priority=\"1\" oneway=\"false\" disallow=\"rail rail_urban rail_electric tram ship\"/>\n"
+" <type id=\"highway.services\" numLanes=\"1\" speed=\"8.33\" priority=\"1\" oneway=\"false\" disallow=\"rail rail_urban rail_electric tram ship\"/>\n"
+" <type id=\"highway.unsurfaced\" numLanes=\"1\" speed=\"8.33\" priority=\"1\" oneway=\"false\" disallow=\"rail rail_urban rail_electric tram ship\"/>\n"
+"\n"
+" <!-- everything which serves mainly pedestrians is oneway because all current pedestrian models do not care about direction -->\n"
+" <type id=\"highway.footway\" numLanes=\"1\" speed=\"8.33\" priority=\"1\" oneway=\"true\" width=\"2\" allow=\"pedestrian\"/>\n"
+" <type id=\"highway.pedestrian\" numLanes=\"1\" speed=\"8.33\" priority=\"1\" oneway=\"true\" width=\"2\" allow=\"pedestrian\"/>\n"
+" <type id=\"highway.path\" numLanes=\"1\" speed=\"2.78\" priority=\"1\" oneway=\"true\" width=\"2\" allow=\"pedestrian bicycle\"/>\n"
+" <type id=\"highway.bridleway\" numLanes=\"1\" speed=\"2.78\" priority=\"1\" oneway=\"true\" width=\"2\" allow=\"pedestrian\"/>\n"
+" <type id=\"highway.cycleway\" numLanes=\"1\" speed=\"5.56\" priority=\"1\" oneway=\"false\" width=\"1\" allow=\"bicycle\"/>\n"
+" <type id=\"highway.step\" numLanes=\"1\" speed=\"1.39\" priority=\"1\" oneway=\"true\" width=\"2\" allow=\"pedestrian\"/>\n"
+" <type id=\"highway.steps\" numLanes=\"1\" speed=\"1.39\" priority=\"1\" oneway=\"true\" width=\"2\" allow=\"pedestrian\"/>\n"
+" <type id=\"highway.stairs\" numLanes=\"1\" speed=\"1.39\" priority=\"1\" oneway=\"true\" width=\"2\" allow=\"pedestrian\"/>\n"
+"\n"
+" <type id=\"highway.bus_guideway\" numLanes=\"1\" speed=\"8.33\" priority=\"1\" oneway=\"true\" allow=\"bus\"/>\n"
+" <type id=\"highway.raceway\" numLanes=\"2\" speed=\"83.33\" priority=\"14\" oneway=\"false\" allow=\"vip\"/>\n"
+" <type id=\"highway.ford\" numLanes=\"1\" speed=\"2.78\" priority=\"1\" oneway=\"false\" allow=\"army\"/>\n"
+"\n"
+" <type id=\"railway.rail\" numLanes=\"1\" speed=\"83.33\" priority=\"15\" oneway=\"true\" allow=\"rail rail_electric\"/>\n"
+" <type id=\"railway.tram\" numLanes=\"1\" speed=\"13.89\" priority=\"15\" oneway=\"true\" allow=\"tram\"/>\n"
+" <type id=\"railway.light_rail\" numLanes=\"1\" speed=\"27.78\" priority=\"15\" oneway=\"true\" allow=\"rail_urban\"/>\n"
+" <type id=\"railway.subway\" numLanes=\"1\" speed=\"27.78\" priority=\"15\" oneway=\"true\" allow=\"rail_urban\"/>\n"
+" <type id=\"railway.preserved\" numLanes=\"1\" speed=\"27.78\" priority=\"15\" oneway=\"true\" allow=\"rail\"/>\n"
+"\n"
+"</types>\n"
+;
diff --git a/src/netimport/vissim/NIImporter_Vissim.cpp b/src/netimport/vissim/NIImporter_Vissim.cpp
index 42ce22e..538d580 100644
--- a/src/netimport/vissim/NIImporter_Vissim.cpp
+++ b/src/netimport/vissim/NIImporter_Vissim.cpp
@@ -3,8 +3,10 @@
/// @author Daniel Krajzewicz
/// @author Jakob Erdmann
/// @author Michael Behrisch
+/// @author Lukas Grohmann (AIT)
+/// @author Gerald Richter (AIT)
/// @date Sept 2002
-/// @version $Id: NIImporter_Vissim.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIImporter_Vissim.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// -------------------
/****************************************************************************/
@@ -106,10 +108,18 @@
#include "tempstructs/NIVissimConnectionCluster.h"
#include "tempstructs/NIVissimNodeDef.h"
#include "tempstructs/NIVissimEdge.h"
+#include "tempstructs/NIVissimConflictArea.h"
#include "tempstructs/NIVissimDistrictConnection.h"
#include "tempstructs/NIVissimVehicleType.h"
+#include <utils/xml/SUMOSAXHandler.h>
+#include <utils/xml/XMLSubSys.h>
+#include <utils/common/FileHelpers.h>
+#include <utils/common/StringTokenizer.h>
+#include <utils/distribution/Distribution_Points.h>
+
#include <netbuild/NBEdgeCont.h> // !!! only for debugging purposes
+#include <netbuild/NBDistribution.h>
#ifdef CHECK_MEMORY_LEAKS
#include <foreign/nvwa/debug_new.h>
@@ -117,6 +127,73 @@
// ===========================================================================
+// static variables
+// ===========================================================================
+StringBijection<int>::Entry NIImporter_Vissim::vissimTags[] = {
+ { "network", NIImporter_Vissim::VISSIM_TAG_NETWORK },
+ { "lanes", NIImporter_Vissim::VISSIM_TAG_LANES },
+ { "lane", NIImporter_Vissim::VISSIM_TAG_LANE },
+ { "link", NIImporter_Vissim::VISSIM_TAG_LINK },
+ { "links", NIImporter_Vissim::VISSIM_TAG_LINKS },
+ { "points3D", NIImporter_Vissim::VISSIM_TAG_POINTS3D },
+ { "point3D", NIImporter_Vissim::VISSIM_TAG_POINT3D },
+ { "fromLinkEndPt", NIImporter_Vissim::VISSIM_TAG_FROM },
+ { "toLinkEndPt", NIImporter_Vissim::VISSIM_TAG_TO },
+ { "vehicleInput", NIImporter_Vissim::VISSIM_TAG_VEHICLE_INPUT },
+ { "parkingLot", NIImporter_Vissim::VISSIM_TAG_PARKINGLOT },
+ { "vehicleClass", NIImporter_Vissim::VISSIM_TAG_VEHICLE_CLASS },
+ { "intObjectRef", NIImporter_Vissim::VISSIM_TAG_INTOBJECTREF },
+ { "desSpeedDecision", NIImporter_Vissim::VISSIM_TAG_SPEED_DECISION },
+ {
+ "desSpeedDistribution",
+ NIImporter_Vissim::VISSIM_TAG_SPEED_DIST
+ },
+ {
+ "speedDistributionDataPoint",
+ NIImporter_Vissim::VISSIM_TAG_DATAPOINT
+ },
+ {
+ "vehicleRoutingDecisionStatic",
+ NIImporter_Vissim::VISSIM_TAG_DECISION_STATIC
+ },
+ {
+ "vehicleRouteStatic",
+ NIImporter_Vissim::VISSIM_TAG_ROUTE_STATIC
+ },
+ { "conflictArea", NIImporter_Vissim::VISSIM_TAG_CA },
+ { "", NIImporter_Vissim::VISSIM_TAG_NOTHING }
+};
+
+
+StringBijection<int>::Entry NIImporter_Vissim::vissimAttrs[] = {
+ { "no", NIImporter_Vissim::VISSIM_ATTR_NO }, //id
+ { "name", NIImporter_Vissim::VISSIM_ATTR_NAME },
+ { "x", NIImporter_Vissim::VISSIM_ATTR_X },
+ { "y", NIImporter_Vissim::VISSIM_ATTR_Y },
+ { "zOffset", NIImporter_Vissim::VISSIM_ATTR_ZOFFSET },
+ { "surch1", NIImporter_Vissim::VISSIM_ATTR_ZUSCHLAG1 },
+ { "surch2", NIImporter_Vissim::VISSIM_ATTR_ZUSCHLAG2 },
+ { "width", NIImporter_Vissim::VISSIM_ATTR_WIDTH },
+ { "linkBehavType", NIImporter_Vissim::VISSIM_ATTR_LINKBEHAVETYPE},
+ { "lane", NIImporter_Vissim::VISSIM_ATTR_LANE },
+ { "pos", NIImporter_Vissim::VISSIM_ATTR_POS },
+ { "link", NIImporter_Vissim::VISSIM_ATTR_LINK },
+ { "intLink", NIImporter_Vissim::VISSIM_ATTR_INTLINK }, //edgeID
+ { "relFlow", NIImporter_Vissim::VISSIM_ATTR_PERCENTAGE },
+ { "zone", NIImporter_Vissim::VISSIM_ATTR_DISTRICT },
+ { "color", NIImporter_Vissim::VISSIM_ATTR_COLOR },
+ { "key", NIImporter_Vissim::VISSIM_ATTR_KEY },
+ { "fx", NIImporter_Vissim::VISSIM_ATTR_FX },
+ { "destLink", NIImporter_Vissim::VISSIM_ATTR_DESTLINK },
+ { "destPos", NIImporter_Vissim::VISSIM_ATTR_DESTPOS },
+ { "link1", NIImporter_Vissim::VISSIM_ATTR_LINK1 },
+ { "link2", NIImporter_Vissim::VISSIM_ATTR_LINK2 },
+ { "status", NIImporter_Vissim::VISSIM_ATTR_STATUS },
+ { "", NIImporter_Vissim::VISSIM_ATTR_NOTHING }
+};
+
+
+// ===========================================================================
// method definitions
// ===========================================================================
// ---------------------------------------------------------------------------
@@ -127,9 +204,487 @@ NIImporter_Vissim::loadNetwork(const OptionsCont& oc, NBNetBuilder& nb) {
if (!oc.isSet("vissim-file")) {
return;
}
- // load the visum network
NIImporter_Vissim loader(nb, oc.getString("vissim-file"));
- loader.load(oc);
+ // check if legacy format file or newer XML file
+ // file name extension check
+ if ((oc.getString("vissim-file").find(".inpx") != std::string::npos))
+ //TODO: check if the given position of .inpx is at the end
+ {
+ // load the XML vissim network
+ loader.loadXML(oc, nb);
+ loader.myInputIsLegacyFormat = false;
+ } else {
+ // load the legacy vissim network
+ loader.load(oc);
+ loader.myInputIsLegacyFormat = true;
+ }
+}
+
+
+// ---------------------------------------------------------------------------
+// definitions of NIVissimXMLHandler_Streckendefinition-methods
+// ---------------------------------------------------------------------------
+NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::NIVissimXMLHandler_Streckendefinition(
+ //std::map<int, VissimXMLEdge>& toFill)
+ nodeMap& elemData)
+ : GenericSAXHandler(vissimTags, VISSIM_TAG_NOTHING,
+ vissimAttrs, VISSIM_ATTR_NOTHING,
+ "vissim - file"),
+ myElemData(elemData),
+ myHierarchyLevel(0),
+ isConnector(false) {
+ myElemData.clear();
+}
+
+NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::~NIVissimXMLHandler_Streckendefinition() { }
+
+void
+NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::myStartElement(int element, const SUMOSAXAttributes& attrs) {
+ myHierarchyLevel++;
+
+ // finding an actual LINK
+ if (element == VISSIM_TAG_LINK) {
+ //parse all links
+ bool ok = true;
+ int id = attrs.get<int>(VISSIM_ATTR_NO, 0, ok);
+ myLastNodeID = id;
+
+ // !!! assuming empty myElemData
+ myElemData["id"].push_back(attrs.get<std::string>(VISSIM_ATTR_NO, 0, ok));
+ // error ignored if name is empty
+ myElemData["name"].push_back(attrs.get<std::string>(VISSIM_ATTR_NAME, 0, ok, false));
+ myElemData["type"].push_back(attrs.get<std::string>(VISSIM_ATTR_LINKBEHAVETYPE, 0, ok));
+ myElemData["zuschlag1"].push_back(attrs.get<std::string>(VISSIM_ATTR_ZUSCHLAG1, 0, ok));
+ myElemData["zuschlag2"].push_back(attrs.get<std::string>(VISSIM_ATTR_ZUSCHLAG2, 0, ok));
+ }
+
+ if (element == VISSIM_TAG_LANE) {
+ bool ok = true;
+ // appends empty element if no width found
+ // error ignored if name is empty
+ myElemData["width"].push_back(attrs.get<std::string>(VISSIM_ATTR_WIDTH, 0, ok, false));
+ }
+
+ if (element == VISSIM_TAG_FROM) {
+ if (isConnector != true) {
+ isConnector = true;
+ }
+ bool ok = true;
+ std::vector<std::string> from(StringTokenizer(attrs.get<std::string>(
+ VISSIM_ATTR_LANE, 0, ok), " ").getVector());
+ myElemData["from_pos"].push_back(attrs.get<std::string>(VISSIM_ATTR_POS, 0, ok));
+ myElemData["from_id"].push_back(from[0]);
+ myElemData["from_lane"].push_back(from[1]);
+ }
+
+ if (element == VISSIM_TAG_TO) {
+ bool ok = true;
+ std::vector<std::string> to(StringTokenizer(attrs.get<std::string>(
+ VISSIM_ATTR_LANE, 0, ok), " ").getVector());
+ myElemData["to_pos"].push_back(attrs.get<std::string>(VISSIM_ATTR_POS, 0, ok));
+ myElemData["to_id"].push_back(to[0]);
+ myElemData["to_lane"].push_back(to[1]);
+ }
+
+ if (element == VISSIM_TAG_POINT3D) {
+ bool ok = true;
+ // create a <sep> separated string of coordinate data
+ std::string sep(" ");
+
+ std::string posS(attrs.get<std::string>(VISSIM_ATTR_X, 0, ok));
+ posS += sep;
+ posS.append(attrs.get<std::string>(VISSIM_ATTR_Y, 0, ok));
+ // allow for no Z
+ std::string z(attrs.get<std::string>(VISSIM_ATTR_ZOFFSET, 0, ok, false));
+ if (z.length() > 0) {
+ posS += sep;
+ posS.append(z);
+ }
+ myElemData["pos"].push_back(posS);
+ }
+
+
+}
+
+void
+NIImporter_Vissim::NIVissimXMLHandler_Streckendefinition::myEndElement(int element) {
+ if (element == VISSIM_TAG_LINK && myHierarchyLevel == 3) {
+ //std::cout << "elemData len:" << myElemData.size() << std::endl;
+
+ NIVissimClosedLanesVector clv; //FIXME -> clv einlesen
+ std::vector<int> assignedVehicles; //FIXME -> assignedVehicles einlesen
+ int id(TplConvert::_str2int(myElemData["id"].front()));
+
+ PositionVector geom;
+ // convert all position coordinate strings to PositionVectors
+ while (!myElemData["pos"].empty()) {
+ std::vector<std::string> sPos_v(StringTokenizer(
+ myElemData["pos"].front(), " ").getVector());
+ myElemData["pos"].pop_front();
+ std::vector<SUMOReal> pos_v(3);
+
+ // doing a transform with explicit hint on function signature
+ std::transform(sPos_v.begin(), sPos_v.end(), pos_v.begin(),
+ TplConvert::_str2SUMOReal);
+ geom.push_back_noDoublePos(Position(pos_v[0], pos_v[1], pos_v[2]));
+ }
+ // FIXME: a length = 0 PosVec seems fatal -> segfault
+ SUMOReal length(geom.length());
+
+ if (isConnector == false) {
+ // Add Edge
+ NIVissimEdge* edge = new NIVissimEdge(id,
+ myElemData["name"].front(),
+ myElemData["type"].front(),
+ (int)myElemData["width"].size(), // numLanes,
+ TplConvert::_str2SUMOReal(myElemData["zuschlag1"].front()),
+ TplConvert::_str2SUMOReal(myElemData["zuschlag2"].front()),
+ length, geom, clv);
+ NIVissimEdge::dictionary(id, edge);
+ if (id == 85 || id == 91) {
+ std::cout << id << "\n";
+ std::cout << myElemData["width"].size() << "\n";
+ std::cout << length << "\n";
+ std::cout << geom << "\n";
+ }
+ } else {
+ int numLanes = (int)myElemData["width"].size();
+ std::vector<int> laneVec(numLanes);
+ // Add Connector
+
+ //NOTE: there should be only 1 lane number in XML
+ // subtraction of 1 as in readExtEdgePointDef()
+ laneVec[0] = TplConvert::_str2int(myElemData["from_lane"].front()) - 1;
+ // then count up, building lane number vector
+ for (std::vector<int>::iterator each = ++laneVec.begin(); each != laneVec.end(); ++each) {
+ *each = *(each - 1) + 1;
+ }
+
+ NIVissimExtendedEdgePoint from_def(
+ TplConvert::_str2int(myElemData["from_id"].front()),
+ laneVec,
+ TplConvert::_str2SUMOReal(myElemData["from_pos"].front()),
+ assignedVehicles);
+
+ //NOTE: there should be only 1 lane number in XML
+ // subtraction of 1 as in readExtEdgePointDef()
+ laneVec[0] = TplConvert::_str2int(myElemData["to_lane"].front()) - 1;
+ // then count up, building lane number vector
+ for (std::vector<int>::iterator each = ++laneVec.begin(); each != laneVec.end(); ++each) {
+ *each = *(each - 1) + 1;
+ }
+
+ NIVissimExtendedEdgePoint to_def(
+ TplConvert::_str2int(myElemData["to_id"].front()),
+ laneVec,
+ TplConvert::_str2SUMOReal(myElemData["to_pos"].front()),
+ assignedVehicles);
+
+ NIVissimConnection* connector = new
+ NIVissimConnection(id,
+ myElemData["name"].front(),
+ from_def, to_def,
+ geom, assignedVehicles, clv);
+
+ NIVissimConnection::dictionary(id, connector);
+ }
+ // clear the element data
+ myElemData.clear();
+ //std::cout << "elemData len (clear):" << myElemData.size() << std::endl;
+ //std::cout.flush();
+ }
+ --myHierarchyLevel;
+}
+
+
+// ---------------------------------------------------------------------------
+// definitions of NIVissimXMLHandler_Zuflussdefinition-methods
+// ---------------------------------------------------------------------------
+NIImporter_Vissim::NIVissimXMLHandler_Zuflussdefinition::NIVissimXMLHandler_Zuflussdefinition()
+ : GenericSAXHandler(vissimTags, VISSIM_TAG_NOTHING,
+ vissimAttrs, VISSIM_ATTR_NOTHING,
+ "vissim - file") {
+}
+
+NIImporter_Vissim::NIVissimXMLHandler_Zuflussdefinition::~NIVissimXMLHandler_Zuflussdefinition() { }
+
+void
+NIImporter_Vissim::NIVissimXMLHandler_Zuflussdefinition::myStartElement(int element, const SUMOSAXAttributes& attrs) {
+ // finding an actual flow
+ if (element == VISSIM_TAG_VEHICLE_INPUT) {
+ //parse all flows
+ bool ok = true;
+ std::string id = attrs.get<std::string>(VISSIM_ATTR_NO, 0, ok);
+ std::string edgeid = attrs.get<std::string>(VISSIM_ATTR_LINK, 0, ok);
+ std::string name = attrs.get<std::string>(VISSIM_ATTR_NAME, 0, ok, false);
+
+ NIVissimSource::dictionary(id,
+ name,
+ edgeid);
+ }
+}
+
+// ---------------------------------------------------------------------------
+// definitions of NIVissimXMLHandler_Parkplatzdefinition-methods
+// ---------------------------------------------------------------------------
+NIImporter_Vissim::NIVissimXMLHandler_Parkplatzdefinition::NIVissimXMLHandler_Parkplatzdefinition()
+ : GenericSAXHandler(vissimTags, VISSIM_TAG_NOTHING,
+ vissimAttrs, VISSIM_ATTR_NOTHING,
+ "vissim - file") {
+}
+
+NIImporter_Vissim::NIVissimXMLHandler_Parkplatzdefinition::~NIVissimXMLHandler_Parkplatzdefinition() { }
+
+void
+NIImporter_Vissim::NIVissimXMLHandler_Parkplatzdefinition::myStartElement(int element, const SUMOSAXAttributes& attrs) {
+ // finding an actual parkinglot
+ if (element == VISSIM_TAG_PARKINGLOT) {
+ //parse all parkinglots
+ bool ok = true;
+ int id = attrs.get<int>(VISSIM_ATTR_NO, 0, ok);
+ int edgeid = attrs.get<int>(VISSIM_ATTR_INTLINK, 0, ok);
+ std::string name = attrs.get<std::string>(VISSIM_ATTR_NAME, 0, ok, false);
+ SUMOReal position = attrs.get<SUMOReal>(VISSIM_ATTR_POS, 0, ok);
+ std::vector<std::pair<int, int> > assignedVehicles; // (vclass, vwunsch)
+ //FIXME: vWunsch + Fahzeugklassen einlesen
+ // There can be s
+ std::vector<int> districts;
+ //FIXME: Parkplatzdefinition für mehrere Zonen implementieren
+ std::vector<SUMOReal> percentages;
+ districts.push_back(attrs.get<int>(VISSIM_ATTR_DISTRICT, 0, ok));
+ percentages.push_back(attrs.get<SUMOReal>(VISSIM_ATTR_PERCENTAGE, 0, ok));
+
+ NIVissimDistrictConnection::dictionary(id,
+ name,
+ districts,
+ percentages,
+ edgeid,
+ position,
+ assignedVehicles);
+ }
+}
+
+
+// ---------------------------------------------------------------------------
+// definitions of NIVissimXMLHandler_Fahrzeugklassendefinition-methods
+// ---------------------------------------------------------------------------
+NIImporter_Vissim::NIVissimXMLHandler_Fahrzeugklassendefinition::NIVissimXMLHandler_Fahrzeugklassendefinition(nodeMap& elemData)
+ : GenericSAXHandler(vissimTags, VISSIM_TAG_NOTHING,
+ vissimAttrs, VISSIM_ATTR_NOTHING,
+ "vissim - file"),
+ myElemData(elemData),
+ myHierarchyLevel(0) {
+ myElemData.clear();
+}
+
+NIImporter_Vissim::NIVissimXMLHandler_Fahrzeugklassendefinition::~NIVissimXMLHandler_Fahrzeugklassendefinition() { }
+
+void
+NIImporter_Vissim::NIVissimXMLHandler_Fahrzeugklassendefinition::myStartElement(int element, const SUMOSAXAttributes& attrs) {
+ myHierarchyLevel++;
+
+ if (element == VISSIM_TAG_VEHICLE_CLASS) {
+ bool ok = true;
+ myElemData["id"].push_back(attrs.get<std::string>(VISSIM_ATTR_NO, 0, ok));
+ myElemData["name"].push_back(attrs.get<std::string>(VISSIM_ATTR_NAME, 0, ok, false));
+ std::string colorStr(attrs.get<std::string>(VISSIM_ATTR_COLOR, 0, ok));
+ for (size_t pos = colorStr.size() - 2; pos > 0; pos -= 2) {
+ colorStr.insert(pos, " ");
+ }
+ myElemData["color"].push_back(colorStr);
+ }
+ if (element == VISSIM_TAG_INTOBJECTREF) {
+ bool ok = true;
+ myElemData["types"].push_back(attrs.get<std::string>(VISSIM_ATTR_KEY, 0, ok));
+
+
+ }
+}
+
+void
+NIImporter_Vissim::NIVissimXMLHandler_Fahrzeugklassendefinition::myEndElement(int element) {
+ if (element == VISSIM_TAG_VEHICLE_CLASS && myHierarchyLevel == 3) {
+ RGBColor color;
+ std::istringstream iss(myElemData["color"].front());
+ std::vector<std::string> sCol_v(StringTokenizer(
+ myElemData["color"].front(), " ").getVector());
+ std::vector<int> myColorVector(sCol_v.size());
+ std::transform(sCol_v.begin(), sCol_v.end(), myColorVector.begin(),
+ (TplConvert::_strHex2int));
+
+ color = RGBColor((unsigned char)myColorVector[0],
+ (unsigned char)myColorVector[1],
+ (unsigned char)myColorVector[2],
+ (unsigned char)myColorVector[3]);
+ std::vector<int> types;
+ while (!myElemData["types"].empty()) {
+ types.push_back(TplConvert::_str2int(myElemData["types"].front()));
+ myElemData["types"].pop_front();
+ }
+
+ NIVissimVehTypeClass::dictionary(TplConvert::_str2int(myElemData["id"].front()),
+ myElemData["name"].front(),
+ color,
+ types);
+ myElemData.clear();
+ }
+ --myHierarchyLevel;
+}
+
+// ---------------------------------------------------------------------------
+// definitions of NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition-methods
+// ---------------------------------------------------------------------------
+NIImporter_Vissim::NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition::NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition(nodeMap& elemData)
+ : GenericSAXHandler(vissimTags, VISSIM_TAG_NOTHING,
+ vissimAttrs, VISSIM_ATTR_NOTHING,
+ "vissim - file"),
+ myElemData(elemData),
+ myHierarchyLevel(0) {
+ myElemData.clear();
+}
+
+NIImporter_Vissim::NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition::~NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition() { }
+
+void
+NIImporter_Vissim::NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition::myStartElement(int element, const SUMOSAXAttributes& attrs) {
+ myHierarchyLevel++;
+ if (element == VISSIM_TAG_SPEED_DIST) {
+ bool ok = true;
+ myElemData["id"].push_back(attrs.get<std::string>(VISSIM_ATTR_NO, 0, ok));
+ }
+
+ if (element == VISSIM_TAG_DATAPOINT) {
+ bool ok = true;
+ std::string sep(" ");
+ std::string posS(attrs.get<std::string>(VISSIM_ATTR_X, 0, ok));
+ posS += sep;
+ posS.append(attrs.get<std::string>(VISSIM_ATTR_FX, 0, ok));
+ myElemData["points"].push_back(posS);
+
+ }
+
+}
+
+void
+NIImporter_Vissim::NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition::myEndElement(int element) {
+ if (element == VISSIM_TAG_SPEED_DIST && myHierarchyLevel == 3) {
+ PositionVector points;
+ while (!myElemData["points"].empty()) {
+ std::vector<std::string> sPos_v(StringTokenizer(
+ myElemData["points"].front(), " ").getVector());
+ myElemData["points"].pop_front();
+ std::vector<SUMOReal> pos_v(2);
+
+ // doing a transform with explicit hint on function signature
+ std::transform(sPos_v.begin(), sPos_v.end(), pos_v.begin(),
+ TplConvert::_str2SUMOReal);
+ points.push_back_noDoublePos(Position(pos_v[0], pos_v[1]));
+ }
+ NBDistribution::dictionary("speed",
+ myElemData["id"].front(),
+ new Distribution_Points(myElemData["id"].front(),
+ points));
+ myElemData.clear();
+ }
+ --myHierarchyLevel;
+}
+
+// ---------------------------------------------------------------------------
+// definitions of NIVissimXMLHandler_VWunschentscheidungsdefinition-methods
+// ---------------------------------------------------------------------------
+NIImporter_Vissim::NIVissimXMLHandler_VWunschentscheidungsdefinition::NIVissimXMLHandler_VWunschentscheidungsdefinition(nodeMap& elemData)
+ : GenericSAXHandler(vissimTags, VISSIM_TAG_NOTHING,
+ vissimAttrs, VISSIM_ATTR_NOTHING,
+ "vissim - file"),
+ myElemData(elemData),
+ myHierarchyLevel(0) {
+ myElemData.clear();
+}
+
+NIImporter_Vissim::NIVissimXMLHandler_VWunschentscheidungsdefinition::~NIVissimXMLHandler_VWunschentscheidungsdefinition() { }
+
+void
+NIImporter_Vissim::NIVissimXMLHandler_VWunschentscheidungsdefinition::myStartElement(int element, const SUMOSAXAttributes& attrs) {
+ myHierarchyLevel++;
+ if (element == VISSIM_TAG_SPEED_DECISION) {
+ bool ok = true;
+ myElemData["name"].push_back(attrs.get<std::string>(VISSIM_ATTR_NAME, 0, ok, false));
+ //FIXME: 2 vWunsch in the xml file, but only 1 of them is set???
+ }
+
+}
+
+void
+NIImporter_Vissim::NIVissimXMLHandler_VWunschentscheidungsdefinition::myEndElement(int /* element */) {
+ --myHierarchyLevel;
+}
+
+
+// ---------------------------------------------------------------------------
+// definitions of NIVissimXMLHandler_Routenentscheidungsdefinition-methods
+// ---------------------------------------------------------------------------
+NIImporter_Vissim::NIVissimXMLHandler_Routenentscheidungsdefinition::NIVissimXMLHandler_Routenentscheidungsdefinition(nodeMap& elemData)
+ : GenericSAXHandler(vissimTags, VISSIM_TAG_NOTHING,
+ vissimAttrs, VISSIM_ATTR_NOTHING,
+ "vissim - file"),
+ myElemData(elemData),
+ myHierarchyLevel(0) {
+ myElemData.clear();
+}
+
+NIImporter_Vissim::NIVissimXMLHandler_Routenentscheidungsdefinition::~NIVissimXMLHandler_Routenentscheidungsdefinition() { }
+
+void
+NIImporter_Vissim::NIVissimXMLHandler_Routenentscheidungsdefinition::myStartElement(int element, const SUMOSAXAttributes& attrs) {
+ myHierarchyLevel++;
+ if (element == VISSIM_TAG_DECISION_STATIC) {
+ bool ok = true;
+ myElemData["startLink"].push_back(attrs.get<std::string>(VISSIM_ATTR_LINK, 0, ok));
+ myElemData["startPos"].push_back(attrs.get<std::string>(VISSIM_ATTR_POS, 0, ok));
+ }
+ if (element == VISSIM_TAG_ROUTE_STATIC) {
+ bool ok = true;
+ myElemData["destLink"].push_back(attrs.get<std::string>(VISSIM_ATTR_DESTLINK, 0, ok));
+ myElemData["destPos"].push_back(attrs.get<std::string>(VISSIM_ATTR_DESTPOS, 0, ok));
+ myElemData["id"].push_back(attrs.get<std::string>(VISSIM_ATTR_NO, 0, ok));
+ }
+ if (element == VISSIM_TAG_INTOBJECTREF) {
+ // bool ok = true;
+ }
+
+}
+
+void
+NIImporter_Vissim::NIVissimXMLHandler_Routenentscheidungsdefinition::myEndElement(int /* element */) {
+ --myHierarchyLevel;
+}
+
+// ---------------------------------------------------------------------------
+// definitions of NIVissimXMLHandler_ConflictArea-methods
+// ---------------------------------------------------------------------------
+NIImporter_Vissim::NIVissimXMLHandler_ConflictArea::NIVissimXMLHandler_ConflictArea()
+ : GenericSAXHandler(vissimTags, VISSIM_TAG_NOTHING,
+ vissimAttrs, VISSIM_ATTR_NOTHING,
+ "vissim - file") {}
+
+NIImporter_Vissim::NIVissimXMLHandler_ConflictArea::~NIVissimXMLHandler_ConflictArea() { }
+
+void
+NIImporter_Vissim::NIVissimXMLHandler_ConflictArea::myStartElement(int element, const SUMOSAXAttributes& attrs) {
+ // finding an actual flow
+ if (element == VISSIM_TAG_CA) {
+ //parse all flows
+ bool ok = true;
+ std::string status = attrs.get<std::string>(VISSIM_ATTR_STATUS, 0, ok);
+ //get only the conflict areas which were set in VISSIM
+ if (status != "PASSIVE") {
+ NIVissimConflictArea::dictionary(attrs.get<int>(VISSIM_ATTR_NO, 0, ok),
+ attrs.get<std::string>(VISSIM_ATTR_LINK1, 0, ok),
+ attrs.get<std::string>(VISSIM_ATTR_LINK2, 0, ok),
+ status);
+ }
+
+ }
}
@@ -314,7 +869,7 @@ NIImporter_Vissim::VissimSingleTypeParser::skipOverreading(std::istream& from,
* NIImporter_Vissim-methods
* ----------------------------------------------------------------------- */
NIImporter_Vissim::NIImporter_Vissim(NBNetBuilder& nb, const std::string& file)
- : myNetBuilder(nb) {
+ : myNetBuilder(nb), myInputIsLegacyFormat(false) {
UNUSED_PARAMETER(file);
insertKnownElements();
buildParsers();
@@ -351,6 +906,7 @@ NIImporter_Vissim::~NIImporter_Vissim() {
NIVissimEdge::clearDict();
NIVissimAbstractEdge::clearDict();
NIVissimConnection::clearDict();
+ NIVissimConflictArea::clearDict();
for (ToParserMap::iterator i = myParsers.begin(); i != myParsers.end(); i++) {
delete(*i).second;
}
@@ -372,6 +928,74 @@ NIImporter_Vissim::load(const OptionsCont& options) {
postLoadBuild(options.getFloat("vissim.join-distance"));
}
+void
+NIImporter_Vissim::loadXML(const OptionsCont& options, NBNetBuilder& /* nb */) {
+ // Parse file
+ std::string file = options.getString("vissim-file");
+ // Create NIVissimXMLHandlers
+ NIVissimXMLHandler_Streckendefinition XMLHandler_Streckendefinition(elementData);
+ NIVissimXMLHandler_Zuflussdefinition XMLHandler_Zuflussdefinition;
+ //NIVissimXMLHandler_Parkplatzdefinition XMLHandler_Parkplatzdefinition;
+ NIVissimXMLHandler_Fahrzeugklassendefinition XMLHandler_Fahrzeugklassendefinition(elementData);
+ NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition XMLHandler_Geschwindigkeitsverteilung(elementData);
+ NIVissimXMLHandler_ConflictArea XMLHandler_ConflictAreas;
+ if (!FileHelpers::isReadable(file)) {
+ WRITE_ERROR("Could not open vissim-file '" + file + "'.");
+ return;
+ }
+
+ // Strecken + Verbinder
+ XMLHandler_Streckendefinition.setFileName(file);
+ PROGRESS_BEGIN_MESSAGE("Parsing strecken+verbinder from vissim-file '" + file + "'");
+ if (!XMLSubSys::runParser(XMLHandler_Streckendefinition, file)) {
+ return;
+ }
+ PROGRESS_DONE_MESSAGE();
+
+ // Zuflüsse
+ XMLHandler_Zuflussdefinition.setFileName(file);
+ PROGRESS_BEGIN_MESSAGE("Parsing zuflüsse from vissim-file '" + file + "'");
+ if (!XMLSubSys::runParser(XMLHandler_Zuflussdefinition, file)) {
+ return;
+ }
+ PROGRESS_DONE_MESSAGE();
+
+ //Geschwindigkeitsverteilungen
+ XMLHandler_Geschwindigkeitsverteilung.setFileName(file);
+ PROGRESS_BEGIN_MESSAGE("Parsing parkplätze from vissim-file '" + file + "'");
+ if (!XMLSubSys::runParser(XMLHandler_Geschwindigkeitsverteilung, file)) {
+ return;
+ }
+ PROGRESS_DONE_MESSAGE();
+
+
+ //Fahrzeugklassen
+ XMLHandler_Fahrzeugklassendefinition.setFileName(file);
+ PROGRESS_BEGIN_MESSAGE("Parsing parkplätze from vissim-file '" + file + "'");
+ if (!XMLSubSys::runParser(XMLHandler_Fahrzeugklassendefinition, file)) {
+ return;
+ }
+ PROGRESS_DONE_MESSAGE();
+
+ //Parkplätze
+ /*XMLHandler_Parkplatzdefinition.setFileName(file);
+ PROGRESS_BEGIN_MESSAGE("Parsing parkplätze from vissim-file '" + file + "'");
+ if (!XMLSubSys::runParser(XMLHandler_Parkplatzdefinition, file)) {
+ return;
+ }
+ PROGRESS_DONE_MESSAGE();*/
+
+
+ //Konfliktflächen
+ XMLHandler_ConflictAreas.setFileName(file);
+ PROGRESS_BEGIN_MESSAGE("Parsing conflict areas from vissim-file '" + file + "'");
+ if (!XMLSubSys::runParser(XMLHandler_ConflictAreas, file)) {
+ return;
+ }
+ PROGRESS_DONE_MESSAGE();
+
+ postLoadBuild(options.getFloat("vissim.join-distance"));
+}
bool
NIImporter_Vissim::admitContinue(const std::string& tag) {
@@ -463,7 +1087,6 @@ NIImporter_Vissim::postLoadBuild(SUMOReal offset) {
NIVissimConnectionCluster::buildNodeClusters();
// NIVissimNodeCluster::dict_recheckEdgeChanges();
-
NIVissimNodeCluster::buildNBNodes(myNetBuilder.getNodeCont());
NIVissimDistrictConnection::dict_BuildDistrictNodes(
myNetBuilder.getDistrictCont(), myNetBuilder.getNodeCont());
@@ -475,6 +1098,7 @@ NIImporter_Vissim::postLoadBuild(SUMOReal offset) {
NIVissimDistrictConnection::dict_BuildDistricts(myNetBuilder.getDistrictCont(), myNetBuilder.getEdgeCont(), myNetBuilder.getNodeCont());
NIVissimConnection::dict_buildNBEdgeConnections(myNetBuilder.getEdgeCont());
NIVissimNodeCluster::dict_addDisturbances(myNetBuilder.getDistrictCont(), myNetBuilder.getNodeCont(), myNetBuilder.getEdgeCont());
+ NIVissimConflictArea::setPriorityRegulation(myNetBuilder.getEdgeCont());
NIVissimTL::dict_SetSignals(myNetBuilder.getTLLogicCont(), myNetBuilder.getEdgeCont());
}
diff --git a/src/netimport/vissim/NIImporter_Vissim.h b/src/netimport/vissim/NIImporter_Vissim.h
index fa50f02..466b621 100644
--- a/src/netimport/vissim/NIImporter_Vissim.h
+++ b/src/netimport/vissim/NIImporter_Vissim.h
@@ -2,8 +2,10 @@
/// @file NIImporter_Vissim.h
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
+/// @author Lukas Grohmann (AIT)
+/// @author Gerald Richter (AIT)
/// @date Sept 2002
-/// @version $Id: NIImporter_Vissim.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIImporter_Vissim.h 18682 2015-08-21 13:53:36Z behrisch $
///
// Importer for networks stored in Vissim format
/****************************************************************************/
@@ -38,7 +40,14 @@
#include <utils/geom/Position.h>
#include "tempstructs/NIVissimExtendedEdgePoint.h"
#include "NIVissimElements.h"
+#include <utils/xml/SUMOSAXHandler.h>
+#include "tempstructs/NIVissimEdge.h"
+#include "tempstructs/NIVissimConnection.h"
+#include "tempstructs/NIVissimConflictArea.h"
+#include <utils/common/StringBijection.h>
+#include <utils/common/StringTokenizer.h>
+#include <list>
// ===========================================================================
// class declarations
@@ -70,6 +79,406 @@ public:
static void loadNetwork(const OptionsCont& oc, NBNetBuilder& nb);
+
+private:
+
+ typedef std::map<std::string, std::list<std::string> > nodeMap;
+ nodeMap elementData;
+
+ /**
+ * @class NIVissimSingleTypeXMLHandler_Streckendefinition
+ * @brief A class which extracts VISSIM-Strecken from a parsed VISSIM-file
+ */
+ class NIVissimXMLHandler_Streckendefinition : public GenericSAXHandler {
+ public:
+ /** @brief Constructor
+ * @param[in] strecken_dic The strecken dictionary to fill
+ */
+ //NIVissimXMLHandler_Streckendefinition(std::map<int, VissimXMLEdge>& toFill);
+ NIVissimXMLHandler_Streckendefinition(nodeMap& elemData);
+
+
+ /// @brief Destructor
+ ~NIVissimXMLHandler_Streckendefinition();
+
+ protected:
+ /// @name inherited from GenericSAXHandler
+ //@{
+
+ /** @brief Called on the opening of a tag;
+ *
+ * @param[in] element ID of the currently opened element
+ * @param[in] attrs Attributes within the currently opened element
+ * @exception ProcessError If something fails
+ * @see GenericSAXHandler::myStartElement
+ */
+ void myStartElement(int element, const SUMOSAXAttributes& attrs);
+ //@}
+
+ void myEndElement(int element);
+ //@}
+
+ private:
+
+ //std::map<int, VissimXMLEdge> myToFill;
+ nodeMap& myElemData;
+
+ /// @brief The current hierarchy level
+ int myHierarchyLevel;
+
+ /// @brief check if the link is a connector
+ bool isConnector;
+
+ /// @brief ID of the currently parsed node, for reporting mainly
+ int myLastNodeID;
+
+ /** @brief invalidated copy constructor */
+ NIVissimXMLHandler_Streckendefinition(const NIVissimXMLHandler_Streckendefinition& s);
+
+ /** @brief invalidated assignment operator */
+ NIVissimXMLHandler_Streckendefinition& operator=(const NIVissimXMLHandler_Streckendefinition& s);
+ };
+
+
+private:
+ /**
+ * @class NIVissimSingleTypeXMLHandler_Zuflussdefinition
+ * @brief A class which extracts VISSIM-Zuflüsse from a parsed VISSIM-file
+ */
+ class NIVissimXMLHandler_Zuflussdefinition : public GenericSAXHandler {
+ public:
+ /** @brief Constructor
+ */
+ NIVissimXMLHandler_Zuflussdefinition();
+
+
+ /// @brief Destructor
+ ~NIVissimXMLHandler_Zuflussdefinition();
+
+ protected:
+ /// @name inherited from GenericSAXHandler
+ //@{
+
+ /** @brief Called on the opening of a tag;
+ *
+ * @param[in] element ID of the currently opened element
+ * @param[in] attrs Attributes within the currently opened element
+ * @exception ProcessError If something fails
+ * @see GenericSAXHandler::myStartElement
+ */
+ void myStartElement(int element, const SUMOSAXAttributes& attrs);
+ //@}
+
+
+ private:
+
+
+
+ /** @brief invalidated copy constructor */
+ NIVissimXMLHandler_Zuflussdefinition(const NIVissimXMLHandler_Zuflussdefinition& z);
+
+ /** @brief invalidated assignment operator */
+ NIVissimXMLHandler_Zuflussdefinition& operator=(const NIVissimXMLHandler_Zuflussdefinition& z);
+ };
+
+
+private:
+ /**
+ * @class NIVissimSingleTypeXMLHandler_Parkplatzdefinition
+ * @brief A class which extracts VISSIM-Parkplätze from a parsed VISSIM-file
+ */
+ class NIVissimXMLHandler_Parkplatzdefinition : public GenericSAXHandler {
+ public:
+ /** @brief Constructor
+ */
+ NIVissimXMLHandler_Parkplatzdefinition();
+
+
+ /// @brief Destructor
+ ~NIVissimXMLHandler_Parkplatzdefinition();
+
+ protected:
+ /// @name inherited from GenericSAXHandler
+ //@{
+
+ /** @brief Called on the opening of a tag;
+ *
+ * @param[in] element ID of the currently opened element
+ * @param[in] attrs Attributes within the currently opened element
+ * @exception ProcessError If something fails
+ * @see GenericSAXHandler::myStartElement
+ */
+ void myStartElement(int element, const SUMOSAXAttributes& attrs);
+ //@}
+
+
+ private:
+
+
+
+ /** @brief invalidated copy constructor */
+ NIVissimXMLHandler_Parkplatzdefinition(const NIVissimXMLHandler_Parkplatzdefinition& z);
+
+ /** @brief invalidated assignment operator */
+ NIVissimXMLHandler_Parkplatzdefinition& operator=(const NIVissimXMLHandler_Parkplatzdefinition& z);
+ };
+
+
+private:
+ /**
+ * @class NIVissimSingleTypeXMLHandler_Fahrzeugklassendefinition
+ * @brief A class which extracts VISSIM-Fahrzeugklassen from a parsed VISSIM-file
+ */
+ class NIVissimXMLHandler_Fahrzeugklassendefinition : public GenericSAXHandler {
+ public:
+ /** @brief Constructor
+ * @param[in] elemData The string container to fill
+ */
+
+ NIVissimXMLHandler_Fahrzeugklassendefinition(nodeMap& elemData);
+
+
+ /// @brief Destructor
+ ~NIVissimXMLHandler_Fahrzeugklassendefinition();
+
+ protected:
+ /// @name inherited from GenericSAXHandler
+ //@{
+
+ /** @brief Called on the opening of a tag;
+ *
+ * @param[in] element ID of the currently opened element
+ * @param[in] attrs Attributes within the currently opened element
+ * @exception ProcessError If something fails
+ * @see GenericSAXHandler::myStartElement
+ */
+ void myStartElement(int element, const SUMOSAXAttributes& attrs);
+ //@}
+
+ void myEndElement(int element);
+ //@}
+
+ private:
+
+ //std::map<int, VissimXMLEdge> myToFill;
+ nodeMap& myElemData;
+
+ /// @brief The current hierarchy level
+ int myHierarchyLevel;
+
+ /// @brief ID of the currently parsed node, for reporting mainly
+ int myLastNodeID;
+
+ /** @brief invalidated copy constructor */
+ NIVissimXMLHandler_Fahrzeugklassendefinition(const NIVissimXMLHandler_Fahrzeugklassendefinition& f);
+
+ /** @brief invalidated assignment operator */
+ NIVissimXMLHandler_Fahrzeugklassendefinition& operator=(const NIVissimXMLHandler_Fahrzeugklassendefinition& f);
+ };
+
+private:
+ /**
+ * @class NIVissimSingleTypeXMLHandler_VWunschentscheidungsdefinition
+ * @brief A class which extracts VISSIM-VWunschentscheidungen from a parsed VISSIM-file
+ */
+ class NIVissimXMLHandler_VWunschentscheidungsdefinition : public GenericSAXHandler {
+ public:
+ /** @brief Constructor
+ * @param[in] elemData The string container to fill
+ */
+
+ NIVissimXMLHandler_VWunschentscheidungsdefinition(nodeMap& elemData);
+
+
+ /// @brief Destructor
+ ~NIVissimXMLHandler_VWunschentscheidungsdefinition();
+
+ protected:
+ /// @name inherited from GenericSAXHandler
+ //@{
+
+ /** @brief Called on the opening of a tag;
+ *
+ * @param[in] element ID of the currently opened element
+ * @param[in] attrs Attributes within the currently opened element
+ * @exception ProcessError If something fails
+ * @see GenericSAXHandler::myStartElement
+ */
+ void myStartElement(int element, const SUMOSAXAttributes& attrs);
+ //@}
+
+ void myEndElement(int element);
+ //@}
+
+ private:
+
+ //std::map<int, VissimXMLEdge> myToFill;
+ nodeMap& myElemData;
+
+ /// @brief The current hierarchy level
+ int myHierarchyLevel;
+
+ /// @brief ID of the currently parsed node, for reporting mainly
+ int myLastNodeID;
+
+ /** @brief invalidated copy constructor */
+ NIVissimXMLHandler_VWunschentscheidungsdefinition(const NIVissimXMLHandler_VWunschentscheidungsdefinition& vW);
+
+ /** @brief invalidated assignment operator */
+ NIVissimXMLHandler_VWunschentscheidungsdefinition& operator=(const NIVissimXMLHandler_VWunschentscheidungsdefinition& vW);
+ };
+
+
+
+
+private:
+ /**
+ * @class NIVissimSingleTypeXMLHandler_Geschwindigkeitsverteilungsdefinition
+ * @brief A class which extracts VISSIM-Geschwindigkeitsverteilung from a parsed VISSIM-file
+ */
+ class NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition : public GenericSAXHandler {
+ public:
+ /** @brief Constructor
+ * @param[in] elemData The string container to fill
+ */
+
+ NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition(nodeMap& elemData);
+
+
+ /// @brief Destructor
+ ~NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition();
+
+ protected:
+ /// @name inherited from GenericSAXHandler
+ //@{
+
+ /** @brief Called on the opening of a tag;
+ *
+ * @param[in] element ID of the currently opened element
+ * @param[in] attrs Attributes within the currently opened element
+ * @exception ProcessError If something fails
+ * @see GenericSAXHandler::myStartElement
+ */
+ void myStartElement(int element, const SUMOSAXAttributes& attrs);
+ //@}
+
+ void myEndElement(int element);
+ //@}
+
+ private:
+
+ //std::map<int, VissimXMLEdge> myToFill;
+ nodeMap& myElemData;
+
+ /// @brief The current hierarchy level
+ int myHierarchyLevel;
+
+ /// @brief ID of the currently parsed node, for reporting mainly
+ int myLastNodeID;
+
+ /** @brief invalidated copy constructor */
+ NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition(const NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition& vW);
+
+ /** @brief invalidated assignment operator */
+ NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition& operator=(const NIVissimXMLHandler_Geschwindigkeitsverteilungsdefinition& vW);
+ };
+
+
+private:
+ /**
+ * @class NIVissimXMLHandler_Routenentscheidungsdefinition
+ * @brief A class which extracts VISSIM-Routes from a parsed VISSIM-file
+ */
+ class NIVissimXMLHandler_Routenentscheidungsdefinition : public GenericSAXHandler {
+ public:
+ /** @brief Constructor
+ * @param[in] elemData The string container to fill
+ */
+
+ NIVissimXMLHandler_Routenentscheidungsdefinition(nodeMap& elemData);
+
+
+ /// @brief Destructor
+ ~NIVissimXMLHandler_Routenentscheidungsdefinition();
+
+ protected:
+ /// @name inherited from GenericSAXHandler
+ //@{
+
+ /** @brief Called on the opening of a tag;
+ *
+ * @param[in] element ID of the currently opened element
+ * @param[in] attrs Attributes within the currently opened element
+ * @exception ProcessError If something fails
+ * @see GenericSAXHandler::myStartElement
+ */
+ void myStartElement(int element, const SUMOSAXAttributes& attrs);
+ //@}
+
+ void myEndElement(int element);
+ //@}
+
+ private:
+
+ //std::map<int, VissimXMLEdge> myToFill;
+ nodeMap& myElemData;
+
+ /// @brief The current hierarchy level
+ int myHierarchyLevel;
+
+ /// @brief ID of the currently parsed node, for reporting mainly
+ int myLastNodeID;
+
+ /** @brief invalidated copy constructor */
+ NIVissimXMLHandler_Routenentscheidungsdefinition(const NIVissimXMLHandler_Routenentscheidungsdefinition& r);
+
+ /** @brief invalidated assignment operator */
+ NIVissimXMLHandler_Routenentscheidungsdefinition& operator=(const NIVissimXMLHandler_Routenentscheidungsdefinition& r);
+ };
+
+
+private:
+ /**
+ * @class NIVissimSingleTypeXMLHandler_ConflictArea
+ * @brief A class which extracts VISSIM-ConflictAreas from a parsed VISSIM-file
+ */
+ class NIVissimXMLHandler_ConflictArea : public GenericSAXHandler {
+ public:
+ /** @brief Constructor
+ */
+ NIVissimXMLHandler_ConflictArea();
+
+
+ /// @brief Destructor
+ ~NIVissimXMLHandler_ConflictArea();
+
+
+ protected:
+ /// @name inherited from GenericSAXHandler
+ //@{
+
+ /** @brief Called on the opening of a tag;
+ *
+ * @param[in] element ID of the currently opened element
+ * @param[in] attrs Attributes within the currently opened element
+ * @exception ProcessError If something fails
+ * @see GenericSAXHandler::myStartElement
+ */
+ void myStartElement(int element, const SUMOSAXAttributes& attrs);
+ //@}
+
+
+ private:
+
+
+ /** @brief invalidated copy constructor */
+ NIVissimXMLHandler_ConflictArea(const NIVissimXMLHandler_ConflictArea& c);
+
+ /** @brief invalidated assignment operator */
+ NIVissimXMLHandler_ConflictArea& operator=(const NIVissimXMLHandler_ConflictArea& c);
+ };
+
+
protected:
/// constructor
NIImporter_Vissim(NBNetBuilder& nb, const std::string& file);
@@ -80,6 +489,8 @@ protected:
/// loads the vissim file
void load(const OptionsCont& options);
+ void loadXML(const OptionsCont& options, NBNetBuilder& nb);
+
bool admitContinue(const std::string& tag);
public:
@@ -176,6 +587,8 @@ private:
NBNetBuilder& myNetBuilder;
+ bool myInputIsLegacyFormat;
+
private:
/// @brief Invalidated copy constructor.
NIImporter_Vissim(const NIImporter_Vissim&);
@@ -183,6 +596,76 @@ private:
/// @brief Invalidated assignment operator.
NIImporter_Vissim& operator=(const NIImporter_Vissim&);
+
+
+ /**
+ * @enum VissimXMLTag
+ * @brief Numbers representing VISSIM-XML - element names
+ * @see GenericSAXHandler
+ */
+ enum VissimXMLTag {
+ VISSIM_TAG_NOTHING = 0,
+ VISSIM_TAG_NETWORK,
+ VISSIM_TAG_LANES,
+ VISSIM_TAG_LANE,
+ VISSIM_TAG_LINK,
+ VISSIM_TAG_LINKS,
+ VISSIM_TAG_POINTS3D,
+ VISSIM_TAG_POINT3D,
+ VISSIM_TAG_FROM,
+ VISSIM_TAG_TO,
+ VISSIM_TAG_VEHICLE_INPUT,
+ VISSIM_TAG_PARKINGLOT,
+ VISSIM_TAG_VEHICLE_CLASS,
+ VISSIM_TAG_INTOBJECTREF,
+ VISSIM_TAG_SPEED_DECISION,
+ VISSIM_TAG_SPEED_DIST,
+ VISSIM_TAG_DATAPOINT,
+ VISSIM_TAG_DECISION_STATIC,
+ VISSIM_TAG_ROUTE_STATIC,
+ VISSIM_TAG_CA
+ };
+
+
+ /**
+ * @enum VissimXMLAttr
+ * @brief Numbers representing VISSIM-XML - attributes
+ * @see GenericSAXHandler
+ */
+ enum VissimXMLAttr {
+ VISSIM_ATTR_NOTHING = 0,
+ VISSIM_ATTR_NO,
+ VISSIM_ATTR_NAME,
+ VISSIM_ATTR_X,
+ VISSIM_ATTR_Y,
+ VISSIM_ATTR_ZOFFSET,
+ VISSIM_ATTR_ZUSCHLAG1,
+ VISSIM_ATTR_ZUSCHLAG2,
+ VISSIM_ATTR_WIDTH,
+ VISSIM_ATTR_LINKBEHAVETYPE,
+ VISSIM_ATTR_LANE,
+ VISSIM_ATTR_POS,
+ VISSIM_ATTR_LINK,
+ VISSIM_ATTR_INTLINK,
+ VISSIM_ATTR_PERCENTAGE,
+ VISSIM_ATTR_DISTRICT,
+ VISSIM_ATTR_COLOR,
+ VISSIM_ATTR_KEY,
+ VISSIM_ATTR_FX,
+ VISSIM_ATTR_DESTLINK,
+ VISSIM_ATTR_DESTPOS,
+ VISSIM_ATTR_LINK1,
+ VISSIM_ATTR_LINK2,
+ VISSIM_ATTR_STATUS
+ };
+
+ /// The names of VISSIM-XML elements (for passing to GenericSAXHandler)
+ static StringBijection<int>::Entry vissimTags[];
+
+ /// The names of VISSIM-XML attributes (for passing to GenericSAXHandler)
+ static StringBijection<int>::Entry vissimAttrs[];
+
+
};
diff --git a/src/netimport/vissim/tempstructs/Makefile.am b/src/netimport/vissim/tempstructs/Makefile.am
index 83141f7..59ce24e 100644
--- a/src/netimport/vissim/tempstructs/Makefile.am
+++ b/src/netimport/vissim/tempstructs/Makefile.am
@@ -4,6 +4,7 @@ libvissimtmpstr_a_SOURCES = NIVissimAbstractEdge.cpp NIVissimAbstractEdge.h \
NIVissimBoundedClusterObject.cpp NIVissimBoundedClusterObject.h \
NIVissimClosedLaneDef.cpp NIVissimClosedLaneDef.h \
NIVissimClosedLanesVector.h NIVissimClosures.cpp NIVissimClosures.h \
+NIVissimConflictArea.cpp NIVissimConflictArea.h \
NIVissimConnection.cpp NIVissimConnection.h \
NIVissimConnectionCluster.cpp NIVissimConnectionCluster.h \
NIVissimDistrictConnection.cpp NIVissimDistrictConnection.h \
diff --git a/src/netimport/vissim/tempstructs/Makefile.in b/src/netimport/vissim/tempstructs/Makefile.in
index a518e28..7e40959 100644
--- a/src/netimport/vissim/tempstructs/Makefile.in
+++ b/src/netimport/vissim/tempstructs/Makefile.in
@@ -101,7 +101,7 @@ libvissimtmpstr_a_LIBADD =
am_libvissimtmpstr_a_OBJECTS = NIVissimAbstractEdge.$(OBJEXT) \
NIVissimBoundedClusterObject.$(OBJEXT) \
NIVissimClosedLaneDef.$(OBJEXT) NIVissimClosures.$(OBJEXT) \
- NIVissimConnection.$(OBJEXT) \
+ NIVissimConflictArea.$(OBJEXT) NIVissimConnection.$(OBJEXT) \
NIVissimConnectionCluster.$(OBJEXT) \
NIVissimDistrictConnection.$(OBJEXT) \
NIVissimDisturbance.$(OBJEXT) NIVissimEdge.$(OBJEXT) \
@@ -345,6 +345,7 @@ libvissimtmpstr_a_SOURCES = NIVissimAbstractEdge.cpp NIVissimAbstractEdge.h \
NIVissimBoundedClusterObject.cpp NIVissimBoundedClusterObject.h \
NIVissimClosedLaneDef.cpp NIVissimClosedLaneDef.h \
NIVissimClosedLanesVector.h NIVissimClosures.cpp NIVissimClosures.h \
+NIVissimConflictArea.cpp NIVissimConflictArea.h \
NIVissimConnection.cpp NIVissimConnection.h \
NIVissimConnectionCluster.cpp NIVissimConnectionCluster.h \
NIVissimDistrictConnection.cpp NIVissimDistrictConnection.h \
@@ -417,6 +418,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/NIVissimBoundedClusterObject.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/NIVissimClosedLaneDef.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/NIVissimClosures.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/NIVissimConflictArea.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/NIVissimConnection.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/NIVissimConnectionCluster.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/NIVissimDistrictConnection.Po at am__quote@
diff --git a/src/netimport/vissim/tempstructs/NIVissimConflictArea.cpp b/src/netimport/vissim/tempstructs/NIVissimConflictArea.cpp
new file mode 100644
index 0000000..c61ab90
--- /dev/null
+++ b/src/netimport/vissim/tempstructs/NIVissimConflictArea.cpp
@@ -0,0 +1,165 @@
+/****************************************************************************/
+/// @file NIVissimConflictArea.cpp
+/// @author Lukas Grohmann
+/// @date Aug 2015
+/// @version $Id: NIVissimConflictArea.cpp 18756 2015-08-31 19:16:33Z behrisch $
+///
+// A temporary storage for conflict areas imported from Vissim
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+#include <iterator>
+#include <map>
+#include <string>
+#include <utils/common/ToString.h>
+#include <utils/common/TplConvert.h>
+#include "NIVissimConflictArea.h"
+#include "NIVissimConnection.h"
+#include <netbuild/NBEdgeCont.h>
+#include <netbuild/NBEdge.h>
+#include <netbuild/NBNode.h>
+
+#ifdef CHECK_MEMORY_LEAKS
+#include <foreign/nvwa/debug_new.h>
+#endif // CHECK_MEMORY_LEAKS
+
+
+// ===========================================================================
+// static members
+// ===========================================================================
+NIVissimConflictArea::DictType NIVissimConflictArea::myDict;
+
+
+// ===========================================================================
+// method definitions
+// ===========================================================================
+NIVissimConflictArea::NIVissimConflictArea(int id,
+ const std::string& link1,
+ const std::string& link2,
+ const std::string& status)
+ : myConflictID(id), myFirstLink(link1), mySecondLink(link2), myStatus(status)
+{}
+
+
+NIVissimConflictArea::~NIVissimConflictArea() {}
+
+
+
+
+bool
+NIVissimConflictArea::dictionary(int id, const std::string& link1,
+ const std::string& link2,
+ const std::string& status) {
+ NIVissimConflictArea* ca = new NIVissimConflictArea(id, link1, link2, status);
+ if (!dictionary(id, ca)) {
+ delete ca;
+ return false;
+ }
+ return true;
+}
+
+
+
+bool
+NIVissimConflictArea::dictionary(int id, NIVissimConflictArea* ca) {
+ DictType::iterator i = myDict.find(id);
+ if (i == myDict.end()) {
+ myDict[id] = ca;
+ return true;
+ }
+ return false;
+}
+
+
+
+NIVissimConflictArea*
+NIVissimConflictArea::dictionary(int id) {
+ DictType::iterator i = myDict.find(id);
+ if (i == myDict.end()) {
+ return 0;
+ }
+ return (*i).second;
+}
+
+
+
+NIVissimConflictArea*
+NIVissimConflictArea::dict_findByLinks(const std::string& link1,
+ const std::string& link2) {
+ for (DictType::iterator i = myDict.begin(); i != myDict.end(); i++) {
+ if (((*i).second->myFirstLink == link1) &&
+ ((*i).second->mySecondLink == link2)) {
+ return (*i).second;
+ }
+ }
+ return 0;
+}
+
+
+void
+NIVissimConflictArea::clearDict() {
+ for (DictType::iterator i = myDict.begin(); i != myDict.end(); i++) {
+ delete(*i).second;
+ }
+ myDict.clear();
+}
+
+
+void
+NIVissimConflictArea::setPriorityRegulation(NBEdgeCont& ec) {
+ std::map<int, NIVissimConflictArea*>::iterator it;
+ for (it = myDict.begin(); it != myDict.end(); it++) {
+ NIVissimConflictArea* const conflictArea = it->second;
+ NIVissimConnection* const firstLink = NIVissimConnection::dictionary(TplConvert::_str2int(conflictArea->getFirstLink()));
+ NIVissimConnection* const secondLink = NIVissimConnection::dictionary(TplConvert::_str2int(conflictArea->getSecondLink()));
+ if (firstLink == 0 || secondLink == 0) {
+ continue;
+ }
+ // status == "TWOYIELDSONE"
+ NIVissimConnection* priority_conn = firstLink;
+ NIVissimConnection* subordinate_conn = secondLink;
+ if (conflictArea->getStatus() == "ONEYIELDSTWO") {
+ priority_conn = secondLink;
+ subordinate_conn = firstLink;
+ }
+ const std::string mayDriveFrom_id = toString<int>(priority_conn->getFromEdgeID());
+ const std::string mayDriveTo_id = toString<int>(priority_conn->getToEdgeID());
+ const std::string mustStopFrom_id = toString<int>(subordinate_conn->getFromEdgeID());
+ const std::string mustStopTo_id = toString<int>(subordinate_conn->getToEdgeID());
+
+ NBEdge* const mayDriveFrom = ec.retrievePossiblySplit(mayDriveFrom_id, true);
+ NBEdge* const mayDriveTo = ec.retrievePossiblySplit(mayDriveTo_id, false);
+ NBEdge* const mustStopFrom = ec.retrievePossiblySplit(mustStopFrom_id, true);
+ NBEdge* const mustStopTo = ec.retrievePossiblySplit(mustStopTo_id, false);
+
+ if (mayDriveFrom != 0 && mayDriveTo != 0 && mustStopFrom != 0 && mustStopTo != 0) {
+ NBNode* node = mayDriveFrom->getToNode();
+ node->addSortedLinkFoes(
+ NBConnection(mayDriveFrom, mayDriveTo),
+ NBConnection(mustStopFrom, mustStopTo));
+ }
+ }
+}
+
+
+/****************************************************************************/
diff --git a/src/netimport/vissim/tempstructs/NIVissimConflictArea.h b/src/netimport/vissim/tempstructs/NIVissimConflictArea.h
new file mode 100644
index 0000000..b4eefe6
--- /dev/null
+++ b/src/netimport/vissim/tempstructs/NIVissimConflictArea.h
@@ -0,0 +1,141 @@
+/****************************************************************************/
+/// @file NIVissimConflictArea.h
+/// @author Lukas Grohmann
+/// @date Aug 2015
+/// @version $Id: NIVissimConflictArea.h 18756 2015-08-31 19:16:33Z behrisch $
+///
+// -------------------
+/****************************************************************************/
+// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors
+/****************************************************************************/
+//
+// This file is part of SUMO.
+// SUMO is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+/****************************************************************************/
+#ifndef NIVissimConflictArea_h
+#define NIVissimConflictArea_h
+
+
+// ===========================================================================
+// included modules
+// ===========================================================================
+#ifdef _MSC_VER
+#include <windows_config.h>
+#else
+#include <config.h>
+#endif
+
+
+#include <map>
+#include <string>
+#include <utils/common/TplConvert.h>
+#include "NIVissimConnection.h"
+#include <netbuild/NBEdgeCont.h>
+#include <netbuild/NBEdge.h>
+#include <netbuild/NBNode.h>
+
+
+// ===========================================================================
+// class declarations
+// ===========================================================================
+
+
+
+// ===========================================================================
+// class definitions
+// ===========================================================================
+/**
+ * @class NIVissimConflictArea
+ * @brief A temporary storage for conflict areas imported from Vissim
+ */
+class NIVissimConflictArea {
+public:
+ /// Constructor
+ NIVissimConflictArea(int id, const std::string& link1,
+ const std::string& link2,
+ const std::string& status);
+
+
+ /// Destructor
+ ~NIVissimConflictArea();
+
+public:
+ /** @brief Adds the described item to the dictionary
+ Builds the conflict area first */
+ static bool dictionary(int id, const std::string& link1,
+ const std::string& link2, const std::string& status);
+
+ /// Adds the conflict area to the dictionary
+ static bool dictionary(int id, NIVissimConflictArea* ca);
+
+ /// Returns the named dictionary
+ static NIVissimConflictArea* dictionary(int id);
+
+ /// Returns the conflict area from the dictionary, which defines
+ /// the priority rule of the two given links
+ static NIVissimConflictArea* dict_findByLinks(const std::string& link1,
+ const std::string& link2);
+
+ /// Clears the dictionary
+ static void clearDict();
+
+ /// Returns the dictionary including all conflict areas
+ static std::map<int, NIVissimConflictArea*> getConflictAreas() {
+ return myDict;
+ }
+
+ /// Returns the ID of the conflic area
+ int getID() {
+ return myConflictID;
+ }
+
+ /// Returns the first link of the conflic area
+ std::string getFirstLink() {
+ return myFirstLink;
+ }
+
+ /// Returns the second link of the conflic area
+ std::string getSecondLink() {
+ return mySecondLink;
+ }
+
+ /// Returns the priority regulation of the conflic area
+ std::string getStatus() {
+ return myStatus;
+ }
+
+ /// Sets the priority regulation according to the VISSIM conflict area data
+ static void setPriorityRegulation(NBEdgeCont& ec);
+
+
+
+private:
+ /// The id of the conflict area
+ int myConflictID;
+
+ /// The first link of the conflict area
+ std::string myFirstLink;
+
+ /// The second link of the conflict area
+ std::string mySecondLink;
+
+ /// The priority regulation of the conflict area
+ std::string myStatus;
+
+private:
+ /// @brief Definition of the dictionary type
+ typedef std::map<int, NIVissimConflictArea*> DictType;
+
+ /// @brief The dictionary
+ static DictType myDict;
+};
+
+
+#endif
+
+/****************************************************************************/
diff --git a/src/netimport/vissim/tempstructs/NIVissimEdge.cpp b/src/netimport/vissim/tempstructs/NIVissimEdge.cpp
index 6b2d26e..6c4c5a6 100644
--- a/src/netimport/vissim/tempstructs/NIVissimEdge.cpp
+++ b/src/netimport/vissim/tempstructs/NIVissimEdge.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: NIVissimEdge.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIVissimEdge.cpp 18592 2015-08-03 17:39:39Z ait-mob-dts $
///
// A temporary storage for edges imported from Vissim
/****************************************************************************/
@@ -585,7 +585,8 @@ NIVissimEdge::recheckSpeedPatches()
std::pair<NIVissimConnectionCluster*, NBNode*>
NIVissimEdge::getFromNode(NBNodeCont& nc, ConnectionClusters& clusters) {
- const SUMOReal MAX_DISTANCE = 10.;
+ // changed MAX_DISTANCE from 10 to 3.5, because 3.5 is the default lane width in VISSIM
+ const SUMOReal MAX_DISTANCE = 3.5;
assert(clusters.size() >= 1);
const Position& beg = myGeom.front();
NIVissimConnectionCluster* c = *(clusters.begin());
diff --git a/src/netimport/vissim/tempstructs/NIVissimEdge.h b/src/netimport/vissim/tempstructs/NIVissimEdge.h
index a055098..c8771d6 100644
--- a/src/netimport/vissim/tempstructs/NIVissimEdge.h
+++ b/src/netimport/vissim/tempstructs/NIVissimEdge.h
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date End of 2002
-/// @version $Id: NIVissimEdge.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NIVissimEdge.h 18640 2015-08-17 15:28:11Z ait-mob-dts $
///
// A temporary storage for edges imported from Vissim
/****************************************************************************/
@@ -259,7 +259,7 @@ private:
/// The name of the edge
std::string myName;
- /// The tape of the edge
+ /// The type of the edge
std::string myType;
/// The number of lanes the edge has
diff --git a/src/netload/NLDetectorBuilder.cpp b/src/netload/NLDetectorBuilder.cpp
index 673abcb..0f3d39e 100644
--- a/src/netload/NLDetectorBuilder.cpp
+++ b/src/netload/NLDetectorBuilder.cpp
@@ -7,7 +7,7 @@
/// @author Christian Roessel
/// @author Jakob Erdmann
/// @date Mon, 15 Apr 2002
-/// @version $Id: NLDetectorBuilder.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NLDetectorBuilder.cpp 18213 2015-04-16 11:55:42Z behrisch $
///
// Builds detectors for microsim
/****************************************************************************/
@@ -78,7 +78,7 @@
* ----------------------------------------------------------------------- */
NLDetectorBuilder::E3DetectorDefinition::E3DetectorDefinition(const std::string& id,
const std::string& device, SUMOReal haltingSpeedThreshold,
- SUMOTime haltingTimeThreshold, int splInterval)
+ SUMOTime haltingTimeThreshold, SUMOTime splInterval)
: myID(id), myDevice(device),
myHaltingSpeedThreshold(haltingSpeedThreshold),
myHaltingTimeThreshold(haltingTimeThreshold),
@@ -100,7 +100,7 @@ NLDetectorBuilder::~NLDetectorBuilder() {}
void
NLDetectorBuilder::buildInductLoop(const std::string& id,
- const std::string& lane, SUMOReal pos, int splInterval,
+ const std::string& lane, SUMOReal pos, SUMOTime splInterval,
const std::string& device, bool friendlyPos, bool splitByType) {
checkSampleInterval(splInterval, SUMO_TAG_E1DETECTOR, id);
// get and check the lane
@@ -159,7 +159,7 @@ NLDetectorBuilder::buildInstantInductLoop(const std::string& id,
void
NLDetectorBuilder::buildE2Detector(const std::string& id,
const std::string& lane, SUMOReal pos, SUMOReal length,
- bool cont, int splInterval,
+ bool cont, SUMOTime splInterval,
const std::string& device,
SUMOTime haltingTimeThreshold,
SUMOReal haltingSpeedThreshold,
@@ -288,7 +288,7 @@ NLDetectorBuilder::convContE2PosLength(const std::string& id, MSLane* clane,
void
NLDetectorBuilder::beginE3Detector(const std::string& id,
- const std::string& device, int splInterval,
+ const std::string& device, SUMOTime splInterval,
SUMOReal haltingSpeedThreshold,
SUMOTime haltingTimeThreshold) {
checkSampleInterval(splInterval, SUMO_TAG_E3DETECTOR, id);
@@ -551,7 +551,7 @@ NLDetectorBuilder::getLaneChecking(const std::string& laneID, SumoXMLTag type,
void
-NLDetectorBuilder::checkSampleInterval(int splInterval, SumoXMLTag type, const std::string& id) {
+NLDetectorBuilder::checkSampleInterval(SUMOTime splInterval, SumoXMLTag type, const std::string& id) {
if (splInterval < 0) {
throw InvalidArgument("Negative sampling frequency (in " + toString(type) + " '" + id + "').");
}
diff --git a/src/netload/NLDetectorBuilder.h b/src/netload/NLDetectorBuilder.h
index f0931b5..3ae510e 100644
--- a/src/netload/NLDetectorBuilder.h
+++ b/src/netload/NLDetectorBuilder.h
@@ -5,7 +5,7 @@
/// @author Christian Roessel
/// @author Michael Behrisch
/// @date Mon, 15 Apr 2002
-/// @version $Id: NLDetectorBuilder.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NLDetectorBuilder.h 18213 2015-04-16 11:55:42Z behrisch $
///
// Builds detectors for microsim
/****************************************************************************/
@@ -99,7 +99,7 @@ public:
* @exception InvalidArgument If one of the values is invalid
*/
void buildInductLoop(const std::string& id,
- const std::string& lane, SUMOReal pos, int splInterval,
+ const std::string& lane, SUMOReal pos, SUMOTime splInterval,
const std::string& device, bool friendlyPos, bool splitByType);
@@ -148,7 +148,7 @@ public:
* @exception InvalidArgument If one of the values is invalid
*/
void buildE2Detector(const std::string& id, const std::string& lane, SUMOReal pos, SUMOReal length,
- bool cont, int splInterval, const std::string& device, SUMOTime haltingTimeThreshold,
+ bool cont, SUMOTime splInterval, const std::string& device, SUMOTime haltingTimeThreshold,
SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold,
bool friendlyPos);
@@ -229,7 +229,7 @@ public:
* @param[in] haltingSpeedThreshold Detector parameter: the speed a vehicle's speed must be below to be assigned as jammed
* @exception InvalidArgument If one of the values is invalid
*/
- void beginE3Detector(const std::string& id, const std::string& device, int splInterval,
+ void beginE3Detector(const std::string& id, const std::string& device, SUMOTime splInterval,
SUMOReal haltingSpeedThreshold, SUMOTime haltingTimeThreshold);
@@ -503,7 +503,7 @@ protected:
*/
E3DetectorDefinition(const std::string& id,
const std::string& device, SUMOReal haltingSpeedThreshold,
- SUMOTime haltingTimeThreshold, int splInterval);
+ SUMOTime haltingTimeThreshold, SUMOTime splInterval);
/// @brief Destructor
~E3DetectorDefinition();
@@ -521,7 +521,7 @@ protected:
/// @brief List of detector's exits
CrossSectionVector myExits;
/// @brief The aggregation interval
- int mySampleInterval;
+ SUMOTime mySampleInterval;
//@}
private:
@@ -610,7 +610,7 @@ protected:
* @exception InvalidArgument If the given sample interval is invalid (<=0)
* @todo Why is splInterval an int???
*/
- void checkSampleInterval(int splInterval, SumoXMLTag type, const std::string& id);
+ void checkSampleInterval(SUMOTime splInterval, SumoXMLTag type, const std::string& id);
/// @}
diff --git a/src/netload/NLHandler.cpp b/src/netload/NLHandler.cpp
index 7eb3a0b..1afec2c 100644
--- a/src/netload/NLHandler.cpp
+++ b/src/netload/NLHandler.cpp
@@ -7,7 +7,7 @@
/// @author Michael Behrisch
/// @author Felix Brack
/// @date Mon, 9 Jul 2001
-/// @version $Id: NLHandler.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: NLHandler.cpp 18686 2015-08-21 14:52:03Z namdre $
///
// The XML-Handler for network loading
/****************************************************************************/
@@ -158,6 +158,9 @@ NLHandler::myStartElement(int element,
case SUMO_TAG_CONTAINER_STOP:
myTriggerBuilder.parseAndBuildContainerStop(myNet, attrs);
break;
+ case SUMO_TAG_CHRG_STN:
+ myTriggerBuilder.parseAndBuildChrgStn(myNet, attrs);
+ break;
case SUMO_TAG_VTYPEPROBE:
addVTypeProbeDetector(attrs);
break;
@@ -191,6 +194,20 @@ NLHandler::myStartElement(int element,
case SUMO_TAG_ROUNDABOUT:
addRoundabout(attrs);
break;
+ case SUMO_TAG_TYPE: {
+ bool ok = true;
+ myCurrentTypeID = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
+ break;
+ }
+ case SUMO_TAG_RESTRICTION: {
+ bool ok = true;
+ const SUMOVehicleClass svc = getVehicleClassID(attrs.get<std::string>(SUMO_ATTR_VCLASS, myCurrentTypeID.c_str(), ok));
+ const SUMOReal speed = attrs.get<SUMOReal>(SUMO_ATTR_SPEED, myCurrentTypeID.c_str(), ok);
+ if (ok) {
+ myNet.addRestriction(myCurrentTypeID, svc, speed);
+ }
+ break;
+ }
default:
break;
}
@@ -321,7 +338,7 @@ NLHandler::beginEdgeParsing(const SUMOSAXAttributes& attrs) {
}
// get the street name
const std::string streetName = attrs.getOpt<std::string>(SUMO_ATTR_NAME, id.c_str(), ok, "");
- // get the edge type (only for visualization)
+ // get the edge type
const std::string edgeType = attrs.getOpt<std::string>(SUMO_ATTR_TYPE, id.c_str(), ok, "");
// get the edge priority (only for visualization)
const int priority = attrs.getOpt<int>(SUMO_ATTR_PRIORITY, id.c_str(), ok, -1); // default taken from netbuild/NBFrame option 'default.priority'
@@ -381,7 +398,7 @@ NLHandler::addLane(const SUMOSAXAttributes& attrs) {
}
const SVCPermissions permissions = parseVehicleClasses(allow, disallow);
if (permissions != SVCAll) {
- myNet.setRestrictionFound();
+ myNet.setPermissionsFound();
}
myCurrentIsBroken |= !ok;
if (!myCurrentIsBroken) {
@@ -895,6 +912,7 @@ NLHandler::addConnection(const SUMOSAXAttributes& attrs) {
const int toLaneIdx = attrs.get<int>(SUMO_ATTR_TO_LANE, 0, ok);
LinkDirection dir = parseLinkDir(attrs.get<std::string>(SUMO_ATTR_DIR, 0, ok));
LinkState state = parseLinkState(attrs.get<std::string>(SUMO_ATTR_STATE, 0, ok));
+ bool keepClear = attrs.getOpt<bool>(SUMO_ATTR_KEEP_CLEAR, 0, ok, true);
std::string tlID = attrs.getOpt<std::string>(SUMO_ATTR_TLID, 0, ok, "");
#ifdef HAVE_INTERNAL_LANES
std::string viaID = attrs.getOpt<std::string>(SUMO_ATTR_VIA, 0, ok, "");
@@ -950,14 +968,14 @@ NLHandler::addConnection(const SUMOSAXAttributes& attrs) {
}
length = via->getLength();
}
- link = new MSLink(toLane, via, dir, state, length);
+ link = new MSLink(toLane, via, dir, state, length, keepClear);
if (via != 0) {
via->addIncomingLane(fromLane, link);
} else {
toLane->addIncomingLane(fromLane, link);
}
#else
- link = new MSLink(toLane, dir, state, length);
+ link = new MSLink(toLane, dir, state, length, keepClear);
toLane->addIncomingLane(fromLane, link);
#endif
toLane->addApproachingLane(fromLane);
diff --git a/src/netload/NLHandler.h b/src/netload/NLHandler.h
index 8271559..e5574e3 100644
--- a/src/netload/NLHandler.h
+++ b/src/netload/NLHandler.h
@@ -5,7 +5,7 @@
/// @author Clemens Honomichl
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: NLHandler.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NLHandler.h 18467 2015-05-29 03:50:41Z behrisch $
///
// The XML-Handler for network loading
/****************************************************************************/
@@ -315,6 +315,9 @@ protected:
/// The id of the currently processed WAUT
std::string myCurrentWAUTID;
+ /// The id of the currently processed edge type
+ std::string myCurrentTypeID;
+
/// The network offset
Position myNetworkOffset;
diff --git a/src/netload/NLJunctionControlBuilder.cpp b/src/netload/NLJunctionControlBuilder.cpp
index d1a2eae..f418bb4 100644
--- a/src/netload/NLJunctionControlBuilder.cpp
+++ b/src/netload/NLJunctionControlBuilder.cpp
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Mon, 9 Jul 2001
-/// @version $Id: NLJunctionControlBuilder.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: NLJunctionControlBuilder.cpp 18213 2015-04-16 11:55:42Z behrisch $
///
// Builder of microsim-junctions and tls
/****************************************************************************/
@@ -360,7 +360,7 @@ NLJunctionControlBuilder::initTrafficLightLogic(const std::string& id, const std
void
NLJunctionControlBuilder::addPhase(SUMOTime duration, const std::string& state,
- int minDuration, int maxDuration) {
+ SUMOTime minDuration, SUMOTime maxDuration) {
// build and add the phase definition to the list
myActivePhases.push_back(new MSPhaseDefinition(duration, minDuration, maxDuration, state));
// add phase duration to the absolute duration
diff --git a/src/netload/NLJunctionControlBuilder.h b/src/netload/NLJunctionControlBuilder.h
index 5ad2c7b..a715866 100644
--- a/src/netload/NLJunctionControlBuilder.h
+++ b/src/netload/NLJunctionControlBuilder.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Mon, 9 Jul 2001
-/// @version $Id: NLJunctionControlBuilder.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NLJunctionControlBuilder.h 18213 2015-04-16 11:55:42Z behrisch $
///
// Builder of microsim-junctions and tls
/****************************************************************************/
@@ -180,7 +180,7 @@ public:
* @todo min/max: maybe only one type of a phase definition should be built
*/
void addPhase(SUMOTime duration, const std::string& state,
- int min, int max);
+ SUMOTime min, SUMOTime max);
/** @brief Returns a previously build tls logic
diff --git a/src/netload/NLTriggerBuilder.cpp b/src/netload/NLTriggerBuilder.cpp
index bf9943e..32c738c 100644
--- a/src/netload/NLTriggerBuilder.cpp
+++ b/src/netload/NLTriggerBuilder.cpp
@@ -1,4 +1,4 @@
-/****************************************************************************/
+/****************************************************************************/
/// @file NLTriggerBuilder.cpp
/// @author Daniel Krajzewicz
/// @author Tino Morenz
@@ -7,7 +7,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Thu, 17 Oct 2002
-/// @version $Id: NLTriggerBuilder.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: NLTriggerBuilder.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Builds trigger objects for microsim
/****************************************************************************/
@@ -43,8 +43,8 @@
#include <microsim/trigger/MSLaneSpeedTrigger.h>
#include <microsim/trigger/MSTriggeredRerouter.h>
#include <microsim/trigger/MSCalibrator.h>
-#include <microsim/trigger/MSBusStop.h>
-#include <microsim/trigger/MSContainerStop.h>
+#include <microsim/MSStoppingPlace.h>
+#include <microsim/trigger/MSChrgStn.h>
#include <utils/common/StringTokenizer.h>
#include <utils/common/FileHelpers.h>
#include <utils/common/UtilExceptions.h>
@@ -155,6 +155,41 @@ NLTriggerBuilder::parseAndBuildLaneSpeedTrigger(MSNet& net, const SUMOSAXAttribu
}
}
+void
+NLTriggerBuilder::parseAndBuildChrgStn(MSNet& net, const SUMOSAXAttributes& attrs) {
+ bool ok = true;
+
+ // get the id, throw if not given or empty...
+ std::string id = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
+
+ if (!ok) {
+ throw ProcessError();
+ }
+
+ // get the lane
+ MSLane* lane = getLane(attrs, "chargingStation", id);
+
+ // get the positions
+ SUMOReal frompos = attrs.getOpt<SUMOReal>(SUMO_ATTR_STARTPOS, id.c_str(), ok, 0);
+ SUMOReal topos = attrs.getOpt<SUMOReal>(SUMO_ATTR_ENDPOS, id.c_str(), ok, lane->getLength());
+ SUMOReal chrgpower = attrs.getOpt<SUMOReal>(SUMO_ATTR_CHRGPOWER, id.c_str(), ok, 0);
+ SUMOReal efficiency = attrs.getOpt<SUMOReal>(SUMO_ATTR_EFFICIENCY, id.c_str(), ok, 0);
+ SUMOReal chargeInTransit = attrs.getOpt<SUMOReal>(SUMO_ATTR_CHRGINTRANSIT, id.c_str(), ok, 0);
+ SUMOReal ChargeDelay = attrs.getOpt<SUMOReal>(SUMO_ATTR_CHRGDELAY, id.c_str(), ok, 0);
+
+ const bool friendlyPos = attrs.getOpt<bool>(SUMO_ATTR_FRIENDLY_POS, id.c_str(), ok, false);
+
+ if (!ok || !myHandler->checkStopPos(frompos, topos, lane->getLength(), POSITION_EPS, friendlyPos)) {
+ throw InvalidArgument("Invalid position for Charging Station '" + id + "'.");
+ }
+
+ // get the lines
+ std::vector<std::string> lines;
+ SUMOSAXAttributes::parseStringVector(attrs.getOpt<std::string>(SUMO_ATTR_LINES, id.c_str(), ok, "", false), lines);
+
+ // build the Charging Station
+ buildChrgStn(net, id, lines, lane, frompos, topos, chrgpower, efficiency, chargeInTransit, ChargeDelay);
+}
void
NLTriggerBuilder::parseAndBuildBusStop(MSNet& net, const SUMOSAXAttributes& attrs) {
@@ -328,7 +363,7 @@ void
NLTriggerBuilder::buildBusStop(MSNet& net, const std::string& id,
const std::vector<std::string>& lines,
MSLane* lane, SUMOReal frompos, SUMOReal topos) {
- MSBusStop* stop = new MSBusStop(id, lines, *lane, frompos, topos);
+ MSStoppingPlace* stop = new MSStoppingPlace(id, lines, *lane, frompos, topos);
if (!net.addBusStop(stop)) {
delete stop;
throw InvalidArgument("Could not build bus stop '" + id + "'; probably declared twice.");
@@ -340,15 +375,25 @@ void
NLTriggerBuilder::buildContainerStop(MSNet& net, const std::string& id,
const std::vector<std::string>& lines,
MSLane* lane, SUMOReal frompos, SUMOReal topos) {
- MSContainerStop* stop = new MSContainerStop(id, lines, *lane, frompos, topos);
+ MSStoppingPlace* stop = new MSStoppingPlace(id, lines, *lane, frompos, topos);
if (!net.addContainerStop(stop)) {
delete stop;
throw InvalidArgument("Could not build container stop '" + id + "'; probably declared twice.");
}
}
+void
+NLTriggerBuilder::buildChrgStn(MSNet& net, const std::string& id,
+ const std::vector<std::string>& lines,
+ MSLane* lane, SUMOReal frompos, SUMOReal topos, SUMOReal chrgpower, SUMOReal efficiency, SUMOReal chargeInTransit, SUMOReal ChargeDelay) {
+ MSChrgStn* chrgStn = new MSChrgStn(id, lines, *lane, frompos, topos, chrgpower, efficiency, chargeInTransit, ChargeDelay);
+ if (!net.addChrgStn(chrgStn)) {
+ delete chrgStn;
+ throw InvalidArgument("Could not build Charging Station '" + id + "'; probably declared twice.");
+ }
+}
std::string
NLTriggerBuilder::getFileName(const SUMOSAXAttributes& attrs,
diff --git a/src/netload/NLTriggerBuilder.h b/src/netload/NLTriggerBuilder.h
index 0cce06a..391b16d 100644
--- a/src/netload/NLTriggerBuilder.h
+++ b/src/netload/NLTriggerBuilder.h
@@ -1,4 +1,4 @@
-/****************************************************************************/
+/****************************************************************************/
/// @file NLTriggerBuilder.h
/// @author Daniel Krajzewicz
/// @author Tino Morenz
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Thu, 17 Oct 2002
-/// @version $Id: NLTriggerBuilder.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: NLTriggerBuilder.h 18756 2015-08-31 19:16:33Z behrisch $
///
// Builds trigger objects for microsim
/****************************************************************************/
@@ -48,7 +48,7 @@ class NLHandler;
class MSTriggeredRerouter;
class MSLane;
class MSEdge;
-class MSBusStop;
+class MSStoppingPlace;
class MSCalibrator;
class MSRouteProbe;
@@ -150,6 +150,14 @@ public:
void parseAndBuildContainerStop(MSNet& net, const SUMOSAXAttributes& attrs);
+ /** @brief Parses his values and builds a charging station
+ *
+ * @param[in] net The network the charging station belongs to
+ * @param[in] attrs SAXattributes which define the trigger
+ * @exception InvalidArgument If a parameter (lane/position) is not valid
+ */
+ void parseAndBuildChrgStn(MSNet& net, const SUMOSAXAttributes& attrs);
+
/** @brief Parses his values and builds a mesoscopic or microscopic calibrator
*
* @param[in] net The network the calibrator belongs to
@@ -191,7 +199,7 @@ protected:
/** @brief Builds a bus stop
*
- * Simply calls the MSBusStop constructor.
+ * Simply calls the MSStoppingPlace constructor.
*
* @param[in] net The net the bus stop belongs to
* @param[in] id The id of the bus stop
@@ -205,10 +213,25 @@ protected:
const std::string& id, const std::vector<std::string>& lines,
MSLane* lane, SUMOReal frompos, SUMOReal topos);
+ /** @brief Builds a charging Station
+ *
+ * Simply calls the MSBusStop constructor.
+ *
+ * @param[in] net The net the charging Station belongs to
+ * @param[in] id The id of the charging Station
+ * @param[in] lines Names of the bus lines that halt on this charging Station
+ * @param[in] lane The lane the charging Station is placed on
+ * @param[in] frompos Begin position of the charging Station on the lane
+ * @param[in] topos End position of the charging Station on the lane
+ * @exception InvalidArgument If the charging Station can not be added to the net (is duplicate)
+ */
+ virtual void buildChrgStn(MSNet& net,
+ const std::string& id, const std::vector<std::string>& lines,
+ MSLane* lane, SUMOReal frompos, SUMOReal topos, SUMOReal chrgpower, SUMOReal efficiency, SUMOReal chargeInTransit, SUMOReal ChargeDelay);
/** @brief Builds a container stop
*
- * Simply calls the MSContainerStop constructor.
+ * Simply calls the MSStoppingPlace constructor.
*
* @param[in] net The net the container stop belongs to
* @param[in] id The id of the container stop
diff --git a/src/netwrite/NWWriter_SUMO.cpp b/src/netwrite/NWWriter_SUMO.cpp
index 5e51d89..6d358f7 100644
--- a/src/netwrite/NWWriter_SUMO.cpp
+++ b/src/netwrite/NWWriter_SUMO.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 04.05.2011
-/// @version $Id: NWWriter_SUMO.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: NWWriter_SUMO.cpp 18739 2015-08-27 06:48:48Z namdre $
///
// Exporter writing networks using the SUMO format
/****************************************************************************/
@@ -77,6 +77,9 @@ NWWriter_SUMO::writeNetwork(const OptionsCont& oc, NBNetBuilder& nb) {
// write network offsets and projection
GeoConvHelper::writeLocation(device);
+ // write edge types and restrictions
+ nb.getTypeCont().writeTypes(device);
+
// write inner lanes
bool origNames = oc.getBool("output.original-names");
if (!oc.getBool("no-internal-links")) {
@@ -170,8 +173,8 @@ NWWriter_SUMO::writeNetwork(const OptionsCont& oc, NBNetBuilder& nb) {
device.writeAttr(SUMO_ATTR_TO, (*it).nextCrossing);
device.writeAttr(SUMO_ATTR_FROM_LANE, 0);
device.writeAttr(SUMO_ATTR_TO_LANE, 0);
- if ((*it).tlID != "") {
- device.writeAttr(SUMO_ATTR_TLID, (*it).tlID);
+ if (node->isTLControlled()) {
+ device.writeAttr(SUMO_ATTR_TLID, (*node->getControllingTLS().begin())->getID());
assert(nextCrossing.tlLinkNo >= 0);
device.writeAttr(SUMO_ATTR_TLLINKINDEX, nextCrossing.tlLinkNo);
}
@@ -317,8 +320,8 @@ NWWriter_SUMO::writeEdge(OutputDevice& into, const NBEdge& e, bool noNames, bool
into.writeAttr(SUMO_ATTR_NAME, StringUtils::escapeXML(e.getStreetName()));
}
into.writeAttr(SUMO_ATTR_PRIORITY, e.getPriority());
- if (e.getTypeName() != "") {
- into.writeAttr(SUMO_ATTR_TYPE, e.getTypeName());
+ if (e.getTypeID() != "") {
+ into.writeAttr(SUMO_ATTR_TYPE, e.getTypeID());
}
if (e.isMacroscopicConnector()) {
into.writeAttr(SUMO_ATTR_FUNCTION, EDGEFUNC_CONNECTOR);
@@ -339,7 +342,7 @@ NWWriter_SUMO::writeEdge(OutputDevice& into, const NBEdge& e, bool noNames, bool
SUMOReal length = e.getLoadedLength();
if (OptionsCont::getOptions().getBool("no-internal-links") && !e.hasLoadedLength()) {
// use length to junction center even if a modified geometry was given
- PositionVector geom = e.getGeometry();
+ PositionVector geom = e.cutAtIntersection(e.getGeometry());
geom.push_back_noDoublePos(e.getToNode()->getCenter());
geom.push_front_noDoublePos(e.getFromNode()->getCenter());
length = geom.length();
@@ -369,7 +372,9 @@ NWWriter_SUMO::writeLane(OutputDevice& into, const std::string& eID, const std::
// the first lane of an edge will be the depart lane
into.writeAttr(SUMO_ATTR_INDEX, index);
// write the list of allowed/disallowed vehicle classes
- writePermissions(into, permissions);
+ if (permissions != SVC_UNSPECIFIED) {
+ writePermissions(into, permissions);
+ }
writePreferences(into, preferred);
// some further information
if (speed == 0) {
@@ -541,6 +546,9 @@ NWWriter_SUMO::writeConnection(OutputDevice& into, const NBEdge& from, const NBE
if (c.mayDefinitelyPass && style != TLL) {
into.writeAttr(SUMO_ATTR_PASS, c.mayDefinitelyPass);
}
+ if ((from.getToNode()->getKeepClear() == false || c.keepClear == false) && style != TLL) {
+ into.writeAttr<bool>(SUMO_ATTR_KEEP_CLEAR, false);
+ }
if (style != PLAIN) {
if (includeInternal) {
into.writeAttr(SUMO_ATTR_VIA, c.getInternalLaneID());
@@ -552,7 +560,7 @@ NWWriter_SUMO::writeConnection(OutputDevice& into, const NBEdge& from, const NBE
}
if (style == SUMONET) {
// write the direction information
- LinkDirection dir = from.getToNode()->getDirection(&from, c.toEdge);
+ LinkDirection dir = from.getToNode()->getDirection(&from, c.toEdge, OptionsCont::getOptions().getBool("lefthand"));
assert(dir != LINKDIR_NODIR);
into.writeAttr(SUMO_ATTR_DIR, toString(dir));
// write the state information
@@ -616,6 +624,8 @@ NWWriter_SUMO::writeRoundabouts(OutputDevice& into, const std::set<EdgeSet>& rou
for (std::set<EdgeSet>::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) {
std::vector<std::string> tEdgeIDs;
for (EdgeSet::const_iterator j = (*i).begin(); j != (*i).end(); ++j) {
+ // the edges may have been erased from NBEdgeCont but their pointers are still valid
+ // we verify their existance in writeRoundabout()
tEdgeIDs.push_back((*j)->getID());
}
std::sort(tEdgeIDs.begin(), tEdgeIDs.end());
@@ -756,38 +766,5 @@ NWWriter_SUMO::writeTrafficLights(OutputDevice& into, const NBTrafficLightLogicC
into.lf();
}
}
-
-
-void
-NWWriter_SUMO::writePermissions(OutputDevice& into, SVCPermissions permissions) {
- if (permissions == SVCAll) {
- return;
- } else if (permissions == 0) {
- into.writeAttr(SUMO_ATTR_DISALLOW, "all");
- return;
- } else {
- size_t num_allowed = 0;
- for (int mask = 1; mask <= SUMOVehicleClass_MAX; mask = mask << 1) {
- if ((mask & permissions) == mask) {
- ++num_allowed;
- }
- }
- if (num_allowed <= (SumoVehicleClassStrings.size() - num_allowed) && num_allowed > 0) {
- into.writeAttr(SUMO_ATTR_ALLOW, getVehicleClassNames(permissions));
- } else {
- into.writeAttr(SUMO_ATTR_DISALLOW, getVehicleClassNames(~permissions));
- }
- }
-}
-
-
-void
-NWWriter_SUMO::writePreferences(OutputDevice& into, SVCPermissions preferred) {
- if (preferred == SVCAll || preferred == 0) {
- return;
- } else {
- into.writeAttr(SUMO_ATTR_PREFER, getVehicleClassNames(preferred));
- }
-}
/****************************************************************************/
diff --git a/src/netwrite/NWWriter_SUMO.h b/src/netwrite/NWWriter_SUMO.h
index 45682a4..1daeefe 100644
--- a/src/netwrite/NWWriter_SUMO.h
+++ b/src/netwrite/NWWriter_SUMO.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 04.05.2011
-/// @version $Id: NWWriter_SUMO.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: NWWriter_SUMO.h 18432 2015-05-21 13:04:55Z behrisch $
///
// Exporter writing networks using the SUMO format
/****************************************************************************/
@@ -93,12 +93,6 @@ public:
/// @brief writes the traffic light logics to the given device
static void writeTrafficLights(OutputDevice& into, const NBTrafficLightLogicCont& tllCont);
- /// @brief writes allowed disallowed attributes if needed;
- static void writePermissions(OutputDevice& into, SVCPermissions permissions);
-
- /// @brief writes allowed disallowed attributes if needed;
- static void writePreferences(OutputDevice& into, SVCPermissions preferred);
-
/** @brief Writes roundabouts
* @param[in] into The device to write the edge into
* @param[in] roundaboutes The roundabouts to write
diff --git a/src/netwrite/NWWriter_XML.cpp b/src/netwrite/NWWriter_XML.cpp
index b28eb9e..b824f92 100644
--- a/src/netwrite/NWWriter_XML.cpp
+++ b/src/netwrite/NWWriter_XML.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 11.05.2011
-/// @version $Id: NWWriter_XML.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NWWriter_XML.cpp 18455 2015-05-27 20:44:31Z behrisch $
///
// Exporter writing networks using XML (native input) format
/****************************************************************************/
@@ -62,6 +62,9 @@ NWWriter_XML::writeNetwork(const OptionsCont& oc, NBNetBuilder& nb) {
// check whether plain-output files shall be generated
if (oc.isSet("plain-output-prefix")) {
writeNodes(oc, nb.getNodeCont());
+ if (nb.getTypeCont().size() > 0) {
+ writeTypes(oc, nb.getTypeCont());
+ }
writeEdgesAndConnections(oc, nb.getNodeCont(), nb.getEdgeCont());
writeTrafficLights(oc, nb.getTLLogicCont(), nb.getEdgeCont());
}
@@ -137,6 +140,9 @@ NWWriter_XML::writeNodes(const OptionsCont& oc, NBNodeCont& nc) {
if (n->getRadius() != NBNode::UNSPECIFIED_RADIUS) {
device.writeAttr(SUMO_ATTR_RADIUS, n->getRadius());
}
+ if (n->getKeepClear() == false) {
+ device.writeAttr<bool>(SUMO_ATTR_KEEP_CLEAR, n->getKeepClear());
+ }
device.closeTag();
}
device.close();
@@ -144,6 +150,15 @@ NWWriter_XML::writeNodes(const OptionsCont& oc, NBNodeCont& nc) {
void
+NWWriter_XML::writeTypes(const OptionsCont& oc, NBTypeCont& tc) {
+ OutputDevice& device = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".typ.xml");
+ device.writeXMLHeader("types", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/types_file.xsd\"");
+ tc.writeTypes(device);
+ device.close();
+}
+
+
+void
NWWriter_XML::writeEdgesAndConnections(const OptionsCont& oc, NBNodeCont& nc, NBEdgeCont& ec) {
const GeoConvHelper& gch = GeoConvHelper::getFinal();
bool useGeo = oc.exists("proj.plain-geo") && oc.getBool("proj.plain-geo");
@@ -153,7 +168,7 @@ NWWriter_XML::writeEdgesAndConnections(const OptionsCont& oc, NBNodeCont& nc, NB
edevice.writeXMLHeader("edges", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/edges_file.xsd\"");
OutputDevice& cdevice = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".con.xml");
cdevice.writeXMLHeader("connections", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/connections_file.xsd\"");
- bool noNames = !oc.getBool("output.street-names");
+ const bool writeNames = oc.getBool("output.street-names");
for (std::map<std::string, NBEdge*>::const_iterator i = ec.begin(); i != ec.end(); ++i) {
// write the edge itself to the edges-files
NBEdge* e = (*i).second;
@@ -161,7 +176,7 @@ NWWriter_XML::writeEdgesAndConnections(const OptionsCont& oc, NBNodeCont& nc, NB
edevice.writeAttr(SUMO_ATTR_ID, e->getID());
edevice.writeAttr(SUMO_ATTR_FROM, e->getFromNode()->getID());
edevice.writeAttr(SUMO_ATTR_TO, e->getToNode()->getID());
- if (!noNames && e->getStreetName() != "") {
+ if (writeNames && e->getStreetName() != "") {
edevice.writeAttr(SUMO_ATTR_NAME, StringUtils::escapeXML(e->getStreetName()));
}
edevice.writeAttr(SUMO_ATTR_PRIORITY, e->getPriority());
@@ -204,6 +219,9 @@ NWWriter_XML::writeEdgesAndConnections(const OptionsCont& oc, NBNodeCont& nc, NB
if (e->getEndOffset() != NBEdge::UNSPECIFIED_OFFSET && !e->hasLaneSpecificEndOffset()) {
edevice.writeAttr(SUMO_ATTR_ENDOFFSET, e->getEndOffset());
}
+ if (!e->hasLaneSpecificPermissions()) {
+ writePermissions(edevice, e->getPermissions(0));
+ }
if (!e->needsLaneSpecificOutput()) {
edevice.closeTag();
} else {
@@ -212,8 +230,10 @@ NWWriter_XML::writeEdgesAndConnections(const OptionsCont& oc, NBNodeCont& nc, NB
edevice.openTag(SUMO_TAG_LANE);
edevice.writeAttr(SUMO_ATTR_INDEX, i);
// write allowed lanes
- NWWriter_SUMO::writePermissions(edevice, lane.permissions);
- NWWriter_SUMO::writePreferences(edevice, lane.preferred);
+ if (e->hasLaneSpecificPermissions()) {
+ writePermissions(edevice, lane.permissions);
+ }
+ writePreferences(edevice, lane.preferred);
// write other attributes
if (lane.width != NBEdge::UNSPECIFIED_WIDTH && e->hasLaneSpecificWidth()) {
edevice.writeAttr(SUMO_ATTR_WIDTH, lane.width);
diff --git a/src/netwrite/NWWriter_XML.h b/src/netwrite/NWWriter_XML.h
index bb38e30..cb0f4d8 100644
--- a/src/netwrite/NWWriter_XML.h
+++ b/src/netwrite/NWWriter_XML.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 11.05.2011
-/// @version $Id: NWWriter_XML.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: NWWriter_XML.h 18432 2015-05-21 13:04:55Z behrisch $
///
// Exporter writing networks using XML (native input) format
/****************************************************************************/
@@ -87,6 +87,12 @@ private:
*/
static void writeNodes(const OptionsCont& oc, NBNodeCont& nc);
+ /** @brief Writes the types file
+ * @param[in] oc The options to use
+ * @param[in] nc The type-container from which to read data
+ */
+ static void writeTypes(const OptionsCont& oc, NBTypeCont& tc);
+
/** @brief Writes the edges and connections files
* @param[in] oc The options to use
* @param[in] nb The network build from which to read data
diff --git a/src/od/ODCell.h b/src/od/ODCell.h
index da3bb54..e8cbbee 100644
--- a/src/od/ODCell.h
+++ b/src/od/ODCell.h
@@ -4,7 +4,7 @@
/// @author Daniel Krajzewicz
/// @author Yun-Pang Floetteroed
/// @date Sept 2002
-/// @version $Id: ODCell.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ODCell.h 18534 2015-07-07 09:26:36Z behrisch $
///
// A single O/D-matrix cell
/****************************************************************************/
@@ -32,6 +32,10 @@
#include <config.h>
#endif
+#include <vector>
+#include <map>
+#include <utils/common/SUMOTime.h>
+
// ===========================================================================
// class declarations
@@ -50,8 +54,6 @@ class RORoute;
* and destination via string-ids of the district, the begin and the end time
* for which this cell is valid, the id of the vehicle type to use, and the
* amount of vehicles to insert during the described interval.
- *
- * @todo Check whether the vehicle type is used and makes sense herein
*/
struct ODCell {
/// @brief The number of vehicles
@@ -74,6 +76,9 @@ struct ODCell {
/// @brief the list of paths / routes
std::vector<RORoute*> pathsVector; // path_id, string of edges?
+
+ /// @brief mapping of departure times to departing vehicles, if already fixed
+ std::map<SUMOTime, std::vector<std::string> > departures;
};
diff --git a/src/od/ODDistrictCont.cpp b/src/od/ODDistrictCont.cpp
index 57958e9..794fa91 100644
--- a/src/od/ODDistrictCont.cpp
+++ b/src/od/ODDistrictCont.cpp
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Yun-Pang Floetteroed
/// @date Sept 2002
-/// @version $Id: ODDistrictCont.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ODDistrictCont.cpp 18280 2015-04-23 10:37:21Z behrisch $
///
// A container for districts
/****************************************************************************/
@@ -78,17 +78,20 @@ ODDistrictCont::getRandomSinkFromDistrict(const std::string& name) const {
void
-ODDistrictCont::loadDistricts(std::string districtfile) {
- if (!FileHelpers::isReadable(districtfile)) {
- throw ProcessError("Could not access network file '" + districtfile + "' to load.");
- }
- PROGRESS_BEGIN_MESSAGE("Loading districts from '" + districtfile + "'");
- // build the xml-parser and handler
- ODDistrictHandler handler(*this, districtfile);
- if (!XMLSubSys::runParser(handler, districtfile, true)) {
- PROGRESS_FAILED_MESSAGE();
- } else {
- PROGRESS_DONE_MESSAGE();
+ODDistrictCont::loadDistricts(std::vector<std::string> files) {
+ for (std::vector<std::string>::iterator i = files.begin(); i != files.end(); ++i) {
+ const std::string& districtfile = *i;
+ if (!FileHelpers::isReadable(districtfile)) {
+ throw ProcessError("Could not access network file '" + districtfile + "' to load.");
+ }
+ PROGRESS_BEGIN_MESSAGE("Loading districts from '" + districtfile + "'");
+ // build the xml-parser and handler
+ ODDistrictHandler handler(*this, districtfile);
+ if (!XMLSubSys::runParser(handler, districtfile, true)) {
+ PROGRESS_FAILED_MESSAGE();
+ } else {
+ PROGRESS_DONE_MESSAGE();
+ }
}
}
diff --git a/src/od/ODDistrictCont.h b/src/od/ODDistrictCont.h
index 18af000..70a1fc0 100644
--- a/src/od/ODDistrictCont.h
+++ b/src/od/ODDistrictCont.h
@@ -4,7 +4,7 @@
/// @author Yun-Pang Floetteroed
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: ODDistrictCont.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ODDistrictCont.h 18280 2015-04-23 10:37:21Z behrisch $
///
// A container for districts
/****************************************************************************/
@@ -89,8 +89,8 @@ public:
*/
std::string getRandomSinkFromDistrict(const std::string& name) const;
- /// @brief load districts from FILE
- void loadDistricts(std::string districtfile);
+ /// @brief load districts from files
+ void loadDistricts(std::vector<std::string> files);
/// @brief create districts from description
void makeDistricts(const std::map<std::string, std::pair<std::vector<std::string>, std::vector<std::string> > >& districts);
diff --git a/src/od/ODMatrix.cpp b/src/od/ODMatrix.cpp
index 19ccd89..1123b6b 100644
--- a/src/od/ODMatrix.cpp
+++ b/src/od/ODMatrix.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Yun-Pang Floetteroed
/// @date 05 Apr. 2006
-/// @version $Id: ODMatrix.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ODMatrix.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// An O/D (origin/destination) matrix
/****************************************************************************/
@@ -46,6 +46,7 @@
#include <utils/common/SUMOTime.h>
#include <utils/iodevices/OutputDevice.h>
#include <utils/importio/LineReader.h>
+#include <utils/xml/SUMOSAXHandler.h>
#include <utils/xml/XMLSubSys.h>
#include "ODAmitranHandler.h"
#include "ODMatrix.h"
@@ -104,10 +105,36 @@ ODMatrix::add(SUMOReal vehicleNumber, SUMOTime begin,
}
+void
+ODMatrix::add(const std::string& id, const SUMOTime depart,
+ const std::string& origin, const std::string& destination,
+ const std::string& vehicleType) {
+ // we start looking from the end because there is a high probability that the input is sorted by time
+ std::vector<ODCell*>::reverse_iterator cell = myContainer.rbegin();
+ for (; cell != myContainer.rend(); ++cell) {
+ if ((*cell)->begin <= depart && (*cell)->end > depart &&
+ (*cell)->origin == origin && (*cell)-> destination == destination &&
+ (*cell)->vehicleType == vehicleType) {
+ break;
+ }
+ }
+ if (cell == myContainer.rend()) {
+ const SUMOTime interval = string2time(OptionsCont::getOptions().getString("aggregation-interval"));
+ const int intervalIdx = (int)(depart / interval);
+ add(1., intervalIdx * interval, (intervalIdx + 1) * interval, origin, destination, vehicleType);
+ cell = myContainer.rbegin();
+ } else {
+ (*cell)->vehicleNumber += 1.;
+ }
+ (*cell)->departures[depart].push_back(id);
+}
+
+
SUMOReal
ODMatrix::computeDeparts(ODCell* cell,
size_t& vehName, std::vector<ODVehicle>& into,
- bool uniform, const std::string& prefix) {
+ const bool uniform, const bool differSourceSink,
+ const std::string& prefix) {
int vehicles2insert = (int) cell->vehicleNumber;
// compute whether the fraction forces an additional vehicle insertion
if (RandHelper::rand() < cell->vehicleNumber - (SUMOReal)vehicles2insert) {
@@ -127,9 +154,14 @@ ODMatrix::computeDeparts(ODCell* cell,
} else {
veh.depart = (SUMOTime)RandHelper::rand(cell->begin, cell->end);
}
-
- veh.from = myDistricts.getRandomSourceFromDistrict(cell->origin);
- veh.to = myDistricts.getRandomSinkFromDistrict(cell->destination);
+ const bool canDiffer = myDistricts.get(cell->origin)->sourceNumber() > 1 || myDistricts.get(cell->destination)->sinkNumber() > 1;
+ do {
+ veh.from = myDistricts.getRandomSourceFromDistrict(cell->origin);
+ veh.to = myDistricts.getRandomSinkFromDistrict(cell->destination);
+ } while (canDiffer && differSourceSink && (veh.to == veh.from));
+ if (!canDiffer && differSourceSink && (veh.to == veh.from)) {
+ WRITE_WARNING("Cannot find different source and sink edge for origin '" + cell->origin + "' and destination '" + cell->destination + "'.");
+ }
veh.cell = cell;
into.push_back(veh);
}
@@ -168,7 +200,8 @@ ODMatrix::writeDefaultAttrs(OutputDevice& dev, const bool noVtype,
void
ODMatrix::write(SUMOTime begin, const SUMOTime end,
- OutputDevice& dev, const bool uniform, const bool noVtype,
+ OutputDevice& dev, const bool uniform,
+ const bool differSourceSink, const bool noVtype,
const std::string& prefix, const bool stepLog) {
if (myContainer.size() == 0) {
return;
@@ -182,7 +215,7 @@ ODMatrix::write(SUMOTime begin, const SUMOTime end,
std::vector<ODVehicle> vehicles;
SUMOTime lastOut = -DELTA_T;
// go through the time steps
- for (SUMOTime t = begin; t != end;) {
+ for (SUMOTime t = begin; t < end;) {
if (stepLog && t - lastOut >= DELTA_T) {
std::cout << "Parsing time " + time2string(t) << '\r';
lastOut = t;
@@ -198,7 +231,7 @@ ODMatrix::write(SUMOTime begin, const SUMOTime end,
}
// get the new departures (into tmp)
const size_t oldSize = vehicles.size();
- const SUMOReal fraction = computeDeparts(*next, vehName, vehicles, uniform, prefix);
+ const SUMOReal fraction = computeDeparts(*next, vehName, vehicles, uniform, differSourceSink, prefix);
if (oldSize != vehicles.size()) {
changed = true;
}
@@ -473,6 +506,7 @@ ODMatrix::applyCurve(const Distribution_Points& ps) {
}
}
+
void
ODMatrix::loadMatrix(OptionsCont& oc) {
std::vector<std::string> files = oc.getStringVector("od-matrix-files");
@@ -519,6 +553,23 @@ ODMatrix::loadMatrix(OptionsCont& oc) {
}
+void
+ODMatrix::loadRoutes(OptionsCont& oc, SUMOSAXHandler& handler) {
+ std::vector<std::string> routeFiles = oc.getStringVector("route-files");
+ for (std::vector<std::string>::iterator i = routeFiles.begin(); i != routeFiles.end(); ++i) {
+ if (!FileHelpers::isReadable(*i)) {
+ throw ProcessError("Could not access route file '" + *i + "' to load.");
+ }
+ PROGRESS_BEGIN_MESSAGE("Loading routes and trips from '" + *i + "'");
+ if (!XMLSubSys::runParser(handler, *i)) {
+ PROGRESS_FAILED_MESSAGE();
+ } else {
+ PROGRESS_DONE_MESSAGE();
+ }
+ }
+}
+
+
Distribution_Points
ODMatrix::parseTimeLine(const std::vector<std::string>& def, bool timelineDayInHours) {
bool interpolating = !timelineDayInHours;
diff --git a/src/od/ODMatrix.h b/src/od/ODMatrix.h
index eccede5..a51120c 100644
--- a/src/od/ODMatrix.h
+++ b/src/od/ODMatrix.h
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Yun-Pang Floetteroed
/// @date 05. Apr. 2006
-/// @version $Id: ODMatrix.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ODMatrix.h 18586 2015-08-03 06:44:47Z namdre $
///
// An O/D (origin/destination) matrix
/****************************************************************************/
@@ -51,6 +51,7 @@
// class declarations
// ===========================================================================
class OutputDevice;
+class SUMOSAXHandler;
// ===========================================================================
@@ -109,6 +110,21 @@ public:
SUMOTime end, const std::string& origin, const std::string& destination,
const std::string& vehicleType);
+ /** @brief Adds a single vehicle with departure time
+ *
+ * If there is no existing ODCell for the given parameters one is generated
+ * using add(...)
+ *
+ * @param[in] id The id of the vehicle
+ * @param[in] depart The departure time of the vehicle
+ * @param[in] origin The origin district to use for the cell's flows
+ * @param[in] destination The destination district to use for the cell's flows
+ * @param[in] vehicleType The vehicle type to use for the cell's flows
+ */
+ void add(const std::string& id, const SUMOTime depart,
+ const std::string& origin, const std::string& destination,
+ const std::string& vehicleType);
+
/** @brief Helper function for flow and trip output writing the depart
* and arrival attributes
*
@@ -139,12 +155,14 @@ public:
* @param[in] end The end time to generate vehicles for
* @param[in] dev The stream to write the generated vehicle trips to
* @param[in] uniform Information whether departure times shallbe uniformly spread or random
+ * @param[in] differSourceSink whether source and sink shall be different edges
* @param[in] noVtype Whether vtype information shall not be written
* @param[in] prefix A prefix for the vehicle names
* @param[in] stepLog Whether processed time shall be written
*/
void write(SUMOTime begin, const SUMOTime end,
- OutputDevice& dev, const bool uniform, const bool noVtype,
+ OutputDevice& dev, const bool uniform,
+ const bool differSourceSink, const bool noVtype,
const std::string& prefix, const bool stepLog);
@@ -206,11 +224,16 @@ public:
void readV(LineReader& lr, SUMOReal scale,
std::string vehType, bool matrixHasVehType);
- /** @brief read a VISUM-matrix with the V Format
+ /** @brief read a matrix in one of several formats
* @todo Describe
*/
void loadMatrix(OptionsCont& oc);
+ /** @brief read SUMO routes
+ * @todo Describe
+ */
+ void loadRoutes(OptionsCont& oc, SUMOSAXHandler& handler);
+
/** @brief split the given timeline
* @todo Describe
*/
@@ -261,11 +284,13 @@ protected:
* @param[in,out] vehName An incremented index of the generated vehicle
* @param[out] into The storage to put generated vehicles into
* @param[in] uniform Information whether departure times shallbe uniformly spread or random
+ * @param[in] differSourceSink whether source and sink shall be different edges
* @param[in] prefix A prefix for the vehicle names
* @return The number of left vehicles to insert
*/
SUMOReal computeDeparts(ODCell* cell,
- size_t& vehName, std::vector<ODVehicle>& into, bool uniform,
+ size_t& vehName, std::vector<ODVehicle>& into,
+ const bool uniform, const bool differSourceSink,
const std::string& prefix);
diff --git a/src/od2trips_main.cpp b/src/od2trips_main.cpp
index c0c8655..07c46ab 100644
--- a/src/od2trips_main.cpp
+++ b/src/od2trips_main.cpp
@@ -6,7 +6,7 @@
/// @author Laura Bieker
/// @author Yun-Pang Floetteroed
/// @date Thu, 12 September 2002
-/// @version $Id: od2trips_main.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: od2trips_main.cpp 18586 2015-08-03 06:44:47Z namdre $
///
// Main for OD2TRIPS
/****************************************************************************/
@@ -88,9 +88,11 @@ fillOptions() {
// register the file input options
- oc.doRegister("net-file", 'n', new Option_FileName());
- oc.addSynonyme("net-file", "net");
- oc.addDescription("net-file", "Input", "Loads network (districts) from FILE");
+ oc.doRegister("taz-files", 'n', new Option_FileName());
+ oc.addSynonyme("taz-files", "taz");
+ oc.addSynonyme("taz-files", "net-file");
+ oc.addSynonyme("taz-files", "net");
+ oc.addDescription("taz-files", "Input", "Loads TAZ (districts; also from networks) from FILE(s)");
oc.doRegister("od-matrix-files", 'd', new Option_FileName());
oc.addSynonyme("od-matrix-files", "od-files");
@@ -131,6 +133,9 @@ fillOptions() {
oc.doRegister("spread.uniform", new Option_Bool(false));
oc.addDescription("spread.uniform", "Processing", "Spreads trips uniformly over each time period");
+ oc.doRegister("different-source-sink", new Option_Bool(false));
+ oc.addDescription("different-source-sink", "Processing", "Always choose source and sink edge which are not identical");
+
oc.doRegister("vtype", new Option_String(""));
oc.addDescription("vtype", "Processing", "Defines the name of the vehicle type to use");
@@ -178,8 +183,8 @@ bool
checkOptions() {
OptionsCont& oc = OptionsCont::getOptions();
bool ok = true;
- if (!oc.isSet("net-file")) {
- WRITE_ERROR("No net input file (-n) specified.");
+ if (!oc.isSet("taz-files")) {
+ WRITE_ERROR("No TAZ input file (-n) specified.");
ok = false;
}
if (!oc.isSet("od-matrix-files") && !oc.isSet("od-amitran-files")) {
@@ -237,7 +242,8 @@ main(int argc, char** argv) {
// initialise subsystems
XMLSubSys::init();
fillOptions();
- OptionsIO::getOptions(true, argc, argv);
+ OptionsIO::setArgs(argc, argv);
+ OptionsIO::getOptions();
if (oc.processMetaOptions(argc < 2)) {
SystemFrame::close();
return 0;
@@ -250,12 +256,12 @@ main(int argc, char** argv) {
RandHelper::initRandGlobal();
// load the districts
// check whether the user gave a net filename
- if (!oc.isSet("net-file")) {
- throw ProcessError("You must supply a network or districts file ('-n').");
+ if (!oc.isSet("taz-files")) {
+ throw ProcessError("You must supply a TAZ, network or districts file ('-n').");
}
// get the file name and set it
ODDistrictCont districts;
- districts.loadDistricts(oc.getString("net-file"));
+ districts.loadDistricts(oc.getStringVector("taz-files"));
if (districts.size() == 0) {
throw ProcessError("No districts loaded.");
}
@@ -278,7 +284,8 @@ main(int argc, char** argv) {
if (OutputDevice::createDeviceByOption("output-file", "routes", "routes_file.xsd")) {
matrix.write(string2time(oc.getString("begin")), string2time(oc.getString("end")),
OutputDevice::getDeviceByOption("output-file"),
- oc.getBool("spread.uniform"), oc.getBool("ignore-vehicle-type"),
+ oc.getBool("spread.uniform"), oc.getBool("different-source-sink"),
+ oc.getBool("ignore-vehicle-type"),
oc.getString("prefix"), !oc.getBool("no-step-log"));
haveOutput = true;
}
diff --git a/src/polyconvert/PCLoaderArcView.cpp b/src/polyconvert/PCLoaderArcView.cpp
index ce89c72..5eeeaea 100644
--- a/src/polyconvert/PCLoaderArcView.cpp
+++ b/src/polyconvert/PCLoaderArcView.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: PCLoaderArcView.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: PCLoaderArcView.cpp 18752 2015-08-30 19:09:05Z namdre $
///
// A reader of pois and polygons from shape files
/****************************************************************************/
@@ -84,8 +84,13 @@ PCLoaderArcView::load(const std::string& file, OptionsCont& oc, PCPolyContainer&
bool useRunningID = oc.getBool("shapefile.use-running-id");
// start parsing
std::string shpName = file + ".shp";
+#if GDAL_VERSION_MAJOR < 2
OGRRegisterAll();
OGRDataSource* poDS = OGRSFDriverRegistrar::Open(shpName.c_str(), FALSE);
+#else
+ GDALAllRegister();
+ GDALDataset* poDS = (GDALDataset*) GDALOpen(shpName.c_str(), GA_ReadOnly);
+#endif
if (poDS == NULL) {
throw ProcessError("Could not open shape description '" + shpName + "'.");
}
diff --git a/src/polyconvert/PCLoaderOSM.cpp b/src/polyconvert/PCLoaderOSM.cpp
index 06a61c2..3772e12 100644
--- a/src/polyconvert/PCLoaderOSM.cpp
+++ b/src/polyconvert/PCLoaderOSM.cpp
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Melanie Knocke
/// @date Wed, 19.11.2008
-/// @version $Id: PCLoaderOSM.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: PCLoaderOSM.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// A reader of pois and polygons stored in OSM-format
/****************************************************************************/
@@ -103,7 +103,7 @@ PCLoaderOSM::loadIfSet(OptionsCont& oc, PCPolyContainer& toFill,
// parse file(s)
std::vector<std::string> files = oc.getStringVector("osm-files");
// load nodes, first
- std::map<SUMOLong, PCOSMNode*> nodes;
+ std::map<long long int, PCOSMNode*> nodes;
bool withAttributes = oc.getBool("all-attributes");
MsgHandler* m = OptionsCont::getOptions().getBool("ignore-errors") ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance();
NodesHandler nodesHandler(nodes, withAttributes, *m);
@@ -119,9 +119,20 @@ PCLoaderOSM::loadIfSet(OptionsCont& oc, PCPolyContainer& toFill,
}
PROGRESS_DONE_MESSAGE();
}
- // load edges, then
- std::map<std::string, PCOSMEdge*> edges;
- EdgesHandler edgesHandler(nodes, edges, withAttributes, *m);
+ // load relations to see which additional ways may be relevant
+ Relations relations;
+ RelationsMap additionalWays;
+ RelationsHandler relationsHandler(additionalWays, relations, withAttributes, *m);
+ for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
+ // edges
+ PROGRESS_BEGIN_MESSAGE("Parsing relations from osm-file '" + *file + "'");
+ XMLSubSys::runParser(relationsHandler, *file);
+ PROGRESS_DONE_MESSAGE();
+ }
+
+ // load ways
+ EdgeMap edges;
+ EdgesHandler edgesHandler(nodes, edges, additionalWays, withAttributes, *m);
for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
// edges
PROGRESS_BEGIN_MESSAGE("Parsing edges from osm-file '" + *file + "'");
@@ -132,23 +143,23 @@ PCLoaderOSM::loadIfSet(OptionsCont& oc, PCPolyContainer& toFill,
// build all
const bool useName = oc.getBool("osm.use-name");
// instatiate polygons
- for (std::map<std::string, PCOSMEdge*>::iterator i = edges.begin(); i != edges.end(); ++i) {
+ for (EdgeMap::iterator i = edges.begin(); i != edges.end(); ++i) {
PCOSMEdge* e = (*i).second;
if (e->myAttributes.size() == 0) {
// cannot be relevant as a polygon
continue;
}
if (e->myCurrentNodes.size() == 0) {
- WRITE_ERROR("Polygon '" + e->id + "' has no shape.");
+ WRITE_ERROR("Polygon '" + toString(e->id) + "' has no shape.");
continue;
}
// compute shape
PositionVector vec;
- for (std::vector<SUMOLong>::iterator j = e->myCurrentNodes.begin(); j != e->myCurrentNodes.end(); ++j) {
+ for (std::vector<long long int>::iterator j = e->myCurrentNodes.begin(); j != e->myCurrentNodes.end(); ++j) {
PCOSMNode* n = nodes.find(*j)->second;
Position pos(n->lon, n->lat);
if (!GeoConvHelper::getProcessing().x2cartesian(pos)) {
- WRITE_WARNING("Unable to project coordinates for polygon '" + e->id + "'.");
+ WRITE_WARNING("Unable to project coordinates for polygon '" + toString(e->id) + "'.");
}
vec.push_back_noDoublePos(pos);
}
@@ -176,7 +187,7 @@ PCLoaderOSM::loadIfSet(OptionsCont& oc, PCPolyContainer& toFill,
// instantiate pois
- for (std::map<SUMOLong, PCOSMNode*>::iterator i = nodes.begin(); i != nodes.end(); ++i) {
+ for (std::map<long long int, PCOSMNode*>::iterator i = nodes.begin(); i != nodes.end(); ++i) {
PCOSMNode* n = (*i).second;
if (n->myAttributes.size() == 0) {
// cannot be relevant as a poi
@@ -208,13 +219,17 @@ PCLoaderOSM::loadIfSet(OptionsCont& oc, PCPolyContainer& toFill,
}
}
// delete nodes
- for (std::map<SUMOLong, PCOSMNode*>::const_iterator i = nodes.begin(); i != nodes.end(); ++i) {
+ for (std::map<long long int, PCOSMNode*>::const_iterator i = nodes.begin(); i != nodes.end(); ++i) {
delete(*i).second;
}
// delete edges
- for (std::map<std::string, PCOSMEdge*>::iterator i = edges.begin(); i != edges.end(); ++i) {
+ for (EdgeMap::iterator i = edges.begin(); i != edges.end(); ++i) {
delete(*i).second;
}
+ // delete relations
+ for (Relations::iterator i = relations.begin(); i != relations.end(); ++i) {
+ delete(*i);
+ }
}
@@ -225,7 +240,7 @@ PCLoaderOSM::addPolygon(const PCOSMEdge* edge, const PositionVector& vec, const
} else {
const bool closedShape = vec.front() == vec.back();
const std::string idSuffix = (index == 0 ? "" : "#" + toString(index));
- const std::string id = def.prefix + (useName && edge->name != "" ? edge->name : edge->id) + idSuffix;
+ const std::string id = def.prefix + (useName && edge->name != "" ? edge->name : toString(edge->id)) + idSuffix;
Polygon* poly = new Polygon(
StringUtils::escapeXML(id),
StringUtils::escapeXML(OptionsCont::getOptions().getBool("osm.keep-full-type") ? fullType : def.id),
@@ -268,7 +283,7 @@ PCLoaderOSM::addPOI(const PCOSMNode* node, const Position& pos, const PCTypeMap:
// ---------------------------------------------------------------------------
// definitions of PCLoaderOSM::NodesHandler-methods
// ---------------------------------------------------------------------------
-PCLoaderOSM::NodesHandler::NodesHandler(std::map<SUMOLong, PCOSMNode*>& toFill,
+PCLoaderOSM::NodesHandler::NodesHandler(std::map<long long int, PCOSMNode*>& toFill,
bool withAttributes, MsgHandler& errorHandler) :
SUMOSAXHandler("osm - file"), myWithAttributes(withAttributes), myErrorHandler(errorHandler),
myToFill(toFill), myLastNodeID(-1) {}
@@ -282,7 +297,7 @@ PCLoaderOSM::NodesHandler::myStartElement(int element, const SUMOSAXAttributes&
myParentElements.push_back(element);
if (element == SUMO_TAG_NODE) {
bool ok = true;
- SUMOLong id = attrs.get<SUMOLong>(SUMO_ATTR_ID, 0, ok);
+ long long int id = attrs.get<long long int>(SUMO_ATTR_ID, 0, ok);
if (!ok) {
return;
}
@@ -330,15 +345,107 @@ PCLoaderOSM::NodesHandler::myEndElement(int element) {
// ---------------------------------------------------------------------------
-// definitions of PCLoaderOSM::EdgesHandler-methods
+// definitions of PCLoaderOSM::RelationsHandler-methods
// ---------------------------------------------------------------------------
-PCLoaderOSM::EdgesHandler::EdgesHandler(const std::map<SUMOLong, PCOSMNode*>& osmNodes,
- std::map<std::string, PCOSMEdge*>& toFill, bool withAttributes, MsgHandler& errorHandler)
- : SUMOSAXHandler("osm - file"), myWithAttributes(withAttributes), myErrorHandler(errorHandler),
- myOSMNodes(osmNodes), myEdgeMap(toFill) {
+PCLoaderOSM::RelationsHandler::RelationsHandler(RelationsMap& additionalWays,
+ Relations& relations,
+ bool withAttributes,
+ MsgHandler& errorHandler) :
+ SUMOSAXHandler("osm - file"),
+ myAdditionalWays(additionalWays),
+ myRelations(relations),
+ myWithAttributes(withAttributes),
+ myErrorHandler(errorHandler),
+ myCurrentRelation(0)
+{ }
+
+
+PCLoaderOSM::RelationsHandler::~RelationsHandler() {
+}
+
+
+void
+PCLoaderOSM::RelationsHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) {
+ myParentElements.push_back(element);
+ // parse "relation" elements
+ if (element == SUMO_TAG_RELATION) {
+ bool ok = true;
+ myCurrentWays.clear();
+ std::string action = attrs.hasAttribute("action") ? attrs.getStringSecure("action", "") : "";
+ if (action == "delete" || !ok) {
+ myCurrentRelation = 0;
+ }
+ myCurrentRelation = new PCOSMRelation();
+ myCurrentRelation->id = attrs.get<long long int>(SUMO_ATTR_ID, 0, ok);
+ myRelations.push_back(myCurrentRelation);
+ return;
+ } else if (myCurrentRelation == 0) {
+ return;
+ }
+ // parse member elements
+ if (element == SUMO_TAG_MEMBER) {
+ bool ok = true;
+ std::string role = attrs.hasAttribute("role") ? attrs.getStringSecure("role", "") : "";
+ long long int ref = attrs.get<long long int>(SUMO_ATTR_REF, 0, ok);
+ if (role == "outer" || role == "inner") {
+ std::string memberType = attrs.get<std::string>(SUMO_ATTR_TYPE, 0, ok);
+ if (memberType == "way") {
+ myCurrentWays.push_back(ref);
+ }
+ }
+ return;
+ }
+ // parse values
+ if (element == SUMO_TAG_TAG && myParentElements.size() > 2 && myParentElements[myParentElements.size() - 2] == SUMO_TAG_RELATION
+ && myCurrentRelation != 0) {
+ bool ok = true;
+ std::string key = attrs.getOpt<std::string>(SUMO_ATTR_K, toString(myCurrentRelation).c_str(), ok, "", false);
+ std::string value = attrs.getOpt<std::string>(SUMO_ATTR_V, toString(myCurrentRelation).c_str(), ok, "", false);
+ if (key == "") {
+ myErrorHandler.inform("Empty key in a a tag while parsing way '" + toString(myCurrentRelation) + "' occured.");
+ ok = false;
+ }
+ if (!ok) {
+ return;
+ }
+ if (key == "name") {
+ myCurrentRelation->name = value;
+ } else if (MyKeysToInclude.count(key) > 0) {
+ for (std::vector<long long int>::iterator it = myCurrentWays.begin(); it != myCurrentWays.end(); ++it) {
+ myAdditionalWays[*it] = myCurrentRelation;
+ }
+ }
+ myCurrentRelation->myAttributes[key] = value;
+ }
}
+void
+PCLoaderOSM::RelationsHandler::myEndElement(int element) {
+ myParentElements.pop_back();
+ if (element == SUMO_TAG_RELATION) {
+ myCurrentRelation = 0;
+ myCurrentWays.clear();
+ }
+}
+
+
+// ---------------------------------------------------------------------------
+// definitions of PCLoaderOSM::EdgesHandler-methods
+// ---------------------------------------------------------------------------
+PCLoaderOSM::EdgesHandler::EdgesHandler(const std::map<long long int, PCOSMNode*>& osmNodes,
+ EdgeMap& toFill,
+ const RelationsMap& additionalWays,
+ bool withAttributes, MsgHandler& errorHandler) :
+ SUMOSAXHandler("osm - file"),
+ myWithAttributes(withAttributes),
+ myErrorHandler(errorHandler),
+ myOSMNodes(osmNodes),
+ myEdgeMap(toFill),
+ myAdditionalWays(additionalWays)
+{ }
+
+
PCLoaderOSM::EdgesHandler::~EdgesHandler() {
}
@@ -349,19 +456,19 @@ PCLoaderOSM::EdgesHandler::myStartElement(int element, const SUMOSAXAttributes&
// parse "way" elements
if (element == SUMO_TAG_WAY) {
bool ok = true;
- std::string id = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
+ long long int id = attrs.get<long long int>(SUMO_ATTR_ID, 0, ok);
if (!ok) {
return;
}
myCurrentEdge = new PCOSMEdge();
myCurrentEdge->id = id;
myCurrentEdge->myIsClosed = false;
- myKeep = false;
+ myKeep = (myAdditionalWays.find(id) != myAdditionalWays.end());
}
// parse "nd" (node) elements
if (element == SUMO_TAG_ND) {
bool ok = true;
- SUMOLong ref = attrs.get<SUMOLong>(SUMO_ATTR_REF, 0, ok);
+ long long int ref = attrs.get<long long int>(SUMO_ATTR_REF, 0, ok);
if (ok) {
if (myOSMNodes.find(ref) == myOSMNodes.end()) {
WRITE_WARNING("The referenced geometry information (ref='" + toString(ref) + "') is not known");
@@ -398,6 +505,10 @@ PCLoaderOSM::EdgesHandler::myEndElement(int element) {
myParentElements.pop_back();
if (element == SUMO_TAG_WAY) {
if (myKeep) {
+ RelationsMap::const_iterator it = myAdditionalWays.find(myCurrentEdge->id);
+ if (it != myAdditionalWays.end()) {
+ myCurrentEdge->myAttributes.insert((*it).second->myAttributes.begin(), (*it).second->myAttributes.end());
+ }
myEdgeMap[myCurrentEdge->id] = myCurrentEdge;
} else {
delete myCurrentEdge;
diff --git a/src/polyconvert/PCLoaderOSM.h b/src/polyconvert/PCLoaderOSM.h
index a81ea23..28405f1 100644
--- a/src/polyconvert/PCLoaderOSM.h
+++ b/src/polyconvert/PCLoaderOSM.h
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Melanie Knocke
/// @date Wed, 19.11.2008
-/// @version $Id: PCLoaderOSM.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: PCLoaderOSM.h 18756 2015-08-31 19:16:33Z behrisch $
///
// A reader of pois and polygons stored in OSM-format
/****************************************************************************/
@@ -72,11 +72,12 @@ public:
protected:
+
/** @brief An internal representation of an OSM-node
*/
struct PCOSMNode {
/// @brief The node's id
- SUMOLong id;
+ long long int id;
/// @brief The longitude the node is located at
SUMOReal lon;
/// @brief The latitude the node is located at
@@ -86,21 +87,37 @@ protected:
};
+ /** @brief An internal definition of a loaded relation
+ */
+ struct PCOSMRelation {
+ /// @brief The relation's id
+ long long int id;
+ /// @brief The relation's name (if any)
+ std::string name;
+ /// @brief Additional attributes
+ std::map<std::string, std::string> myAttributes;
+ };
+
+
/** @brief An internal definition of a loaded edge
*/
struct PCOSMEdge {
/// @brief The edge's id
- std::string id;
+ long long int id;
/// @brief The edge's name (if any)
std::string name;
/// @brief Information whether this area is closed
bool myIsClosed;
/// @brief The list of nodes this edge is made of
- std::vector<SUMOLong> myCurrentNodes;
+ std::vector<long long int> myCurrentNodes;
/// @brief Additional attributes
std::map<std::string, std::string> myAttributes;
};
+ typedef std::vector<PCOSMRelation*> Relations;
+ typedef std::map<long long int, PCOSMRelation*> RelationsMap;
+ typedef std::map<long long int, PCOSMEdge*> EdgeMap;
+
protected:
/// @brief try add the polygon and return the next index on success
static int addPolygon(const PCOSMEdge* edge, const PositionVector& vec, const PCTypeMap::TypeDef& def,
@@ -130,7 +147,7 @@ protected:
* @param[in] withAttributes Whether all attributes shall be stored
* @param[in] errorHandler The handler to report errors to (WarningHandler for ignoring errors)
*/
- NodesHandler(std::map<SUMOLong, PCOSMNode*>& toFill, bool withAttributes,
+ NodesHandler(std::map<long long int, PCOSMNode*>& toFill, bool withAttributes,
MsgHandler& errorHandler);
@@ -170,13 +187,13 @@ protected:
MsgHandler& myErrorHandler;
/// @brief The nodes container to fill
- std::map<SUMOLong, PCOSMNode*>& myToFill;
+ std::map<long long int, PCOSMNode*>& myToFill;
/// @brief Current path in order to know to what occuring values belong
std::vector<int> myParentElements;
/// @brief The id of the last parsed node
- SUMOLong myLastNodeID;
+ long long int myLastNodeID;
private:
/// @brief Invalidated copy constructor
@@ -187,6 +204,86 @@ protected:
};
+ /**
+ * @class RelationsHandler
+ * @brief A class which extracts relevant way-ids from relations in a parsed OSM-file
+ */
+ class RelationsHandler : public SUMOSAXHandler {
+ public:
+ /** @brief Constructor
+ *
+ * @param[in] osmNodes The previously parsed (osm-)nodes
+ * @param[in] toFill The edges container to fill with read edges
+ * @param[in] withAttributes Whether all attributes shall be stored
+ * @param[in] errorHandler The handler to report errors to (WarningHandler for ignoring errors)
+ */
+ RelationsHandler(RelationsMap& additionalWays,
+ Relations& relations,
+ bool withAttributes,
+ MsgHandler& errorHandler);
+
+
+ /// @brief Destructor
+ ~RelationsHandler();
+
+
+ protected:
+ /// @name inherited from GenericSAXHandler
+ //@{
+
+ /** @brief Called on the opening of a tag;
+ *
+ * @param[in] element ID of the currently opened element
+ * @param[in] attrs Attributes within the currently opened element
+ * @exception ProcessError If something fails
+ * @see GenericSAXHandler::myStartElement
+ */
+ void myStartElement(int element, const SUMOSAXAttributes& attrs);
+
+
+ /** @brief Called when a closing tag occurs
+ *
+ * @param[in] element ID of the currently opened element
+ * @exception ProcessError If something fails
+ * @see GenericSAXHandler::myEndElement
+ */
+ void myEndElement(int element);
+ //@}
+
+
+ private:
+ /// @brief additional ways which are reference by relations
+ RelationsMap& myAdditionalWays;
+
+ /// @brief the loaded relations
+ Relations& myRelations;
+
+ /// @brief Whether all attributes shall be stored
+ bool myWithAttributes;
+
+ /// @brief The handler to report errors to (will be the WarningsHandler if --ignore-errors was set)
+ MsgHandler& myErrorHandler;
+
+ /// @brief The currently parsed relation
+ PCOSMRelation* myCurrentRelation;
+
+ /// @brief the ways within the current relation
+ std::vector<long long int> myCurrentWays;
+
+ /// @brief Current path in order to know to what occuring values belong
+ std::vector<long long int> myParentElements;
+
+ /// @brief whether the last edge (way) should be kept because it had a key from the inclusion list
+ bool myKeep;
+
+ private:
+ /// @brief Invalidated copy constructor
+ RelationsHandler(const RelationsHandler& s);
+
+ /// @brief Invalidated assignment operator
+ RelationsHandler& operator=(const RelationsHandler& s);
+
+ };
/**
@@ -200,10 +297,13 @@ protected:
* @param[in] osmNodes The previously parsed (osm-)nodes
* @param[in] toFill The edges container to fill with read edges
* @param[in] withAttributes Whether all attributes shall be stored
+ * @param[in] additionalWays Additional ways which were identified as polygons to import
* @param[in] errorHandler The handler to report errors to (WarningHandler for ignoring errors)
*/
- EdgesHandler(const std::map<SUMOLong, PCOSMNode*>& osmNodes,
- std::map<std::string, PCOSMEdge*>& toFill, bool withAttributes,
+ EdgesHandler(const std::map<long long int, PCOSMNode*>& osmNodes,
+ EdgeMap& toFill,
+ const RelationsMap& additionalWays,
+ bool withAttributes,
MsgHandler& errorHandler);
@@ -243,10 +343,13 @@ protected:
MsgHandler& myErrorHandler;
/// @brief The previously parsed nodes
- const std::map<SUMOLong, PCOSMNode*>& myOSMNodes;
+ const std::map<long long int, PCOSMNode*>& myOSMNodes;
/// @brief A map of built edges
- std::map<std::string, PCOSMEdge*>& myEdgeMap;
+ EdgeMap& myEdgeMap;
+
+ /// @brief additional ways which are reference by relations
+ const RelationsMap& myAdditionalWays;
/// @brief The currently built edge
PCOSMEdge* myCurrentEdge;
diff --git a/src/polyconvert/PCLoaderVisum.cpp b/src/polyconvert/PCLoaderVisum.cpp
index 5bd63d4..9255a6a 100644
--- a/src/polyconvert/PCLoaderVisum.cpp
+++ b/src/polyconvert/PCLoaderVisum.cpp
@@ -5,7 +5,7 @@
/// @author Christoph Sommer
/// @author Michael Behrisch
/// @date Thu, 02.11.2006
-/// @version $Id: PCLoaderVisum.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: PCLoaderVisum.cpp 18239 2015-04-20 11:37:12Z behrisch $
///
// A reader of pois and polygons stored in VISUM-format
/****************************************************************************/
@@ -87,10 +87,10 @@ PCLoaderVisum::load(const std::string& file, OptionsCont& oc, PCPolyContainer& t
PCTypeMap& tm) {
GeoConvHelper& geoConvHelper = GeoConvHelper::getProcessing();
std::string what;
- std::map<SUMOLong, Position> punkte;
- std::map<SUMOLong, PositionVector> kanten;
- std::map<SUMOLong, PositionVector> teilflaechen;
- std::map<SUMOLong, SUMOLong> flaechenelemente;
+ std::map<long long int, Position> punkte;
+ std::map<long long int, PositionVector> kanten;
+ std::map<long long int, PositionVector> teilflaechen;
+ std::map<long long int, long long int> flaechenelemente;
NamedColumnsParser lineParser;
LineReader lr(file);
while (lr.hasMore()) {
@@ -102,7 +102,7 @@ PCLoaderVisum::load(const std::string& file, OptionsCont& oc, PCPolyContainer& t
// read items
if (what == "$PUNKT") {
lineParser.parseLine(line);
- SUMOLong id = TplConvert::_2long(lineParser.get("ID").c_str());
+ long long int id = TplConvert::_2long(lineParser.get("ID").c_str());
SUMOReal x = TplConvert::_2SUMOReal(lineParser.get("XKOORD").c_str());
SUMOReal y = TplConvert::_2SUMOReal(lineParser.get("YKOORD").c_str());
Position pos(x, y);
@@ -113,9 +113,9 @@ PCLoaderVisum::load(const std::string& file, OptionsCont& oc, PCPolyContainer& t
continue;
} else if (what == "$KANTE") {
lineParser.parseLine(line);
- SUMOLong id = TplConvert::_2long(lineParser.get("ID").c_str());
- SUMOLong fromID = TplConvert::_2long(lineParser.get("VONPUNKTID").c_str());
- SUMOLong toID = TplConvert::_2long(lineParser.get("NACHPUNKTID").c_str());
+ long long int id = TplConvert::_2long(lineParser.get("ID").c_str());
+ long long int fromID = TplConvert::_2long(lineParser.get("VONPUNKTID").c_str());
+ long long int toID = TplConvert::_2long(lineParser.get("NACHPUNKTID").c_str());
PositionVector vec;
vec.push_back(punkte[fromID]);
vec.push_back(punkte[toID]);
@@ -123,7 +123,7 @@ PCLoaderVisum::load(const std::string& file, OptionsCont& oc, PCPolyContainer& t
continue;
} else if (what == "$ZWISCHENPUNKT") {
lineParser.parseLine(line);
- SUMOLong id = TplConvert::_2long(lineParser.get("KANTEID").c_str());
+ long long int id = TplConvert::_2long(lineParser.get("KANTEID").c_str());
int index = TplConvert::_2int(lineParser.get("INDEX").c_str());
SUMOReal x = TplConvert::_2SUMOReal(lineParser.get("XKOORD").c_str());
SUMOReal y = TplConvert::_2SUMOReal(lineParser.get("YKOORD").c_str());
@@ -135,10 +135,10 @@ PCLoaderVisum::load(const std::string& file, OptionsCont& oc, PCPolyContainer& t
continue;
} else if (what == "$TEILFLAECHENELEMENT") {
lineParser.parseLine(line);
- SUMOLong id = TplConvert::_2long(lineParser.get("TFLAECHEID").c_str());
+ long long int id = TplConvert::_2long(lineParser.get("TFLAECHEID").c_str());
//int index = TplConvert::_2int(lineParser.get("INDEX").c_str());
//index = 0; /// hmmmm - assume it's sorted...
- SUMOLong kid = TplConvert::_2long(lineParser.get("KANTEID").c_str());
+ long long int kid = TplConvert::_2long(lineParser.get("KANTEID").c_str());
int dir = TplConvert::_2int(lineParser.get("RICHTUNG").c_str());
if (teilflaechen.find(id) == teilflaechen.end()) {
teilflaechen[id] = PositionVector();
@@ -155,8 +155,8 @@ PCLoaderVisum::load(const std::string& file, OptionsCont& oc, PCPolyContainer& t
continue;
} else if (what == "$FLAECHENELEMENT") {
lineParser.parseLine(line);
- SUMOLong id = TplConvert::_2long(lineParser.get("FLAECHEID").c_str());
- SUMOLong tid = TplConvert::_2long(lineParser.get("TFLAECHEID").c_str());
+ long long int id = TplConvert::_2long(lineParser.get("FLAECHEID").c_str());
+ long long int tid = TplConvert::_2long(lineParser.get("TFLAECHEID").c_str());
flaechenelemente[id] = tid;
continue;
}
@@ -221,7 +221,7 @@ PCLoaderVisum::load(const std::string& file, OptionsCont& oc, PCPolyContainer& t
// parse the poi
// $POI:Nr;CATID;CODE;NAME;Kommentar;XKoord;YKoord;
lineParser.parseLine(line);
- SUMOLong idL = TplConvert::_2long(lineParser.get("Nr").c_str());
+ long long int idL = TplConvert::_2long(lineParser.get("Nr").c_str());
std::string id = toString(idL);
std::string catid = lineParser.get("CATID");
// process read values
@@ -299,9 +299,9 @@ PCLoaderVisum::load(const std::string& file, OptionsCont& oc, PCPolyContainer& t
if (parsingDistrictsDirectly) {
//$BEZIRK:NR CODE NAME TYPNR XKOORD YKOORD FLAECHEID BEZART IVANTEIL_Q IVANTEIL_Z OEVANTEIL METHODEANBANTEILE ZWERT1 ZWERT2 ZWERT3 ISTINAUSWAHL OBEZNR NOM_COM COD_COM
lineParser.parseLine(line);
- SUMOLong idL = TplConvert::_2long(lineParser.get("NR").c_str());
+ long long int idL = TplConvert::_2long(lineParser.get("NR").c_str());
std::string id = toString(idL);
- SUMOLong area = TplConvert::_2long(lineParser.get("FLAECHEID").c_str());
+ long long int area = TplConvert::_2long(lineParser.get("FLAECHEID").c_str());
SUMOReal x = TplConvert::_2SUMOReal(lineParser.get("XKOORD").c_str());
SUMOReal y = TplConvert::_2SUMOReal(lineParser.get("YKOORD").c_str());
// patch the values
diff --git a/src/polyconvert/PCNetProjectionLoader.cpp b/src/polyconvert/PCNetProjectionLoader.cpp
index 7d209c4..66ce0ab 100644
--- a/src/polyconvert/PCNetProjectionLoader.cpp
+++ b/src/polyconvert/PCNetProjectionLoader.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Thu, 02.11.2006
-/// @version $Id: PCNetProjectionLoader.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: PCNetProjectionLoader.cpp 18427 2015-05-21 08:24:03Z behrisch $
///
// A reader for a SUMO network's projection description
/****************************************************************************/
@@ -113,7 +113,8 @@ PCNetProjectionLoader::myStartElement(int element,
Boundary origBoundary = attrs.get<Boundary>(SUMO_ATTR_ORIG_BOUNDARY, 0, myFoundLocation);
std::string proj = attrs.get<std::string>(SUMO_ATTR_ORIG_PROJ, 0, myFoundLocation);
if (myFoundLocation) {
- Position networkOffset = s[0];
+ OptionsCont& oc = OptionsCont::getOptions();
+ Position networkOffset = s[0] + Position(oc.getFloat("offset.x"), oc.getFloat("offset.y"));
GeoConvHelper::init(proj, networkOffset, origBoundary, convBoundary, myShift);
}
}
diff --git a/src/polyconvert/PCPolyContainer.cpp b/src/polyconvert/PCPolyContainer.cpp
index cdc6337..ee13e4c 100644
--- a/src/polyconvert/PCPolyContainer.cpp
+++ b/src/polyconvert/PCPolyContainer.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Melanie Knocke
/// @date Mon, 05 Dec 2005
-/// @version $Id: PCPolyContainer.cpp 18137 2015-03-24 15:12:38Z behrisch $
+/// @version $Id: PCPolyContainer.cpp 18703 2015-08-24 07:29:42Z namdre $
///
// A storage for loaded polygons and pois
/****************************************************************************/
@@ -42,6 +42,7 @@
#include <utils/shapes/Polygon.h>
#include <utils/iodevices/OutputDevice.h>
#include <utils/xml/SUMOSAXAttributes.h>
+#include <utils/options/OptionsCont.h>
#include "PCPolyContainer.h"
#ifdef CHECK_MEMORY_LEAKS
@@ -172,13 +173,14 @@ PCPolyContainer::save(const std::string& file, bool useGeo) {
i->second->writeXML(out, useGeo);
}
// write pois
+ const SUMOReal zOffset = OptionsCont::getOptions().getFloat("poi-layer-offset");
for (POICont::iterator i = myPOICont.begin(); i != myPOICont.end(); ++i) {
PointOfInterest* p = i->second;
out.openTag(SUMO_TAG_POI);
out.writeAttr(SUMO_ATTR_ID, StringUtils::escapeXML(p->getID()));
out.writeAttr(SUMO_ATTR_TYPE, StringUtils::escapeXML(p->getType()));
out.writeAttr(SUMO_ATTR_COLOR, p->getColor());
- out.writeAttr(SUMO_ATTR_LAYER, p->getLayer());
+ out.writeAttr(SUMO_ATTR_LAYER, p->getLayer() + zOffset);
if (useGeo) {
Position pos(*p);
gch.cartesian2geo(pos);
diff --git a/src/polyconvert/polyconvert_main.cpp b/src/polyconvert/polyconvert_main.cpp
index b149d02..21e7b5b 100644
--- a/src/polyconvert/polyconvert_main.cpp
+++ b/src/polyconvert/polyconvert_main.cpp
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Melanie Knocke
/// @date Mon, 05 Dec 2005
-/// @version $Id: polyconvert_main.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: polyconvert_main.cpp 18703 2015-08-24 07:29:42Z namdre $
///
// Main for POLYCONVERT
/****************************************************************************/
@@ -187,6 +187,8 @@ fillOptions() {
oc.doRegister("ignore-errors", new Option_Bool(false));
oc.addDescription("ignore-errors", "Processing", "Continue on broken input");
+ oc.doRegister("poi-layer-offset", new Option_Float(0));
+ oc.addDescription("poi-layer-offset", "Processing", "Adds FLOAT to the layer value for each poi (i.e. to raise it above polygons)");
// building defaults options
oc.doRegister("color", new Option_String("0.2,0.5,1."));
@@ -220,7 +222,8 @@ main(int argc, char** argv) {
// initialise subsystems
XMLSubSys::init();
fillOptions();
- OptionsIO::getOptions(true, argc, argv);
+ OptionsIO::setArgs(argc, argv);
+ OptionsIO::getOptions();
if (oc.processMetaOptions(argc < 2)) {
SystemFrame::close();
return 0;
@@ -272,6 +275,9 @@ main(int argc, char** argv) {
pruningBoundary = GeomConvHelper::parseBoundaryReporting(oc.getString("prune.boundary"), "--prune.boundary", 0, ok);
prune = true;
}
+ if (oc.isSet("osm-files") && oc.isDefault("poi-layer-offset")) {
+ oc.set("poi-layer-offset", "5"); // sufficient when using the default typemap
+ }
PCPolyContainer toFill(prune, pruningBoundary, oc.getStringVector("remove"));
diff --git a/src/router/Makefile.am b/src/router/Makefile.am
index 2c70adb..a94a317 100644
--- a/src/router/Makefile.am
+++ b/src/router/Makefile.am
@@ -5,7 +5,7 @@ ROEdge.cpp ROEdge.h \
ROFrame.cpp ROFrame.h ROHelper.cpp ROHelper.h ROLane.h \
ROLoader.cpp ROLoader.h \
RONet.cpp RONet.h RONetHandler.cpp RONetHandler.h \
-RONode.cpp RONode.h RORouteAggregator.h \
+RONode.cpp RONode.h \
RORoute.cpp RORoute.h RORouteDef.cpp RORouteDef.h \
RORouteHandler.cpp RORouteHandler.h \
ROVehicle.cpp ROVehicle.h \
diff --git a/src/router/Makefile.in b/src/router/Makefile.in
index 811abd7..ef6a74b 100644
--- a/src/router/Makefile.in
+++ b/src/router/Makefile.in
@@ -335,7 +335,7 @@ ROEdge.cpp ROEdge.h \
ROFrame.cpp ROFrame.h ROHelper.cpp ROHelper.h ROLane.h \
ROLoader.cpp ROLoader.h \
RONet.cpp RONet.h RONetHandler.cpp RONetHandler.h \
-RONode.cpp RONode.h RORouteAggregator.h \
+RONode.cpp RONode.h \
RORoute.cpp RORoute.h RORouteDef.cpp RORouteDef.h \
RORouteHandler.cpp RORouteHandler.h \
ROVehicle.cpp ROVehicle.h \
diff --git a/src/router/ROEdge.cpp b/src/router/ROEdge.cpp
index 48d6b9c..534798c 100644
--- a/src/router/ROEdge.cpp
+++ b/src/router/ROEdge.cpp
@@ -7,7 +7,7 @@
/// @author Melanie Knocke
/// @author Yun-Pang Floetteroed
/// @date Sept 2002
-/// @version $Id: ROEdge.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: ROEdge.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// A basic edge for routing applications
/****************************************************************************/
@@ -40,6 +40,7 @@
#include <iostream>
#include "ROLane.h"
#include "ROEdge.h"
+#include "RONet.h"
#include "ROVehicle.h"
#include <utils/vehicle/SUMOVTypeParameter.h>
#include <utils/emissions/PollutantsInterface.h>
@@ -56,6 +57,7 @@
bool ROEdge::myUseBoundariesOnOverrideTT = false;
bool ROEdge::myUseBoundariesOnOverrideE = false;
bool ROEdge::myInterpolate = false;
+bool ROEdge::myAmParallel = false;
bool ROEdge::myHaveTTWarned = false;
bool ROEdge::myHaveEWarned = false;
ROEdgeVector ROEdge::myEdges;
@@ -64,18 +66,25 @@ ROEdgeVector ROEdge::myEdges;
// ===========================================================================
// method definitions
// ===========================================================================
-ROEdge::ROEdge(const std::string& id, RONode* from, RONode* to, unsigned int index, const int priority)
- : Named(id), myFromNode(from), myToNode(to), myIndex(index), myPriority(priority),
- mySpeed(-1), myLength(0),
- myUsingTTTimeLine(false),
- myUsingETimeLine(false),
- myCombinedPermissions(0),
- myFromJunction(0),
- myToJunction(0) {
+ROEdge::ROEdge(const std::string& id, RONode* from, RONode* to, unsigned int index, const int priority) :
+ Named(id),
+ myFromJunction(from),
+ myToJunction(to),
+ myIndex(index),
+ myPriority(priority),
+ mySpeed(-1),
+ myLength(0),
+ myUsingTTTimeLine(false),
+ myUsingETimeLine(false),
+ myCombinedPermissions(0) {
while (myEdges.size() <= index) {
myEdges.push_back(0);
}
myEdges[index] = this;
+ if (from == 0 && to == 0) {
+ // TAZ edge, no lanes
+ myCombinedPermissions = SVCAll;
+ }
}
@@ -134,8 +143,8 @@ ROEdge::getEffort(const ROVehicle* const veh, SUMOReal time) const {
SUMOReal
ROEdge::getDistanceTo(const ROEdge* other) const {
- if (getToNode() != 0 && other->getFromNode() != 0) {
- return getToNode()->getPosition().distanceTo2D(other->getFromNode()->getPosition());
+ if (getToJunction() != 0 && other->getFromJunction() != 0) {
+ return getToJunction()->getPosition().distanceTo2D(other->getFromJunction()->getPosition());
} else {
return 0; // optimism is just right for astar
}
@@ -205,7 +214,7 @@ ROEdge::getStoredEffort(SUMOReal time, SUMOReal& ret) const {
unsigned int
ROEdge::getNumSuccessors() const {
- if (getType() == ET_SINK) {
+ if (getFunc() == ET_SINK) {
return 0;
}
return (unsigned int) myFollowingEdges.size();
@@ -214,7 +223,7 @@ ROEdge::getNumSuccessors() const {
unsigned int
ROEdge::getNumPredecessors() const {
- if (getType() == ET_SOURCE) {
+ if (getFunc() == ET_SOURCE) {
return 0;
}
return (unsigned int) myApproachingEdges.size();
@@ -222,12 +231,6 @@ ROEdge::getNumPredecessors() const {
void
-ROEdge::setType(ROEdge::EdgeType type) {
- myType = type;
-}
-
-
-void
ROEdge::buildTimeLines(const std::string& measure) {
if (myUsingETimeLine) {
SUMOReal value = myLength / mySpeed;
@@ -278,15 +281,25 @@ ROEdge::dictionary(size_t id) {
const ROEdgeVector&
ROEdge::getSuccessors(SUMOVehicleClass vClass) const {
- if (vClass == SVC_IGNORING) {
+ if (vClass == SVC_IGNORING || !RONet::getInstance()->hasPermissions() || myFunc == ET_DISTRICT) {
return myFollowingEdges;
}
- ClassesSuccesorMap::const_iterator i = myClassesSuccessorMap.find(vClass);
+#ifdef HAVE_FOX
+ if (myAmParallel) {
+ RONet::getInstance()->lock();
+ }
+#endif
+ std::map<SUMOVehicleClass, ROEdgeVector>::const_iterator i = myClassesSuccessorMap.find(vClass);
if (i != myClassesSuccessorMap.end()) {
// can use cached value
+#ifdef HAVE_FOX
+ if (myAmParallel) {
+ RONet::getInstance()->unlock();
+ }
+#endif
return i->second;
} else {
- // this vClass is requested for the first time. rebuild all succesors
+ // this vClass is requested for the first time. rebuild all successors
std::set<ROEdge*> followers;
for (std::vector<ROLane*>::const_iterator it = myLanes.begin(); it != myLanes.end(); ++it) {
ROLane* lane = *it;
@@ -300,8 +313,19 @@ ROEdge::getSuccessors(SUMOVehicleClass vClass) const {
}
}
}
+ // also add district edges (they are not connected at the lane level
+ for (ROEdgeVector::const_iterator it = myFollowingEdges.begin(); it != myFollowingEdges.end(); ++it) {
+ if ((*it)->getFunc() == ET_DISTRICT) {
+ followers.insert(*it);
+ }
+ }
myClassesSuccessorMap[vClass].insert(myClassesSuccessorMap[vClass].begin(),
followers.begin(), followers.end());
+#ifdef HAVE_FOX
+ if (myAmParallel) {
+ RONet::getInstance()->unlock();
+ }
+#endif
return myClassesSuccessorMap[vClass];
}
diff --git a/src/router/ROEdge.h b/src/router/ROEdge.h
index 3645a7f..d735e62 100644
--- a/src/router/ROEdge.h
+++ b/src/router/ROEdge.h
@@ -7,7 +7,7 @@
/// @author Melanie Knocke
/// @author Yun-Pang Floetteroed
/// @date Sept 2002
-/// @version $Id: ROEdge.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ROEdge.h 18627 2015-08-13 08:58:59Z namdre $
///
// A basic edge for routing applications
/****************************************************************************/
@@ -73,10 +73,10 @@ typedef std::vector<const ROEdge*> ConstROEdgeVector;
class ROEdge : public Named {
public:
/**
- * @enum EdgeType
- * @brief Possible types of edges
+ * @enum EdgeFunc
+ * @brief Possible functions of edges
*/
- enum EdgeType {
+ enum EdgeFunc {
/// @brief A normal edge
ET_NORMAL,
/// @brief An edge representing a whole district
@@ -131,24 +131,35 @@ public:
virtual void addSuccessor(ROEdge* s, std::string dir = "");
- /** @brief Sets the type of te edge
- * @param[in] type The new type for the edge
+ /** @brief Sets the function of the edge
+ * @param[in] func The new function for the edge
*/
- void setType(EdgeType type);
+ inline void setFunc(EdgeFunc func) {
+ myFunc = func;
+ }
+
+
+ /** @brief Sets the vehicle class specific speed limits of the edge
+ * @param[in] restrictions The restrictions for the edge
+ */
+ inline void setRestrictions(const std::map<SUMOVehicleClass, SUMOReal>* restrictions) {
+ myRestrictions = restrictions;
+ }
+
/// @brief return whether this edge is an internal edge
inline bool isInternal() const {
- return myType == ET_INTERNAL;
+ return myFunc == ET_INTERNAL;
}
/// @brief return whether this edge is a pedestrian crossing
inline bool isCrossing() const {
- return myType == ET_CROSSING;
+ return myFunc == ET_CROSSING;
}
/// @brief return whether this edge is walking area
inline bool isWalkingArea() const {
- return myType == ET_WALKINGAREA;
+ return myFunc == ET_WALKINGAREA;
}
/** @brief Builds the internal representation of the travel time/effort
@@ -168,12 +179,12 @@ public:
/// @name Getter methods
//@{
- /** @brief Returns the type of the edge
- * @return This edge's type
- * @see EdgeType
+ /** @brief Returns the function of the edge
+ * @return This edge's basic function
+ * @see EdgeFunc
*/
- EdgeType getType() const {
- return myType;
+ EdgeFunc getFunc() const {
+ return myFunc;
}
@@ -208,22 +219,6 @@ public:
}
- /** @brief Returns the node this edge starts at
- * @return The node this edge starts at
- */
- RONode* getFromNode() const {
- return myFromNode;
- }
-
-
- /** @brief Returns the node this edge ends at
- * @return The node this edge ends at
- */
- RONode* getToNode() const {
- return myToNode;
- }
-
-
/** @brief returns the information whether this edge is directly connected to the given
*
* @param[in] e The edge which may be connected
@@ -403,13 +398,15 @@ public:
return myEdges.size();
};
- static void setTimeLineOptions(
+ static void setGlobalOptions(
bool useBoundariesOnOverrideTT,
bool useBoundariesOnOverrideE,
- bool interpolate) {
+ bool interpolate,
+ bool isParallel) {
myUseBoundariesOnOverrideTT = useBoundariesOnOverrideTT;
myUseBoundariesOnOverrideE = useBoundariesOnOverrideE;
myInterpolate = interpolate;
+ myAmParallel = isParallel;
}
/// @brief get edge priority (road class)
@@ -426,11 +423,6 @@ public:
}
- void setJunctions(RONode* from, RONode* to) {
- myFromJunction = from;
- myToJunction = to;
- }
-
/** @brief Returns this edge's lanes
*
* @return This edge's lanes
@@ -450,8 +442,9 @@ protected:
protected:
- /// @brief The nodes this edge is connecting
- RONode* const myFromNode, * const myToNode;
+ /// @brief the junctions for this edge
+ RONode* myFromJunction;
+ RONode* myToJunction;
/// @brief The index (numeric id) of the edge
const unsigned int myIndex;
@@ -483,6 +476,9 @@ protected:
/// @brief Information whether to interpolate at interval boundaries
static bool myInterpolate;
+ /// @brief Information whether we are routing multi-threaded
+ static bool myAmParallel;
+
/// @brief Information whether the edge has reported missing weights
static bool myHaveEWarned;
/// @brief Information whether the edge has reported missing weights
@@ -494,8 +490,11 @@ protected:
/// @brief List of edges that approached this edge
ROEdgeVector myApproachingEdges;
- /// @brief The type of the edge
- EdgeType myType;
+ /// @brief The function of the edge
+ EdgeFunc myFunc;
+
+ /// The vClass speed restrictions for this edge
+ const std::map<SUMOVehicleClass, SUMOReal>* myRestrictions;
/// @brief This edge's lanes
std::vector<ROLane*> myLanes;
@@ -505,13 +504,9 @@ protected:
static ROEdgeVector myEdges;
- /// @brief the junctions for this edge
- RONode* myFromJunction;
- RONode* myToJunction;
/// @brief The successors available for a given vClass
- typedef std::map<SUMOVehicleClass, ROEdgeVector> ClassesSuccesorMap;
- mutable ClassesSuccesorMap myClassesSuccessorMap;
+ mutable std::map<SUMOVehicleClass, ROEdgeVector> myClassesSuccessorMap;
private:
/// @brief Invalidated copy constructor
diff --git a/src/router/ROFrame.cpp b/src/router/ROFrame.cpp
index 12bdca1..cbd78b6 100644
--- a/src/router/ROFrame.cpp
+++ b/src/router/ROFrame.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: ROFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ROFrame.cpp 18620 2015-08-11 08:28:58Z namdre $
///
// Sets and checks options for routing
/****************************************************************************/
@@ -129,6 +129,12 @@ ROFrame::fillOptions(OptionsCont& oc, bool forDuarouter) {
oc.doRegister("repair", new Option_Bool(false));
oc.addDescription("repair", "Processing", "Tries to correct a false route");
+ oc.doRegister("repair.from", new Option_Bool(false));
+ oc.addDescription("repair.from", "Processing", "Tries to correct an invalid starting edge by using the first usable edge instead");
+
+ oc.doRegister("repair.to", new Option_Bool(false));
+ oc.addDescription("repair.to", "Processing", "Tries to correct an invalid destination edge by using the last usable edge instead");
+
oc.doRegister("weights.interpolate", new Option_Bool(false));
oc.addSynonyme("weights.interpolate", "interpolate", true);
oc.addDescription("weights.interpolate", "Processing", "Interpolate edge weights at interval boundaries");
@@ -138,12 +144,15 @@ ROFrame::fillOptions(OptionsCont& oc, bool forDuarouter) {
if (forDuarouter) {
oc.doRegister("routing-algorithm", new Option_String("dijkstra"));
- oc.addDescription("routing-algorithm", "Processing", "Select among routing algorithms ['dijkstra', 'astar', 'bulkstar', 'CH', 'CHWrapper']");
+ oc.addDescription("routing-algorithm", "Processing", "Select among routing algorithms ['dijkstra', 'astar', 'CH', 'CHWrapper']");
oc.doRegister("weight-period", new Option_String("3600", "TIME"));
oc.addDescription("weight-period", "Processing", "Aggregation period for the given weight files; triggers rebuilding of Contraction Hierarchy");
}
+ oc.doRegister("bulk-routing", new Option_Bool(false));
+ oc.addDescription("bulk-routing", "Processing", "Aggregate routing queries with the same origin");
+
#ifdef HAVE_FOX
oc.doRegister("routing-threads", new Option_Integer(0));
oc.addDescription("routing-threads", "Processing", "The number of parallel execution threads used for routing");
diff --git a/src/router/ROHelper.cpp b/src/router/ROHelper.cpp
index baa6f81..857d12a 100644
--- a/src/router/ROHelper.cpp
+++ b/src/router/ROHelper.cpp
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: ROHelper.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ROHelper.cpp 18627 2015-08-13 08:58:59Z namdre $
///
// Some helping methods for router
/****************************************************************************/
@@ -44,12 +44,24 @@ void
recheckForLoops(ConstROEdgeVector& edges) {
// XXX check for stops, departLane, departPos, departSpeed, ....
+ // removal of edge loops within the route (edge occurs twice)
+ std::map<const ROEdge*, size_t> lastOccurence; // index of the last occurence of this edge
+ for (size_t ii = 0; ii < edges.size(); ++ii) {
+ std::map<const ROEdge*, size_t>::iterator it_pre = lastOccurence.find(edges[ii]);
+ if (it_pre != lastOccurence.end()) {
+ edges.erase(edges.begin() + it_pre->second, edges.begin() + ii);
+ ii = it_pre->second;
+ } else {
+ lastOccurence[edges[ii]] = ii;
+ }
+ }
+
// remove loops at the route's begin
// (vehicle makes a turnaround to get into the right direction at an already passed node)
- RONode* start = edges[0]->getFromNode();
+ const RONode* start = edges[0]->getFromJunction();
unsigned lastStart = 0;
for (unsigned i = 1; i < edges.size(); i++) {
- if (edges[i]->getFromNode() == start) {
+ if (edges[i]->getFromJunction() == start) {
lastStart = i;
}
}
@@ -58,10 +70,10 @@ recheckForLoops(ConstROEdgeVector& edges) {
}
// remove loops at the route's end
// (vehicle makes a turnaround to get into the right direction at an already passed node)
- RONode* end = edges.back()->getToNode();
+ const RONode* end = edges.back()->getToJunction();
size_t firstEnd = edges.size() - 1;
for (unsigned i = 0; i < firstEnd; i++) {
- if (edges[i]->getToNode() == end) {
+ if (edges[i]->getToJunction() == end) {
firstEnd = i;
}
}
@@ -69,25 +81,13 @@ recheckForLoops(ConstROEdgeVector& edges) {
edges.erase(edges.begin() + firstEnd + 2, edges.end());
}
- // removal of edge loops within the route (edge occurs twice)
- std::map<const ROEdge*, size_t> lastOccurence; // index of the last occurence of this edge
- for (size_t ii = 0; ii < edges.size(); ++ii) {
- std::map<const ROEdge*, size_t>::iterator it_pre = lastOccurence.find(edges[ii]);
- if (it_pre != lastOccurence.end()) {
- edges.erase(edges.begin() + it_pre->second, edges.begin() + ii);
- ii = it_pre->second;
- } else {
- lastOccurence[edges[ii]] = ii;
- }
- }
-
// removal of node loops (node occurs twice) is not done because these may occur legitimately
/*
std::vector<RONode*> nodes;
for (ConstROEdgeVector::iterator i = edges.begin(); i != edges.end(); ++i) {
- nodes.push_back((*i)->getFromNode());
+ nodes.push_back((*i)->getFromJunction());
}
- nodes.push_back(edges.back()->getToNode());
+ nodes.push_back(edges.back()->getToJunction());
bool changed = false;
do {
changed = false;
diff --git a/src/router/ROLoader.cpp b/src/router/ROLoader.cpp
index c4e542e..acf282c 100644
--- a/src/router/ROLoader.cpp
+++ b/src/router/ROLoader.cpp
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Christian Roessel
/// @date Sept 2002
-/// @version $Id: ROLoader.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ROLoader.cpp 18397 2015-05-18 14:04:14Z behrisch $
///
// Loader for networks and route imports
/****************************************************************************/
@@ -54,7 +54,6 @@
#include "ROLoader.h"
#include "ROEdge.h"
#include "RORouteHandler.h"
-#include "RORouteAggregator.h"
#ifdef CHECK_MEMORY_LEAKS
#include <foreign/nvwa/debug_new.h>
@@ -182,7 +181,12 @@ ROLoader::openRoutes(RONet& net) {
if (MsgHandler::getErrorInstance()->wasInformed()) {
throw ProcessError();
} else {
- throw ProcessError("No route input specified or all routes were invalid.");
+ const std::string error = "No route input specified or all routes were invalid.";
+ if (myOptions.getBool("ignore-errors")) {
+ WRITE_WARNING(error);
+ } else {
+ throw ProcessError(error);
+ }
}
}
// skip routes prior to the begin time
@@ -225,15 +229,6 @@ ROLoader::processRoutes(const SUMOTime start, const SUMOTime end, const SUMOTime
}
-void
-ROLoader::processAllRoutesWithBulkRouter(SUMOTime /* start */, SUMOTime end,
- RONet& net, SUMOAbstractRouter<ROEdge, ROVehicle>& router) {
- myLoaders.loadNext(SUMOTime_MAX);
- RORouteAggregator::processAllRoutes(net, router);
- net.saveAndRemoveRoutesUntil(myOptions, router, end);
-}
-
-
bool
ROLoader::openTypedRoutes(const std::string& optionName,
RONet& net) {
diff --git a/src/router/ROLoader.h b/src/router/ROLoader.h
index 84acedd..df69ffb 100644
--- a/src/router/ROLoader.h
+++ b/src/router/ROLoader.h
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Sept 2002
-/// @version $Id: ROLoader.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ROLoader.h 18397 2015-05-18 14:04:14Z behrisch $
///
// Loader for networks and route imports
/****************************************************************************/
@@ -88,10 +88,6 @@ public:
void processRoutes(const SUMOTime start, const SUMOTime end, const SUMOTime increment,
RONet& net, SUMOAbstractRouter<ROEdge, ROVehicle>& router);
- /** @brief Loads all routes and processes them with BulkStarRouter */
- void processAllRoutesWithBulkRouter(SUMOTime start, SUMOTime end,
- RONet& net, SUMOAbstractRouter<ROEdge, ROVehicle>& router);
-
protected:
/** @brief Opens route handler of the given type
*
diff --git a/src/router/RONet.cpp b/src/router/RONet.cpp
index 6a77220..94dbfdd 100644
--- a/src/router/RONet.cpp
+++ b/src/router/RONet.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: RONet.cpp 18136 2015-03-24 15:10:45Z behrisch $
+/// @version $Id: RONet.cpp 18467 2015-05-29 03:50:41Z behrisch $
///
// The router's network representation
/****************************************************************************/
@@ -53,19 +53,38 @@
// ===========================================================================
+// static member definitions
+// ===========================================================================
+RONet* RONet::myInstance = 0;
+
+
+// ===========================================================================
// method definitions
// ===========================================================================
+RONet*
+RONet::getInstance(void) {
+ if (myInstance != 0) {
+ return myInstance;
+ }
+ throw ProcessError("A network was not yet constructed.");
+}
+
+
RONet::RONet()
: myVehicleTypes(), myDefaultVTypeMayBeDeleted(true),
myRoutesOutput(0), myRouteAlternativesOutput(0), myTypesOutput(0),
myReadRouteNo(0), myDiscardedRouteNo(0), myWrittenRouteNo(0),
- myHaveRestrictions(false),
+ myHavePermissions(false),
myNumInternalEdges(0),
myErrorHandler(OptionsCont::getOptions().exists("ignore-errors")
&& OptionsCont::getOptions().getBool("ignore-errors") ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()) {
+ if (myInstance != 0) {
+ throw ProcessError("A network was already constructed.");
+ }
SUMOVTypeParameter* type = new SUMOVTypeParameter(DEFAULT_VTYPE_ID, SVC_IGNORING);
type->onlyReferenced = true;
myVehicleTypes.add(type->id, type);
+ myInstance = this;
}
@@ -78,6 +97,22 @@ RONet::~RONet() {
}
+void
+RONet::addRestriction(const std::string& id, const SUMOVehicleClass svc, const SUMOReal speed) {
+ myRestrictions[id][svc] = speed;
+}
+
+
+const std::map<SUMOVehicleClass, SUMOReal>*
+RONet::getRestrictions(const std::string& id) const {
+ std::map<std::string, std::map<SUMOVehicleClass, SUMOReal> >::const_iterator i = myRestrictions.find(id);
+ if (i == myRestrictions.end()) {
+ return 0;
+ }
+ return &i->second;
+}
+
+
bool
RONet::addEdge(ROEdge* edge) {
if (!myEdges.add(edge->getID(), edge)) {
@@ -85,7 +120,7 @@ RONet::addEdge(ROEdge* edge) {
delete edge;
return false;
}
- if (edge->getType() == ROEdge::ET_INTERNAL) {
+ if (edge->getFunc() == ROEdge::ET_INTERNAL) {
myNumInternalEdges += 1;
}
return true;
@@ -100,9 +135,9 @@ RONet::addDistrict(const std::string id, ROEdge* source, ROEdge* sink) {
delete sink;
return false;
}
- sink->setType(ROEdge::ET_DISTRICT);
+ sink->setFunc(ROEdge::ET_DISTRICT);
addEdge(sink);
- source->setType(ROEdge::ET_DISTRICT);
+ source->setFunc(ROEdge::ET_DISTRICT);
addEdge(source);
myDistricts[id] = std::make_pair(std::vector<std::string>(), std::vector<std::string>());
return true;
@@ -420,6 +455,50 @@ RONet::checkFlows(SUMOTime time) {
}
+void
+RONet::createBulkRouteRequests(SUMOAbstractRouter<ROEdge, ROVehicle>& router, const SUMOTime time, const bool removeLoops, const std::map<std::string, ROVehicle*>& mmap) {
+ std::map<const ROEdge*, std::vector<ROVehicle*> > bulkVehs;
+ for (std::map<std::string, ROVehicle*>::const_iterator i = mmap.begin(); i != mmap.end(); ++i) {
+ ROVehicle* const vehicle = i->second;
+ if (vehicle->getDepart() < time) {
+ const RORoute* const stub = vehicle->getRouteDefinition()->getFirstRoute();
+ bulkVehs[stub->getFirst()].push_back(vehicle);
+ ROVehicle* const first = bulkVehs[stub->getFirst()].front();
+ if (first->getMaxSpeed() != vehicle->getMaxSpeed()) {
+ WRITE_WARNING("Bulking different maximum speeds ('" + first->getID() + "' and '" + vehicle->getID() + "') may lead to suboptimal routes.");
+ }
+ if (first->getVClass() != vehicle->getVClass()) {
+ WRITE_WARNING("Bulking different vehicle classes ('" + first->getID() + "' and '" + vehicle->getID() + "') may lead to invalid routes.");
+ }
+ }
+ }
+ int workerIndex = 0;
+ for (std::map<const ROEdge*, std::vector<ROVehicle*> >::const_iterator i = bulkVehs.begin(); i != bulkVehs.end(); ++i) {
+#ifdef HAVE_FOX
+ if (myThreadPool.size() > 0) {
+ ROVehicle* const first = i->second.front();
+ myThreadPool.add(new RoutingTask(first, removeLoops, myErrorHandler), workerIndex);
+ myThreadPool.add(new BulkmodeTask(true), workerIndex);
+ for (std::vector<ROVehicle*>::const_iterator j = i->second.begin() + 1; j != i->second.end(); ++j) {
+ myThreadPool.add(new RoutingTask(*j, removeLoops, myErrorHandler), workerIndex);
+ }
+ myThreadPool.add(new BulkmodeTask(false), workerIndex);
+ workerIndex++;
+ if (workerIndex == (int)myThreadPool.size()) {
+ workerIndex = 0;
+ }
+ continue;
+ }
+#endif
+ for (std::vector<ROVehicle*>::const_iterator j = i->second.begin(); j != i->second.end(); ++j) {
+ (*j)->setRoutingSuccess(computeRoute(router, *j, removeLoops, myErrorHandler));
+ router.setBulkMode(true);
+ }
+ router.setBulkMode(false);
+ }
+}
+
+
SUMOTime
RONet::saveAndRemoveRoutesUntil(OptionsCont& options, SUMOAbstractRouter<ROEdge, ROVehicle>& router,
SUMOTime time) {
@@ -431,25 +510,35 @@ RONet::saveAndRemoveRoutesUntil(OptionsCont& options, SUMOAbstractRouter<ROEdge,
#endif
if (myVehicles.size() != 0) {
const std::map<std::string, ROVehicle*>& mmap = myVehicles.getMyMap();
- for (std::map<std::string, ROVehicle*>::const_iterator i = mmap.begin(); i != mmap.end(); ++i) {
- if (i->second->getDepart() >= time) {
- // we cannot go through a sorted list here, because the priority queue in the myVehicles container is not fully sorted
- continue;
- }
- i->second->setRoutingSuccess(false);
+ if (options.getBool("bulk-routing")) {
#ifdef HAVE_FOX
- // add thread if necessary
- const int numThreads = (int)myThreadPool.size();
- if (numThreads < maxNumThreads && myThreadPool.isFull()) {
- new WorkerThread(myThreadPool, numThreads == 0 ? &router : router.clone());
- }
- // add task
- if (maxNumThreads > 0) {
- myThreadPool.add(new RoutingTask(i->second, removeLoops, myErrorHandler));
- continue;
+ while ((int)myThreadPool.size() < maxNumThreads) {
+ new WorkerThread(myThreadPool, myThreadPool.size() == 0 ? &router : router.clone());
}
#endif
- i->second->setRoutingSuccess(computeRoute(router, i->second, removeLoops, myErrorHandler));
+ createBulkRouteRequests(router, time, removeLoops, mmap);
+ } else {
+ for (std::map<std::string, ROVehicle*>::const_iterator i = mmap.begin(); i != mmap.end(); ++i) {
+ ROVehicle* const vehicle = i->second;
+ if (vehicle->getDepart() >= time) {
+ // we cannot go through a sorted list here, because the priority queue in the myVehicles container is not fully sorted
+ continue;
+ }
+#ifdef HAVE_FOX
+ // add task
+ if (maxNumThreads > 0) {
+ vehicle->setRoutingSuccess(false);
+ // add thread if necessary
+ const int numThreads = (int)myThreadPool.size();
+ if (numThreads < maxNumThreads && myThreadPool.isFull()) {
+ new WorkerThread(myThreadPool, numThreads == 0 ? &router : router.clone());
+ }
+ myThreadPool.add(new RoutingTask(vehicle, removeLoops, myErrorHandler));
+ continue;
+ }
+#endif
+ vehicle->setRoutingSuccess(computeRoute(router, vehicle, removeLoops, myErrorHandler));
+ }
}
#ifdef HAVE_FOX
myThreadPool.waitAll();
@@ -544,14 +633,14 @@ RONet::getEdgeMap() const {
bool
-RONet::hasRestrictions() const {
- return myHaveRestrictions;
+RONet::hasPermissions() const {
+ return myHavePermissions;
}
void
-RONet::setRestrictionFound() {
- myHaveRestrictions = true;
+RONet::setPermissionsFound() {
+ myHavePermissions = true;
}
diff --git a/src/router/RONet.h b/src/router/RONet.h
index d6bb9f2..5d95f5a 100644
--- a/src/router/RONet.h
+++ b/src/router/RONet.h
@@ -5,7 +5,7 @@
/// @author Jakob Erdmann
/// @author Yun-Pang Floetteroed
/// @date Sept 2002
-/// @version $Id: RONet.h 18136 2015-03-24 15:10:45Z behrisch $
+/// @version $Id: RONet.h 18756 2015-08-31 19:16:33Z behrisch $
///
// The router's network representation
/****************************************************************************/
@@ -70,17 +70,37 @@ class OutputDevice;
* @todo Vehicle ids are not tracked; it may happen that the same id is added twice...
*/
class RONet {
- friend class RORouteAggregator;
-
public:
/// @brief Constructor
RONet();
+ /** @brief Returns the pointer to the unique instance of RONet (singleton).
+ * @return Pointer to the unique RONet-instance
+ */
+ static RONet* getInstance();
+
+
/// @brief Destructor
virtual ~RONet();
+ /** @brief Adds a restriction for an edge type
+ * @param[in] id The id of the type
+ * @param[in] svc The vehicle class the restriction refers to
+ * @param[in] speed The restricted speed
+ */
+ void addRestriction(const std::string& id, const SUMOVehicleClass svc, const SUMOReal speed);
+
+
+ /** @brief Returns the restrictions for an edge type
+ * If no restrictions are present, 0 is returned.
+ * @param[in] id The id of the type
+ * @return The mapping of vehicle classes to maximum speeds
+ */
+ const std::map<SUMOVehicleClass, SUMOReal>* getRestrictions(const std::string& id) const;
+
+
/// @name Insertion and retrieval of graph parts
//@{
@@ -387,9 +407,9 @@ public:
const std::map<std::string, ROEdge*>& getEdgeMap() const;
- bool hasRestrictions() const;
+ bool hasPermissions() const;
- void setRestrictionFound();
+ void setPermissionsFound();
OutputDevice* getRouteOutput(const bool alternative = false) {
if (alternative) {
@@ -398,7 +418,18 @@ public:
return myRoutesOutput;
}
-protected:
+#ifdef HAVE_FOX
+ void lock() {
+ myThreadPool.lock();
+ }
+
+ void unlock() {
+ myThreadPool.unlock();
+ }
+#endif
+
+
+private:
static bool computeRoute(SUMOAbstractRouter<ROEdge, ROVehicle>& router,
const ROVehicle* const veh, const bool removeLoops,
MsgHandler* errorHandler);
@@ -411,8 +442,12 @@ protected:
void checkFlows(SUMOTime time);
+ void createBulkRouteRequests(SUMOAbstractRouter<ROEdge, ROVehicle>& router, const SUMOTime time, const bool removeLoops, const std::map<std::string, ROVehicle*>& mmap);
+
+private:
+ /// @brief Unique instance of RONet
+ static RONet* myInstance;
-protected:
/// @brief Known vehicle ids
std::set<std::string> myVehIDs;
@@ -481,7 +516,10 @@ protected:
unsigned int myWrittenRouteNo;
/// @brief Whether the network contains edges which not all vehicles may pass
- bool myHaveRestrictions;
+ bool myHavePermissions;
+
+ /// @brief The vehicle class specific speed restrictions
+ std::map<std::string, std::map<SUMOVehicleClass, SUMOReal> > myRestrictions;
/// @brief The number of internal edges in the dictionary
int myNumInternalEdges;
@@ -490,8 +528,6 @@ protected:
MsgHandler* myErrorHandler;
#ifdef HAVE_FOX
- FXWorkerThread::Pool myThreadPool;
-
private:
class WorkerThread : public FXWorkerThread {
public:
@@ -522,6 +558,24 @@ private:
/// @brief Invalidated assignment operator.
RoutingTask& operator=(const RoutingTask&);
};
+
+ class BulkmodeTask : public FXWorkerThread::Task {
+ public:
+ BulkmodeTask(const bool value) : myValue(value) {}
+ void run(FXWorkerThread* context) {
+ static_cast<WorkerThread*>(context)->getRouter().setBulkMode(myValue);
+ }
+ private:
+ const bool myValue;
+ private:
+ /// @brief Invalidated assignment operator.
+ BulkmodeTask& operator=(const BulkmodeTask&);
+ };
+
+
+private:
+ /// @brief for multi threaded routing
+ FXWorkerThread::Pool myThreadPool;
#endif
private:
diff --git a/src/router/RONetHandler.cpp b/src/router/RONetHandler.cpp
index ee02cdc..1fcc8cc 100644
--- a/src/router/RONetHandler.cpp
+++ b/src/router/RONetHandler.cpp
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Yun-Pang Floetteroed
/// @date Sept 2002
-/// @version $Id: RONetHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: RONetHandler.cpp 18627 2015-08-13 08:58:59Z namdre $
///
// The handler for SUMO-Networks
/****************************************************************************/
@@ -102,6 +102,20 @@ RONetHandler::myStartElement(int element,
case SUMO_TAG_TAZSINK:
parseDistrictEdge(attrs, false);
break;
+ case SUMO_TAG_TYPE: {
+ bool ok = true;
+ myCurrentTypeID = attrs.get<std::string>(SUMO_ATTR_ID, 0, ok);
+ break;
+ }
+ case SUMO_TAG_RESTRICTION: {
+ bool ok = true;
+ const SUMOVehicleClass svc = getVehicleClassID(attrs.get<std::string>(SUMO_ATTR_VCLASS, myCurrentTypeID.c_str(), ok));
+ const SUMOReal speed = attrs.get<SUMOReal>(SUMO_ATTR_SPEED, myCurrentTypeID.c_str(), ok);
+ if (ok) {
+ myNet.addRestriction(myCurrentTypeID, svc, speed);
+ }
+ break;
+ }
default:
break;
}
@@ -118,7 +132,6 @@ RONetHandler::myEndElement(int element) {
RONode* from = myNet.getNode(it->second.first);
RONode* to = myNet.getNode(it->second.second);
if (edge != 0 && from != 0 && to != 0) {
- edge->setJunctions(from, to);
from->addOutgoing(edge);
to->addIncoming(edge);
}
@@ -138,7 +151,7 @@ RONetHandler::parseEdge(const SUMOSAXAttributes& attrs) {
if (!ok) {
throw ProcessError();
}
- const SumoXMLEdgeFunc type = attrs.getEdgeFunc(ok);
+ const SumoXMLEdgeFunc func = attrs.getEdgeFunc(ok);
if (!ok) {
WRITE_ERROR("Edge '" + myCurrentName + "' has an unknown type.");
return;
@@ -150,7 +163,7 @@ RONetHandler::parseEdge(const SUMOSAXAttributes& attrs) {
RONode* toNode;
int priority;
myCurrentEdge = 0;
- if (type == EDGEFUNC_INTERNAL || type == EDGEFUNC_CROSSING || type == EDGEFUNC_WALKINGAREA) {
+ if (func == EDGEFUNC_INTERNAL || func == EDGEFUNC_CROSSING || func == EDGEFUNC_WALKINGAREA) {
assert(myCurrentName[0] == ':');
std::string junctionID = myCurrentName.substr(1, myCurrentName.rfind('_') - 1);
myJunctionGraph[myCurrentName] = std::make_pair(junctionID, junctionID);
@@ -179,30 +192,31 @@ RONetHandler::parseEdge(const SUMOSAXAttributes& attrs) {
// build the edge
myCurrentEdge = myEdgeBuilder.buildEdge(myCurrentName, fromNode, toNode, priority);
// set the type
+ myCurrentEdge->setRestrictions(myNet.getRestrictions(attrs.getOpt<std::string>(SUMO_ATTR_TYPE, myCurrentName.c_str(), ok, "")));
myProcess = true;
- switch (type) {
+ switch (func) {
case EDGEFUNC_CONNECTOR:
case EDGEFUNC_NORMAL:
- myCurrentEdge->setType(ROEdge::ET_NORMAL);
+ myCurrentEdge->setFunc(ROEdge::ET_NORMAL);
break;
case EDGEFUNC_SOURCE:
- myCurrentEdge->setType(ROEdge::ET_SOURCE);
+ myCurrentEdge->setFunc(ROEdge::ET_SOURCE);
break;
case EDGEFUNC_SINK:
- myCurrentEdge->setType(ROEdge::ET_SINK);
+ myCurrentEdge->setFunc(ROEdge::ET_SINK);
break;
case EDGEFUNC_WALKINGAREA:
- myCurrentEdge->setType(ROEdge::ET_WALKINGAREA);
+ myCurrentEdge->setFunc(ROEdge::ET_WALKINGAREA);
break;
case EDGEFUNC_CROSSING:
- myCurrentEdge->setType(ROEdge::ET_CROSSING);
+ myCurrentEdge->setFunc(ROEdge::ET_CROSSING);
break;
case EDGEFUNC_INTERNAL:
- myCurrentEdge->setType(ROEdge::ET_INTERNAL);
+ myCurrentEdge->setFunc(ROEdge::ET_INTERNAL);
myProcess = false;
break;
default:
- throw ProcessError("Unhandled EdgeFunk " + toString(type));
+ throw ProcessError("Unhandled EdgeFunc " + toString(func));
}
if (!myNet.addEdge(myCurrentEdge)) {
@@ -235,7 +249,7 @@ RONetHandler::parseLane(const SUMOSAXAttributes& attrs) {
// get the vehicle classes
SVCPermissions permissions = parseVehicleClasses(allow, disallow);
if (permissions != SVCAll) {
- myNet.setRestrictionFound();
+ myNet.setPermissionsFound();
}
// add when both values are valid
if (maxSpeed > 0 && length > 0 && id.length() > 0) {
@@ -284,7 +298,7 @@ RONetHandler::parseConnection(const SUMOSAXAttributes& attrs) {
if (to == 0) {
throw ProcessError("unknown to-edge '" + toID + "' in connection");
}
- if (from->getType() == ROEdge::ET_INTERNAL) { // skip inner lane connections
+ if (from->getFunc() == ROEdge::ET_INTERNAL) { // skip inner lane connections
return;
}
if (from->getLanes().size() <= (size_t)fromLane) {
diff --git a/src/router/RONetHandler.h b/src/router/RONetHandler.h
index 8c3e0d4..1f1043b 100644
--- a/src/router/RONetHandler.h
+++ b/src/router/RONetHandler.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: RONetHandler.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: RONetHandler.h 18467 2015-05-29 03:50:41Z behrisch $
///
// The handler that parses a SUMO-network for its usage in a router
/****************************************************************************/
@@ -189,6 +189,9 @@ protected:
/// @brief The name of the edge/node that is currently processed
std::string myCurrentName;
+ /// The id of the currently processed edge type
+ std::string myCurrentTypeID;
+
/// @brief The currently built edge
ROEdge* myCurrentEdge;
diff --git a/src/router/RONode.h b/src/router/RONode.h
index 8a2bef8..17930cd 100644
--- a/src/router/RONode.h
+++ b/src/router/RONode.h
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: RONode.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: RONode.h 18627 2015-08-13 08:58:59Z namdre $
///
// Base class for nodes used by the router
/****************************************************************************/
@@ -71,7 +71,7 @@ public:
/** @brief Returns the position of the node
* @return This node's position
*/
- const Position& getPosition() {
+ const Position& getPosition() const {
return myPosition;
}
diff --git a/src/router/RORoute.cpp b/src/router/RORoute.cpp
index c00d6a1..7437d7b 100644
--- a/src/router/RORoute.cpp
+++ b/src/router/RORoute.cpp
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Yun-Pang Floetteroed
/// @date Sept 2002
-/// @version $Id: RORoute.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: RORoute.cpp 18467 2015-05-29 03:50:41Z behrisch $
///
// A complete router's route
/****************************************************************************/
@@ -108,8 +108,8 @@ RORoute::writeXMLDefinition(OutputDevice& dev, const ROVehicle* const veh,
dev.writeAttr(SUMO_ATTR_COLOR, *myColor);
}
if (!myRoute.empty()) {
- const int frontOffset = myRoute.front()->getType() == ROEdge::ET_DISTRICT ? 1 : 0;
- const int backOffset = myRoute.back()->getType() == ROEdge::ET_DISTRICT ? 1 : 0;
+ const int frontOffset = myRoute.front()->getFunc() == ROEdge::ET_DISTRICT ? 1 : 0;
+ const int backOffset = myRoute.back()->getFunc() == ROEdge::ET_DISTRICT ? 1 : 0;
if (frontOffset + backOffset > 0) {
ConstROEdgeVector temp(myRoute.begin() + frontOffset, myRoute.end() - backOffset);
dev.writeAttr(SUMO_ATTR_EDGES, temp);
diff --git a/src/router/RORouteAggregator.h b/src/router/RORouteAggregator.h
deleted file mode 100644
index 6e7a3c2..0000000
--- a/src/router/RORouteAggregator.h
+++ /dev/null
@@ -1,197 +0,0 @@
-/****************************************************************************/
-/// @file RORouteAggregator.h
-/// @author Jakob Erdmann
-/// @author Laura Bieker
-/// @author Michael Behrisch
-/// @date February 2012
-/// @version $Id: RORouteAggregator.h 18095 2015-03-17 09:39:00Z behrisch $
-///
-// Handles grouping of routes to supply input for BulkStarRouter
-/****************************************************************************/
-// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
-// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors
-/****************************************************************************/
-//
-// This file is part of SUMO.
-// SUMO is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-/****************************************************************************/
-#ifndef RORouteAggregator_h
-#define RORouteAggregator_h
-
-
-// ===========================================================================
-// included modules
-// ===========================================================================
-#ifdef _MSC_VER
-#include <windows_config.h>
-#else
-#include <config.h>
-#endif
-
-#include <string>
-#include <algorithm>
-#include <foreign/rtree/RTree.h>
-#include <utils/geom/PositionVector.h>
-#include <utils/common/UtilExceptions.h>
-#include <router/ROEdge.h>
-#include <utils/vehicle/BulkStarRouter.h>
-
-
-// ===========================================================================
-// class definitions
-// ===========================================================================
-//
-class RORouteAggregator {
-
-public:
-
- /** @brief precomputes all routes grouped by their destination edge
- * @note: the current setup is not suitable for using RORouteDef_Complete
- * along with --repair since the sequence is not optimized for in-between destinations
- */
- static void processAllRoutes(RONet& net, SUMOAbstractRouter<ROEdge, ROVehicle>& router) {
- // simple version: group by destination edge
- SameTargetMap stm;
- NamedObjectCont<ROVehicle*>::IDMap vehicles = net.getVehicles().getMyMap();
- if (vehicles.size() == 0) {
- throw ProcessError("No vehicles loaded");
- }
- // XXX @todo: use a configurable default vehicle
- const ROVehicle* defaultVehicle = vehicles.begin()->second;
- for (NamedObjectCont<ROVehicle*>::IDMap::const_iterator it = vehicles.begin(); it != vehicles.end(); it++) {
- ROVehicle* veh = it->second;
- stm[veh->getRouteDefinition()->getDestination()].push_back(veh);
- }
- WRITE_MESSAGE("Loaded " + toString(vehicles.size()) + " vehicles with " + toString(stm.size()) + " unique destinations");
-
- // merge nearby destinations for efficiency
- const int MERGE_DISTANCE = 6; // XXX @todo make configurable
- for (int i = 1; i <= MERGE_DISTANCE; i++) {
- stm = mergeTargets(stm, MERGE_DISTANCE);
- }
- WRITE_MESSAGE("Kept " + toString(stm.size()) + " unique destinations after merging");
-
- // skip precomputation if not enough vehicles have the same destination
- // this value could be set automatically: num_edges / avg_number_of_nodes_visited_for_astar
- const size_t SKIP_LIMIT = 11; // XXX @todo make configurable
- int num_prepared = 0;
- int num_unprepared = 0;
- int num_routes_prepared = 0;
- int num_routes_unprepared = 0;
- // process by destination edge
- for (SameTargetMap::iterator it = stm.begin(); it != stm.end(); it++) {
- const ROEdge* dest = it->first;
- VehVec& bulkVehicles = it->second;
- bool skip = false;
- if (bulkVehicles.size() < SKIP_LIMIT) {
- skip = true;
- num_routes_unprepared += (int)bulkVehicles.size();
- num_unprepared += 1;
- } else {
- num_routes_prepared += (int)bulkVehicles.size();
- num_prepared += 1;
- }
- router.prepare(dest, defaultVehicle, skip);
- for (VehVec::iterator it = bulkVehicles.begin(); it != bulkVehicles.end(); it++) {
- ROVehicle* veh = *it;
- RORouteDef* routeDef = veh->getRouteDefinition();
- routeDef->preComputeCurrentRoute(router, veh->getDepartureTime(), *veh);
- }
- }
- WRITE_MESSAGE("Performed pre-computation for " + toString(num_prepared) + " destinations");
- WRITE_MESSAGE("Skipped pre-computation for " + toString(num_unprepared) + " destinations");
- WRITE_MESSAGE("Computed " + toString(num_routes_prepared) + " routes with pre-computation");
- WRITE_MESSAGE("Computed " + toString(num_routes_unprepared) + " routes without pre-computation");
- }
-
-private:
- typedef std::vector<ROVehicle*> VehVec;
- typedef std::map<const ROEdge*, VehVec> SameTargetMap;
- typedef std::set<const ROEdge*> EdgeSet;
-
-
- /** Function-object for sorting from highest to lowest vehicle count. */
- struct ComparatorNumVehicles {
-
- ComparatorNumVehicles(SameTargetMap& sameTargetMap):
- mySameTargetMap(sameTargetMap) {}
-
- bool operator()(const ROEdge* const a, const ROEdge* const b) {
- return (mySameTargetMap[a].size() > mySameTargetMap[b].size());
- }
-
- SameTargetMap& mySameTargetMap;
-
- private:
- /// @brief Invalidated assignment operator.
- ComparatorNumVehicles& operator=(const ComparatorNumVehicles&);
-
- };
-
-
- static SameTargetMap mergeTargets(SameTargetMap& stm, const int distance) {
- SameTargetMap result;
- // we want to merg edges with few vehicles to edges with many vehicles
- // so we have to sort by number of vehicles first
- ConstROEdgeVector heap;
- heap.reserve(stm.size());
- ComparatorNumVehicles cmp(stm);
- for (SameTargetMap::iterator it = stm.begin(); it != stm.end(); it++) {
- heap.push_back(it->first);
- }
- make_heap(heap.begin(), heap.end(), cmp);
- while (heap.size() > 0) {
- const ROEdge* dest = heap.front();
- pop_heap(heap.begin(), heap.end(), cmp);
- heap.pop_back();
- if (stm.count(dest) > 0 && // dest has not been merged yet
- stm[dest].size() > 0) { // for some strange reason 0-length vectors are found despite erase
- result[dest] = stm[dest];
- stm.erase(dest);
- EdgeSet nearby = getNearby(dest, distance);
- for (EdgeSet::iterator it = nearby.begin(); it != nearby.end(); it++) {
- const ROEdge* nearEdge = *it;
- if (stm.count(nearEdge) > 0) {
- // nearEdge occurs as destination and has not been merged yet
- result[dest].insert(result[dest].end(), stm[nearEdge].begin(), stm[nearEdge].end());
- stm.erase(nearEdge);
- }
- }
- }
- }
- return result;
- }
-
-
- static EdgeSet getNearby(const ROEdge* edge, const int distance) {
- EdgeSet result;
- result.insert(edge);
- EdgeSet fringe(result);
- for (int i = 0; i < distance; i++) {
- fringe = approachingEdges(fringe);
- result.insert(fringe.begin(), fringe.end());
- }
- return result;
- }
-
-
- static EdgeSet approachingEdges(EdgeSet edges) {
- EdgeSet result;
- for (EdgeSet::iterator it = edges.begin(); it != edges.end(); it++) {
- result.insert((*it)->getPredecessors().begin(), (*it)->getPredecessors().end());
- }
- return result;
- }
-
-
-};
-
-
-#endif
-
-/****************************************************************************/
-
diff --git a/src/router/RORouteDef.cpp b/src/router/RORouteDef.cpp
index 368b0e2..72442ef 100644
--- a/src/router/RORouteDef.cpp
+++ b/src/router/RORouteDef.cpp
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Sept 2002
-/// @version $Id: RORouteDef.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: RORouteDef.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Base class for a vehicle's route definition
/****************************************************************************/
@@ -105,15 +105,19 @@ void
RORouteDef::preComputeCurrentRoute(SUMOAbstractRouter<ROEdge, ROVehicle>& router,
SUMOTime begin, const ROVehicle& veh) const {
myNewRoute = false;
+ const OptionsCont& oc = OptionsCont::getOptions();
assert(myAlternatives[0]->getEdgeVector().size() > 0);
MsgHandler* mh = (OptionsCont::getOptions().getBool("ignore-errors") ?
MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance());
- if (myAlternatives[0]->getFirst()->prohibits(&veh)) {
- /// XXX check for specified arrivalLane / departLane
+ if (myAlternatives[0]->getFirst()->prohibits(&veh) && (!oc.getBool("repair.from")
+ // do not try to reassign starting edge for trip input
+ || myMayBeDisconnected || myAlternatives[0]->getEdgeVector().size() < 2)) {
mh->inform("Vehicle '" + veh.getID() + "' is not allowed to depart on edge '" +
myAlternatives[0]->getFirst()->getID() + "'.");
return;
- } else if (myAlternatives[0]->getLast()->prohibits(&veh)) {
+ } else if (myAlternatives[0]->getLast()->prohibits(&veh) && (!oc.getBool("repair.to")
+ // do not try to reassign destination edge for trip input
+ || myMayBeDisconnected || myAlternatives[0]->getEdgeVector().size() < 2)) {
// this check is not strictly necessary unless myTryRepair is set.
// However, the error message is more helpful than "no connection found"
mh->inform("Vehicle '" + veh.getID() + "' is not allowed to arrive on edge '" +
@@ -167,6 +171,23 @@ RORouteDef::repairCurrentRoute(SUMOAbstractRouter<ROEdge, ROVehicle>& router,
}
} else {
// prepare mandatory edges
+ if (oldEdges.front()->prohibits(&veh)) {
+ // option repair.from is in effect
+ for (ConstROEdgeVector::iterator i = oldEdges.begin(); i != oldEdges.end();) {
+ if ((*i)->prohibits(&veh)) {
+ i = oldEdges.erase(i);
+ } else {
+ WRITE_MESSAGE("Changing invalid starting edge '"
+ + myAlternatives[0]->getEdgeVector().front()->getID()
+ + "' to '" + (*i)->getID() + "' for vehicle '" + veh.getID() + "'.");
+ break;
+ }
+ }
+ }
+ if (oldEdges.size() == 0) {
+ mh->inform("Could not find new starting edge for vehicle '" + veh.getID() + "'.");
+ return;
+ }
mandatory.push_back(oldEdges.front());
ConstROEdgeVector stops = veh.getStopEdges();
for (ConstROEdgeVector::const_iterator i = stops.begin(); i != stops.end(); ++i) {
@@ -174,6 +195,20 @@ RORouteDef::repairCurrentRoute(SUMOAbstractRouter<ROEdge, ROVehicle>& router,
mandatory.push_back(*i);
}
}
+ if (oldEdges.back()->prohibits(&veh)) {
+ // option repair.to is in effect
+ for (ConstROEdgeVector::reverse_iterator i = oldEdges.rbegin(); i != oldEdges.rend();) {
+ if ((*i)->prohibits(&veh)) {
+ ++i;
+ oldEdges.erase(i.base());
+ } else {
+ WRITE_MESSAGE("Changing invalid destination edge '"
+ + myAlternatives[0]->getEdgeVector().back()->getID()
+ + "' to '" + (*i)->getID() + "' for vehicle '" + veh.getID() + "'.");
+ break;
+ }
+ }
+ }
if (mandatory.size() < 2 || oldEdges.back() != mandatory.back()) {
mandatory.push_back(oldEdges.back());
}
@@ -199,6 +234,10 @@ RORouteDef::repairCurrentRoute(SUMOAbstractRouter<ROEdge, ROVehicle>& router,
if ((*(i - 1))->isConnectedTo(*i, &veh)) {
newEdges.push_back(*i);
} else {
+ if (myAlternatives[0]->getEdgeVector().size() > 2) {
+ // only inform if the input is (probably) not a trip
+ WRITE_MESSAGE("Edge '" + (*(i - 1))->getID() + "' not connected to '" + (*i)->getID() + " for vehicle '" + veh.getID() + "'.");
+ }
ConstROEdgeVector edges;
router.compute(newEdges.back(), *i, &veh, begin, edges);
if (edges.size() == 0) {
@@ -247,8 +286,7 @@ RORouteDef::addAlternative(SUMOAbstractRouter<ROEdge, ROVehicle>& router,
if (myTryRepair) {
if (myNewRoute) {
delete myAlternatives[0];
- myAlternatives.pop_back();
- myAlternatives.push_back(current);
+ myAlternatives[0] = current;
}
const SUMOReal costs = router.recomputeCosts(current->getEdgeVector(), veh, begin);
if (costs < 0) {
diff --git a/src/router/RORouteHandler.cpp b/src/router/RORouteHandler.cpp
index cd02543..90e3070 100644
--- a/src/router/RORouteHandler.cpp
+++ b/src/router/RORouteHandler.cpp
@@ -5,7 +5,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date Mon, 9 Jul 2001
-/// @version $Id: RORouteHandler.cpp 18136 2015-03-24 15:10:45Z behrisch $
+/// @version $Id: RORouteHandler.cpp 18541 2015-07-07 13:49:54Z behrisch $
///
// Parser and container for routes during their loading
/****************************************************************************/
@@ -335,7 +335,7 @@ RORouteHandler::closeRoute(const bool mayBeDisconnected) {
myActiveRouteStops.clear();
return;
}
- if (myActiveRoute.size() == 1 && myActiveRoute.front()->getType() == ROEdge::ET_DISTRICT) {
+ if (myActiveRoute.size() == 1 && myActiveRoute.front()->getFunc() == ROEdge::ET_DISTRICT) {
myErrorOutput->inform("The routing information for vehicle '" + myVehicleParameter->id + "' is insufficient.");
myActiveRouteID = "";
myActiveRouteStops.clear();
@@ -388,7 +388,7 @@ RORouteHandler::openRouteDistribution(const SUMOSAXAttributes& attrs) {
}
}
// try to get the index of the last element
- int index = attrs.get<int>(SUMO_ATTR_LAST, id.c_str(), ok);
+ int index = attrs.getOpt<int>(SUMO_ATTR_LAST, id.c_str(), ok, 0);
if (ok && index < 0) {
myErrorOutput->inform("Negative index of a route alternative (id='" + id + "').");
return;
diff --git a/src/router/ROVehicle.h b/src/router/ROVehicle.h
index 05284a9..55b08c3 100644
--- a/src/router/ROVehicle.h
+++ b/src/router/ROVehicle.h
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Sept 2002
-/// @version $Id: ROVehicle.h 18136 2015-03-24 15:10:45Z behrisch $
+/// @version $Id: ROVehicle.h 18213 2015-04-16 11:55:42Z behrisch $
///
// A vehicle as used by router
/****************************************************************************/
@@ -110,7 +110,7 @@ public:
* @return The vehicle's depart time
*/
SUMOTime getDepartureTime() const {
- return MAX2(0, myParameter.depart);
+ return MAX2(SUMOTime(0), myParameter.depart);
}
/** @brief Returns the time the vehicle starts at, -1 for triggered vehicles
diff --git a/src/sumo_main.cpp b/src/sumo_main.cpp
index 9f1490e..26574f5 100644
--- a/src/sumo_main.cpp
+++ b/src/sumo_main.cpp
@@ -6,7 +6,7 @@
/// @author Thimor Bohn
/// @author Michael Behrisch
/// @date Tue, 20 Nov 2001
-/// @version $Id: sumo_main.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: sumo_main.cpp 18486 2015-06-11 11:10:09Z behrisch $
///
// Main for SUMO
/****************************************************************************/
@@ -134,7 +134,8 @@ main(int argc, char** argv) {
// initialise subsystems
XMLSubSys::init();
MSFrame::fillOptions();
- OptionsIO::getOptions(true, argc, argv);
+ OptionsIO::setArgs(argc, argv);
+ OptionsIO::getOptions();
if (oc.processMetaOptions(argc < 2)) {
SystemFrame::close();
return 0;
diff --git a/src/tools/TrajectoriesHandler.cpp b/src/tools/TrajectoriesHandler.cpp
index d7fc65a..e79e08f 100644
--- a/src/tools/TrajectoriesHandler.cpp
+++ b/src/tools/TrajectoriesHandler.cpp
@@ -2,7 +2,7 @@
/// @file TrajectoriesHandler.cpp
/// @author Michael Behrisch
/// @date 14.03.2014
-/// @version $Id: TrajectoriesHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: TrajectoriesHandler.cpp 18219 2015-04-17 07:40:07Z behrisch $
///
// An XML-Handler for amitran and netstate trajectories
/****************************************************************************/
@@ -71,7 +71,7 @@ TrajectoriesHandler::myStartElement(int element,
break;
case SUMO_TAG_VEHICLE:
if (attrs.hasAttribute(SUMO_ATTR_SPEED)) {
- writeEmissions(std::cout, attrs.getString(SUMO_ATTR_ID), myDefaultClass, myCurrentTime, attrs.getFloat(SUMO_ATTR_SPEED));
+ writeEmissions(std::cout, attrs.getString(SUMO_ATTR_ID), myDefaultClass, STEPS2TIME(myCurrentTime), attrs.getFloat(SUMO_ATTR_SPEED));
} else {
const std::string acId = attrs.getString(SUMO_ATTR_ACTORCONFIG);
const std::string id = attrs.getString(SUMO_ATTR_ID);
@@ -106,7 +106,7 @@ TrajectoriesHandler::myStartElement(int element,
writeXMLEmissions(id, c, time, v, a, s);
}
if (myStdOut != 0) {
- writeEmissions(*myStdOut, id, c, time, v, a, s);
+ writeEmissions(*myStdOut, id, c, STEPS2TIME(time), v, a, s);
}
break;
}
diff --git a/src/tools/emissionsDrivingCycle_main.cpp b/src/tools/emissionsDrivingCycle_main.cpp
index 5123509..7183a93 100644
--- a/src/tools/emissionsDrivingCycle_main.cpp
+++ b/src/tools/emissionsDrivingCycle_main.cpp
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date Wed, 21.08.2013
-/// @version $Id: emissionsDrivingCycle_main.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: emissionsDrivingCycle_main.cpp 18486 2015-06-11 11:10:09Z behrisch $
///
// Main for an emissions calculator
/****************************************************************************/
@@ -129,7 +129,8 @@ main(int argc, char** argv) {
try {
// initialise the application system (messaging, xml, options)
XMLSubSys::init();
- OptionsIO::getOptions(true, argc, argv);
+ OptionsIO::setArgs(argc, argv);
+ OptionsIO::getOptions();
OptionsCont& oc = OptionsCont::getOptions();
if (oc.processMetaOptions(argc < 2)) {
SystemFrame::close();
diff --git a/src/tools/emissionsMap_main.cpp b/src/tools/emissionsMap_main.cpp
index a687e51..676c9e0 100644
--- a/src/tools/emissionsMap_main.cpp
+++ b/src/tools/emissionsMap_main.cpp
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date Wed, 21.08.2013
-/// @version $Id: emissionsMap_main.cpp 17682 2015-01-23 07:27:34Z behrisch $
+/// @version $Id: emissionsMap_main.cpp 18486 2015-06-11 11:10:09Z behrisch $
///
// Main for an emissions map writer
/****************************************************************************/
@@ -140,7 +140,8 @@ main(int argc, char** argv) {
try {
// initialise the application system (messaging, xml, options)
XMLSubSys::init();
- OptionsIO::getOptions(true, argc, argv);
+ OptionsIO::setArgs(argc, argv);
+ OptionsIO::getOptions();
OptionsCont& oc = OptionsCont::getOptions();
if (oc.processMetaOptions(argc < 2)) {
SystemFrame::close();
diff --git a/src/traci-server/TraCIConstants.h b/src/traci-server/TraCIConstants.h
index c209360..48ae9a9 100644
--- a/src/traci-server/TraCIConstants.h
+++ b/src/traci-server/TraCIConstants.h
@@ -12,7 +12,7 @@
/// @author Jakob Erdmann
/// @author Laura Bieker
/// @date 2007/10/24
-/// @version $Id: TraCIConstants.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: TraCIConstants.h 18719 2015-08-25 12:52:06Z behrisch $
///
/// holds codes used for TraCI
/****************************************************************************/
@@ -34,7 +34,7 @@
// ****************************************
// VERSION
// ****************************************
-#define TRACI_VERSION 9
+#define TRACI_VERSION 10
// ****************************************
@@ -383,6 +383,16 @@
// vehicle finished route during teleport
#define REMOVE_TELEPORT_ARRIVED 0x04
+// ****************************************
+// PERSON/CONTAINER STAGES
+// ****************************************
+// person walking / container transhiping
+#define STAGE_WALKING 0x00
+// person riding / container being transported
+#define STAGE_DRIVING 0x01
+// person / container stopping
+#define STAGE_WAITING 0x02
+
// ****************************************
// VARIABLE TYPES (for CMD_GET_*_VARIABLE)
@@ -405,7 +415,7 @@
// last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges)
#define LAST_STEP_MEAN_SPEED 0x11
-// last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges)
+// last step vehicle list (get: induction loops, multi-entry/multi-exit detector, lanes, edges)
#define LAST_STEP_VEHICLE_ID_LIST 0x12
// last step occupancy (get: induction loops, lanes, edges)
@@ -429,6 +439,9 @@
// last step jam length in meters
#define JAM_LENGTH_METERS 0x19
+// last step person list (get: edges)
+#define LAST_STEP_PERSON_ID_LIST 0x1a
+
// traffic light states, encoded as rRgGyYoO tuple (get: traffic lights)
#define TL_RED_YELLOW_GREEN_STATE 0x20
@@ -493,7 +506,7 @@
// maximum allowed/possible speed (get: vehicle types, lanes, set: edges, lanes)
#define VAR_MAXSPEED 0x41
-// position (2D) (get: vehicle, poi, set: poi)
+// position (2D) (get: vehicle, poi, inductionloop, areadetector; set: poi)
#define VAR_POSITION 0x42
// position (3D) (get: vehicle, poi, set: poi)
@@ -502,7 +515,7 @@
// angle (get: vehicle)
#define VAR_ANGLE 0x43
-// angle (get: vehicle types, lanes, set: lanes)
+// angle (get: vehicle types, lanes, arealdetector, set: lanes)
#define VAR_LENGTH 0x44
// color (get: vehicles, vehicle types, polygons, pois)
@@ -541,7 +554,7 @@
// road id (get: vehicles)
#define VAR_ROAD_ID 0x50
-// lane id (get: vehicles)
+// lane id (get: vehicles, inductionloop, arealdetector)
#define VAR_LANE_ID 0x51
// lane index (get: vehicles)
@@ -641,6 +654,9 @@
// current leader together with gap (get: vehicle)
#define VAR_LEADER 0x68
+// edge index in current route (get: vehicle)
+#define VAR_ROUTE_INDEX 0x69
+
//current waiting time (get: vehicle, lane)
#define VAR_WAITING_TIME 0x7a
@@ -745,6 +761,14 @@
// validates current route (vehicles)
#define VAR_ROUTE_VALID 0x92
+// retrieve information regarding the current person/container stage
+#define VAR_STAGE 0xc0
+
+// retrieve information regarding the next edge including crossings and walkingAreas (pedestrians only)
+#define VAR_NEXT_EDGE 0xc1
+
+// retrieve the number of stages (person, container)
+#define VAR_NUM_STAGES 0xc2
// zoom
#define VAR_VIEW_ZOOM 0xa0
diff --git a/src/traci-server/TraCIServer.cpp b/src/traci-server/TraCIServer.cpp
index dcb4e04..1f4a3eb 100644
--- a/src/traci-server/TraCIServer.cpp
+++ b/src/traci-server/TraCIServer.cpp
@@ -11,7 +11,7 @@
/// @author Michael Behrisch
/// @author Mario Krumnow
/// @date 2007/10/24
-/// @version $Id: TraCIServer.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: TraCIServer.cpp 18693 2015-08-21 20:36:16Z behrisch $
///
/// TraCI server used to control sumo by a remote TraCI client (e.g., ns2)
/****************************************************************************/
@@ -202,6 +202,10 @@ TraCIServer::close() {
if (myInstance == 0) {
return;
}
+ if (myDoCloseConnection) {
+ myInstance->writeStatusCmd(CMD_CLOSE, RTYPE_OK, "");
+ myInstance->mySocket->sendExact(myInstance->myOutputStorage);
+ }
delete myInstance;
myInstance = 0;
myDoCloseConnection = true;
@@ -300,11 +304,6 @@ TraCIServer::processCommandsUntilSimStep(SUMOTime step) {
} catch (tcpip::SocketException& e) {
throw ProcessError(e.what());
}
- if (myInstance != NULL) {
- delete myInstance;
- myInstance = 0;
- myDoCloseConnection = true;
- }
}
@@ -433,9 +432,11 @@ TraCIServer::dispatchCommand() {
return commandId;
}
case CMD_CLOSE:
- success = commandCloseConnection();
+ myDoCloseConnection = true;
+ success = true;
break;
case CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE:
+ case CMD_SUBSCRIBE_AREAL_DETECTOR_VARIABLE:
case CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE:
case CMD_SUBSCRIBE_TL_VARIABLE:
case CMD_SUBSCRIBE_LANE_VARIABLE:
@@ -452,6 +453,7 @@ TraCIServer::dispatchCommand() {
success = addObjectVariableSubscription(commandId, false);
break;
case CMD_SUBSCRIBE_INDUCTIONLOOP_CONTEXT:
+ case CMD_SUBSCRIBE_AREAL_DETECTOR_CONTEXT:
case CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT:
case CMD_SUBSCRIBE_TL_CONTEXT:
case CMD_SUBSCRIBE_LANE_CONTEXT:
@@ -508,15 +510,6 @@ TraCIServer::commandGetVersion() {
}
-bool
-TraCIServer::commandCloseConnection() {
- myDoCloseConnection = true;
- // write answer
- writeStatusCmd(CMD_CLOSE, RTYPE_OK, "");
- return true;
-}
-
-
void
TraCIServer::postProcessSimulationStep2() {
SUMOTime t = MSNet::getInstance()->getCurrentTimeStep();
diff --git a/src/traci-server/TraCIServer.h b/src/traci-server/TraCIServer.h
index 68c0e8b..c95572d 100644
--- a/src/traci-server/TraCIServer.h
+++ b/src/traci-server/TraCIServer.h
@@ -9,7 +9,7 @@
/// @author Sascha Krieg
/// @author Michael Behrisch
/// @date 2007/10/24
-/// @version $Id: TraCIServer.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: TraCIServer.h 18693 2015-08-21 20:36:16Z behrisch $
///
/// TraCI server used to control sumo by a remote TraCI client
/****************************************************************************/
@@ -280,12 +280,6 @@ private:
bool commandGetVersion();
- /** @brief Indicates the connection as being closed
- * @return Always true
- */
- bool commandCloseConnection();
-
-
/** @brief Handles subscriptions to send after a simstep2 command
*/
void postProcessSimulationStep2();
diff --git a/src/traci-server/TraCIServerAPI_ArealDetector.cpp b/src/traci-server/TraCIServerAPI_ArealDetector.cpp
index 86a76c6..3a8045d 100644
--- a/src/traci-server/TraCIServerAPI_ArealDetector.cpp
+++ b/src/traci-server/TraCIServerAPI_ArealDetector.cpp
@@ -5,7 +5,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date 03.02.2014
-/// @version $Id: TraCIServerAPI_ArealDetector.cpp 17682 2015-01-23 07:27:34Z behrisch $
+/// @version $Id: TraCIServerAPI_ArealDetector.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// APIs for getting/setting areal detector values via TraCI
/****************************************************************************/
@@ -52,9 +52,19 @@ TraCIServerAPI_ArealDetector::processGet(TraCIServer& server, tcpip::Storage& in
int variable = inputStorage.readUnsignedByte();
std::string id = inputStorage.readString();
// check variable
- if (variable != ID_LIST && variable != ID_COUNT && variable != JAM_LENGTH_VEHICLE && variable != JAM_LENGTH_METERS &&
- variable != LAST_STEP_VEHICLE_NUMBER && variable != LAST_STEP_MEAN_SPEED && variable != LAST_STEP_VEHICLE_ID_LIST
- && variable != LAST_STEP_VEHICLE_HALTING_NUMBER && variable != ID_COUNT && variable != LAST_STEP_OCCUPANCY) {
+ if (variable != ID_LIST
+ && variable != ID_COUNT
+ && variable != JAM_LENGTH_VEHICLE
+ && variable != JAM_LENGTH_METERS
+ && variable != LAST_STEP_VEHICLE_NUMBER
+ && variable != LAST_STEP_MEAN_SPEED
+ && variable != LAST_STEP_VEHICLE_ID_LIST
+ && variable != LAST_STEP_VEHICLE_HALTING_NUMBER
+ && variable != ID_COUNT
+ && variable != LAST_STEP_OCCUPANCY
+ && variable != VAR_POSITION
+ && variable != VAR_LANE_ID
+ && variable != VAR_LENGTH) {
return server.writeErrorStatusCmd(CMD_GET_AREAL_DETECTOR_VARIABLE, "Get Areal Detector Variable: unsupported variable specified", outputStorage);
}
@@ -112,6 +122,18 @@ TraCIServerAPI_ArealDetector::processGet(TraCIServer& server, tcpip::Storage& in
tempMsg.writeUnsignedByte(TYPE_DOUBLE);
tempMsg.writeDouble(e2->getCurrentOccupancy());
break;
+ case VAR_POSITION:
+ tempMsg.writeUnsignedByte(TYPE_DOUBLE);
+ tempMsg.writeDouble(e2->getStartPos());
+ break;
+ case VAR_LANE_ID:
+ tempMsg.writeUnsignedByte(TYPE_STRING);
+ tempMsg.writeString(e2->getLane()->getID());
+ break;
+ case VAR_LENGTH:
+ tempMsg.writeUnsignedByte(TYPE_DOUBLE);
+ tempMsg.writeDouble(e2->getEndPos() - e2->getStartPos());
+ break;
default:
break;
}
diff --git a/src/traci-server/TraCIServerAPI_Edge.cpp b/src/traci-server/TraCIServerAPI_Edge.cpp
index 0641685..fcf08bc 100644
--- a/src/traci-server/TraCIServerAPI_Edge.cpp
+++ b/src/traci-server/TraCIServerAPI_Edge.cpp
@@ -7,7 +7,7 @@
/// @author Laura Bieker
/// @author Mario Krumnow
/// @date Sept 2002
-/// @version $Id: TraCIServerAPI_Edge.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: TraCIServerAPI_Edge.cpp 18274 2015-04-22 15:00:44Z behrisch $
///
// APIs for getting/setting edge values via TraCI
/****************************************************************************/
@@ -41,6 +41,7 @@
#include <microsim/MSEdge.h>
#include <microsim/MSLane.h>
#include <microsim/MSVehicle.h>
+#include <microsim/pedestrians/MSPerson.h>
#include "TraCIConstants.h"
#include "TraCIServerAPI_Edge.h"
#include <microsim/MSEdgeWeightsStorage.h>
@@ -66,6 +67,7 @@ TraCIServerAPI_Edge::processGet(TraCIServer& server, tcpip::Storage& inputStorag
&& variable != VAR_NOXEMISSION && variable != VAR_FUELCONSUMPTION && variable != VAR_NOISEEMISSION && variable != VAR_WAITING_TIME
&& variable != LAST_STEP_VEHICLE_NUMBER && variable != LAST_STEP_MEAN_SPEED && variable != LAST_STEP_OCCUPANCY
&& variable != LAST_STEP_VEHICLE_HALTING_NUMBER && variable != LAST_STEP_LENGTH
+ && variable != LAST_STEP_PERSON_ID_LIST
&& variable != LAST_STEP_VEHICLE_ID_LIST && variable != ID_COUNT && variable != VAR_PARAMETER) {
return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "Get Edge Variable: unsupported variable specified", outputStorage);
}
@@ -94,7 +96,7 @@ TraCIServerAPI_Edge::processGet(TraCIServer& server, tcpip::Storage& inputStorag
switch (variable) {
case VAR_EDGE_TRAVELTIME: {
// time
- SUMOTime time = 0;
+ int time = 0;
if (!server.readTypeCheckingInt(inputStorage, time)) {
return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "The message must contain the time definition.", outputStorage);
}
@@ -109,7 +111,7 @@ TraCIServerAPI_Edge::processGet(TraCIServer& server, tcpip::Storage& inputStorag
break;
case VAR_EDGE_EFFORT: {
// time
- SUMOTime time = 0;
+ int time = 0;
if (!server.readTypeCheckingInt(inputStorage, time)) {
return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "The message must contain the time definition.", outputStorage);
}
@@ -136,6 +138,16 @@ TraCIServerAPI_Edge::processGet(TraCIServer& server, tcpip::Storage& inputStorag
tempMsg.writeDouble(wtime);
}
break;
+ case LAST_STEP_PERSON_ID_LIST: {
+ std::vector<std::string> personIDs;
+ std::vector<MSTransportable*> persons = e->getSortedPersons(MSNet::getInstance()->getCurrentTimeStep());
+ for (std::vector<MSTransportable*>::iterator it = persons.begin(); it != persons.end(); ++it) {
+ personIDs.push_back((*it)->getID());
+ }
+ tempMsg.writeUnsignedByte(TYPE_STRINGLIST);
+ tempMsg.writeStringList(personIDs);
+ }
+ break;
case LAST_STEP_VEHICLE_ID_LIST: {
std::vector<std::string> vehIDs;
const std::vector<MSLane*>& lanes = e->getLanes();
@@ -362,7 +374,7 @@ TraCIServerAPI_Edge::processSet(TraCIServer& server, tcpip::Storage& inputStorag
int parameterCount = inputStorage.readInt();
if (parameterCount == 3) {
// bound by time
- SUMOTime begTime = 0, endTime = 0;
+ int begTime = 0, endTime = 0;
double value = 0;
if (!server.readTypeCheckingInt(inputStorage, begTime)) {
return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "The first variable must be the begin time given as int.", outputStorage);
@@ -380,7 +392,7 @@ TraCIServerAPI_Edge::processSet(TraCIServer& server, tcpip::Storage& inputStorag
if (!server.readTypeCheckingDouble(inputStorage, value)) {
return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The variable must be the value given as double", outputStorage);
}
- MSNet::getInstance()->getWeightsStorage().addTravelTime(e, 0, SUMOTime_MAX, value);
+ MSNet::getInstance()->getWeightsStorage().addTravelTime(e, SUMOReal(0), SUMOReal(SUMOTime_MAX), value);
} else {
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Setting travel time requires either begin time, end time, and value, or only value as parameter.", outputStorage);
}
@@ -394,7 +406,7 @@ TraCIServerAPI_Edge::processSet(TraCIServer& server, tcpip::Storage& inputStorag
int parameterCount = inputStorage.readInt();
if (parameterCount == 3) {
// bound by time
- SUMOTime begTime = 0, endTime = 0;
+ int begTime = 0, endTime = 0;
double value = 0;
if (!server.readTypeCheckingInt(inputStorage, begTime)) {
return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "The first variable must be the begin time given as int.", outputStorage);
@@ -412,7 +424,7 @@ TraCIServerAPI_Edge::processSet(TraCIServer& server, tcpip::Storage& inputStorag
if (!server.readTypeCheckingDouble(inputStorage, value)) {
return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The variable must be the value given as double", outputStorage);
}
- MSNet::getInstance()->getWeightsStorage().addEffort(e, 0, SUMOTime_MAX, value);
+ MSNet::getInstance()->getWeightsStorage().addEffort(e, SUMOReal(0), SUMOReal(SUMOTime_MAX), value);
} else {
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Setting effort requires either begin time, end time, and value, or only value as parameter.", outputStorage);
}
diff --git a/src/traci-server/TraCIServerAPI_Person.cpp b/src/traci-server/TraCIServerAPI_Person.cpp
index 9307011..ce17dee 100644
--- a/src/traci-server/TraCIServerAPI_Person.cpp
+++ b/src/traci-server/TraCIServerAPI_Person.cpp
@@ -2,7 +2,7 @@
/// @file TraCIServerAPI_Person.cpp
/// @author Daniel Krajzewicz
/// @date 26.05.2014
-/// @version $Id: TraCIServerAPI_Person.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: TraCIServerAPI_Person.cpp 18274 2015-04-22 15:00:44Z behrisch $
///
// APIs for getting/setting person values via TraCI
/****************************************************************************/
@@ -60,6 +60,7 @@ TraCIServerAPI_Person::processGet(TraCIServer& server, tcpip::Storage& inputStor
&& variable != VAR_WIDTH && variable != VAR_LENGTH && variable != VAR_MINGAP
&& variable != VAR_TYPE && variable != VAR_SHAPECLASS && variable != VAR_COLOR
&& variable != VAR_WAITING_TIME && variable != VAR_PARAMETER
+ && variable != VAR_NEXT_EDGE
) {
return server.writeErrorStatusCmd(CMD_GET_PERSON_VARIABLE, "Get Person Variable: unsupported variable specified", outputStorage);
}
@@ -83,7 +84,7 @@ TraCIServerAPI_Person::processGet(TraCIServer& server, tcpip::Storage& inputStor
tempMsg.writeInt((int) c.size());
}
} else {
- MSPerson* p = c.get(id);
+ MSTransportable* p = c.get(id);
if (p == 0) {
return server.writeErrorStatusCmd(CMD_GET_PERSON_VARIABLE, "Person '" + id + "' is not known", outputStorage);
}
@@ -131,6 +132,10 @@ TraCIServerAPI_Person::processGet(TraCIServer& server, tcpip::Storage& inputStor
tempMsg.writeUnsignedByte(TYPE_STRING);
tempMsg.writeString(p->getVehicleType().getID());
break;
+ case VAR_NEXT_EDGE:
+ tempMsg.writeUnsignedByte(TYPE_STRING);
+ tempMsg.writeString(dynamic_cast<MSPerson*>(p)->getNextEdge());
+ break;
case VAR_PARAMETER: {
std::string paramName = "";
if (!server.readTypeCheckingString(inputStorage, paramName)) {
@@ -163,7 +168,7 @@ TraCIServerAPI_Person::processSet(TraCIServer& server, tcpip::Storage& inputStor
// id
MSPersonControl& c = MSNet::getInstance()->getPersonControl();
std::string id = inputStorage.readString();
- MSPerson* p = c.get(id);
+ MSTransportable* p = c.get(id);
if (p == 0) {
return server.writeErrorStatusCmd(CMD_SET_PERSON_VARIABLE, "Person '" + id + "' is not known", outputStorage);
}
diff --git a/src/traci-server/TraCIServerAPI_Simulation.cpp b/src/traci-server/TraCIServerAPI_Simulation.cpp
index 9566e9d..92eced0 100644
--- a/src/traci-server/TraCIServerAPI_Simulation.cpp
+++ b/src/traci-server/TraCIServerAPI_Simulation.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Sept 2002
-/// @version $Id: TraCIServerAPI_Simulation.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: TraCIServerAPI_Simulation.cpp 18258 2015-04-21 13:20:47Z behrisch $
///
// APIs for getting/setting edge values via TraCI
/****************************************************************************/
@@ -86,7 +86,7 @@ TraCIServerAPI_Simulation::processGet(TraCIServer& server, tcpip::Storage& input
switch (variable) {
case VAR_TIME_STEP:
tempMsg.writeUnsignedByte(TYPE_INTEGER);
- tempMsg.writeInt(MSNet::getInstance()->getCurrentTimeStep());
+ tempMsg.writeInt((int)MSNet::getInstance()->getCurrentTimeStep());
break;
case VAR_LOADED_VEHICLES_NUMBER:
writeVehicleStateNumber(server, tempMsg, MSNet::VEHICLE_STATE_BUILT);
@@ -147,7 +147,7 @@ TraCIServerAPI_Simulation::processGet(TraCIServer& server, tcpip::Storage& input
break;
case VAR_DELTA_T:
tempMsg.writeUnsignedByte(TYPE_INTEGER);
- tempMsg.writeInt(DELTA_T);
+ tempMsg.writeInt((int)DELTA_T);
break;
case VAR_NET_BOUNDING_BOX: {
tempMsg.writeUnsignedByte(TYPE_BOUNDINGBOX);
@@ -190,12 +190,12 @@ TraCIServerAPI_Simulation::processGet(TraCIServer& server, tcpip::Storage& input
if (!server.readTypeCheckingString(inputStorage, id)) {
return server.writeErrorStatusCmd(CMD_GET_SIM_VARIABLE, "Retrieval of persons at busstop requires a string.", outputStorage);
}
- MSBusStop* s = MSNet::getInstance()->getBusStop(id);
+ MSStoppingPlace* s = MSNet::getInstance()->getBusStop(id);
if (s == 0) {
return server.writeErrorStatusCmd(CMD_GET_SIM_VARIABLE, "Unknown bus stop '" + id + "'.", outputStorage);
}
tempMsg.writeUnsignedByte(TYPE_INTEGER);
- tempMsg.writeInt(s->getPersonNumber());
+ tempMsg.writeInt(s->getTransportableNumber());
break;
}
default:
diff --git a/src/traci-server/TraCIServerAPI_TLS.cpp b/src/traci-server/TraCIServerAPI_TLS.cpp
index cb05682..501de97 100644
--- a/src/traci-server/TraCIServerAPI_TLS.cpp
+++ b/src/traci-server/TraCIServerAPI_TLS.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date 07.05.2009
-/// @version $Id: TraCIServerAPI_TLS.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: TraCIServerAPI_TLS.cpp 18213 2015-04-16 11:55:42Z behrisch $
///
// APIs for getting/setting traffic light values via TraCI
/****************************************************************************/
@@ -122,13 +122,13 @@ TraCIServerAPI_TLS::processGet(TraCIServer& server, tcpip::Storage& inputStorage
for (unsigned int j = 0; j < phaseNo; ++j) {
MSPhaseDefinition phase = logic->getPhase(j);
tempContent.writeUnsignedByte(TYPE_INTEGER);
- tempContent.writeInt(phase.duration);
+ tempContent.writeInt((int)phase.duration);
++cnt;
tempContent.writeUnsignedByte(TYPE_INTEGER);
- tempContent.writeInt(phase.minDuration);
+ tempContent.writeInt((int)phase.minDuration);
++cnt; // not implemented
tempContent.writeUnsignedByte(TYPE_INTEGER);
- tempContent.writeInt(phase.maxDuration);
+ tempContent.writeInt((int)phase.maxDuration);
++cnt; // not implemented
const std::string& state = phase.getState();
//unsigned int linkNo = (unsigned int)(vars.getActive()->getLinks().size());
@@ -316,7 +316,7 @@ TraCIServerAPI_TLS::processSet(TraCIServer& server, tcpip::Storage& inputStorage
if (index < 0 || vars.getActive()->getPhaseNumber() <= (unsigned int)index) {
return server.writeErrorStatusCmd(CMD_SET_TL_VARIABLE, "The phase index is not in the allowed range.", outputStorage);
}
- int duration = vars.getActive()->getPhase(index).duration;
+ const SUMOTime duration = vars.getActive()->getPhase(index).duration;
vars.getActive()->changeStepAndDuration(tlsControl, cTime, index, duration);
}
break;
diff --git a/src/traci-server/TraCIServerAPI_Vehicle.cpp b/src/traci-server/TraCIServerAPI_Vehicle.cpp
index 012f4e3..4b55963 100644
--- a/src/traci-server/TraCIServerAPI_Vehicle.cpp
+++ b/src/traci-server/TraCIServerAPI_Vehicle.cpp
@@ -8,7 +8,7 @@
/// @author Mario Krumnow
/// @author Jakob Erdmann
/// @date 07.05.2009
-/// @version $Id: TraCIServerAPI_Vehicle.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: TraCIServerAPI_Vehicle.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// APIs for getting/setting vehicle values via TraCI
/****************************************************************************/
@@ -97,6 +97,7 @@ TraCIServerAPI_Vehicle::processGet(TraCIServer& server, tcpip::Storage& inputSto
&& variable != VAR_ACCEL && variable != VAR_DECEL && variable != VAR_IMPERFECTION
&& variable != VAR_TAU && variable != VAR_BEST_LANES && variable != DISTANCE_REQUEST
&& variable != ID_COUNT && variable != VAR_STOPSTATE && variable != VAR_WAITING_TIME
+ && variable != VAR_ROUTE_INDEX
&& variable != VAR_PARAMETER
) {
return server.writeErrorStatusCmd(CMD_GET_VEHICLE_VARIABLE, "Get Vehicle Variable: unsupported variable specified", outputStorage);
@@ -112,7 +113,7 @@ TraCIServerAPI_Vehicle::processGet(TraCIServer& server, tcpip::Storage& inputSto
std::vector<std::string> ids;
MSVehicleControl& c = MSNet::getInstance()->getVehicleControl();
for (MSVehicleControl::constVehIt i = c.loadedVehBegin(); i != c.loadedVehEnd(); ++i) {
- if ((*i).second->isOnRoad()) {
+ if ((*i).second->isOnRoad() || (*i).second->isParking()) {
ids.push_back((*i).first);
}
}
@@ -133,33 +134,34 @@ TraCIServerAPI_Vehicle::processGet(TraCIServer& server, tcpip::Storage& inputSto
return server.writeErrorStatusCmd(CMD_GET_VEHICLE_VARIABLE, "Vehicle '" + id + "' is not a micro-simulation vehicle", outputStorage);
}
const bool onRoad = v->isOnRoad();
+ const bool visible = onRoad || v->isParking();
switch (variable) {
case VAR_SPEED:
tempMsg.writeUnsignedByte(TYPE_DOUBLE);
- tempMsg.writeDouble(onRoad ? v->getSpeed() : INVALID_DOUBLE_VALUE);
+ tempMsg.writeDouble(visible ? v->getSpeed() : INVALID_DOUBLE_VALUE);
break;
case VAR_SPEED_WITHOUT_TRACI:
tempMsg.writeUnsignedByte(TYPE_DOUBLE);
- tempMsg.writeDouble(onRoad ? v->getSpeedWithoutTraciInfluence() : INVALID_DOUBLE_VALUE);
+ tempMsg.writeDouble(visible ? v->getSpeedWithoutTraciInfluence() : INVALID_DOUBLE_VALUE);
break;
case VAR_POSITION:
tempMsg.writeUnsignedByte(POSITION_2D);
- tempMsg.writeDouble(onRoad ? v->getPosition().x() : INVALID_DOUBLE_VALUE);
- tempMsg.writeDouble(onRoad ? v->getPosition().y() : INVALID_DOUBLE_VALUE);
+ tempMsg.writeDouble(visible ? v->getPosition().x() : INVALID_DOUBLE_VALUE);
+ tempMsg.writeDouble(visible ? v->getPosition().y() : INVALID_DOUBLE_VALUE);
break;
case VAR_POSITION3D:
tempMsg.writeUnsignedByte(POSITION_3D);
- tempMsg.writeDouble(onRoad ? v->getPosition().x() : INVALID_DOUBLE_VALUE);
- tempMsg.writeDouble(onRoad ? v->getPosition().y() : INVALID_DOUBLE_VALUE);
- tempMsg.writeDouble(onRoad ? v->getPosition().z() : INVALID_DOUBLE_VALUE);
+ tempMsg.writeDouble(visible ? v->getPosition().x() : INVALID_DOUBLE_VALUE);
+ tempMsg.writeDouble(visible ? v->getPosition().y() : INVALID_DOUBLE_VALUE);
+ tempMsg.writeDouble(visible ? v->getPosition().z() : INVALID_DOUBLE_VALUE);
break;
case VAR_ANGLE:
tempMsg.writeUnsignedByte(TYPE_DOUBLE);
- tempMsg.writeDouble(onRoad ? v->getAngle() : INVALID_DOUBLE_VALUE);
+ tempMsg.writeDouble(visible ? v->getAngle() : INVALID_DOUBLE_VALUE);
break;
case VAR_ROAD_ID:
tempMsg.writeUnsignedByte(TYPE_STRING);
- tempMsg.writeString(onRoad ? v->getLane()->getEdge().getID() : "");
+ tempMsg.writeString(visible ? v->getLane()->getEdge().getID() : "");
break;
case VAR_LANE_ID:
tempMsg.writeUnsignedByte(TYPE_STRING);
@@ -182,6 +184,14 @@ TraCIServerAPI_Vehicle::processGet(TraCIServer& server, tcpip::Storage& inputSto
tempMsg.writeUnsignedByte(TYPE_STRING);
tempMsg.writeString(v->getRoute().getID());
break;
+ case VAR_ROUTE_INDEX:
+ tempMsg.writeUnsignedByte(TYPE_INTEGER);
+ if (v->hasDeparted()) {
+ tempMsg.writeInt((int)v->getRoutePosition());
+ } else {
+ tempMsg.writeInt(INVALID_INT_VALUE);
+ }
+ break;
case VAR_COLOR:
tempMsg.writeUnsignedByte(TYPE_COLOR);
tempMsg.writeUnsignedByte(v->getParameter().color.red());
@@ -195,31 +205,31 @@ TraCIServerAPI_Vehicle::processGet(TraCIServer& server, tcpip::Storage& inputSto
break;
case VAR_CO2EMISSION:
tempMsg.writeUnsignedByte(TYPE_DOUBLE);
- tempMsg.writeDouble(onRoad ? v->getCO2Emissions() : INVALID_DOUBLE_VALUE);
+ tempMsg.writeDouble(visible ? v->getCO2Emissions() : INVALID_DOUBLE_VALUE);
break;
case VAR_COEMISSION:
tempMsg.writeUnsignedByte(TYPE_DOUBLE);
- tempMsg.writeDouble(onRoad ? v->getCOEmissions() : INVALID_DOUBLE_VALUE);
+ tempMsg.writeDouble(visible ? v->getCOEmissions() : INVALID_DOUBLE_VALUE);
break;
case VAR_HCEMISSION:
tempMsg.writeUnsignedByte(TYPE_DOUBLE);
- tempMsg.writeDouble(onRoad ? v->getHCEmissions() : INVALID_DOUBLE_VALUE);
+ tempMsg.writeDouble(visible ? v->getHCEmissions() : INVALID_DOUBLE_VALUE);
break;
case VAR_PMXEMISSION:
tempMsg.writeUnsignedByte(TYPE_DOUBLE);
- tempMsg.writeDouble(onRoad ? v->getPMxEmissions() : INVALID_DOUBLE_VALUE);
+ tempMsg.writeDouble(visible ? v->getPMxEmissions() : INVALID_DOUBLE_VALUE);
break;
case VAR_NOXEMISSION:
tempMsg.writeUnsignedByte(TYPE_DOUBLE);
- tempMsg.writeDouble(onRoad ? v->getNOxEmissions() : INVALID_DOUBLE_VALUE);
+ tempMsg.writeDouble(visible ? v->getNOxEmissions() : INVALID_DOUBLE_VALUE);
break;
case VAR_FUELCONSUMPTION:
tempMsg.writeUnsignedByte(TYPE_DOUBLE);
- tempMsg.writeDouble(onRoad ? v->getFuelConsumption() : INVALID_DOUBLE_VALUE);
+ tempMsg.writeDouble(visible ? v->getFuelConsumption() : INVALID_DOUBLE_VALUE);
break;
case VAR_NOISEEMISSION:
tempMsg.writeUnsignedByte(TYPE_DOUBLE);
- tempMsg.writeDouble(onRoad ? v->getHarmonoise_NoiseEmissions() : INVALID_DOUBLE_VALUE);
+ tempMsg.writeDouble(visible ? v->getHarmonoise_NoiseEmissions() : INVALID_DOUBLE_VALUE);
break;
case VAR_PERSON_NUMBER:
tempMsg.writeUnsignedByte(TYPE_INTEGER);
@@ -251,7 +261,7 @@ TraCIServerAPI_Vehicle::processGet(TraCIServer& server, tcpip::Storage& inputSto
return server.writeErrorStatusCmd(CMD_GET_VEHICLE_VARIABLE, "Retrieval of travel time requires time, and edge as parameter.", outputStorage);
}
// time
- SUMOTime time = 0;
+ int time = 0;
if (!server.readTypeCheckingInt(inputStorage, time)) {
return server.writeErrorStatusCmd(CMD_GET_VEHICLE_VARIABLE, "Retrieval of travel time requires the referenced time as first parameter.", outputStorage);
}
@@ -283,7 +293,7 @@ TraCIServerAPI_Vehicle::processGet(TraCIServer& server, tcpip::Storage& inputSto
return server.writeErrorStatusCmd(CMD_GET_VEHICLE_VARIABLE, "Retrieval of travel time requires time, and edge as parameter.", outputStorage);
}
// time
- SUMOTime time = 0;
+ int time = 0;
if (!server.readTypeCheckingInt(inputStorage, time)) {
return server.writeErrorStatusCmd(CMD_GET_VEHICLE_VARIABLE, "Retrieval of effort requires the referenced time as first parameter.", outputStorage);
}
@@ -366,10 +376,15 @@ TraCIServerAPI_Vehicle::processGet(TraCIServer& server, tcpip::Storage& inputSto
}
break;
case VAR_STOPSTATE: {
- char b = (
- 1 * (v->isStopped() ? 1 : 0) +
- 2 * (v->isParking() ? 1 : 0) +
- 4 * (v->isStoppedTriggered() ? 1 : 0));
+ char b = 0;
+ if (v->isStopped()) {
+ const MSVehicle::Stop& stop = v->getNextStop();
+ b = 1 + (stop.parking ? 2 : 0) +
+ (stop.triggered ? 4 : 0) +
+ (stop.containerTriggered ? 8 : 0) +
+ (stop.busstop != 0 ? 16 : 0) +
+ (stop.containerstop != 0 ? 32 : 0);
+ }
tempMsg.writeUnsignedByte(TYPE_UBYTE);
tempMsg.writeUnsignedByte(b);
}
@@ -441,6 +456,9 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
}
// id
std::string id = inputStorage.readString();
+#ifdef DEBUG_VTD
+ WRITE_MESSAGE("Processing " + id);
+#endif
const bool shouldExist = variable != ADD && variable != ADD_FULL;
SUMOVehicle* sumoVehicle = MSNet::getInstance()->getVehicleControl().getVehicle(id);
if (sumoVehicle == 0) {
@@ -458,8 +476,8 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Stop needs a compound object description.", outputStorage);
}
int compoundSize = inputStorage.readInt();
- if (compoundSize != 4 && compoundSize != 5) {
- return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Stop needs a compound object description of four of five items.", outputStorage);
+ if (compoundSize < 4 || compoundSize > 7) {
+ return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Stop needs a compound object description of four to seven items.", outputStorage);
}
// read road map position
std::string roadId;
@@ -468,14 +486,14 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
}
double pos = 0;
if (!server.readTypeCheckingDouble(inputStorage, pos)) {
- return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The second stop parameter must be the position along the edge given as a double.", outputStorage);
+ return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The second stop parameter must be the end position along the edge given as a double.", outputStorage);
}
int laneIndex = 0;
if (!server.readTypeCheckingByte(inputStorage, laneIndex)) {
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The third stop parameter must be the lane index given as a byte.", outputStorage);
}
// waitTime
- SUMOTime waitTime = 0;
+ int waitTime = -1;
if (!server.readTypeCheckingInt(inputStorage, waitTime)) {
return server.writeErrorStatusCmd(CMD_GET_VEHICLE_VARIABLE, "The fourth stop parameter must be the waiting time given as an integer.", outputStorage);
}
@@ -483,31 +501,62 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
bool parking = false;
bool triggered = false;
bool containerTriggered = false;
- if (compoundSize == 5) {
+ bool isBusStop = false;
+ bool isContainerStop = false;
+ if (compoundSize >= 5) {
int stopFlags;
if (!server.readTypeCheckingByte(inputStorage, stopFlags)) {
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The fifth stop parameter must be a byte indicating its parking/triggered status.", outputStorage);
}
parking = ((stopFlags & 1) != 0);
triggered = ((stopFlags & 2) != 0);
+ containerTriggered = ((stopFlags & 4) != 0);
+ isBusStop = ((stopFlags & 8) != 0);
+ isContainerStop = ((stopFlags & 16) != 0);
+ }
+ double startPos = pos - POSITION_EPS;
+ if (compoundSize >= 6) {
+ double tmp;
+ if (!server.readTypeCheckingDouble(inputStorage, tmp)) {
+ return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The sixth stop parameter must be the start position along the edge given as a double.", outputStorage);
+ }
+ if (tmp != INVALID_DOUBLE_VALUE) {
+ startPos = tmp;
+ }
}
- // check
- if (pos < 0) {
- return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Position on lane must not be negative.", outputStorage);
- }
- // get the actual lane that is referenced by laneIndex
- MSEdge* road = MSEdge::dictionary(roadId);
- if (road == 0) {
- return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Unable to retrieve road with given id.", outputStorage);
- }
- const std::vector<MSLane*>& allLanes = road->getLanes();
- if ((laneIndex < 0) || laneIndex >= (int)(allLanes.size())) {
- return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "No lane with index '" + toString(laneIndex) + "' on road '" + roadId + "'.", outputStorage);
+ int until = -1;
+ if (compoundSize >= 7) {
+ if (!server.readTypeCheckingInt(inputStorage, until)) {
+ return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The seventh stop parameter must be the waiting end time given as integer.", outputStorage);
+ }
}
- // Forward command to vehicle
std::string error;
- if (!v->addTraciStop(allLanes[laneIndex], pos, 0, waitTime, parking, triggered, containerTriggered, error)) {
- return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, error, outputStorage);
+ if (isBusStop || isContainerStop) {
+ // Forward command to vehicle
+ if (!v->addTraciBusOrContainerStop(roadId, waitTime, until, parking, triggered, containerTriggered, isContainerStop, error)) {
+ return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, error, outputStorage);
+ }
+ } else {
+ // check
+ if (startPos < 0) {
+ return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Position on lane must not be negative.", outputStorage);
+ }
+ if (pos < startPos) {
+ return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "End position on lane must be after start position.", outputStorage);
+ }
+ // get the actual lane that is referenced by laneIndex
+ MSEdge* road = MSEdge::dictionary(roadId);
+ if (road == 0) {
+ return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Unable to retrieve road with given id.", outputStorage);
+ }
+ const std::vector<MSLane*>& allLanes = road->getLanes();
+ if ((laneIndex < 0) || laneIndex >= (int)(allLanes.size())) {
+ return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "No lane with index '" + toString(laneIndex) + "' on road '" + roadId + "'.", outputStorage);
+ }
+ // Forward command to vehicle
+ if (!v->addTraciStop(allLanes[laneIndex], startPos, pos, waitTime, until, parking, triggered, containerTriggered, error)) {
+ return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, error, outputStorage);
+ }
}
}
break;
@@ -550,7 +599,7 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The first lane change parameter must be the lane index given as a byte.", outputStorage);
}
// stickyTime
- SUMOTime stickyTime = 0;
+ int stickyTime = 0;
if (!server.readTypeCheckingInt(inputStorage, stickyTime)) {
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The second lane change parameter must be the duration given as an integer.", outputStorage);
}
@@ -610,7 +659,7 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
if (newSpeed < 0) {
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Speed must not be negative", outputStorage);
}
- SUMOTime duration = 0;
+ int duration = 0;
if (!server.readTypeCheckingInt(inputStorage, duration)) {
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The second slow down parameter must be the duration given as an integer.", outputStorage);
}
@@ -688,7 +737,7 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
int parameterCount = inputStorage.readInt();
if (parameterCount == 4) {
// begin time
- SUMOTime begTime = 0, endTime = 0;
+ int begTime = 0, endTime = 0;
if (!server.readTypeCheckingInt(inputStorage, begTime)) {
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Setting travel time using 4 parameters requires the begin time as first parameter.", outputStorage);
}
@@ -731,7 +780,7 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
while (v->getWeightsStorage().knowsTravelTime(edge)) {
v->getWeightsStorage().removeTravelTime(edge);
}
- v->getWeightsStorage().addTravelTime(edge, 0, SUMOTime_MAX, value);
+ v->getWeightsStorage().addTravelTime(edge, SUMOReal(0), SUMOReal(SUMOTime_MAX), value);
} else if (parameterCount == 1) {
// edge
std::string edgeID;
@@ -758,7 +807,7 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
int parameterCount = inputStorage.readInt();
if (parameterCount == 4) {
// begin time
- SUMOTime begTime = 0, endTime = 0;
+ int begTime = 0, endTime = 0;
if (!server.readTypeCheckingInt(inputStorage, begTime)) {
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Setting effort using 4 parameters requires the begin time as first parameter.", outputStorage);
}
@@ -801,7 +850,7 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
while (v->getWeightsStorage().knowsEffort(edge)) {
v->getWeightsStorage().removeEffort(edge);
}
- v->getWeightsStorage().addEffort(edge, 0, SUMOTime_MAX, value);
+ v->getWeightsStorage().addEffort(edge, SUMOReal(0), SUMOReal(SUMOTime_MAX), value);
} else if (parameterCount == 1) {
// edge
std::string edgeID;
@@ -877,7 +926,11 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Vehicle '" + laneID + "' may be set onto an edge to pass only.", outputStorage);
}
v->onRemovalFromNet(MSMoveReminder::NOTIFICATION_TELEPORT);
- v->getLane()->removeVehicle(v, MSMoveReminder::NOTIFICATION_TELEPORT);
+ if (v->getLane() != 0) {
+ v->getLane()->removeVehicle(v, MSMoveReminder::NOTIFICATION_TELEPORT);
+ } else {
+ v->setTentativeLaneAndPosition(l, position);
+ }
while (v->getEdge() != &destinationEdge) {
const MSEdge* nextEdge = v->succEdge(1);
// let the vehicle move to the next edge
@@ -961,18 +1014,21 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
if (!route) {
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Invalid route '" + routeID + "' for vehicle: '" + id + "'", outputStorage);
}
-
- if (!server.readTypeCheckingInt(inputStorage, vehicleParams.depart)) {
+ int depart;
+ if (!server.readTypeCheckingInt(inputStorage, depart)) {
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Third parameter (depart) requires an integer.", outputStorage);
}
- if (vehicleParams.depart < 0) {
- const int proc = static_cast<int>(-vehicleParams.depart);
+ if (depart < 0) {
+ const int proc = -depart;
if (proc >= static_cast<int>(DEPART_DEF_MAX)) {
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Invalid departure time.", outputStorage);
}
vehicleParams.departProcedure = (DepartDefinition)proc;
- } else if (vehicleParams.depart < MSNet::getInstance()->getCurrentTimeStep()) {
- return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Departure time in the past.", outputStorage);
+ } else if (depart < MSNet::getInstance()->getCurrentTimeStep()) {
+ vehicleParams.depart = MSNet::getInstance()->getCurrentTimeStep();
+ WRITE_WARNING("Departure time for vehicle '" + id + "' is in the past; using current time instead.");
+ } else {
+ vehicleParams.depart = depart;
}
double pos;
@@ -1124,7 +1180,6 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
if (!server.readTypeCheckingInt(inputStorage, num)) {
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "13th parameter (person capacity) requires an int.", outputStorage);
}
- vehicleParams.personCapacity = num;
if (!server.readTypeCheckingInt(inputStorage, num)) {
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "14th parameter (person number) requires an int.", outputStorage);
}
@@ -1196,7 +1251,10 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The second parameter for setting a VTD vehicle must be lane given as an int.", outputStorage);
}
// x
- double x = 0, y = 0, angle = 0;
+ double x = 0;
+ double y = 0;
+ double angle = 0;
+ double origAngle = 0;
if (!server.readTypeCheckingDouble(inputStorage, x)) {
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The third parameter for setting a VTD vehicle must be the x-position given as a double.", outputStorage);
}
@@ -1205,7 +1263,7 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The fourth parameter for setting a VTD vehicle must be the y-position given as a double.", outputStorage);
}
// angle
- if (!server.readTypeCheckingDouble(inputStorage, angle)) {
+ if (!server.readTypeCheckingDouble(inputStorage, origAngle)) {
return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The fifth parameter for setting a VTD vehicle must be the angle given as a double.", outputStorage);
}
// process
@@ -1219,15 +1277,17 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
}
Position pos(x, y);
angle *= -1.;
- if (fabs(angle) > 180.) {
- angle = 180. - angle;
+ if (angle >= 180.) {
+ angle = -360. + angle;
+ } else if (angle <= -180.) {
+ angle = 360. + angle;
}
Position vehPos = v->getPosition();
v->getBestLanes();
#ifdef DEBUG_VTD
std::cout << std::endl << "begin vehicle " << v->getID() << " vehPos:" << vehPos << " lane:" << v->getLane()->getID() << std::endl;
- std::cout << " want pos:" << pos << " edge:" << edgeID << " laneNum:" << laneNum << " angle:" << angle << std::endl;
+ std::cout << " want pos:" << pos << " edge:" << edgeID << " laneNum:" << laneNum << " origAngle:" << origAngle << " angle:" << angle << std::endl;
#endif
ConstMSEdgeVector edges;
@@ -1235,23 +1295,28 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
SUMOReal lanePos;
SUMOReal bestDistance = std::numeric_limits<SUMOReal>::max();
int routeOffset = 0;
- // case a): edge/lane is known and matches route
- bool dFound = vtdMap(pos, origID, angle, *v, server, bestDistance, &lane, lanePos, routeOffset, edges);
- //
- SUMOReal maxRouteDistance = 100;
- /*
- if (cFound && (bestDistanceA > maxRouteDistance && bestDistanceC > maxRouteDistance)) {
- // both route-based approach yield in a position too far away from the submitted --> new route!?
- server.setVTDControlled(v, laneC, lanePosC, routeOffsetC, edgesC);
- } else {
- */
- // use the best we have
- if (dFound && maxRouteDistance > bestDistance) {
- server.setVTDControlled(v, lane, lanePos, routeOffset, edges, MSNet::getInstance()->getCurrentTimeStep());
+ /* EGO vehicle is known to have a fixed route. @todo make this into a parameter of the TraCI call */
+ if (v->getID() != "VTD_EGO") {
+ // case a): vehicle is on its earlier route
+ // we additionally assume it is moving forward (SUMO-limit);
+ // note that the route ("edges") is not changed in this case
+ bool found = vtdMap_matchingRoutePosition(pos, origID, *v, bestDistance, &lane, lanePos, routeOffset, edges);
+ SUMOReal maxRouteDistance = 100;
+ // use the best we have
+ if (found && maxRouteDistance > bestDistance) {
+ server.setVTDControlled(v, lane, lanePos, routeOffset, edges, MSNet::getInstance()->getCurrentTimeStep());
+ }
} else {
- return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Could not map vehicle '" + id + "'.", outputStorage);
+ // case b): vehicle does not follow a pre-fixed route (regard the limiting factor in maxRouteDistance)
+ bool found = vtdMap(pos, origID, angle, *v, server, bestDistance, &lane, lanePos, routeOffset, edges);
+ SUMOReal maxRouteDistance = 100;
+ // use the best we have
+ if (found && maxRouteDistance > bestDistance) {
+ server.setVTDControlled(v, lane, lanePos, routeOffset, edges, MSNet::getInstance()->getCurrentTimeStep());
+ } else {
+ return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Could not map vehicle '" + id + "'.", outputStorage);
+ }
}
- //}
}
break;
case VAR_SPEED_FACTOR: {
@@ -1297,6 +1362,7 @@ TraCIServerAPI_Vehicle::processSet(TraCIServer& server, tcpip::Storage& inputSto
bool
TraCIServerAPI_Vehicle::vtdMap(const Position& pos, const std::string& origID, const SUMOReal angle, MSVehicle& v, TraCIServer& server,
SUMOReal& bestDistance, MSLane** lane, SUMOReal& lanePos, int& routeOffset, ConstMSEdgeVector& edges) {
+ // collect edges around the vehicle
SUMOReal speed = pos.distanceTo2D(v.getPosition()); // !!!v.getSpeed();
std::set<std::string> into;
PositionVector shape;
@@ -1304,46 +1370,73 @@ TraCIServerAPI_Vehicle::vtdMap(const Position& pos, const std::string& origID, c
server.collectObjectsInRange(CMD_GET_EDGE_VARIABLE, shape, speed * 2, into);
SUMOReal maxDist = 0;
std::map<MSLane*, LaneUtility> lane2utility;
+ // compute utility for all candidate edges
for (std::set<std::string>::const_iterator j = into.begin(); j != into.end(); ++j) {
MSEdge* e = MSEdge::dictionary(*j);
const MSEdge* prevEdge = 0;
const MSEdge* nextEdge = 0;
MSEdge::EdgeBasicFunction ef = e->getPurpose();
bool onRoute = false;
+ // the next if/the clause sets "onRoute", "prevEdge", and "nextEdge", depending on
+ // whether the currently seen edge is an internal one or a normal one
if (ef != MSEdge::EDGEFUNCTION_INTERNAL) {
+#ifdef DEBUG_VTD_ANGLE
+ std::cout << "Ego on normal" << std::endl;
+#endif
+ // a normal edge
+ //
+ // check whether the currently seen edge is in the vehicle's route
+ // - either the one it's on or one of the next edges
const ConstMSEdgeVector& ev = v.getRoute().getEdges();
unsigned int routePosition = v.getRoutePosition();
if (v.getLane()->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) {
++routePosition;
}
ConstMSEdgeVector::const_iterator edgePos = std::find(ev.begin() + routePosition, ev.end(), e);
- onRoute = edgePos != ev.end();
+ onRoute = edgePos != ev.end(); // no? -> onRoute is false
if (edgePos == ev.end() - 1 && v.getEdge() == e) {
+ // onRoute is false as well if the vehicle is beyond the edge
onRoute &= v.getEdge()->getLanes()[0]->getLength() > v.getPositionOnLane() + SPEED2DIST(speed);
}
+ // save prior and next edges
prevEdge = e;
nextEdge = !onRoute || edgePos == ev.end() - 1 ? 0 : *(edgePos + 1);
+#ifdef DEBUG_VTD_ANGLE
+ std::cout << "normal:" << e->getID() << " prev:" << prevEdge->getID() << " next:";
+ if (nextEdge != 0) {
+ std::cout << nextEdge->getID();
+ }
+ std::cout << std::endl;
+#endif
} else {
+#ifdef DEBUG_VTD_ANGLE
+ std::cout << "Ego on internal" << std::endl;
+#endif
+ // an internal edge
+ // get the previous edge
prevEdge = e;
while (prevEdge != 0 && prevEdge->getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) {
MSLane* l = prevEdge->getLanes()[0];
l = l->getLogicalPredecessorLane();
prevEdge = l == 0 ? 0 : &l->getEdge();
}
+ // check whether the previous edge is on the route (was on the route)
const ConstMSEdgeVector& ev = v.getRoute().getEdges();
ConstMSEdgeVector::const_iterator prevEdgePos = std::find(ev.begin() + v.getRoutePosition(), ev.end(), prevEdge);
- if (prevEdgePos != ev.end() && ev.size() > 1 && prevEdgePos != ev.end() - 1) {
- const MSJunction* junction = e->getFromJunction();
- const ConstMSEdgeVector& outgoing = junction->getOutgoing();
- ConstMSEdgeVector::const_iterator nextEdgePos = std::find(outgoing.begin(), outgoing.end(), *(ev.begin() + v.getRoutePosition() + 1));
- if (nextEdgePos != outgoing.end()) {
- nextEdge = *nextEdgePos;
- onRoute = true;
- }
+ nextEdge = e;
+ while (nextEdge != 0 && nextEdge->getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) {
+ nextEdge = nextEdge->getSuccessors()[0]; // should be only one for an internal edge
+ }
+ if (prevEdgePos != ev.end()) {
+ onRoute = *(prevEdgePos + 1) == nextEdge;
}
+#ifdef DEBUG_VTD_ANGLE
+ std::cout << "internal:" << e->getID() << " prev:" << prevEdge->getID() << " next:" << nextEdge->getID() << std::endl;
+#endif
}
+ // weight the lanes...
const std::vector<MSLane*>& lanes = e->getLanes();
for (std::vector<MSLane*>::const_iterator k = lanes.begin(); k != lanes.end(); ++k) {
MSLane* lane = *k;
@@ -1359,23 +1452,28 @@ TraCIServerAPI_Vehicle::vtdMap(const Position& pos, const std::string& origID, c
langle = lane->getShape().rotationDegreeAtOffset(off);
}
}
- maxDist = MAX2(maxDist, dist);
bool sameEdge = &lane->getEdge() == &v.getLane()->getEdge() && v.getEdge()->getLanes()[0]->getLength() > v.getPositionOnLane() + SPEED2DIST(speed);
+ /*
const MSEdge* rNextEdge = nextEdge;
- if (rNextEdge == 0 && lane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) {
+ while(rNextEdge==0&&lane->getEdge().getPurpose()==MSEdge::EDGEFUNCTION_INTERNAL) {
MSLane* next = lane->getLinkCont()[0]->getLane();
rNextEdge = next == 0 ? 0 : &next->getEdge();
}
+ */
#ifdef DEBUG_VTD_ANGLE
std::cout << lane->getID() << ": " << langle << " " << off << std::endl;
#endif
lane2utility[lane] = LaneUtility(
dist, GeomHelper::getMinAngleDiff(angle, langle),
lane->getParameter("origId", "") == origID,
- onRoute, sameEdge, prevEdge, rNextEdge);
+ onRoute, sameEdge, prevEdge, nextEdge);
+ // update scaling value
+ maxDist = MAX2(maxDist, dist);
+
}
}
+ // get the best lane given the previously computed values
SUMOReal bestValue = 0;
MSLane* bestLane = 0;
for (std::map<MSLane*, LaneUtility>::iterator i = lane2utility.begin(); i != lane2utility.end(); ++i) {
@@ -1386,12 +1484,11 @@ TraCIServerAPI_Vehicle::vtdMap(const Position& pos, const std::string& origID, c
SUMOReal idN = u.ID ? 1 : 0;
SUMOReal onRouteN = u.onRoute ? 1 : 0;
SUMOReal sameEdgeN = u.sameEdge ? MIN2(v.getEdge()->getLength() / speed, (SUMOReal)1.) : 0;
- SUMOReal value = distN * .5
- + angleDiffN * 0 /*.5 */
- + idN * .5
- + onRouteN * 0.5
- + sameEdgeN * 0.5
- ;
+ SUMOReal value = (distN * .35
+ + angleDiffN * 0.35 /*.5 */
+ + idN * .1
+ + onRouteN * 0.1
+ + sameEdgeN * 0.1);
#ifdef DEBUG_VTD
std::cout << " x; l:" << l->getID() << " d:" << u.dist << " dN:" << distN << " aD:" << angleDiffN <<
" ID:" << idN << " oRN:" << onRouteN << " sEN:" << sameEdgeN << " value:" << value << std::endl;
@@ -1401,6 +1498,7 @@ TraCIServerAPI_Vehicle::vtdMap(const Position& pos, const std::string& origID, c
bestLane = l;
}
}
+ // no best lane found, return
if (bestLane == 0) {
return false;
}
@@ -1414,15 +1512,92 @@ TraCIServerAPI_Vehicle::vtdMap(const Position& pos, const std::string& origID, c
ConstMSEdgeVector::const_iterator prevEdgePos = std::find(ev.begin() + v.getRoutePosition(), ev.end(), prevEdge);
routeOffset = (int)std::distance(ev.begin(), prevEdgePos) - v.getRoutePosition();
} else {
- edges.push_back(prevEdge);
+ edges.push_back(u.prevEdge);
+ /*
+ if(bestLane->getEdge().getPurpose()!=MSEdge::EDGEFUNCTION_INTERNAL) {
+ edges.push_back(&bestLane->getEdge());
+ }
+ */
if (u.nextEdge != 0) {
edges.push_back(u.nextEdge);
}
routeOffset = 0;
+#ifdef DEBUG_VTD_ANGLE
+ std::cout << "internal2:" << " prev:";
+ if (u.prevEdge != 0) {
+ std::cout << u.prevEdge->getID();
+ }
+ std::cout << " next:";
+ if (u.nextEdge != 0) {
+ std::cout << u.nextEdge->getID();
+ }
+ std::cout << std::endl;
+#endif
}
return true;
}
+
+bool
+TraCIServerAPI_Vehicle::vtdMap_matchingRoutePosition(const Position& pos, const std::string& origID, MSVehicle& v,
+ SUMOReal& bestDistance, MSLane** lane, SUMOReal& lanePos, int& routeOffset, ConstMSEdgeVector& /*edges*/) {
+
+ int lastBestRouteEdge = 0; // index of the best edge found when going down the route's list of edges
+ int lastRouteEdge = 0; // last non-internal edge on the route (seen so far)
+ // get the lanes the vehicle may use
+ const std::vector<MSLane*>& bestLaneConts = v.getBestLanesContinuation(v.getLane());
+ for (std::vector<MSLane*>::const_iterator i = bestLaneConts.begin(); i != bestLaneConts.end() && bestDistance > POSITION_EPS; ++i) { // yes, we quit if the distance is < 0.1m or so
+ if (*i == 0) { // why is that possible???
+ continue;
+ }
+ MSEdge& e = (*i)->getEdge();
+ if (i != bestLaneConts.begin() && e.getPurpose() != MSEdge::EDGEFUNCTION_INTERNAL) {
+ ++lastRouteEdge; // increment index, if not internal and not the current one
+ }
+ const std::vector<MSLane*>& lanes = e.getLanes(); // go over the edge's lanes
+ for (std::vector<MSLane*>::const_iterator k = lanes.begin(); k != lanes.end() && bestDistance > POSITION_EPS; ++k) {
+ MSLane* cl = *k;
+ SUMOReal dist = cl->getShape().distance(pos); // get distance
+#ifdef DEBUG_VTD
+ std::cout << " b at lane " << cl->getID() << " dist:" << dist << " best:" << bestDistance << std::endl;
+#endif
+ if (dist < bestDistance) {
+ // is the new distance the best one? keep then...
+ bestDistance = dist;
+ *lane = cl;
+ lastBestRouteEdge = lastRouteEdge;
+ }
+ }
+ }
+ // quit if no solution was found, reporting a failure
+ if (lane == 0) {
+#ifdef DEBUG_VTD
+ std::cout << " b failed - no best route lane" << std::endl;
+#endif
+ return false;
+ }
+ // position may be inaccurate; let's checkt the given index, too
+ // a) is enabled for non-internal lanes only, as otherwise the position information may ambiguous
+ // b) it's something one has to enable when building the nework - keepin the OSM IDs - is probably not always done
+ if ((*lane)->getEdge().getPurpose() != MSEdge::EDGEFUNCTION_INTERNAL) {
+ const std::vector<MSLane*>& lanes = (*lane)->getEdge().getLanes();
+ for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
+ if ((*i)->getParameter("origId", "") == origID) {
+ *lane = *i;
+ break;
+ }
+ }
+ }
+ // check position, stuff, we should have the best lane along the route
+ lanePos = MAX2(SUMOReal(0), MIN2(SUMOReal((*lane)->getLength() - POSITION_EPS), (*lane)->getShape().nearest_offset_to_point2D(pos, false)));
+ routeOffset = lastBestRouteEdge;
+#ifdef DEBUG_VTD
+ std::cout << " b ok lane " << (*lane)->getID() << " lanePos:" << lanePos << " best:" << lastBestRouteEdge << std::endl;
+#endif
+ return true;
+}
+
+
bool
TraCIServerAPI_Vehicle::commandDistanceRequest(TraCIServer& server, tcpip::Storage& inputStorage,
tcpip::Storage& outputStorage, const MSVehicle* v) {
diff --git a/src/traci-server/TraCIServerAPI_Vehicle.h b/src/traci-server/TraCIServerAPI_Vehicle.h
index 3d1b58d..a0971b8 100644
--- a/src/traci-server/TraCIServerAPI_Vehicle.h
+++ b/src/traci-server/TraCIServerAPI_Vehicle.h
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date 07.05.2009
-/// @version $Id: TraCIServerAPI_Vehicle.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: TraCIServerAPI_Vehicle.h 18756 2015-08-31 19:16:33Z behrisch $
///
// APIs for getting/setting vehicle values via TraCI
/****************************************************************************/
@@ -87,6 +87,9 @@ private:
static bool vtdMap(const Position& pos, const std::string& origID, const SUMOReal angle, MSVehicle& v, TraCIServer& server,
SUMOReal& bestDistance, MSLane** lane, SUMOReal& lanePos, int& routeOffset, ConstMSEdgeVector& edges);
+ static bool vtdMap_matchingRoutePosition(const Position& pos, const std::string& origID, MSVehicle& v,
+ SUMOReal& bestDistance, MSLane** lane, SUMOReal& lanePos, int& routeOffset, ConstMSEdgeVector& edges);
+
static std::map<std::string, std::vector<MSLane*> > gVTDMap;
diff --git a/src/traci_testclient/TraCITestClient.cpp b/src/traci_testclient/TraCITestClient.cpp
index 6bc2eb5..2282a9a 100644
--- a/src/traci_testclient/TraCITestClient.cpp
+++ b/src/traci_testclient/TraCITestClient.cpp
@@ -7,7 +7,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date 2008/04/07
-/// @version $Id: TraCITestClient.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: TraCITestClient.cpp 18213 2015-04-16 11:55:42Z behrisch $
///
/// A test execution class
/****************************************************************************/
@@ -263,7 +263,7 @@ TraCITestClient::commandSetValue(int domID, int varID, const std::string& objID,
void
-TraCITestClient::commandSubscribeObjectVariable(int domID, const std::string& objID, int beginTime, int endTime, int varNo, std::ifstream& defFile) {
+TraCITestClient::commandSubscribeObjectVariable(int domID, const std::string& objID, SUMOTime beginTime, SUMOTime endTime, int varNo, std::ifstream& defFile) {
std::vector<int> vars;
for (int i = 0; i < varNo; ++i) {
int var;
@@ -287,7 +287,7 @@ TraCITestClient::commandSubscribeObjectVariable(int domID, const std::string& ob
void
-TraCITestClient::commandSubscribeContextVariable(int domID, const std::string& objID, int beginTime, int endTime,
+TraCITestClient::commandSubscribeContextVariable(int domID, const std::string& objID, SUMOTime beginTime, SUMOTime endTime,
int domain, SUMOReal range, int varNo, std::ifstream& defFile) {
std::vector<int> vars;
for (int i = 0; i < varNo; ++i) {
diff --git a/src/traci_testclient/TraCITestClient.h b/src/traci_testclient/TraCITestClient.h
index 566d28c..0d8fae1 100644
--- a/src/traci_testclient/TraCITestClient.h
+++ b/src/traci_testclient/TraCITestClient.h
@@ -5,7 +5,7 @@
/// @author Axel Wegener
/// @author Michael Behrisch
/// @date 2008/04/07
-/// @version $Id: TraCITestClient.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: TraCITestClient.h 18213 2015-04-16 11:55:42Z behrisch $
///
/// A test execution class
/****************************************************************************/
@@ -105,7 +105,7 @@ protected:
* @param[in] varNo The number of subscribed variables
* @param[in] defFile The stream to read variable values from
*/
- void commandSubscribeObjectVariable(int domID, const std::string& objID, int beginTime, int endTime, int varNo, std::ifstream& defFile);
+ void commandSubscribeObjectVariable(int domID, const std::string& objID, SUMOTime beginTime, SUMOTime endTime, int varNo, std::ifstream& defFile);
/** @brief Sends and validates a SubscribeContext command
@@ -118,7 +118,7 @@ protected:
* @param[in] varNo The number of subscribed variables
* @param[in] defFile The stream to read variable values from
*/
- void commandSubscribeContextVariable(int domID, const std::string& objID, int beginTime, int endTime, int domain, SUMOReal range, int varNo, std::ifstream& defFile);
+ void commandSubscribeContextVariable(int domID, const std::string& objID, SUMOTime beginTime, SUMOTime endTime, int domain, SUMOReal range, int varNo, std::ifstream& defFile);
/// @}
diff --git a/src/utils/common/RandHelper.h b/src/utils/common/RandHelper.h
index e175aab..438b407 100644
--- a/src/utils/common/RandHelper.h
+++ b/src/utils/common/RandHelper.h
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Fri, 29.04.2005
-/// @version $Id: RandHelper.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: RandHelper.h 18239 2015-04-20 11:37:12Z behrisch $
///
//
/****************************************************************************/
@@ -88,6 +88,16 @@ public:
return minV + rand(maxV - minV);
}
+ /// @brief Returns a random 64 bit integer in [0, maxV-1]
+ static inline long long int rand(long long int maxV) {
+ return (long long int) RandHelper::myRandomNumberGenerator.randInt64((unsigned long long int)(maxV - 1));
+ }
+
+ /// @brief Returns a random 64 bit integer in [minV, maxV-1]
+ static inline long long int rand(long long int minV, long long int maxV) {
+ return minV + rand(maxV - minV);
+ }
+
/// @brief Access to a random number from a normal distribution
static inline SUMOReal randNorm(SUMOReal mean, SUMOReal variance, MTRand* rng = 0) {
if (rng == 0) {
diff --git a/src/utils/common/SUMOTime.h b/src/utils/common/SUMOTime.h
index 3e0b850..76d6a58 100644
--- a/src/utils/common/SUMOTime.h
+++ b/src/utils/common/SUMOTime.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Fri, 29.04.2005
-/// @version $Id: SUMOTime.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: SUMOTime.h 18239 2015-04-20 11:37:12Z behrisch $
///
// Variables, methods, and tools for internal time representation
/****************************************************************************/
@@ -32,7 +32,7 @@
#include <config.h>
#endif
-#include <climits>
+#include <limits>
#include <string>
#include "UtilExceptions.h"
@@ -40,10 +40,10 @@
// ===========================================================================
// type definitions
// ===========================================================================
-typedef int SUMOTime;
-#define SUMOTime_MAX INT_MAX
-#define SUMOTime_MIN INT_MIN
-#define SUMOTIME_MAXSTRING "2147483" // INT_MAX / 1000
+typedef long long int SUMOTime;
+#define SUMOTime_MAX std::numeric_limits<SUMOTime>::max()
+#define SUMOTime_MIN std::numeric_limits<SUMOTime>::min()
+#define SUMOTIME_MAXSTRING "9223372036854774" // SUMOTime_MAX / 1000 - 1 (because of rounding errors)
#ifndef HAVE_SUBSECOND_TIMESTEPS
// the step length in s
diff --git a/src/utils/common/SUMOVehicleClass.cpp b/src/utils/common/SUMOVehicleClass.cpp
index 4d78a22..bebdb28 100644
--- a/src/utils/common/SUMOVehicleClass.cpp
+++ b/src/utils/common/SUMOVehicleClass.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Walter Bamberger
/// @date 2006-01-24
-/// @version $Id: SUMOVehicleClass.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: SUMOVehicleClass.cpp 18432 2015-05-21 13:04:55Z behrisch $
///
// Definitions of SUMO vehicle classes and helper functions
/****************************************************************************/
@@ -38,6 +38,7 @@
#include <utils/common/ToString.h>
#include <utils/common/MsgHandler.h>
#include <utils/common/StringTokenizer.h>
+#include <utils/iodevices/OutputDevice.h>
#ifdef CHECK_MEMORY_LEAKS
@@ -148,23 +149,6 @@ const SVCPermissions SVC_UNSPECIFIED = -1;
// ------------ Conversion of SUMOVehicleClass
std::string
-getVehicleClassCompoundName(int id) {
- std::string ret;
- const std::vector<std::string> names = SumoVehicleClassStrings.getStrings();
- for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); it++) {
- if ((id & SumoVehicleClassStrings.get(*it))) {
- ret += ("|" + *it);
- }
- }
- if (ret.length() > 0) {
- return ret.substr(1);
- } else {
- return ret;
- }
-}
-
-
-std::string
getVehicleClassNames(SVCPermissions permissions) {
if (permissions == SVCAll) {
return "all";
@@ -274,6 +258,39 @@ parseVehicleClasses(const std::vector<std::string>& allowedS) {
}
+void
+writePermissions(OutputDevice& into, SVCPermissions permissions) {
+ if (permissions == SVCAll) {
+ return;
+ } else if (permissions == 0) {
+ into.writeAttr(SUMO_ATTR_DISALLOW, "all");
+ return;
+ } else {
+ size_t num_allowed = 0;
+ for (int mask = 1; mask <= SUMOVehicleClass_MAX; mask = mask << 1) {
+ if ((mask & permissions) == mask) {
+ ++num_allowed;
+ }
+ }
+ if (num_allowed <= (SumoVehicleClassStrings.size() - num_allowed) && num_allowed > 0) {
+ into.writeAttr(SUMO_ATTR_ALLOW, getVehicleClassNames(permissions));
+ } else {
+ into.writeAttr(SUMO_ATTR_DISALLOW, getVehicleClassNames(~permissions));
+ }
+ }
+}
+
+
+void
+writePreferences(OutputDevice& into, SVCPermissions preferred) {
+ if (preferred == SVCAll || preferred == 0) {
+ return;
+ } else {
+ into.writeAttr(SUMO_ATTR_PREFER, getVehicleClassNames(preferred));
+ }
+}
+
+
SUMOVehicleShape
getVehicleShapeID(const std::string& name) {
if (SumoVehicleShapeStrings.hasString(name)) {
diff --git a/src/utils/common/SUMOVehicleClass.h b/src/utils/common/SUMOVehicleClass.h
index 3319163..e66239c 100644
--- a/src/utils/common/SUMOVehicleClass.h
+++ b/src/utils/common/SUMOVehicleClass.h
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Walter Bamberger
/// @date 2006-01-24
-/// @version $Id: SUMOVehicleClass.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: SUMOVehicleClass.h 18610 2015-08-06 14:15:04Z namdre $
///
// Definitions of SUMO vehicle classes and helper functions
/****************************************************************************/
@@ -40,6 +40,13 @@
#include <utils/common/StringBijection.h>
#include <utils/xml/SUMOXMLDefinitions.h>
+
+// ===========================================================================
+// class declarations
+// ===========================================================================
+class OutputDevice;
+
+
// ===========================================================================
// enum definitions
// ===========================================================================
@@ -183,8 +190,11 @@ enum SUMOVehicleClass {
/// @brief is a user-defined type
SVC_CUSTOM1 = 1 << 23,
/// @brief is a user-defined type
- SVC_CUSTOM2 = 1 << 24
- //@}
+ SVC_CUSTOM2 = 1 << 24,
+ //@}
+
+ /// @brief classes which (normally) do not drive on normal roads
+ SVC_NON_ROAD = SVC_TRAM | SVC_RAIL | SVC_RAIL_URBAN | SVC_RAIL_ELECTRIC | SVC_SHIP
};
extern const int SUMOVehicleClass_MAX;
@@ -214,14 +224,6 @@ typedef int SUMOEmissionClass;
// ---------------------------------------------------------------------------
// abstract vehicle class / purpose
// ---------------------------------------------------------------------------
-/* @brief SUMOVehicleClass is meant to be OR'ed to combine information about vehicle
- * ownership and vehicle "size" into one int.
- * These OR'ed values cannot be translated directly into strings with toString().
- * The names of all base values are concatenated with '|' as a separator.
- */
-extern std::string getVehicleClassCompoundName(int id);
-
-
/** @brief Returns the ids of the given classes, divided using a ' '
* @param[in] the permissions to encode
* @return The string representation of these classes
@@ -277,6 +279,12 @@ extern SVCPermissions parseVehicleClasses(const std::string& allowedS, const std
extern SVCPermissions parseVehicleClasses(const std::vector<std::string>& allowedS);
+/// @brief writes allowed disallowed attributes if needed;
+extern void writePermissions(OutputDevice& into, SVCPermissions permissions);
+
+/// @brief writes allowed disallowed attributes if needed;
+extern void writePreferences(OutputDevice& into, SVCPermissions preferred);
+
// ---------------------------------------------------------------------------
// vehicle shape class
// ---------------------------------------------------------------------------
diff --git a/src/utils/common/StdDefs.cpp b/src/utils/common/StdDefs.cpp
index 5dc86bd..0f0afb5 100644
--- a/src/utils/common/StdDefs.cpp
+++ b/src/utils/common/StdDefs.cpp
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date 2014-01-07
-/// @version $Id: StdDefs.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: StdDefs.cpp 18403 2015-05-19 10:41:09Z namdre $
///
/****************************************************************************/
// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
@@ -98,6 +98,7 @@ const std::string getBuildName(const std::string& version) {
bool gDebugFlag1 = false;
bool gDebugFlag2 = false;
+std::string gDebugSelectedVehicle = "";
/****************************************************************************/
diff --git a/src/utils/common/StdDefs.h b/src/utils/common/StdDefs.h
index 435f48f..15531d8 100644
--- a/src/utils/common/StdDefs.h
+++ b/src/utils/common/StdDefs.h
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Fri, 29.04.2005
-/// @version $Id: StdDefs.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: StdDefs.h 18403 2015-05-19 10:41:09Z namdre $
///
//
/****************************************************************************/
@@ -115,6 +115,8 @@ ISNAN(T a) {
extern bool gDebugFlag1;
extern bool gDebugFlag2;
+extern std::string gDebugSelectedVehicle;
+
#endif
/****************************************************************************/
diff --git a/src/utils/common/StringUtils.cpp b/src/utils/common/StringUtils.cpp
index d8b6a87..3c71dec 100644
--- a/src/utils/common/StringUtils.cpp
+++ b/src/utils/common/StringUtils.cpp
@@ -4,7 +4,7 @@
/// @author Laura Bieker
/// @author Michael Behrisch
/// @date unknown
-/// @version $Id: StringUtils.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: StringUtils.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Some static methods for string processing
/****************************************************************************/
@@ -176,6 +176,74 @@ StringUtils::escapeXML(const std::string& orig) {
}
+std::string
+StringUtils::urlEncode(const std::string& toEncode, const std::string encodeWhich) {
+ std::ostringstream out;
+
+ for (std::string::size_type i = 0; i < toEncode.length(); ++i) {
+ const char t = toEncode.at(i);
+
+ if ((encodeWhich != "" && encodeWhich.find(t) == std::string::npos) ||
+ (encodeWhich == "" &&
+ ((t >= 45 && t <= 57) || // hyphen, period, slash, 0-9
+ (t >= 65 && t <= 90) || // A-Z
+ t == 95 || // underscore
+ (t >= 97 && t <= 122) || // a-z
+ t == 126)) // tilde
+ ) {
+ out << toEncode.at(i);
+ } else {
+ out << charToHex(toEncode.at(i));
+ }
+ }
-/****************************************************************************/
+ return out.str();
+}
+
+std::string
+StringUtils::urlDecode(const std::string& toDecode) {
+ std::ostringstream out;
+
+ for (std::string::size_type i = 0; i < toDecode.length(); ++i) {
+ if (toDecode.at(i) == '%') {
+ std::string str(toDecode.substr(i + 1, 2));
+ out << hexToChar(str);
+ i += 2;
+ } else {
+ out << toDecode.at(i);
+ }
+ }
+
+ return out.str();
+}
+
+std::string
+StringUtils::charToHex(unsigned char c) {
+ short i = c;
+ std::stringstream s;
+
+ s << "%" << std::setw(2) << std::setfill('0') << std::hex << i;
+
+ return s.str();
+}
+
+unsigned char
+StringUtils::hexToChar(const std::string& str) {
+ short c = 0;
+
+ if (!str.empty()) {
+ std::istringstream in(str);
+
+ in >> std::hex >> c;
+
+ if (in.fail()) {
+ throw std::runtime_error("stream decode failure");
+ }
+ }
+
+ return static_cast<unsigned char>(c);
+}
+
+
+/****************************************************************************/
diff --git a/src/utils/common/StringUtils.h b/src/utils/common/StringUtils.h
index e0e9cb1..0d2f25d 100644
--- a/src/utils/common/StringUtils.h
+++ b/src/utils/common/StringUtils.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date unknown
-/// @version $Id: StringUtils.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: StringUtils.h 18756 2015-08-31 19:16:33Z behrisch $
///
// Some static methods for string processing
/****************************************************************************/
@@ -83,6 +83,14 @@ public:
/// An empty string
static std::string emptyString;
+ // the following methods stem from http://bogomip.net/blog/cpp-url-encoding-and-decoding/
+
+ static std::string urlEncode(const std::string& url, const std::string encodeWhich = "");
+ static std::string urlDecode(const std::string& encoded);
+
+ static std::string charToHex(unsigned char c);
+ static unsigned char hexToChar(const std::string& str);
+
};
diff --git a/src/utils/common/SysUtils.cpp b/src/utils/common/SysUtils.cpp
index bf56fbb..907b4e9 100644
--- a/src/utils/common/SysUtils.cpp
+++ b/src/utils/common/SysUtils.cpp
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Jakob Erdmann
/// @date Tue, 29.05.2005
-/// @version $Id: SysUtils.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: SysUtils.cpp 18483 2015-06-10 14:11:49Z behrisch $
///
// A few system-specific functions
/****************************************************************************/
@@ -73,9 +73,7 @@ SysUtils::getWindowsTicks() {
unsigned long
SysUtils::runHiddenCommand(const std::string& cmd) {
-#ifndef WIN32
- return (unsigned long)system(cmd.c_str());
-#else
+#ifdef _MSC_VER
// code inspired by http://www.codeproject.com/Articles/2537/Running-console-applications-silently
STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInfo;
@@ -107,6 +105,8 @@ SysUtils::runHiddenCommand(const std::string& cmd) {
delete args;
return rc;
+#else
+ return (unsigned long)system(cmd.c_str());
#endif
}
diff --git a/src/utils/common/SystemFrame.cpp b/src/utils/common/SystemFrame.cpp
index 081ed41..39c18a3 100644
--- a/src/utils/common/SystemFrame.cpp
+++ b/src/utils/common/SystemFrame.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Mon, 23.06.2003
-/// @version $Id: SystemFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: SystemFrame.cpp 18401 2015-05-19 10:11:15Z namdre $
///
// A set of actions common to all applications
/****************************************************************************/
@@ -106,7 +106,7 @@ SystemFrame::addReportOptions(OptionsCont& oc) {
oc.doRegister("error-log", new Option_FileName());
oc.addDescription("error-log", "Report", "Writes all warnings and errors to FILE");
- oc.doRegister("output-prefix", new Option_FileName());//!!! check, describe
+ oc.doRegister("output-prefix", new Option_String());
oc.addDescription("output-prefix", "Output", "Prefix which is applied to all output files. The special string 'TIME' is replaced by the current time.");
}
diff --git a/src/utils/common/ToString.h b/src/utils/common/ToString.h
index 30fb4e7..df9b29a 100644
--- a/src/utils/common/ToString.h
+++ b/src/utils/common/ToString.h
@@ -5,7 +5,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Wed, 23 Sep 2002
-/// @version $Id: ToString.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: ToString.h 18239 2015-04-20 11:37:12Z behrisch $
///
// -------------------
/****************************************************************************/
@@ -197,6 +197,12 @@ inline std::string toString(const std::vector<int>& v, std::streamsize accuracy)
template <>
+inline std::string toString(const std::vector<long long int>& v, std::streamsize accuracy) {
+ return joinToString(v, " ", accuracy);
+}
+
+
+template <>
inline std::string toString(const std::vector<SUMOReal>& v, std::streamsize accuracy) {
return joinToString(v, " ", accuracy);
}
diff --git a/src/utils/common/TplConvert.h b/src/utils/common/TplConvert.h
index a7dafdc..0a04cda 100644
--- a/src/utils/common/TplConvert.h
+++ b/src/utils/common/TplConvert.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sun, 09 Jun 2002
-/// @version $Id: TplConvert.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: TplConvert.h 18592 2015-08-03 17:39:39Z ait-mob-dts $
///
// Some conversion methods (from strings to other)
/****************************************************************************/
@@ -112,7 +112,7 @@ public:
not contain an integer */
template<class E>
static int _2int(const E* const data) {
- SUMOLong result = _2long(data);
+ long long int result = _2long(data);
if (result > std::numeric_limits<int>::max() || result < std::numeric_limits<int>::min()) {
throw NumberFormatException();
}
@@ -120,30 +120,49 @@ public:
}
+ /** converts a string into the integer value described by it
+ by calling the char-type converter, which
+ throws an EmptyData - exception if the given string is empty
+ throws a NumberFormatException - exception when the string does
+ not contain an integer */
+ static int _str2int(const std::string& sData) {
+ return _2int(sData.c_str());
+ }
+
+
/** converts a char-type array with a hex value into the integer value described by it
throws an EmptyData - exception if the given string is empty
throws a NumberFormatException - exception when the string does
not contain an integer */
template<class E>
static int _hex2int(const E* const data) {
- SUMOLong result = _hex2long(data);
+ long long int result = _hex2long(data);
if (result > std::numeric_limits<int>::max() || result < std::numeric_limits<int>::min()) {
throw NumberFormatException();
}
return (int)result;
}
+ /** converts a string with a hex value into the integer value described by it
+ by calling the char-type converter, which
+ throws an EmptyData - exception if the given string is empty
+ throws a NumberFormatException - exception when the string does
+ not contain an integer */
+ static int _strHex2int(const std::string& sData) {
+ return _hex2int(sData.c_str());
+ }
+
/** converts a char-type array into the long value described by it
throws an EmptyData - exception if the given string is empty
throws a NumberFormatException - exception when the string does
not contain a long */
template<class E>
- static SUMOLong _2long(const E* const data) {
+ static long long int _2long(const E* const data) {
if (data == 0 || data[0] == 0) {
throw EmptyData();
}
- SUMOLong sgn = 1;
+ long long int sgn = 1;
unsigned i = 0;
if (data[0] == '+') {
i++;
@@ -152,7 +171,7 @@ public:
i++;
sgn = -1;
}
- SUMOLong ret = 0;
+ long long int ret = 0;
for (; data[i] != 0; i++) {
ret *= 10;
// !!! need to catch overflows
@@ -174,11 +193,11 @@ public:
throws a NumberFormatException - exception when the string does
not contain a long */
template<class E>
- static SUMOLong _hex2long(const E* const data) {
+ static long long int _hex2long(const E* const data) {
if (data == 0 || data[0] == 0) {
throw EmptyData();
}
- SUMOLong sgn = 1;
+ long long int sgn = 1;
unsigned i = 0;
if (data[0] == '+') {
i++;
@@ -193,7 +212,7 @@ public:
if (data[i] == '0' && (data[i + 1] == 'x' || data[i + 1] == 'X')) {
i += 2;
}
- SUMOLong ret = 0;
+ long long int ret = 0;
for (; data[i] != 0; i++) {
ret *= 16;
// !!! need to catch overflows
@@ -233,10 +252,10 @@ public:
i++;
sgn = -1;
}
- // we try to parse it as a SUMOLong storing the decimal point pos
+ // we try to parse it as a long long int storing the decimal point pos
int pointPos = -1;
- int digits = std::numeric_limits<SUMOLong>::digits10;
- SUMOLong ret = 0;
+ int digits = std::numeric_limits<long long int>::digits10;
+ long long int ret = 0;
for (; data[i] != 0 && data[i] != 'e' && data[i] != 'E'; i++) {
char akt = (char) data[i];
if (akt < '0' || akt > '9') {
@@ -247,7 +266,7 @@ public:
throw NumberFormatException();
}
digits--;
- if (digits >= 0) { // we skip the digits which don't fit into SUMOLong
+ if (digits >= 0) { // we skip the digits which don't fit into long long int
ret = ret * 10 + akt - 48;
}
}
@@ -269,6 +288,16 @@ public:
}
+ /** converts a string into the SUMOReal value described by it
+ by calling the char-type converter, which
+ throws an EmptyData - exception if the given string is empty
+ throws a NumberFormatException - exception when the string does
+ not contain a SUMOReal */
+ static SUMOReal _str2SUMOReal(const std::string& sData) {
+ return _2SUMOReal(sData.c_str());
+ }
+
+
/** converts a 0-terminated char-type array into the boolean value
described by it
returns true if the data* is one of the following (case insensitive):
@@ -321,7 +350,7 @@ public:
described by it
returns the default value if the data is empty */
template<class E>
- static SUMOLong _2longSec(const E* const data, long def) {
+ static long long int _2longSec(const E* const data, long def) {
if (data == 0 || data[0] == 0) {
return def;
}
diff --git a/src/utils/foxtools/FXWorkerThread.h b/src/utils/foxtools/FXWorkerThread.h
index 81c5625..72b303a 100644
--- a/src/utils/foxtools/FXWorkerThread.h
+++ b/src/utils/foxtools/FXWorkerThread.h
@@ -2,7 +2,7 @@
/// @file FXWorkerThread.h
/// @author Michael Behrisch
/// @date 2014-07-13
-/// @version $Id: FXWorkerThread.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: FXWorkerThread.h 18756 2015-08-31 19:16:33Z behrisch $
///
// A thread class together with a pool and a task for parallelized computation
/****************************************************************************/
@@ -125,13 +125,18 @@ public:
myWorkers.push_back(w);
}
- /** @brief Gives a number to the given task and assigns it to a randomly chosen worker.
+ /** @brief Gives a number to the given task and assigns it to the worker with the given index.
+ * If the index is negative, assign to the next (round robin) one.
*
* @param[in] t the task to add
+ * @param[in] index index of the worker thread to use or -1 for an arbitrary one
*/
- void add(Task* const t) {
+ void add(Task* const t, int index = -1) {
t->setIndex(myRunningIndex++);
- myWorkers[myRunningIndex % myWorkers.size()]->add(t);
+ if (index < 0) {
+ index = myRunningIndex % myWorkers.size();
+ }
+ myWorkers[index]->add(t);
}
/** @brief Adds the given task to the list of finished tasks and assigns it to a randomly chosen worker.
diff --git a/src/utils/geom/PositionVector.cpp b/src/utils/geom/PositionVector.cpp
index 11df714..47f99ef 100644
--- a/src/utils/geom/PositionVector.cpp
+++ b/src/utils/geom/PositionVector.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Walter Bamberger
/// @date Sept 2002
-/// @version $Id: PositionVector.cpp 18142 2015-03-25 08:32:29Z namdre $
+/// @version $Id: PositionVector.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// A list of positions
/****************************************************************************/
@@ -519,6 +519,14 @@ PositionVector::add(SUMOReal xoff, SUMOReal yoff, SUMOReal zoff) {
void
+PositionVector::mirrorX() {
+ for (int i = 0; i < static_cast<int>(size()); i++) {
+ (*this)[i].mul(1, -1);
+ }
+}
+
+
+void
PositionVector::reshiftRotate(SUMOReal xoff, SUMOReal yoff, SUMOReal rot) {
for (int i = 0; i < static_cast<int>(size()); i++) {
(*this)[i].reshiftRotate(xoff, yoff, rot);
@@ -827,7 +835,7 @@ PositionVector::eraseAt(int i) {
SUMOReal
PositionVector::nearest_offset_to_point2D(const Position& p, bool perpendicular) const {
SUMOReal minDist = std::numeric_limits<SUMOReal>::max();
- SUMOReal nearestPos = -1;
+ SUMOReal nearestPos = GeomHelper::INVALID_OFFSET;
SUMOReal seen = 0;
for (const_iterator i = begin(); i != end() - 1; i++) {
const SUMOReal pos =
@@ -1106,7 +1114,7 @@ PositionVector::getEndLine() const {
void
PositionVector::closePolygon() {
- if ((*this)[0] == back()) {
+ if (size() == 0 || (*this)[0] == back()) {
return;
}
push_back((*this)[0]);
@@ -1240,6 +1248,18 @@ PositionVector::operator==(const PositionVector& v2) const {
}
+bool
+PositionVector::hasElevation() const {
+ if (size() > 2) {
+ return false;
+ }
+ for (const_iterator i = begin(); i != end() - 1; i++) {
+ if ((*i).z() != (*(i + 1)).z()) {
+ return true;
+ }
+ }
+ return false;
+}
/****************************************************************************/
diff --git a/src/utils/geom/PositionVector.h b/src/utils/geom/PositionVector.h
index c9f7689..1678d54 100644
--- a/src/utils/geom/PositionVector.h
+++ b/src/utils/geom/PositionVector.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: PositionVector.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: PositionVector.h 18639 2015-08-17 13:59:19Z namdre $
///
// A list of positions
/****************************************************************************/
@@ -210,6 +210,9 @@ public:
void add(SUMOReal xoff, SUMOReal yoff, SUMOReal zoff);
+ /// @brief mirror coordinates along the x-axis
+ void mirrorX();
+
void reshiftRotate(SUMOReal xoff, SUMOReal yoff, SUMOReal rot);
PositionVector convexHull() const;
@@ -317,6 +320,9 @@ public:
void removeColinearPoints();
+ /// @brief return whether two positions differ in z-coordinate
+ bool hasElevation() const;
+
};
diff --git a/src/utils/gui/div/GLHelper.cpp b/src/utils/gui/div/GLHelper.cpp
index 574af07..4bc9803 100644
--- a/src/utils/gui/div/GLHelper.cpp
+++ b/src/utils/gui/div/GLHelper.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: GLHelper.cpp 18119 2015-03-20 10:14:31Z behrisch $
+/// @version $Id: GLHelper.cpp 18364 2015-05-11 14:08:29Z namdre $
///
// Some methods which help to draw certain geometrical objects in openGL
/****************************************************************************/
@@ -468,7 +468,7 @@ GLHelper::drawText(const std::string& text, const Position& pos,
SUMOReal w = pfdkGetStringWidth(text.c_str());
glRotated(180, 1, 0, 0);
glRotated(angle, 0, 0, 1);
- glTranslated(-w / 2., 0.4, 0);
+ glTranslated(-w / 2., size / 4, 0);
pfDrawString(text.c_str());
glPopMatrix();
}
diff --git a/src/utils/gui/div/GUIParameterTableWindow.cpp b/src/utils/gui/div/GUIParameterTableWindow.cpp
index 991598b..0e7c175 100644
--- a/src/utils/gui/div/GUIParameterTableWindow.cpp
+++ b/src/utils/gui/div/GUIParameterTableWindow.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Sept 2002
-/// @version $Id: GUIParameterTableWindow.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIParameterTableWindow.cpp 18239 2015-04-20 11:37:12Z behrisch $
///
// The window that holds the table of an object's parameter
/****************************************************************************/
@@ -232,6 +232,14 @@ GUIParameterTableWindow::mkItem(const char* name, bool dynamic,
void
+GUIParameterTableWindow::mkItem(const char* name, bool dynamic,
+ long long int value) {
+ GUIParameterTableItemInterface* i = new GUIParameterTableItem<long long int>(myTable, myCurrentPos++, name, dynamic, value);
+ myItems.push_back(i);
+}
+
+
+void
GUIParameterTableWindow::updateTable() {
AbstractMutex::ScopedLocker locker(myLock);
if (myObject == 0) {
diff --git a/src/utils/gui/div/GUIParameterTableWindow.h b/src/utils/gui/div/GUIParameterTableWindow.h
index 14c0380..9ca8c2f 100644
--- a/src/utils/gui/div/GUIParameterTableWindow.h
+++ b/src/utils/gui/div/GUIParameterTableWindow.h
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Sept 2002
-/// @version $Id: GUIParameterTableWindow.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUIParameterTableWindow.h 18239 2015-04-20 11:37:12Z behrisch $
///
// The window that holds the table of an object's parameter
/****************************************************************************/
@@ -161,6 +161,16 @@ public:
void mkItem(const char* name, bool dynamic, int value);
+ /** @brief Adds a row which shows a 64 bit integer-value
+ *
+ * @param[in] name The name of the row entry
+ * @param[in] dynamic Information whether the entry is dynamic
+ * @param[in] value The value to show
+ * @todo the dynamic-parameter is obsolete
+ */
+ void mkItem(const char* name, bool dynamic, long long int value);
+
+
/** @brief Adds a row which shows a SUMOReal-value
*
* @param[in] name The name of the row entry
diff --git a/src/utils/gui/events/GUIEvent.h b/src/utils/gui/events/GUIEvent.h
index 624cb20..d552efc 100644
--- a/src/utils/gui/events/GUIEvent.h
+++ b/src/utils/gui/events/GUIEvent.h
@@ -2,7 +2,7 @@
/// @file GUIEvent.h
/// @author Daniel Krajzewicz
/// @date Sept 2002
-/// @version $Id: GUIEvent.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIEvent.h 18724 2015-08-25 21:00:09Z behrisch $
///
// Definition of an own event class
/****************************************************************************/
@@ -59,6 +59,10 @@ enum GUIEventType {
The reason and the time step are stored within the event */
EVENT_SIMULATION_ENDED,
+ /** @brief Send when a screenshot is requested;
+ View and file name are stored within the event */
+ EVENT_SCREENSHOT,
+
/// End of events list; use this to define new
EVENT_END
};
diff --git a/src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp b/src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp
index 4924754..9e4e584 100644
--- a/src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp
+++ b/src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: GUIGLObjectPopupMenu.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIGLObjectPopupMenu.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// The popup menu of a globject
/****************************************************************************/
@@ -46,6 +46,7 @@
#include <foreign/nvwa/debug_new.h>
#endif // CHECK_MEMORY_LEAKS
+#define DEBUG_VEHICLE_GUI_SELECTION 1
// ===========================================================================
// FOX callback mapping
@@ -130,6 +131,9 @@ long
GUIGLObjectPopupMenu::onCmdAddSelected(FXObject*, FXSelector, void*) {
gSelected.select(myObject->getGlID());
myParent->update();
+#ifdef DEBUG_VEHICLE_GUI_SELECTION
+ gDebugSelectedVehicle = myObject->getMicrosimID();
+#endif
return 1;
}
diff --git a/src/utils/gui/globjects/GUIPointOfInterest.cpp b/src/utils/gui/globjects/GUIPointOfInterest.cpp
index c0125f4..1a7fe09 100644
--- a/src/utils/gui/globjects/GUIPointOfInterest.cpp
+++ b/src/utils/gui/globjects/GUIPointOfInterest.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date June 2006
-/// @version $Id: GUIPointOfInterest.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIPointOfInterest.cpp 18421 2015-05-20 14:57:37Z namdre $
///
// The GUI-version of a point of interest
/****************************************************************************/
@@ -121,8 +121,12 @@ GUIPointOfInterest::drawGL(const GUIVisualizationSettings& s) const {
GLHelper::drawFilledCircle((SUMOReal) 1.3 * exaggeration, 16);
}
glPopMatrix();
- drawName(Position(x() + 1.32 * exaggeration, y() + 1.32 * exaggeration),
- s.scale, s.poiName);
+ const Position namePos = Position(x() + 1.32 * exaggeration, y() + 1.32 * exaggeration);
+ drawName(namePos, s.scale, s.poiName);
+ if (s.poiType.show) {
+ GLHelper::drawText(myType, namePos + Position(0, -0.6 * s.poiType.size / s.scale),
+ GLO_MAX, s.poiType.size / s.scale, s.poiType.color);
+ }
glPopName();
}
/****************************************************************************/
diff --git a/src/utils/gui/globjects/GUIPolygon.cpp b/src/utils/gui/globjects/GUIPolygon.cpp
index 290d667..f9c1fbf 100644
--- a/src/utils/gui/globjects/GUIPolygon.cpp
+++ b/src/utils/gui/globjects/GUIPolygon.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date June 2006
-/// @version $Id: GUIPolygon.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIPolygon.cpp 18722 2015-08-25 15:41:30Z namdre $
///
// The GUI-version of a polygon
/****************************************************************************/
@@ -138,6 +138,9 @@ GLfloat yPlane[] = {0.0, INV_POLY_TEX_DIM, 0.0, 0.0};
void
GUIPolygon::drawGL(const GUIVisualizationSettings& s) const {
+ if (s.polySize.getExaggeration(s) == 0) {
+ return;
+ }
Boundary boundary = myShape.getBoxBoundary();
if (s.scale * MAX2(boundary.getWidth(), boundary.getHeight()) < s.polySize.minSize) {
return;
@@ -207,7 +210,12 @@ GUIPolygon::drawGL(const GUIVisualizationSettings& s) const {
GLHelper::debugVertices(myShape, 80 / s.scale);
#endif
glPopMatrix();
- drawName(myShape.getPolygonCenter(), s.scale, s.polyName);
+ const Position namePos = myShape.getPolygonCenter();
+ drawName(namePos, s.scale, s.polyName);
+ if (s.polyType.show) {
+ GLHelper::drawText(myType, namePos + Position(0, -0.6 * s.polyType.size / s.scale),
+ GLO_MAX, s.polyType.size / s.scale, s.polyType.color);
+ }
glPopName();
}
diff --git a/src/utils/gui/settings/GUIVisualizationSettings.cpp b/src/utils/gui/settings/GUIVisualizationSettings.cpp
index b77482e..6aab777 100644
--- a/src/utils/gui/settings/GUIVisualizationSettings.cpp
+++ b/src/utils/gui/settings/GUIVisualizationSettings.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: GUIVisualizationSettings.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUIVisualizationSettings.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Stores the information about how to visualize structures
/****************************************************************************/
@@ -76,7 +76,9 @@ GUIVisualizationSettings::GUIVisualizationSettings()
addSize(1),
addName(false, 50, RGBColor(255, 0, 128, 255)),
poiSize(0), poiName(false, 50, RGBColor(255, 0, 128, 255)),
+ poiType(false, 50, RGBColor(255, 0, 128, 255)),
polySize(0), polyName(false, 50, RGBColor(255, 0, 128, 255)),
+ polyType(false, 50, RGBColor(255, 0, 128, 255)),
showSizeLegend(true),
gaming(false),
selectionScale(1),
@@ -87,6 +89,7 @@ GUIVisualizationSettings::GUIVisualizationSettings()
scheme.addColor(RGBColor(192, 66, 44), 2, "bike lane");
scheme.addColor(RGBColor(0, 0, 0, 0), 3, "green verge");
scheme.addColor(RGBColor(150, 200, 200), 4, "waterway");
+ scheme.addColor(RGBColor(92, 92, 92), 5, "no passenger"); // paths, service roads etc
laneColorer.addScheme(scheme);
scheme = GUIColorScheme("by selection (lane-/streetwise)", RGBColor(128, 128, 128, 255), "unselected", true);
scheme.addColor(RGBColor(0, 80, 180, 255), 1, "selected");
@@ -98,8 +101,9 @@ GUIVisualizationSettings::GUIVisualizationSettings()
scheme.addColor(RGBColor(192, 66, 44), (SUMOReal)SVC_BICYCLE, "bicycle");
scheme.addColor(RGBColor(40, 100, 40), (SUMOReal)SVC_BUS, "bus");
scheme.addColor(RGBColor(166, 147, 26), (SUMOReal)SVC_TAXI, "taxi");
- scheme.addColor(RGBColor::BLACK, (SUMOReal)(SVCAll & ~SVC_PEDESTRIAN), "disallow_pedestrian");
- scheme.addColor(RGBColor(64, 0, 86), (SUMOReal)(SVCAll & ~(SVC_PEDESTRIAN | SVC_BICYCLE | SVC_MOPED)), "disallow_apedestrian_bicycle");
+ scheme.addColor(RGBColor::BLACK, (SUMOReal)(SVCAll & ~SVC_NON_ROAD), "normal_road");
+ scheme.addColor(RGBColor::BLACK, (SUMOReal)(SVCAll & ~(SVC_PEDESTRIAN | SVC_NON_ROAD)), "disallow_pedestrian");
+ scheme.addColor(RGBColor(255, 206, 0), (SUMOReal)(SVCAll & ~(SVC_PEDESTRIAN | SVC_BICYCLE | SVC_MOPED | SVC_NON_ROAD)), "motorway");
scheme.addColor(RGBColor(150, 200, 200), (SUMOReal)SVC_SHIP, "waterway");
scheme.addColor(RGBColor::GREEN, (SUMOReal)SVCAll, "all");
laneColorer.addScheme(scheme);
@@ -196,7 +200,7 @@ GUIVisualizationSettings::GUIVisualizationSettings()
scheme.addColor(RGBColor::BLUE, (SUMOReal) - .3);
scheme.setAllowsNegativeValues(true);
laneColorer.addScheme(scheme);
- scheme = GUIColorScheme("by inclination at segment start", RGBColor::GREY);
+ scheme = GUIColorScheme("by segment inclination", RGBColor::GREY);
scheme.addColor(RGBColor::YELLOW, (SUMOReal) .1);
scheme.addColor(RGBColor::RED, (SUMOReal) .3);
scheme.addColor(RGBColor::GREEN, (SUMOReal) - .1);
@@ -659,11 +663,13 @@ GUIVisualizationSettings::save(OutputDevice& dev) const {
dev.openTag(SUMO_TAG_VIEWSETTINGS_POIS);
poiSize.print(dev, "poi");
poiName.print(dev, "poiName");
+ poiType.print(dev, "poiType");
dev.closeTag();
// polys
dev.openTag(SUMO_TAG_VIEWSETTINGS_POLYS);
polySize.print(dev, "poly");
polyName.print(dev, "polyName");
+ polyType.print(dev, "polyType");
dev.closeTag();
// legend
dev.openTag(SUMO_TAG_VIEWSETTINGS_LEGEND);
@@ -823,12 +829,18 @@ GUIVisualizationSettings::operator==(const GUIVisualizationSettings& v2) {
if (poiName != v2.poiName) {
return false;
}
+ if (poiType != v2.poiType) {
+ return false;
+ }
if (polySize != v2.polySize) {
return false;
}
if (polyName != v2.polyName) {
return false;
}
+ if (polyType != v2.polyType) {
+ return false;
+ }
if (showSizeLegend != v2.showSizeLegend) {
return false;
diff --git a/src/utils/gui/settings/GUIVisualizationSettings.h b/src/utils/gui/settings/GUIVisualizationSettings.h
index d9dc46e..835a891 100644
--- a/src/utils/gui/settings/GUIVisualizationSettings.h
+++ b/src/utils/gui/settings/GUIVisualizationSettings.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: GUIVisualizationSettings.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIVisualizationSettings.h 18421 2015-05-20 14:57:37Z namdre $
///
// Stores the information about how to visualize structures
/****************************************************************************/
@@ -259,11 +259,15 @@ public:
GUIVisualizationSizeSettings poiSize;
// Setting bundles for optional drawing poi names
GUIVisualizationTextSettings poiName;
+ // Setting bundles for optional drawing poi types
+ GUIVisualizationTextSettings poiType;
// Setting bundles for controling the size of the drawn polygons
GUIVisualizationSizeSettings polySize;
// Setting bundles for optional drawing polygon names
GUIVisualizationTextSettings polyName;
+ // Setting bundles for optional drawing polygon types
+ GUIVisualizationTextSettings polyType;
//@}
/// @brief Information whether the size legend shall be drawn
diff --git a/src/utils/gui/windows/GUIAppEnum.h b/src/utils/gui/windows/GUIAppEnum.h
index 6e52833..f935af8 100644
--- a/src/utils/gui/windows/GUIAppEnum.h
+++ b/src/utils/gui/windows/GUIAppEnum.h
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Andreas Gaubatz
/// @date Mon, 08.03.2004
-/// @version $Id: GUIAppEnum.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIAppEnum.h 18296 2015-04-24 12:41:38Z namdre $
///
// Message and object IDs used by the FOX-version of the gui
/****************************************************************************/
@@ -431,6 +431,8 @@ enum {
MID_GNE_ADD_REVERSE_EDGE,
/** edit junction shape */
MID_GNE_NODE_SHAPE,
+ /** turn junction into geometry node */
+ MID_GNE_NODE_REPLACE,
/** set non-default geometry endpoint */
MID_GNE_SET_EDGE_ENDPOINT,
/** restore geometry endpoint to node position */
diff --git a/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp b/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp
index 862bade..5df8049 100644
--- a/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp
+++ b/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: GUIDanielPerspectiveChanger.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIDanielPerspectiveChanger.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// A class that allows to steer the visual output in dependence to
/****************************************************************************/
@@ -30,6 +30,7 @@
#include <config.h>
#endif
+#include <fxkeys.h>
#include <utils/geom/Boundary.h>
#include <utils/geom/Position.h>
#include <utils/gui/settings/GUICompleteSchemeStorage.h>
@@ -52,7 +53,9 @@ GUIDanielPerspectiveChanger::GUIDanielPerspectiveChanger(
myRotation(0),
myMouseButtonState(MOUSEBTN_NONE),
myMoveOnClick(false),
- myDragDelay(0) {}
+ myZoomBase(viewPort.getCenter()),
+ myDragDelay(0)
+{}
GUIDanielPerspectiveChanger::~GUIDanielPerspectiveChanger() {}
@@ -250,4 +253,88 @@ GUIDanielPerspectiveChanger::changeCanvassLeft(int change) {
myViewPort.ymax());
}
+
+long
+GUIDanielPerspectiveChanger::onKeyPress(void* data) {
+ FXEvent* e = (FXEvent*) data;
+ SUMOReal zoomDiff = 0.1;
+ SUMOReal moveX = 0;
+ SUMOReal moveY = 0;
+ SUMOReal moveFactor = 1;
+ bool pageVertical = true;
+ bool ctrl = false;
+ if (e->state & CONTROLMASK) {
+ ctrl = true;
+ zoomDiff /= 2;
+ moveFactor /= 10;
+ } else if (e->state & SHIFTMASK) {
+ pageVertical = false;
+ zoomDiff *= 2;
+ }
+ switch (e->code) {
+ case FX::KEY_Left:
+ moveX = -1;
+ moveFactor /= 10;
+ break;
+ case FX::KEY_Right:
+ moveX = 1;
+ moveFactor /= 10;
+ break;
+ case FX::KEY_Up:
+ moveY = -1;
+ moveFactor /= 10;
+ break;
+ case FX::KEY_Down:
+ moveY = 1;
+ moveFactor /= 10;
+ break;
+ case FX::KEY_Page_Up:
+ if (pageVertical) {
+ moveY = -1;
+ } else {
+ moveX = -1;
+ }
+ break;
+ case FX::KEY_Page_Down:
+ if (pageVertical) {
+ moveY = 1;
+ } else {
+ moveX = 1;
+ }
+ break;
+ case FX::KEY_plus:
+ case FX::KEY_KP_Add:
+ myZoomBase = myCallback.getPositionInformation();
+ zoom(1.0 + zoomDiff);
+ myCallback.updateToolTip();
+ return 1;
+ case FX::KEY_minus:
+ case FX::KEY_KP_Subtract:
+ zoomDiff = -zoomDiff;
+ myZoomBase = myCallback.getPositionInformation();
+ zoom(1.0 + zoomDiff);
+ myCallback.updateToolTip();
+ return 1;
+ case FX::KEY_Home:
+ case FX::KEY_KP_Home:
+ myCallback.recenterView();
+ myCallback.update();
+ return 1;
+ case FX::KEY_v:
+ // from an architecture standpoint this isn't the best place to put
+ // this. But its simple
+ if (ctrl) {
+ myCallback.showViewschemeEditor();
+ return 1;
+ }
+ default:
+ return 0;
+ }
+ myViewPort.moveby(moveX * moveFactor * myViewPort.getWidth(),
+ -moveY * moveFactor * myViewPort.getHeight());
+ myCallback.update();
+ return 1;
+}
+
+
/****************************************************************************/
diff --git a/src/utils/gui/windows/GUIDanielPerspectiveChanger.h b/src/utils/gui/windows/GUIDanielPerspectiveChanger.h
index d292fdd..990f537 100644
--- a/src/utils/gui/windows/GUIDanielPerspectiveChanger.h
+++ b/src/utils/gui/windows/GUIDanielPerspectiveChanger.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: GUIDanielPerspectiveChanger.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIDanielPerspectiveChanger.h 18297 2015-04-26 17:52:39Z behrisch $
///
// A class that allows to steer the visual output in dependence to
/****************************************************************************/
@@ -71,6 +71,7 @@ public:
bool onRightBtnRelease(void* data);
void onMouseWheel(void* data);
void onMouseMove(void* data);
+ long onKeyPress(void* data);
/// Returns the rotation of the canvas stored in this changer
virtual SUMOReal getRotation() const;
diff --git a/src/utils/gui/windows/GUIDialog_ViewSettings.cpp b/src/utils/gui/windows/GUIDialog_ViewSettings.cpp
index 76d53a4..45a861f 100644
--- a/src/utils/gui/windows/GUIDialog_ViewSettings.cpp
+++ b/src/utils/gui/windows/GUIDialog_ViewSettings.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Wed, 21. Dec 2005
-/// @version $Id: GUIDialog_ViewSettings.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUIDialog_ViewSettings.cpp 18421 2015-05-20 14:57:37Z namdre $
///
// The dialog to change the view (gui) settings.
/****************************************************************************/
@@ -499,6 +499,7 @@ GUIDialog_ViewSettings::GUIDialog_ViewSettings(GUISUMOAbstractView* parent,
new FXMatrix(frame6, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
myPOINamePanel = new NamePanel(m61, this, "Show poi names", mySettings->poiName);
+ myPOITypePanel = new NamePanel(m61, this, "Show poi types", mySettings->poiType);
new FXHorizontalSeparator(frame6 , SEPARATOR_GROOVE | LAYOUT_FILL_X);
FXMatrix* m62 =
@@ -517,6 +518,7 @@ GUIDialog_ViewSettings::GUIDialog_ViewSettings(GUISUMOAbstractView* parent,
new FXMatrix(frame9, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS,
0, 0, 0, 0, 10, 10, 10, 10, 5, 5);
myPolyNamePanel = new NamePanel(m91, this, "Show polygon names", mySettings->polyName);
+ myPolyTypePanel = new NamePanel(m91, this, "Show polygon types", mySettings->polyType);
new FXHorizontalSeparator(frame9 , SEPARATOR_GROOVE | LAYOUT_FILL_X);
myPolySizePanel = new SizePanel(m91, this, mySettings->polySize);
@@ -576,7 +578,9 @@ GUIDialog_ViewSettings::~GUIDialog_ViewSettings() {
delete myVehicleNamePanel;
delete myAddNamePanel;
delete myPOINamePanel;
+ delete myPOITypePanel;
delete myPolyNamePanel;
+ delete myPolyTypePanel;
delete myEdgeNamePanel;
// delete size panels
delete myVehicleSizePanel;
@@ -674,9 +678,11 @@ GUIDialog_ViewSettings::onCmdNameChange(FXObject*, FXSelector, void* data) {
myAddSizePanel->update(mySettings->addSize);
myPOINamePanel->update(mySettings->poiName);
+ myPOITypePanel->update(mySettings->poiType);
myPOISizePanel->update(mySettings->poiSize);
myPolyNamePanel->update(mySettings->polyName);
+ myPolyTypePanel->update(mySettings->polyType);
myPolySizePanel->update(mySettings->polySize);
myShowLane2Lane->setCheck(mySettings->showLane2Lane);
@@ -867,9 +873,11 @@ GUIDialog_ViewSettings::onCmdColorChange(FXObject* sender, FXSelector, void* /*v
tmpSettings.addSize = myAddSizePanel->getSettings();
tmpSettings.poiName = myPOINamePanel->getSettings();
+ tmpSettings.poiType = myPOITypePanel->getSettings();
tmpSettings.poiSize = myPOISizePanel->getSettings();
tmpSettings.polyName = myPolyNamePanel->getSettings();
+ tmpSettings.polyType = myPolyTypePanel->getSettings();
tmpSettings.polySize = myPolySizePanel->getSettings();
tmpSettings.showLane2Lane = (myShowLane2Lane->getCheck() != FALSE);
diff --git a/src/utils/gui/windows/GUIDialog_ViewSettings.h b/src/utils/gui/windows/GUIDialog_ViewSettings.h
index e2661d3..20f3d59 100644
--- a/src/utils/gui/windows/GUIDialog_ViewSettings.h
+++ b/src/utils/gui/windows/GUIDialog_ViewSettings.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Wed, 21. Dec 2005
-/// @version $Id: GUIDialog_ViewSettings.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUIDialog_ViewSettings.h 18421 2015-05-20 14:57:37Z namdre $
///
// The dialog to change the view (gui) settings.
/****************************************************************************/
@@ -318,7 +318,7 @@ private:
NamePanel* myEdgeNamePanel, *myInternalEdgeNamePanel, *myCwaEdgeNamePanel, *myStreetNamePanel,
*myJunctionNamePanel, *myInternalJunctionNamePanel,
*myVehicleNamePanel, *myPersonNamePanel, *myContainerNamePanel,
- *myAddNamePanel, *myPOINamePanel, *myPolyNamePanel;
+ *myAddNamePanel, *myPOINamePanel, *myPolyNamePanel, *myPOITypePanel, *myPolyTypePanel;
SizePanel* myVehicleSizePanel, *myPersonSizePanel, *myContainerSizePanel, *myPOISizePanel, *myPolySizePanel, *myAddSizePanel;
diff --git a/src/utils/gui/windows/GUIMainWindow.h b/src/utils/gui/windows/GUIMainWindow.h
index 9a4c1b6..199be45 100644
--- a/src/utils/gui/windows/GUIMainWindow.h
+++ b/src/utils/gui/windows/GUIMainWindow.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Fri, 29.04.2005
-/// @version $Id: GUIMainWindow.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIMainWindow.h 18761 2015-09-01 14:15:44Z behrisch $
///
//
/****************************************************************************/
@@ -36,11 +36,18 @@
#include <vector>
#include <string>
#include <map>
+#include <utils/common/StdDefs.h>
#include <utils/common/SUMOTime.h>
#include <utils/foxtools/MFXMutex.h>
// ===========================================================================
+// class declarations
+// ===========================================================================
+class GUIEvent;
+
+
+// ===========================================================================
// class definitions
// ===========================================================================
class GUIMainWindow : public FXMainWindow {
@@ -92,6 +99,13 @@ public:
return 0;
}
+ /** @brief Sends an event from the application thread to the GUI and waits until it is handled
+ * @param event the event to send
+ */
+ virtual void sendBlockingEvent(GUIEvent* event) {
+ UNUSED_PARAMETER(event);
+ }
+
protected:
std::vector<FXMDIChild*> mySubWindows;
std::vector<FXMainWindow*> myTrackerWindows;
diff --git a/src/utils/gui/windows/GUIPerspectiveChanger.cpp b/src/utils/gui/windows/GUIPerspectiveChanger.cpp
index 5fb3adc..c2c48d8 100644
--- a/src/utils/gui/windows/GUIPerspectiveChanger.cpp
+++ b/src/utils/gui/windows/GUIPerspectiveChanger.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: GUIPerspectiveChanger.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIPerspectiveChanger.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// A class that allows to steer the visual output in dependence to user
/****************************************************************************/
@@ -78,6 +78,15 @@ GUIPerspectiveChanger::onMouseWheel(void*) {}
void
GUIPerspectiveChanger::onMouseMove(void*) {}
+long
+GUIPerspectiveChanger::onKeyPress(void*) {
+ return 0;
+}
+
+long
+GUIPerspectiveChanger::onKeyRelease(void*) {
+ return 0;
+}
FXint
GUIPerspectiveChanger::getMouseXPosition() const {
diff --git a/src/utils/gui/windows/GUIPerspectiveChanger.h b/src/utils/gui/windows/GUIPerspectiveChanger.h
index d1c8c40..003b869 100644
--- a/src/utils/gui/windows/GUIPerspectiveChanger.h
+++ b/src/utils/gui/windows/GUIPerspectiveChanger.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: GUIPerspectiveChanger.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: GUIPerspectiveChanger.h 18294 2015-04-24 10:23:48Z namdre $
///
// A virtual class that allows to steer the visual output in dependence to
/****************************************************************************/
@@ -78,6 +78,8 @@ public:
virtual bool onRightBtnRelease(void* data);
virtual void onMouseWheel(void* data);
virtual void onMouseMove(void* data);
+ virtual long onKeyPress(void* data);
+ virtual long onKeyRelease(void* data);
/// Returns the rotation of the canvas stored in this changer
virtual SUMOReal getRotation() const = 0;
diff --git a/src/utils/gui/windows/GUISUMOAbstractView.cpp b/src/utils/gui/windows/GUISUMOAbstractView.cpp
index dd37c89..094ebce 100644
--- a/src/utils/gui/windows/GUISUMOAbstractView.cpp
+++ b/src/utils/gui/windows/GUISUMOAbstractView.cpp
@@ -6,7 +6,7 @@
/// @author Laura Bieker
/// @author Andreas Gaubatz
/// @date Sept 2002
-/// @version $Id: GUISUMOAbstractView.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUISUMOAbstractView.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// The base class for a view
/****************************************************************************/
@@ -124,6 +124,8 @@ GUISUMOAbstractView::GUISUMOAbstractView(FXComposite* p,
myUseToolTips(false),
myAmInitialised(false),
myViewportChooser(0),
+ myWindowCursorPositionX(getWidth() / 2),
+ myWindowCursorPositionY(getHeight() / 2),
myVisualizationChanger(0) {
setTarget(this);
enable();
@@ -587,6 +589,7 @@ GUISUMOAbstractView::destroyPopup() {
long
GUISUMOAbstractView::onLeftBtnPress(FXObject*, FXSelector , void* data) {
destroyPopup();
+ setFocus();
FXEvent* e = (FXEvent*) data;
// check whether the selection-mode is activated
if (e->state & CONTROLMASK) {
@@ -705,41 +708,15 @@ GUISUMOAbstractView::openObjectDialog() {
long
GUISUMOAbstractView::onKeyPress(FXObject* o, FXSelector sel, void* data) {
- FXEvent* e = (FXEvent*) data;
- if ((e->state & ALTMASK) != 0) {
- setDefaultCursor(getApp()->getDefaultCursor(DEF_CROSSHAIR_CURSOR));
- grabKeyboard();
- }
- /*
- switch(e->code) {
- case KEY_Left:
- myChanger->move((SUMOReal) -p2m((SUMOReal) getWidth()/10), 0);
- break;
- case KEY_Right:
- myChanger->move((SUMOReal) p2m((SUMOReal) getWidth()/10), 0);
- break;
- case KEY_Up:
- myChanger->move(0, (SUMOReal) -p2m((SUMOReal) getHeight()/10));
- break;
- case KEY_Down:
- myChanger->move(0, (SUMOReal) p2m((SUMOReal) getHeight()/10));
- break;
- default:
- break;
- }
- */
- return FXGLCanvas::onKeyPress(o, sel, data);
+ FXGLCanvas::onKeyPress(o, sel, data);
+ return myChanger->onKeyPress(data);
}
long
GUISUMOAbstractView::onKeyRelease(FXObject* o, FXSelector sel, void* data) {
- FXEvent* e = (FXEvent*) data;
- if ((e->state & ALTMASK) == 0) {
- ungrabKeyboard();
- setDefaultCursor(getApp()->getDefaultCursor(DEF_ARROW_CURSOR));
- }
- return FXGLCanvas::onKeyRelease(o, sel, data);
+ FXGLCanvas::onKeyRelease(o, sel, data);
+ return myChanger->onKeyRelease(data);
}
diff --git a/src/utils/gui/windows/GUISUMOAbstractView.h b/src/utils/gui/windows/GUISUMOAbstractView.h
index 1cba206..17e5f70 100644
--- a/src/utils/gui/windows/GUISUMOAbstractView.h
+++ b/src/utils/gui/windows/GUISUMOAbstractView.h
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Andreas Gaubatz
/// @date Sept 2002
-/// @version $Id: GUISUMOAbstractView.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: GUISUMOAbstractView.h 18725 2015-08-25 21:08:12Z behrisch $
///
// The base class for a view
/****************************************************************************/
@@ -384,9 +384,6 @@ protected:
/// @brief Information whether too-tip informations shall be generated
bool myInEditMode;
- /// @brief Position of the cursor relative to the window
- FXint myWindowCursorPositionX, myWindowCursorPositionY;
-
/// @brief Offset to the mouse-hotspot from the mouse position
int myMouseHotspotX, myMouseHotspotY;
@@ -400,8 +397,11 @@ protected:
/// Internal information whether doInit() was called
bool myAmInitialised;
-
GUIDialog_EditViewport* myViewportChooser;
+
+ /// @brief Position of the cursor relative to the window
+ FXint myWindowCursorPositionX, myWindowCursorPositionY;
+
GUIDialog_ViewSettings* myVisualizationChanger;
diff --git a/src/utils/iodevices/OutputDevice_File.cpp b/src/utils/iodevices/OutputDevice_File.cpp
index 66e9d3f..86f6774 100644
--- a/src/utils/iodevices/OutputDevice_File.cpp
+++ b/src/utils/iodevices/OutputDevice_File.cpp
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date 2004
-/// @version $Id: OutputDevice_File.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: OutputDevice_File.cpp 18310 2015-04-28 06:14:09Z behrisch $
///
// An output device that encapsulates an ofstream
/****************************************************************************/
@@ -31,6 +31,8 @@
#endif
#include <iostream>
+#include <cstring>
+#include <cerrno>
#include <utils/common/UtilExceptions.h>
#include "OutputDevice_File.h"
@@ -56,7 +58,7 @@ OutputDevice_File::OutputDevice_File(const std::string& fullName, const bool bin
}
if (!myFileStream->good()) {
delete myFileStream;
- throw IOError("Could not build output file '" + fullName + "'.");
+ throw IOError("Could not build output file '" + fullName + "' (" + std::strerror(errno) + ").");
}
}
diff --git a/src/utils/iodevices/OutputDevice_String.cpp b/src/utils/iodevices/OutputDevice_String.cpp
index 028675e..a8f95eb 100644
--- a/src/utils/iodevices/OutputDevice_String.cpp
+++ b/src/utils/iodevices/OutputDevice_String.cpp
@@ -2,7 +2,7 @@
/// @file OutputDevice_String.cpp
/// @author Michael Behrisch
/// @date 2009
-/// @version $Id: OutputDevice_String.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: OutputDevice_String.cpp 18375 2015-05-15 07:05:22Z behrisch $
///
// An output device that encapsulates a stringstream
/****************************************************************************/
@@ -42,6 +42,8 @@
// ===========================================================================
OutputDevice_String::OutputDevice_String(const bool binary, const unsigned int defaultIndentation)
: OutputDevice(binary, defaultIndentation) {
+ setPrecision();
+ myStream << std::setiosflags(std::ios::fixed);
}
diff --git a/src/utils/options/Option.cpp b/src/utils/options/Option.cpp
index 4449f77..54db187 100644
--- a/src/utils/options/Option.cpp
+++ b/src/utils/options/Option.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Mon, 17 Dec 2001
-/// @version $Id: Option.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: Option.cpp 18308 2015-04-27 21:28:24Z behrisch $
///
// A class representing a single program option
/****************************************************************************/
@@ -37,6 +37,7 @@
#include <utils/common/TplConvert.h>
#include <utils/common/UtilExceptions.h>
#include <utils/common/StringTokenizer.h>
+#include <utils/common/StringUtils.h>
#include <utils/common/MsgHandler.h>
#include <utils/common/ToString.h>
@@ -459,6 +460,12 @@ Option_FileName::isFileName() const {
}
+std::string
+Option_FileName::getValueString() const {
+ return StringUtils::urlEncode(myValue, " ;%");
+}
+
+
/* -------------------------------------------------------------------------
* Option_UIntVector - methods
diff --git a/src/utils/options/Option.h b/src/utils/options/Option.h
index 8b69e51..f60bbc0 100644
--- a/src/utils/options/Option.h
+++ b/src/utils/options/Option.h
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date Mon, 17 Dec 2001
-/// @version $Id: Option.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: Option.h 18306 2015-04-27 20:35:05Z behrisch $
///
// Classes representing a single program option (with different types)
/****************************************************************************/
@@ -630,6 +630,17 @@ public:
*/
bool isFileName() const;
+
+ /** @brief Returns the string-representation of the value
+ *
+ * The value is URL-encoded using StringUtils::urlEncode and returned.
+ *
+ * @see std::string Option::getValueString()
+ * @return The stored value encoded into a string
+ */
+ std::string getValueString() const;
+
+
};
diff --git a/src/utils/options/OptionsCont.cpp b/src/utils/options/OptionsCont.cpp
index 5fa143e..3127ac8 100644
--- a/src/utils/options/OptionsCont.cpp
+++ b/src/utils/options/OptionsCont.cpp
@@ -5,7 +5,7 @@
/// @author Michael Behrisch
/// @author Walter Bamberger
/// @date Mon, 17 Dec 2001
-/// @version $Id: OptionsCont.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: OptionsCont.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// A storage for options (typed value containers)
/****************************************************************************/
@@ -38,6 +38,8 @@
#include <cstdlib>
#include <cassert>
#include <ctime>
+#include <cstring>
+#include <cerrno>
#include <iterator>
#include "Option.h"
#include "OptionsCont.h"
@@ -316,7 +318,7 @@ OptionsCont::relocateFiles(const std::string& configuration) const {
if (!FileHelpers::isAbsolute(tmp)) {
tmp = FileHelpers::getConfigurationRelative(configuration, tmp);
}
- conv += tmp;
+ conv += StringUtils::urlDecode(tmp);
}
if (conv != (*i)->getString()) {
(*i)->set(conv);
@@ -344,7 +346,7 @@ OptionsCont::isUsableFileList(const std::string& name) const {
for (std::vector<std::string>::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
if (!FileHelpers::isReadable(*fileIt)) {
if (*fileIt != "") {
- WRITE_ERROR("File '" + *fileIt + "' is not accessible.");
+ WRITE_ERROR("File '" + *fileIt + "' is not accessible (" + std::strerror(errno) + ").");
ok = false;
} else {
WRITE_WARNING("Empty file name given; ignoring.");
diff --git a/src/utils/options/OptionsIO.cpp b/src/utils/options/OptionsIO.cpp
index d003519..2d5597b 100644
--- a/src/utils/options/OptionsIO.cpp
+++ b/src/utils/options/OptionsIO.cpp
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date Mon, 17 Dec 2001
-/// @version $Id: OptionsIO.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: OptionsIO.cpp 18486 2015-06-11 11:10:09Z behrisch $
///
// Helper for parsing command line arguments and reading configuration files
/****************************************************************************/
@@ -61,20 +61,19 @@ char** OptionsIO::myArgV;
// method definitions
// ===========================================================================
void
-OptionsIO::getOptions(bool loadConfig, int argc, char** argv) {
+OptionsIO::setArgs(int argc, char** argv) {
+ myArgC = argc;
+ myArgV = argv;
+}
+
+
+void
+OptionsIO::getOptions() {
// preparse the options
// (maybe another configuration file was chosen)
- if (argc > 0) {
- myArgC = argc;
- myArgV = argv;
- }
if (!OptionsParser::parse(myArgC, myArgV)) {
throw ProcessError("Could not parse commandline options.");
}
- // check whether to use the command line parameters only
- if (!loadConfig) {
- return;
- }
// read the configuration when everything's ok
OptionsCont::getOptions().resetWritable();
loadConfiguration();
diff --git a/src/utils/options/OptionsIO.h b/src/utils/options/OptionsIO.h
index 741640b..c39ddd1 100644
--- a/src/utils/options/OptionsIO.h
+++ b/src/utils/options/OptionsIO.h
@@ -3,7 +3,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date Mon, 17 Dec 2001
-/// @version $Id: OptionsIO.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: OptionsIO.h 18486 2015-06-11 11:10:09Z behrisch $
///
// Helper for parsing command line arguments and reading configuration files
/****************************************************************************/
@@ -53,11 +53,18 @@ class OptionsCont;
*/
class OptionsIO {
public:
- /** @brief Parses the command line arguments and loads the configuration optionally
+ /** @brief Stores the command line arguments for later parsing
+ *
+ * @param[in] argc number of arguments given at the command line
+ * @param[in] argv arguments given at the command line
+ */
+ static void setArgs(int argc, char** argv);
+
+
+ /** @brief Parses the command line arguments and loads the configuration
*
* Command line arguments are parsed, first, throwing a ProcessError
- * if something fails. If loadConfig is false, the method returns
- * after this. Otherwise, options are reset to being writeable and the
+ * if something fails. Then options are reset to being writeable and the
* configuration is loaded using "loadConfiguration". After this,
* the options are reset again and the command line arguments are
* reparsed.
@@ -65,13 +72,8 @@ public:
* This workflow allows to read the name of a configuration file from
* command line arguments, first, then to load values from this configuration
* file and reset them by other values from the command line.
- *
- * @param[in] loadConfig Whether the configuration shall be loaded
- * @param[in] argc number of arguments given at the command line
- * @param[in] argv arguments given at the command line
*/
- static void getOptions(bool loadConfig,
- int argc = 0, char** argv = 0);
+ static void getOptions();
/** @brief Loads and parses the configuration
diff --git a/src/utils/traci/TraCIAPI.cpp b/src/utils/traci/TraCIAPI.cpp
index 3193bec..9eb8936 100644
--- a/src/utils/traci/TraCIAPI.cpp
+++ b/src/utils/traci/TraCIAPI.cpp
@@ -5,7 +5,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date 30.05.2012
-/// @version $Id: TraCIAPI.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: TraCIAPI.cpp 18213 2015-04-16 11:55:42Z behrisch $
///
// C++ TraCI client API implementation
/****************************************************************************/
@@ -96,7 +96,7 @@ TraCIAPI::send_commandSimulationStep(SUMOTime time) const {
outMsg.writeUnsignedByte(1 + 1 + 4);
// command id
outMsg.writeUnsignedByte(CMD_SIMSTEP2);
- outMsg.writeInt(time);
+ outMsg.writeInt((int)time);
// send request message
mySocket->sendExact(outMsg);
}
@@ -162,7 +162,7 @@ TraCIAPI::send_commandSetValue(int domID, int varID, const std::string& objID, t
void
-TraCIAPI::send_commandSubscribeObjectVariable(int domID, const std::string& objID, int beginTime, int endTime,
+TraCIAPI::send_commandSubscribeObjectVariable(int domID, const std::string& objID, SUMOTime beginTime, SUMOTime endTime,
const std::vector<int>& vars) const {
if (mySocket == 0) {
throw tcpip::SocketException("Socket is not initialised");
@@ -175,8 +175,8 @@ TraCIAPI::send_commandSubscribeObjectVariable(int domID, const std::string& objI
// command id
outMsg.writeUnsignedByte(domID);
// time
- outMsg.writeInt(beginTime);
- outMsg.writeInt(endTime);
+ outMsg.writeInt((int)beginTime);
+ outMsg.writeInt((int)endTime);
// object id
outMsg.writeString(objID);
// command id
@@ -190,7 +190,7 @@ TraCIAPI::send_commandSubscribeObjectVariable(int domID, const std::string& objI
void
-TraCIAPI::send_commandSubscribeObjectContext(int domID, const std::string& objID, int beginTime, int endTime,
+TraCIAPI::send_commandSubscribeObjectContext(int domID, const std::string& objID, SUMOTime beginTime, SUMOTime endTime,
int domain, SUMOReal range, const std::vector<int>& vars) const {
if (mySocket == 0) {
throw tcpip::SocketException("Socket is not initialised");
@@ -203,8 +203,8 @@ TraCIAPI::send_commandSubscribeObjectContext(int domID, const std::string& objID
// command id
outMsg.writeUnsignedByte(domID);
// time
- outMsg.writeInt(beginTime);
- outMsg.writeInt(endTime);
+ outMsg.writeInt((int)beginTime);
+ outMsg.writeInt((int)endTime);
// object id
outMsg.writeString(objID);
// domain and range
@@ -445,14 +445,14 @@ TraCIAPI::EdgeScope::getIDCount() const {
SUMOReal
TraCIAPI::EdgeScope::getAdaptedTraveltime(const std::string& edgeID, SUMOTime time) const {
tcpip::Storage content;
- content.writeInt(time);
+ content.writeInt((int)time);
return myParent.getDouble(CMD_GET_EDGE_VARIABLE, VAR_CO2EMISSION, edgeID, &content);
}
SUMOReal
TraCIAPI::EdgeScope::getEffort(const std::string& edgeID, SUMOTime time) const {
tcpip::Storage content;
- content.writeInt(time);
+ content.writeInt((int)time);
return myParent.getDouble(CMD_GET_EDGE_VARIABLE, VAR_CO2EMISSION, edgeID, &content);
}
@@ -1314,11 +1314,11 @@ TraCIAPI::TrafficLightScope::setCompleteRedYellowGreenDefinition(const std::stri
content.writeInt((int)logic.phases.size());
for (int i = 0; i < (int) logic.phases.size(); ++i) {
content.writeUnsignedByte(TYPE_INTEGER);
- content.writeInt(logic.phases[i].duration);
+ content.writeInt((int)logic.phases[i].duration);
content.writeUnsignedByte(TYPE_INTEGER);
- content.writeInt(logic.phases[i].duration1);
+ content.writeInt((int)logic.phases[i].duration1);
content.writeUnsignedByte(TYPE_INTEGER);
- content.writeInt(logic.phases[i].duration2);
+ content.writeInt((int)logic.phases[i].duration2);
content.writeUnsignedByte(TYPE_STRING);
content.writeString(logic.phases[i].phase);
}
diff --git a/src/utils/traci/TraCIAPI.h b/src/utils/traci/TraCIAPI.h
index e8f3720..1203221 100644
--- a/src/utils/traci/TraCIAPI.h
+++ b/src/utils/traci/TraCIAPI.h
@@ -4,7 +4,7 @@
/// @author Mario Krumnow
/// @author Michael Behrisch
/// @date 30.05.2012
-/// @version $Id: TraCIAPI.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: TraCIAPI.h 18213 2015-04-16 11:55:42Z behrisch $
///
// C++ TraCI client API implementation
/****************************************************************************/
@@ -707,7 +707,7 @@ protected:
* @param[in] endTime The end time step of subscriptions
* @param[in] vars The variables to subscribe
*/
- void send_commandSubscribeObjectVariable(int domID, const std::string& objID, int beginTime, int endTime, const std::vector<int>& vars) const;
+ void send_commandSubscribeObjectVariable(int domID, const std::string& objID, SUMOTime beginTime, SUMOTime endTime, const std::vector<int>& vars) const;
/** @brief Sends a SubscribeContext request
@@ -719,7 +719,7 @@ protected:
* @param[in] range The range around the obj to investigate
* @param[in] vars The variables to subscribe
*/
- void send_commandSubscribeObjectContext(int domID, const std::string& objID, int beginTime, int endTime,
+ void send_commandSubscribeObjectContext(int domID, const std::string& objID, SUMOTime beginTime, SUMOTime endTime,
int domain, SUMOReal range, const std::vector<int>& vars) const;
/// @}
diff --git a/src/utils/vehicle/AStarRouter.h b/src/utils/vehicle/AStarRouter.h
index f0892bc..b4af4aa 100644
--- a/src/utils/vehicle/AStarRouter.h
+++ b/src/utils/vehicle/AStarRouter.h
@@ -4,7 +4,7 @@
/// @author Daniel Krajzewicz
/// @author Michael Behrisch
/// @date January 2012
-/// @version $Id: AStarRouter.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: AStarRouter.h 18467 2015-05-29 03:50:41Z behrisch $
///
// A* Algorithm using euclidean distance heuristic.
// Based on DijkstraRouterTT. For routing by effort a novel heuristic would be needed.
@@ -54,12 +54,12 @@
// ===========================================================================
/**
* @class AStarRouter
- * @brief Computes the shortest path through a network using the Dijkstra algorithm.
+ * @brief Computes the shortest path through a network using the A* algorithm.
*
* The template parameters are:
* @param E The edge class to use (MSEdge/ROEdge)
* @param V The vehicle class to use (MSVehicle/ROVehicle)
- * @param PF The prohibition function to use (prohibited_withRestrictions/prohibited_noRestrictions)
+ * @param PF The prohibition function to use (prohibited_withPermissions/noProhibitions)
* @param EC The class to retrieve the effort for an edge from
*
* The router is edge-based. It must know the number of edges for internal reasons
@@ -177,12 +177,21 @@ public:
this->startQuery();
const SUMOVehicleClass vClass = vehicle == 0 ? SVC_IGNORING : vehicle->getVClass();
const SUMOReal time = STEPS2TIME(msTime);
- init();
- // add begin node
- EdgeInfo* const fromInfo = &(myEdgeInfos[from->getNumericalID()]);
- fromInfo->traveltime = 0;
- fromInfo->prev = 0;
- myFrontierList.push_back(fromInfo);
+ if (this->myBulkMode) {
+ const EdgeInfo& toInfo = myEdgeInfos[to->getNumericalID()];
+ if (toInfo.visited) {
+ buildPathFrom(&toInfo, into);
+ this->endQuery(1);
+ return;
+ }
+ } else {
+ init();
+ // add begin node
+ EdgeInfo* const fromInfo = &(myEdgeInfos[from->getNumericalID()]);
+ fromInfo->traveltime = 0;
+ fromInfo->prev = 0;
+ myFrontierList.push_back(fromInfo);
+ }
// loop
int num_visited = 0;
while (!myFrontierList.empty()) {
@@ -190,17 +199,15 @@ public:
// use the node with the minimal length
EdgeInfo* const minimumInfo = myFrontierList.front();
const E* const minEdge = minimumInfo->edge;
- pop_heap(myFrontierList.begin(), myFrontierList.end(), myComparator);
- myFrontierList.pop_back();
- myFound.push_back(minimumInfo);
// check whether the destination node was already reached
if (minEdge == to) {
buildPathFrom(minimumInfo, into);
this->endQuery(num_visited);
- // DEBUG
- //std::cout << "visited " + toString(num_visited) + " edges (final path length: " + toString(into.size()) + ")\n";
return;
}
+ pop_heap(myFrontierList.begin(), myFrontierList.end(), myComparator);
+ myFrontierList.pop_back();
+ myFound.push_back(minimumInfo);
minimumInfo->visited = true;
const SUMOReal traveltime = minimumInfo->traveltime + this->getEffort(minEdge, vehicle, time + minimumInfo->traveltime);
// admissible A* heuristic: straight line distance at maximum speed
@@ -260,13 +267,13 @@ public:
public:
/// Builds the path from marked edges
- void buildPathFrom(EdgeInfo* rbegin, std::vector<const E*>& edges) {
- std::deque<const E*> tmp;
+ void buildPathFrom(const EdgeInfo* rbegin, std::vector<const E*>& edges) {
+ std::vector<const E*> tmp;
while (rbegin != 0) {
- tmp.push_front((E*) rbegin->edge); // !!!
+ tmp.push_back(rbegin->edge);
rbegin = rbegin->prev;
}
- std::copy(tmp.begin(), tmp.end(), std::back_inserter(edges));
+ std::copy(tmp.rbegin(), tmp.rend(), std::back_inserter(edges));
}
protected:
@@ -285,7 +292,6 @@ protected:
/// @brief the lookup table for travel time heuristics
const LookupTable* const myLookupTable;
-
};
diff --git a/src/utils/vehicle/BulkStarRouter.h b/src/utils/vehicle/BulkStarRouter.h
deleted file mode 100644
index 6c0ee49..0000000
--- a/src/utils/vehicle/BulkStarRouter.h
+++ /dev/null
@@ -1,383 +0,0 @@
-/****************************************************************************/
-/// @file BulkStarRouter.h
-/// @author Jakob Erdmann
-/// @author Laura Bieker
-/// @author Michael Behrisch
-/// @date February 2012
-/// @version $Id: BulkStarRouter.h 18095 2015-03-17 09:39:00Z behrisch $
-///
-// A* Algorithm using shortest-path-in-fast-graph-heuristic for bulk routing
-// This router is made for routing multiple sources (at different times) to the same destination
-// In the reverse graph (using maximum edge speed) a lower-bound shortest path tree from the target is built.
-// These optimistic distances are then used as admissable heuristc
-// when routing forward in the time-dependent graph from multiple sources.
-// @note: this heuristic does not perform well if the actual vehicles are much slower than the maximum edge speeds
-// @note: this heuristic also does not perform well if the actual vehicles have usage restrictions
-// @todo: add option for setting maximum speed
-/****************************************************************************/
-// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
-// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
-/****************************************************************************/
-//
-// This file is part of SUMO.
-// SUMO is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-/****************************************************************************/
-#ifndef BulkStarRouter_h
-#define BulkStarRouter_h
-
-
-// ===========================================================================
-// included modules
-// ===========================================================================
-#ifdef _MSC_VER
-#include <windows_config.h>
-#else
-#include <config.h>
-#endif
-
-#include <string>
-#include <functional>
-#include <vector>
-#include <set>
-#include <limits>
-#include <algorithm>
-#include <iterator>
-#include <utils/common/MsgHandler.h>
-#include <utils/common/StdDefs.h>
-#include <utils/common/ToString.h>
-#include <utils/vehicle/SUMOAbstractRouter.h>
-
-
-// ===========================================================================
-// class definitions
-// ===========================================================================
-/**
- * @class BulkStarRouterTT
- * @brief Computes the shortest path through a network using the Dijkstra algorithm.
- *
- * The template parameters are:
- * @param E The edge class to use (MSEdge/ROEdge)
- * @param V The vehicle class to use (MSVehicle/ROVehicle)
- * @param PF The prohibition function to use (prohibited_withRestrictions/prohibited_noRestrictions)
- * @param EC The class to retrieve the effort for an edge from
- *
- * The router is edge-based. It must know the number of edges for internal reasons
- * and whether a missing connection between two given edges (unbuild route) shall
- * be reported as an error or as a warning.
- *
- */
-template<class E, class V, class PF>
-class BulkStarRouter: public SUMOAbstractRouter<E, V>, public PF {
-
-public:
- /// Type of the function that is used to retrieve the edge effort.
- typedef SUMOReal(* Operation)(const E* const, const V* const, SUMOReal);
- typedef SUMOReal(E::* MinTTOperation)(const V* const) const;
-
-
- /// Constructor
- BulkStarRouter(size_t noE, bool unbuildIsWarning, Operation operation, MinTTOperation minTTOperation) :
- SUMOAbstractRouter<E, V>(operation, "BulkStarRouter"),
- myErrorMsgHandler(unbuildIsWarning ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()),
- myMinTTOperation(minTTOperation),
- myPreparedDestination(0) {
- for (size_t i = 0; i < noE; i++) {
- myEdgeInfos.push_back(EdgeInfo(i));
- }
- }
-
- /// Destructor
- virtual ~BulkStarRouter() {}
-
- virtual SUMOAbstractRouter<E, V>* clone() const {
- return new BulkStarRouter<E, V, PF>(myEdgeInfos.size(), myErrorMsgHandler == MsgHandler::getWarningInstance(), this->myOperation, myMinTTOperation);
- }
-
- /**
- * @struct EdgeInfo
- * A definition about a route's edge with the effort needed to reach it and
- * the information about the previous edge.
- */
- class EdgeInfo {
- public:
- /// Constructor
- EdgeInfo(size_t id) :
- edge(E::dictionary(id)),
- traveltime(std::numeric_limits<SUMOReal>::max()),
- heuristicTime(std::numeric_limits<SUMOReal>::max()),
- minRemaining(0),
- prev(0),
- visited(false) {}
-
- /// The current edge
- const E* edge;
-
- /// Effort to reach the edge
- SUMOReal traveltime;
-
- /// Estimated time to reach the edge (traveltime + lower bound on remaining time)
- SUMOReal heuristicTime;
-
- /// minimum time to destination
- SUMOReal minRemaining;
-
- /// The previous edge
- EdgeInfo* prev;
-
- /// The previous edge
- bool visited;
-
- inline void reset() {
- // heuristicTime is set before adding to the frontier, thus no reset is needed
- traveltime = std::numeric_limits<SUMOReal>::max();
- visited = false;
- }
- };
-
- /**
- * @class EdgeInfoComparator
- * Class to compare (and so sort) nodes by their effort
- */
- class EdgeInfoComparator {
- public:
- /// Comparing method
- bool operator()(const EdgeInfo* nod1, const EdgeInfo* nod2) const {
- if (nod1->heuristicTime == nod2->heuristicTime) {
- return nod1->edge->getNumericalID() > nod2->edge->getNumericalID();
- }
- return nod1->heuristicTime > nod2->heuristicTime;
- }
- };
-
- inline SUMOReal getMinEffort(const E* const e, const V* const v) const {
- return (e->*myMinTTOperation)(v);
- }
-
-
- /** @brief Builds a complete shorteset path tree in the (static) reverse
- * graph from destination (Dijkstra until all EdgeInfos are visited)
- * @param[in] destination The common destination for the following routes
- * @param[in] fastestVehicle An optimistic vehicle (fastest, least restriction) for the following routes
- * @param[in] skip Whether to shortcut the preparation (query uses euclidean heuristic)
- * */
- void prepare(const E* destination, const V* fastestVehicle, bool skip) {
- if (skip) {
- myPreparedDestination = 0;
- return;
- }
- myPreparedDestination = destination;
- for (typename std::vector<EdgeInfo>::iterator i = myEdgeInfos.begin(); i != myEdgeInfos.end(); i++) {
- (*i).reset();
- (*i).minRemaining = 0;
- }
- myFrontier.clear();
- myFound.clear();
- // add begin node
- EdgeInfo* const fromInfo = &(myEdgeInfos[destination->getNumericalID()]);
- fromInfo->traveltime = 0;
- fromInfo->prev = 0;
- myFrontier.push_back(fromInfo);
- // loop
- int num_visited = 0;
- while (!myFrontier.empty()) {
- num_visited += 1;
- // use the node with the minimal length
- EdgeInfo* const minimumInfo = myFrontier.front();
- const E* const minEdge = minimumInfo->edge;
- pop_heap(myFrontier.begin(), myFrontier.end(), myComparator);
- myFrontier.pop_back();
- myFound.push_back(minimumInfo);
- minimumInfo->visited = true;
- const SUMOReal traveltime = minimumInfo->traveltime + getMinEffort(minEdge, fastestVehicle);
- // check all ways from the node with the minimal length
- for (typename std::vector<E*>::const_iterator it = minEdge->getPredecessors().begin(); it != minEdge->getPredecessors().end(); it++) {
- const E* const follower = *it;
- EdgeInfo* const followerInfo = &(myEdgeInfos[follower->getNumericalID()]);
- const SUMOReal oldEffort = followerInfo->traveltime;
- if (!followerInfo->visited && traveltime < oldEffort) {
- followerInfo->traveltime = traveltime;
- followerInfo->minRemaining = traveltime;
- followerInfo->heuristicTime = traveltime; // plain dijkstra
- followerInfo->prev = minimumInfo;
- if (oldEffort == std::numeric_limits<SUMOReal>::max()) {
- myFrontier.push_back(followerInfo);
- push_heap(myFrontier.begin(), myFrontier.end(), myComparator);
- } else {
- push_heap(myFrontier.begin(),
- find(myFrontier.begin(), myFrontier.end(), followerInfo) + 1,
- myComparator);
- }
- }
- }
- }
- // DEBUG
- //std::cout << "visited " + toString(num_visited) + " edges during pre-computation\n";
-
- // DEBUG
- //std::vector<const E*> debugPath;
- //for (typename std::vector<EdgeInfo>::iterator it = myEdgeInfos.begin(); it != myEdgeInfos.end(); it++) {
- // if (it->edge->getID() == "src") {
- // buildPathFrom(&(*it), debugPath);
- // std::cout << "shortest path in reverse graph:\n";
- // for (typename std::vector<const E*>::iterator it_path = debugPath.begin(); it_path != debugPath.end(); it_path++) {
- // std::cout << (*it_path)->getID() << " ";
- // }
- // std::cout << "\n";
- // }
- //}
- }
-
-
- void init() {
- // all EdgeInfos touched in the previous query are either in myFrontier or myFound: clean those up
- for (typename std::vector<EdgeInfo*>::iterator i = myFrontier.begin(); i != myFrontier.end(); i++) {
- (*i)->reset();
- }
- myFrontier.clear();
- for (typename std::vector<EdgeInfo*>::iterator i = myFound.begin(); i != myFound.end(); i++) {
- (*i)->reset();
- }
- myFound.clear();
- }
-
-
- /** @brief Builds the route between the given edges using the minimum travel time */
- void compute(const E* from, const E* to, const V* const vehicle,
- SUMOTime msTime, std::vector<const E*>& into) {
- assert(from != 0 && to != 0);
- this->startQuery();
- const SUMOVehicleClass vClass = vehicle == 0 ? SVC_IGNORING : vehicle->getVClass();
- init();
- const Prepared prepared = (myPreparedDestination == 0 ?
- NO : (myPreparedDestination == to ? YES_EXACT : YES));
- const SUMOReal time = STEPS2TIME(msTime);
- const EdgeInfo& toInfo = myEdgeInfos[to->getNumericalID()];
- EdgeInfo* const fromInfo = &(myEdgeInfos[from->getNumericalID()]);
- fromInfo->traveltime = 0;
- fromInfo->prev = 0;
- myFrontier.push_back(fromInfo);
- // loop
- int num_visited = 0;
- while (!myFrontier.empty()) {
- num_visited += 1;
- // use the node with the minimal length
- EdgeInfo* const minimumInfo = myFrontier.front();
- const E* const minEdge = minimumInfo->edge;
- pop_heap(myFrontier.begin(), myFrontier.end(), myComparator);
- myFrontier.pop_back();
- myFound.push_back(minimumInfo);
- // check whether the destination node was already reached
- if (minEdge == to) {
- buildPathFrom(minimumInfo, into);
- this->endQuery(num_visited);
- // DEBUG
- //std::cout << "visited " + toString(num_visited) + " edges (final path length: " + toString(into.size()) + ")\n";
- return;
- }
- minimumInfo->visited = true;
- const SUMOReal traveltime = minimumInfo->traveltime + this->getEffort(minEdge, vehicle, time + minimumInfo->traveltime);
- // check all ways from the node with the minimal length
- const std::vector<E*>& successors = minEdge->getSuccessors(vClass);
- for (typename std::vector<E*>::const_iterator it = successors.begin(); it != successors.end(); ++it) {
- const E* const follower = *it;
- EdgeInfo* const followerInfo = &(myEdgeInfos[follower->getNumericalID()]);
- // check whether it can be used
- if (PF::operator()(follower, vehicle)) {
- continue;
- }
- const SUMOReal oldEffort = followerInfo->traveltime;
- if (!followerInfo->visited && traveltime < oldEffort) {
- followerInfo->traveltime = traveltime;
- // admissible A* heuristic:
- SUMOReal heuristic_remaining = 0;
- switch (prepared) {
- case NO:
- // straight line distance at maximum speed
- heuristic_remaining = minEdge->getDistanceTo(to) / vehicle->getMaxSpeed();
- break;
- case YES_EXACT:
- // shortest path for fastest vehicle in uncongested network
- heuristic_remaining = minimumInfo->minRemaining;
- break;
- case YES:
- // triangle inequality
- heuristic_remaining = MAX2(
- minimumInfo->minRemaining - toInfo.minRemaining,
- minEdge->getDistanceTo(to) / vehicle->getMaxSpeed());
- break;
- }
- followerInfo->heuristicTime = traveltime + heuristic_remaining;
- followerInfo->prev = minimumInfo;
- if (oldEffort == std::numeric_limits<SUMOReal>::max()) {
- myFrontier.push_back(followerInfo);
- push_heap(myFrontier.begin(), myFrontier.end(), myComparator);
- } else {
- push_heap(myFrontier.begin(),
- find(myFrontier.begin(), myFrontier.end(), followerInfo) + 1,
- myComparator);
- }
- }
- }
- }
- this->endQuery(num_visited);
- myErrorMsgHandler->inform("No connection between '" + from->getID() + "' and '" + to->getID() + "' found.");
- }
-
-
- SUMOReal recomputeCosts(const std::vector<const E*>& edges, const V* const v, SUMOTime msTime) const {
- const SUMOReal time = STEPS2TIME(msTime);
- SUMOReal costs = 0;
- for (typename std::vector<const E*>::const_iterator i = edges.begin(); i != edges.end(); ++i) {
- if (PF::operator()(*i, v)) {
- return -1;
- }
- costs += this->getEffort(*i, v, time + costs);
- }
- return costs;
- }
-
-public:
- /// Builds the path from marked edges
- void buildPathFrom(EdgeInfo* rbegin, std::vector<const E*>& edges) {
- std::deque<const E*> tmp;
- while (rbegin != 0) {
- tmp.push_front((E*) rbegin->edge); // !!!
- rbegin = rbegin->prev;
- }
- std::copy(tmp.begin(), tmp.end(), std::back_inserter(edges));
- }
-
-private:
- enum Prepared {
- NO,
- YES,
- YES_EXACT // optimistic shortest paths are computed for the current destination
- };
-
- /// The container of edge information
- std::vector<EdgeInfo> myEdgeInfos;
-
- /// A container for reusage of the min edge heap
- std::vector<EdgeInfo*> myFrontier;
- /// @brief list of visited Edges (for resetting)
- std::vector<EdgeInfo*> myFound;
-
- EdgeInfoComparator myComparator;
-
- /// @brief the handler for routing errors
- MsgHandler* const myErrorMsgHandler;
-
- MinTTOperation myMinTTOperation;
-
- const E* myPreparedDestination;
-};
-
-
-#endif
-
-/****************************************************************************/
-
diff --git a/src/utils/vehicle/CHRouter.h b/src/utils/vehicle/CHRouter.h
index 5b6accd..e7368ab 100644
--- a/src/utils/vehicle/CHRouter.h
+++ b/src/utils/vehicle/CHRouter.h
@@ -4,7 +4,7 @@
/// @author Laura Bieker
/// @author Michael Behrisch
/// @date February 2012
-/// @version $Id: CHRouter.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: CHRouter.h 18467 2015-05-29 03:50:41Z behrisch $
///
// Shortest Path search using a Contraction Hierarchy
/****************************************************************************/
@@ -63,7 +63,7 @@
* The template parameters are:
* @param E The edge class to use (MSEdge/ROEdge)
* @param V The vehicle class to use (MSVehicle/ROVehicle)
- * @param PF The prohibition function to use (prohibited_withRestrictions/prohibited_noRestrictions)
+ * @param PF The prohibition function to use (prohibited_withPermissions/noProhibitions)
*
* The router is edge-based. It must know the number of edges for internal reasons
* and whether a missing connection between two given edges (unbuild route) shall
diff --git a/src/utils/vehicle/CHRouterWrapper.h b/src/utils/vehicle/CHRouterWrapper.h
index 0176b8e..cc27f0e 100644
--- a/src/utils/vehicle/CHRouterWrapper.h
+++ b/src/utils/vehicle/CHRouterWrapper.h
@@ -4,7 +4,7 @@
/// @author Laura Bieker
/// @author Michael Behrisch
/// @date March 2012
-/// @version $Id: CHRouterWrapper.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: CHRouterWrapper.h 18467 2015-05-29 03:50:41Z behrisch $
///
// Wraps multiple CHRouters for different vehicle types
/****************************************************************************/
@@ -57,7 +57,7 @@
* The template parameters are:
* @param E The edge class to use (MSEdge/ROEdge)
* @param V The vehicle class to use (MSVehicle/ROVehicle)
- * @param PF The prohibition function to use (prohibited_withRestrictions/prohibited_noRestrictions)
+ * @param PF The prohibition function to use (prohibited_withPermissions/noProhibitions)
*
* The router is edge-based. It must know the number of edges for internal reasons
* and whether a missing connection between two given edges (unbuild route) shall
@@ -121,7 +121,7 @@ public:
private:
- typedef CHRouter<E, V, prohibited_noRestrictions<E, V> > CHRouterType;
+ typedef CHRouter<E, V, noProhibitions<E, V> > CHRouterType;
typedef std::map<std::pair<const SUMOVehicleClass, const SUMOReal>, CHRouterType*> RouterMap;
RouterMap myRouters;
diff --git a/src/utils/vehicle/DijkstraRouterEffort.h b/src/utils/vehicle/DijkstraRouterEffort.h
index 664db2e..dd42bde 100644
--- a/src/utils/vehicle/DijkstraRouterEffort.h
+++ b/src/utils/vehicle/DijkstraRouterEffort.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Mon, 25 July 2005
-/// @version $Id: DijkstraRouterEffort.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: DijkstraRouterEffort.h 18467 2015-05-29 03:50:41Z behrisch $
///
// Dijkstra shortest path algorithm using other values
/****************************************************************************/
@@ -54,7 +54,7 @@
* The template parameters are:
* @param E The edge class to use (MSEdge/ROEdge)
* @param V The vehicle class to use (MSVehicle/ROVehicle)
- * @param PF The prohibition function to use (prohibited_withRestrictions/prohibited_noRestrictions)
+ * @param PF The prohibition function to use (prohibited_withPermissions/noProhibitions)
* @param EC The class to retrieve the effort for an edge from
*
* The router is edge-based. It must know the number of edges for internal reasons
@@ -154,13 +154,22 @@ public:
assert(from != 0 && to != 0);
this->startQuery();
const SUMOVehicleClass vClass = vehicle == 0 ? SVC_IGNORING : vehicle->getVClass();
- init();
- // add begin node
- EdgeInfo* const fromInfo = &(myEdgeInfos[from->getNumericalID()]);
- fromInfo->effort = 0;
- fromInfo->prev = 0;
- fromInfo->leaveTime = STEPS2TIME(msTime);
- myFrontierList.push_back(fromInfo);
+ if (this->myBulkMode) {
+ const EdgeInfo& toInfo = myEdgeInfos[to->getNumericalID()];
+ if (toInfo.visited) {
+ buildPathFrom(&toInfo, into);
+ this->endQuery(1);
+ return;
+ }
+ } else {
+ init();
+ // add begin node
+ EdgeInfo* const fromInfo = &(myEdgeInfos[from->getNumericalID()]);
+ fromInfo->effort = 0;
+ fromInfo->prev = 0;
+ fromInfo->leaveTime = STEPS2TIME(msTime);
+ myFrontierList.push_back(fromInfo);
+ }
// loop
int num_visited = 0;
while (!myFrontierList.empty()) {
@@ -225,13 +234,13 @@ public:
public:
/// Builds the path from marked edges
- void buildPathFrom(EdgeInfo* rbegin, std::vector<const E*>& edges) {
- std::deque<const E*> tmp;
+ void buildPathFrom(const EdgeInfo* rbegin, std::vector<const E*>& edges) {
+ std::vector<const E*> tmp;
while (rbegin != 0) {
- tmp.push_front((E*) rbegin->edge); // !!!
+ tmp.push_back(rbegin->edge);
rbegin = rbegin->prev;
}
- std::copy(tmp.begin(), tmp.end(), std::back_inserter(edges));
+ std::copy(tmp.rbegin(), tmp.rend(), std::back_inserter(edges));
}
private:
diff --git a/src/utils/vehicle/DijkstraRouterTT.h b/src/utils/vehicle/DijkstraRouterTT.h
index 6919ec2..3b35743 100644
--- a/src/utils/vehicle/DijkstraRouterTT.h
+++ b/src/utils/vehicle/DijkstraRouterTT.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Mon, 25 July 2005
-/// @version $Id: DijkstraRouterTT.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: DijkstraRouterTT.h 18467 2015-05-29 03:50:41Z behrisch $
///
// Dijkstra shortest path algorithm using travel time
/****************************************************************************/
@@ -59,7 +59,7 @@
* The template parameters are:
* @param E The edge class to use (MSEdge/ROEdge)
* @param V The vehicle class to use (MSVehicle/ROVehicle)
- * @param PF The prohibition function to use (prohibited_withRestrictions/prohibited_noRestrictions)
+ * @param PF The prohibition function to use (prohibited_withPermissions/noProhibitions)
* @param EC The class to retrieve the effort for an edge from
*
* The router is edge-based. It must know the number of edges for internal reasons
@@ -153,12 +153,21 @@ public:
this->startQuery();
const SUMOVehicleClass vClass = vehicle == 0 ? SVC_IGNORING : vehicle->getVClass();
const SUMOReal time = STEPS2TIME(msTime);
- init();
- // add begin node
- EdgeInfo* const fromInfo = &(myEdgeInfos[from->getNumericalID()]);
- fromInfo->traveltime = 0;
- fromInfo->prev = 0;
- myFrontierList.push_back(fromInfo);
+ if (this->myBulkMode) {
+ const EdgeInfo& toInfo = myEdgeInfos[to->getNumericalID()];
+ if (toInfo.visited) {
+ buildPathFrom(&toInfo, into);
+ this->endQuery(1);
+ return;
+ }
+ } else {
+ init();
+ // add begin node
+ EdgeInfo* const fromInfo = &(myEdgeInfos[from->getNumericalID()]);
+ fromInfo->traveltime = 0;
+ fromInfo->prev = 0;
+ myFrontierList.push_back(fromInfo);
+ }
// loop
int num_visited = 0;
while (!myFrontierList.empty()) {
@@ -166,16 +175,6 @@ public:
// use the node with the minimal length
EdgeInfo* const minimumInfo = myFrontierList.front();
const E* const minEdge = minimumInfo->edge;
- pop_heap(myFrontierList.begin(), myFrontierList.end(), myComparator);
- myFrontierList.pop_back();
- myFound.push_back(minimumInfo);
-#ifdef DijkstraRouterTT_DEBUG_QUERY
- std::cout << "DEBUG: hit '" << minEdge->getID() << "' TT: " << minimumInfo->traveltime << " Q: ";
- for (typename std::vector<EdgeInfo*>::iterator it = myFrontierList.begin(); it != myFrontierList.end(); it++) {
- std::cout << (*it)->traveltime << "," << (*it)->edge->getID() << " ";
- }
- std::cout << "\n";
-#endif
// check whether the destination node was already reached
if (minEdge == to) {
buildPathFrom(minimumInfo, into);
@@ -185,7 +184,17 @@ public:
#endif
return;
}
+ pop_heap(myFrontierList.begin(), myFrontierList.end(), myComparator);
+ myFrontierList.pop_back();
+ myFound.push_back(minimumInfo);
minimumInfo->visited = true;
+#ifdef DijkstraRouterTT_DEBUG_QUERY
+ std::cout << "DEBUG: hit '" << minEdge->getID() << "' TT: " << minimumInfo->traveltime << " Q: ";
+ for (typename std::vector<EdgeInfo*>::iterator it = myFrontierList.begin(); it != myFrontierList.end(); it++) {
+ std::cout << (*it)->traveltime << "," << (*it)->edge->getID() << " ";
+ }
+ std::cout << "\n";
+#endif
const SUMOReal traveltime = minimumInfo->traveltime + this->getEffort(minEdge, vehicle, time + minimumInfo->traveltime);
// check all ways from the node with the minimal length
const std::vector<E*>& successors = minEdge->getSuccessors(vClass);
@@ -235,13 +244,13 @@ public:
public:
/// Builds the path from marked edges
- void buildPathFrom(EdgeInfo* rbegin, std::vector<const E*>& edges) {
- std::deque<const E*> tmp;
+ void buildPathFrom(const EdgeInfo* rbegin, std::vector<const E*>& edges) {
+ std::vector<const E*> tmp;
while (rbegin != 0) {
- tmp.push_front((E*) rbegin->edge); // !!!
+ tmp.push_back(rbegin->edge);
rbegin = rbegin->prev;
}
- std::copy(tmp.begin(), tmp.end(), std::back_inserter(edges));
+ std::copy(tmp.rbegin(), tmp.rend(), std::back_inserter(edges));
}
const EdgeInfo& getEdgeInfo(size_t index) const {
diff --git a/src/utils/vehicle/Makefile.am b/src/utils/vehicle/Makefile.am
index df71bdb..e352620 100644
--- a/src/utils/vehicle/Makefile.am
+++ b/src/utils/vehicle/Makefile.am
@@ -1,7 +1,6 @@
noinst_LIBRARIES = libvehicle.a
libvehicle_a_SOURCES = AStarRouter.h \
-BulkStarRouter.h \
CHRouter.h CHRouterWrapper.h \
DijkstraRouterTT.h DijkstraRouterEffort.h \
GawronCalculator.h LogitCalculator.h RouteCostCalculator.h \
diff --git a/src/utils/vehicle/Makefile.in b/src/utils/vehicle/Makefile.in
index 9a8a1e0..fe61ed2 100644
--- a/src/utils/vehicle/Makefile.in
+++ b/src/utils/vehicle/Makefile.in
@@ -328,7 +328,6 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LIBRARIES = libvehicle.a
libvehicle_a_SOURCES = AStarRouter.h \
-BulkStarRouter.h \
CHRouter.h CHRouterWrapper.h \
DijkstraRouterTT.h DijkstraRouterEffort.h \
GawronCalculator.h LogitCalculator.h RouteCostCalculator.h \
diff --git a/src/utils/vehicle/PedestrianRouter.h b/src/utils/vehicle/PedestrianRouter.h
index a962c1f..75fab87 100644
--- a/src/utils/vehicle/PedestrianRouter.h
+++ b/src/utils/vehicle/PedestrianRouter.h
@@ -2,7 +2,7 @@
/// @file PedestrianRouter.h
/// @author Jakob Erdmann
/// @date Mon, 03 March 2014
-/// @version $Id: PedestrianRouter.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: PedestrianRouter.h 18467 2015-05-29 03:50:41Z behrisch $
///
// The Pedestrian Router build a special network and (delegegates to a SUMOAbstractRouter)
/****************************************************************************/
@@ -71,7 +71,7 @@ inline const L* getSidewalk(const E* edge) {
template<class E, class N>
struct PedestrianTrip {
- PedestrianTrip(const E* _from, const E* _to, SUMOReal _departPos, SUMOReal _arrivalPos, SUMOReal _speed, SUMOReal _departTime, const N* _node) :
+ PedestrianTrip(const E* _from, const E* _to, SUMOReal _departPos, SUMOReal _arrivalPos, SUMOReal _speed, SUMOTime _departTime, const N* _node) :
from(_from),
to(_to),
node(_node),
@@ -83,7 +83,7 @@ struct PedestrianTrip {
// exists just for debugging purposes
std::string getID() const {
- return from->getID() + ":" + to->getID() + ":" + toString(departTime);
+ return from->getID() + ":" + to->getID() + ":" + time2string(departTime);
}
@@ -97,7 +97,7 @@ struct PedestrianTrip {
const SUMOReal departPos;
const SUMOReal arrivalPos;
const SUMOReal speed;
- const SUMOReal departTime;
+ const SUMOTime departTime;
private:
/// @brief Invalidated assignment operator.
PedestrianTrip& operator=(const PedestrianTrip&);
@@ -392,7 +392,7 @@ public:
// @note pedestrian traffic lights should never have LINKSTATE_TL_REDYELLOW
if (edge->myEdge->isCrossing() && edge->myLane->getIncomingLinkState() == LINKSTATE_TL_RED) {
// red traffic lights occurring later in the route may be green by the time we arive
- tlsDelay += MAX2(SUMOReal(0), TL_RED_PENALTY - (time - trip->departTime));
+ tlsDelay += MAX2(SUMOReal(0), TL_RED_PENALTY - (time - STEPS2TIME(trip->departTime)));
}
#ifdef PedestrianRouter_DEBUG_EFFORTS
@@ -542,7 +542,7 @@ private:
// common specializations
template<class E, class L, class N>
class PedestrianRouterDijkstra : public PedestrianRouter < E, L, N,
- DijkstraRouterTT<PedestrianEdge<E, L, N>, PedestrianTrip<E, N>, prohibited_withRestrictions<PedestrianEdge<E, L, N>, PedestrianTrip<E, N> > > > { };
+ DijkstraRouterTT<PedestrianEdge<E, L, N>, PedestrianTrip<E, N>, prohibited_withPermissions<PedestrianEdge<E, L, N>, PedestrianTrip<E, N> > > > { };
// ===========================================================================
diff --git a/src/utils/vehicle/SUMOAbstractRouter.h b/src/utils/vehicle/SUMOAbstractRouter.h
index 23d9156..5fd528f 100644
--- a/src/utils/vehicle/SUMOAbstractRouter.h
+++ b/src/utils/vehicle/SUMOAbstractRouter.h
@@ -4,7 +4,7 @@
/// @author Michael Behrisch
/// @author Jakob Erdmann
/// @date 25.Jan 2006
-/// @version $Id: SUMOAbstractRouter.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: SUMOAbstractRouter.h 18467 2015-05-29 03:50:41Z behrisch $
///
// The dijkstra-router
/****************************************************************************/
@@ -58,6 +58,7 @@ public:
/// Constructor
SUMOAbstractRouter(Operation operation, const std::string& type):
myOperation(operation),
+ myBulkMode(false),
myType(type),
myQueryVisits(0),
myNumQueries(0),
@@ -83,11 +84,6 @@ public:
virtual SUMOReal recomputeCosts(const std::vector<const E*>& edges,
const V* const v, SUMOTime msTime) const = 0;
- // interface extension for BulkStarRouter
- virtual void prepare(const E*, const V*, bool) {
- assert(false);
- }
-
inline SUMOReal getEffort(const E* const e, const V* const v, SUMOReal t) const {
return (*myOperation)(e, v, t);
}
@@ -102,20 +98,27 @@ public:
myQueryTimeSum += (SysUtils::getCurrentMillis() - myQueryStartTime);
}
+ void setBulkMode(const bool mode) {
+ myBulkMode = mode;
+ }
+
protected:
/// @brief The object's operation to perform.
Operation myOperation;
+ /// @brief whether we are currently operating several route queries in a bulk
+ bool myBulkMode;
+
private:
/// @brief the type of this router
const std::string myType;
/// @brief counters for performance logging
- SUMOLong myQueryVisits;
- SUMOLong myNumQueries;
+ long long int myQueryVisits;
+ long long int myNumQueries;
/// @brief the time spent querying in milliseconds
- SUMOLong myQueryStartTime;
- SUMOLong myQueryTimeSum;
+ long long int myQueryStartTime;
+ long long int myQueryTimeSum;
private:
/// @brief Invalidated assignment operator
SUMOAbstractRouter& operator=(const SUMOAbstractRouter& s);
@@ -123,7 +126,7 @@ private:
template<class E, class V>
-struct prohibited_withRestrictions {
+struct prohibited_withPermissions {
public:
inline bool operator()(const E* edge, const V* vehicle) const {
if (std::find(myProhibited.begin(), myProhibited.end(), edge) != myProhibited.end()) {
@@ -142,7 +145,7 @@ protected:
};
template<class E, class V>
-struct prohibited_noRestrictions {
+struct noProhibitions {
public:
inline bool operator()(const E*, const V*) const {
return false;
diff --git a/src/utils/vehicle/SUMOVTypeParameter.cpp b/src/utils/vehicle/SUMOVTypeParameter.cpp
index 86f75b6..3c5f9fe 100644
--- a/src/utils/vehicle/SUMOVTypeParameter.cpp
+++ b/src/utils/vehicle/SUMOVTypeParameter.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date 10.09.2009
-/// @version $Id: SUMOVTypeParameter.cpp 18136 2015-03-24 15:10:45Z behrisch $
+/// @version $Id: SUMOVTypeParameter.cpp 18516 2015-07-01 20:47:12Z behrisch $
///
// Structure representing possible vehicle parameter
/****************************************************************************/
@@ -261,7 +261,7 @@ SUMOVTypeParameter::write(OutputDevice& dev) const {
dev.writeAttr(SUMO_ATTR_LOADING_DURATION, loadingDuration);
}
- if (cfParameter.size() != 0) {
+ if (wasSet(VTYPEPARS_CAR_FOLLOW_MODEL) || cfParameter.size() != 0) {
dev.openTag(cfModel);
std::vector<SumoXMLAttr> attrs;
for (CFParams::const_iterator i = cfParameter.begin(); i != cfParameter.end(); ++i) {
diff --git a/src/utils/vehicle/SUMOVTypeParameter.h b/src/utils/vehicle/SUMOVTypeParameter.h
index 936fb9f..237a61d 100644
--- a/src/utils/vehicle/SUMOVTypeParameter.h
+++ b/src/utils/vehicle/SUMOVTypeParameter.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date 10.09.2009
-/// @version $Id: SUMOVTypeParameter.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: SUMOVTypeParameter.h 18516 2015-07-01 20:47:12Z behrisch $
///
// Structure representing possible vehicle parameter
/****************************************************************************/
@@ -69,6 +69,7 @@ const int VTYPEPARS_PERSON_CAPACITY = 2 << 16;
const int VTYPEPARS_BOARDING_DURATION = 2 << 17;
const int VTYPEPARS_CONTAINER_CAPACITY = 2 << 18;
const int VTYPEPARS_LOADING_DURATION = 2 << 19;
+const int VTYPEPARS_CAR_FOLLOW_MODEL = 2 << 20;
// ===========================================================================
diff --git a/src/utils/vehicle/SUMOVehicle.h b/src/utils/vehicle/SUMOVehicle.h
index cbcb159..8afe09b 100644
--- a/src/utils/vehicle/SUMOVehicle.h
+++ b/src/utils/vehicle/SUMOVehicle.h
@@ -1,10 +1,10 @@
-/****************************************************************************/
+/****************************************************************************/
/// @file SUMOVehicle.h
/// @author Michael Behrisch
/// @author Daniel Krajzewicz
/// @author Jakob Erdmann
/// @date Tue, 17 Feb 2009
-/// @version $Id: SUMOVehicle.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: SUMOVehicle.h 18730 2015-08-26 09:24:04Z namdre $
///
// Abstract base class for vehicle representations
/****************************************************************************/
@@ -49,7 +49,7 @@ class MSEdge;
class MSLane;
class MSDevice;
class MSPerson;
-class MSContainer;
+class MSTransportable;
class SUMOSAXAttributes;
typedef std::vector<const MSEdge*> ConstMSEdgeVector;
@@ -101,6 +101,11 @@ public:
*/
virtual SUMOReal getSpeed() const = 0;
+ /** @brief Returns the lane the vehicle is on
+ * @return The vehicle's current lane
+ */
+ virtual MSLane* getLane() const = 0;
+
/** @brief Returns the vehicle's type
* @return The vehicle's type
*/
@@ -180,6 +185,11 @@ public:
*/
virtual bool isOnRoad() const = 0;
+ /** @brief Returns the information whether the vehicle is parked
+ * @return Whether the vehicle is parked
+ */
+ virtual bool isParking() const = 0;
+
/** @brief Returns this vehicle's real departure time
* @return This vehicle's real departure time
*/
@@ -191,6 +201,10 @@ public:
*/
virtual SUMOReal getArrivalPos() const = 0;
+ /** @brief Sets this vehicle's desired arrivalPos for its current route
+ */
+ virtual void setArrivalPos(SUMOReal arrivalPos) = 0;
+
/** @brief Returns whether this vehicle has departed
*/
virtual bool hasDeparted() const = 0;
@@ -215,7 +229,7 @@ public:
*
* @param[in] person The person to add
*/
- virtual void addPerson(MSPerson* person) = 0;
+ virtual void addPerson(MSTransportable* person) = 0;
/** @brief Adds a container to this vehicle
*
@@ -223,7 +237,7 @@ public:
*
* @param[in] container The container to add
*/
- virtual void addContainer(MSContainer* container) = 0;
+ virtual void addContainer(MSTransportable* container) = 0;
/** @brief Adds a stop
*
diff --git a/src/utils/vehicle/SUMOVehicleParameter.cpp b/src/utils/vehicle/SUMOVehicleParameter.cpp
index e6ee5c1..d76985b 100644
--- a/src/utils/vehicle/SUMOVehicleParameter.cpp
+++ b/src/utils/vehicle/SUMOVehicleParameter.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Tue, 31.03.2009
-/// @version $Id: SUMOVehicleParameter.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: SUMOVehicleParameter.cpp 18186 2015-04-01 15:30:42Z behrisch $
///
// Structure representing possible vehicle parameter
/****************************************************************************/
@@ -55,7 +55,7 @@ SUMOVehicleParameter::SUMOVehicleParameter()
arrivalPos(0), arrivalPosProcedure(ARRIVAL_POS_DEFAULT),
arrivalSpeed(-1), arrivalSpeedProcedure(ARRIVAL_SPEED_DEFAULT),
repetitionNumber(-1), repetitionsDone(-1), repetitionOffset(-1), repetitionProbability(-1), repetitionEnd(-1),
- line(), fromTaz(), toTaz(), personCapacity(0), personNumber(0), containerNumber(0), setParameter(0) {
+ line(), fromTaz(), toTaz(), personNumber(0), containerNumber(0), setParameter(0) {
}
@@ -239,9 +239,6 @@ SUMOVehicleParameter::write(OutputDevice& dev, const OptionsCont& oc) const {
if (wasSet(VEHPARS_TO_TAZ_SET)) {
dev.writeAttr(SUMO_ATTR_TO_TAZ, toTaz);
}
- if (wasSet(VEHPARS_PERSON_CAPACITY_SET)) {
- dev.writeAttr(SUMO_ATTR_PERSON_CAPACITY, personCapacity);
- }
if (wasSet(VEHPARS_PERSON_NUMBER_SET)) {
dev.writeAttr(SUMO_ATTR_PERSON_NUMBER, personNumber);
}
diff --git a/src/utils/vehicle/SUMOVehicleParameter.h b/src/utils/vehicle/SUMOVehicleParameter.h
index c07d472..f7f9a70 100644
--- a/src/utils/vehicle/SUMOVehicleParameter.h
+++ b/src/utils/vehicle/SUMOVehicleParameter.h
@@ -5,7 +5,7 @@
/// @author Axel Wegener
/// @author Michael Behrisch
/// @date 2006-01-24
-/// @version $Id: SUMOVehicleParameter.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: SUMOVehicleParameter.h 18686 2015-08-21 14:52:03Z namdre $
///
// Structure representing possible vehicle parameter
/****************************************************************************/
@@ -472,6 +472,8 @@ public:
std::string busstop;
/// @brief (Optional) container stop if one is assigned to the stop
std::string containerstop;
+ /// @brief (Optional) charging station if one is assigned to the stop
+ std::string chrgStn;
/// @brief The stopping position start
SUMOReal startPos;
/// @brief The stopping position end
@@ -499,13 +501,10 @@ public:
/// @brief List of the stops the vehicle will make
std::vector<Stop> stops;
- /// @brief The vehicle's capacity (persons)
- unsigned int personCapacity;
-
- /// @brief The number of persons in the vehicle
+ /// @brief The static number of persons in the vehicle when it departs (not including boarding persons)
unsigned int personNumber;
- /// @brief The number of containers in the vehicle
+ /// @brief The static number of containers in the vehicle when it departs
unsigned int containerNumber;
/// @brief Information for the router which parameter were set
diff --git a/src/utils/xml/SUMOSAXAttributes.cpp b/src/utils/xml/SUMOSAXAttributes.cpp
index a77af83..44982da 100644
--- a/src/utils/xml/SUMOSAXAttributes.cpp
+++ b/src/utils/xml/SUMOSAXAttributes.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Fri, 30 Mar 2007
-/// @version $Id: SUMOSAXAttributes.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: SUMOSAXAttributes.cpp 18239 2015-04-20 11:37:12Z behrisch $
///
// Encapsulated SAX-Attributes
/****************************************************************************/
@@ -198,10 +198,10 @@ int SUMOSAXAttributes::getInternal(const int attr) const {
}
-template<> const SUMOLong invalid_return<SUMOLong>::value = -1;
-template<> const std::string invalid_return<SUMOLong>::type = "long";
+template<> const long long int invalid_return<long long int>::value = -1;
+template<> const std::string invalid_return<long long int>::type = "long";
template<>
-SUMOLong SUMOSAXAttributes::getInternal(const int attr) const {
+long long int SUMOSAXAttributes::getInternal(const int attr) const {
return getLong(attr);
}
diff --git a/src/utils/xml/SUMOSAXAttributes.h b/src/utils/xml/SUMOSAXAttributes.h
index 8407636..755ca76 100644
--- a/src/utils/xml/SUMOSAXAttributes.h
+++ b/src/utils/xml/SUMOSAXAttributes.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Fri, 30 Mar 2007
-/// @version $Id: SUMOSAXAttributes.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: SUMOSAXAttributes.h 18239 2015-04-20 11:37:12Z behrisch $
///
// Encapsulated SAX-Attributes
/****************************************************************************/
@@ -222,7 +222,7 @@ public:
* @exception EmptyData If the attribute is not known or the attribute value is an empty string
* @exception NumberFormatException If the attribute value can not be parsed to an int
*/
- virtual SUMOLong getLong(int id) const = 0;
+ virtual long long int getLong(int id) const = 0;
/**
diff --git a/src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp b/src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp
index 60ae22a..82d9116 100644
--- a/src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp
+++ b/src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: SUMOSAXAttributesImpl_Binary.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: SUMOSAXAttributesImpl_Binary.cpp 18239 2015-04-20 11:37:12Z behrisch $
///
// Encapsulated Xerces-SAX-attributes
/****************************************************************************/
@@ -185,7 +185,7 @@ SUMOSAXAttributesImpl_Binary::getInt(int id) const {
}
-SUMOLong
+long long int
SUMOSAXAttributesImpl_Binary::getLong(int /* id */) const {
throw NumberFormatException();
}
diff --git a/src/utils/xml/SUMOSAXAttributesImpl_Binary.h b/src/utils/xml/SUMOSAXAttributesImpl_Binary.h
index 63764c5..58a3544 100644
--- a/src/utils/xml/SUMOSAXAttributesImpl_Binary.h
+++ b/src/utils/xml/SUMOSAXAttributesImpl_Binary.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Fri, 30 Mar 2007
-/// @version $Id: SUMOSAXAttributesImpl_Binary.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: SUMOSAXAttributesImpl_Binary.h 18239 2015-04-20 11:37:12Z behrisch $
///
// Encapsulated Xerces-SAX-attributes
/****************************************************************************/
@@ -133,7 +133,7 @@ public:
* @exception EmptyData If the attribute is not known or the attribute value is an empty string
* @exception NumberFormatException If the attribute value can not be parsed to an int
*/
- SUMOLong getLong(int id) const;
+ long long int getLong(int id) const;
/**
diff --git a/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp b/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp
index 900d1a2..049f61d 100644
--- a/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp
+++ b/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Sept 2002
-/// @version $Id: SUMOSAXAttributesImpl_Xerces.cpp 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: SUMOSAXAttributesImpl_Xerces.cpp 18239 2015-04-20 11:37:12Z behrisch $
///
// Encapsulated Xerces-SAX-attributes
/****************************************************************************/
@@ -87,7 +87,7 @@ SUMOSAXAttributesImpl_Xerces::getInt(int id) const {
}
-SUMOLong
+long long int
SUMOSAXAttributesImpl_Xerces::getLong(int id) const {
return TplConvert::_2long(getAttributeValueSecure(id));
}
diff --git a/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h b/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h
index 6402edf..59fade3 100644
--- a/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h
+++ b/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h
@@ -4,7 +4,7 @@
/// @author Jakob Erdmann
/// @author Michael Behrisch
/// @date Fri, 30 Mar 2007
-/// @version $Id: SUMOSAXAttributesImpl_Xerces.h 18095 2015-03-17 09:39:00Z behrisch $
+/// @version $Id: SUMOSAXAttributesImpl_Xerces.h 18239 2015-04-20 11:37:12Z behrisch $
///
// Encapsulated Xerces-SAX-attributes
/****************************************************************************/
@@ -132,7 +132,7 @@ public:
* @exception EmptyData If the attribute is not known or the attribute value is an empty string
* @exception NumberFormatException If the attribute value can not be parsed to an int
*/
- SUMOLong getLong(int id) const;
+ long long int getLong(int id) const;
/**
diff --git a/src/utils/xml/SUMOVehicleParserHelper.cpp b/src/utils/xml/SUMOVehicleParserHelper.cpp
index 65e8e1a..6e74b75 100644
--- a/src/utils/xml/SUMOVehicleParserHelper.cpp
+++ b/src/utils/xml/SUMOVehicleParserHelper.cpp
@@ -6,7 +6,7 @@
/// @author Michael Behrisch
/// @author Laura Bieker
/// @date Mon, 07.04.2008
-/// @version $Id: SUMOVehicleParserHelper.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: SUMOVehicleParserHelper.cpp 18516 2015-07-01 20:47:12Z behrisch $
///
// Helper methods for parsing vehicle attributes
/****************************************************************************/
@@ -165,7 +165,7 @@ SUMOVehicleParserHelper::parseFlowAttributes(const SUMOSAXAttributes& attrs, con
} else {
// interpret repetitionNumber
if (ok && ret->repetitionProbability > 0) {
- ret->repetitionNumber = INT_MAX;
+ ret->repetitionNumber = std::numeric_limits<int>::max();
ret->repetitionEnd = end;
} else {
if (ok && ret->repetitionOffset <= 0) {
@@ -173,7 +173,7 @@ SUMOVehicleParserHelper::parseFlowAttributes(const SUMOSAXAttributes& attrs, con
throw ProcessError("Invalid repetition rate in the definition of flow '" + id + "'.");
}
if (end == SUMOTime_MAX) {
- ret->repetitionNumber = INT_MAX;
+ ret->repetitionNumber = std::numeric_limits<int>::max();
} else {
ret->repetitionNumber = MAX2(1, (int)(((SUMOReal)(end - ret->depart)) / ret->repetitionOffset + 0.5));
}
@@ -410,6 +410,16 @@ SUMOVehicleParserHelper::beginVTypeParsing(const SUMOSAXAttributes& attrs, const
throw ProcessError();
}
}
+ if (attrs.hasAttribute(SUMO_ATTR_CAR_FOLLOW_MODEL)) {
+ const std::string cfmS = attrs.get<std::string>(SUMO_ATTR_CAR_FOLLOW_MODEL, vtype->id.c_str(), ok);
+ if (SUMOXMLDefinitions::CarFollowModels.hasString(cfmS)) {
+ vtype->cfModel = SUMOXMLDefinitions::CarFollowModels.get(cfmS);
+ vtype->setParameter |= VTYPEPARS_CAR_FOLLOW_MODEL;
+ } else {
+ WRITE_ERROR("Unknown car following model '" + cfmS + "' when parsing vtype '" + vtype->id + "'");
+ throw ProcessError();
+ }
+ }
if (attrs.hasAttribute(SUMO_ATTR_PERSON_CAPACITY)) {
vtype->personCapacity = attrs.get<int>(SUMO_ATTR_PERSON_CAPACITY, vtype->id.c_str(), ok);
vtype->setParameter |= VTYPEPARS_PERSON_CAPACITY;
@@ -426,11 +436,7 @@ SUMOVehicleParserHelper::beginVTypeParsing(const SUMOSAXAttributes& attrs, const
vtype->loadingDuration = attrs.getSUMOTimeReporting(SUMO_ATTR_LOADING_DURATION, vtype->id.c_str(), ok);
vtype->setParameter |= VTYPEPARS_LOADING_DURATION;
}
- try {
- parseVTypeEmbedded(*vtype, SUMO_TAG_CF_KRAUSS, attrs, true);
- } catch (ProcessError&) {
- throw;
- }
+ parseVTypeEmbedded(*vtype, vtype->cfModel, attrs, true);
if (!ok) {
delete vtype;
throw ProcessError();
@@ -461,6 +467,7 @@ SUMOVehicleParserHelper::parseVTypeEmbedded(SUMOVTypeParameter& into,
}
if (!fromVType) {
into.cfModel = cf_it->first;
+ into.setParameter |= VTYPEPARS_CAR_FOLLOW_MODEL;
}
bool ok = true;
for (std::set<SumoXMLAttr>::const_iterator it = cf_it->second.begin(); it != cf_it->second.end(); it++) {
diff --git a/src/utils/xml/SUMOXMLDefinitions.cpp b/src/utils/xml/SUMOXMLDefinitions.cpp
index 14e648a..121a924 100644
--- a/src/utils/xml/SUMOXMLDefinitions.cpp
+++ b/src/utils/xml/SUMOXMLDefinitions.cpp
@@ -7,7 +7,7 @@
/// @author Michael Behrisch
/// @author Walter Bamberger
/// @date Sept 2002
-/// @version $Id: SUMOXMLDefinitions.cpp 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: SUMOXMLDefinitions.cpp 18756 2015-08-31 19:16:33Z behrisch $
///
// Definitions of elements and attributes known by SUMO
/****************************************************************************/
@@ -53,6 +53,7 @@ StringBijection<int>::Entry SUMOXMLDefinitions::tags[] = {
{ "poi", SUMO_TAG_POI },
{ "poly", SUMO_TAG_POLY },
{ "junction", SUMO_TAG_JUNCTION },
+ { "restriction", SUMO_TAG_RESTRICTION },
{ "e1Detector", SUMO_TAG_E1DETECTOR },
{ "inductionLoop", SUMO_TAG_INDUCTION_LOOP },
{ "e2Detector", SUMO_TAG_E2DETECTOR },
@@ -71,6 +72,7 @@ StringBijection<int>::Entry SUMOXMLDefinitions::tags[] = {
{ "rerouter", SUMO_TAG_REROUTER },
{ "busStop", SUMO_TAG_BUS_STOP },
{ "containerStop", SUMO_TAG_CONTAINER_STOP },
+ { "chargingStation", SUMO_TAG_CHRG_STN },
{ "vTypeProbe", SUMO_TAG_VTYPEPROBE },
{ "routeProbe", SUMO_TAG_ROUTEPROBE },
{ "routes", SUMO_TAG_ROUTES },
@@ -213,6 +215,7 @@ StringBijection<int>::Entry SUMOXMLDefinitions::attrs[] = {
{ "oneway", SUMO_ATTR_ONEWAY },
{ "width", SUMO_ATTR_WIDTH },
{ "sidewalkWidth", SUMO_ATTR_SIDEWALKWIDTH },
+ { "bikeLaneWidth", SUMO_ATTR_BIKELANEWIDTH },
{ "remove", SUMO_ATTR_REMOVE },
{ "length", SUMO_ATTR_LENGTH },
@@ -255,10 +258,16 @@ StringBijection<int>::Entry SUMOXMLDefinitions::attrs[] = {
{ "speedFactor", SUMO_ATTR_SPEEDFACTOR },
{ "speedDev", SUMO_ATTR_SPEEDDEV },
{ "laneChangeModel", SUMO_ATTR_LANE_CHANGE_MODEL },
+ { "carFollowModel", SUMO_ATTR_CAR_FOLLOW_MODEL },
{ "minGap", SUMO_ATTR_MINGAP },
{ "boardingDuration", SUMO_ATTR_BOARDING_DURATION },
{ "loadingDuration", SUMO_ATTR_LOADING_DURATION },
+ { "chrgpower", SUMO_ATTR_CHRGPOWER },
+ { "efficiency", SUMO_ATTR_EFFICIENCY },
+ { "chargeInTransit", SUMO_ATTR_CHRGINTRANSIT },
+ { "chargeDelay", SUMO_ATTR_CHRGDELAY},
+
{ "sigma", SUMO_ATTR_SIGMA },
{ "tau", SUMO_ATTR_TAU },
{ "tmp1", SUMO_ATTR_TMP1 },
@@ -309,6 +318,7 @@ StringBijection<int>::Entry SUMOXMLDefinitions::attrs[] = {
{ "spreadType", SUMO_ATTR_SPREADTYPE },
{ "radius", SUMO_ATTR_RADIUS },
{ "customShape", SUMO_ATTR_CUSTOMSHAPE },
+ { "keepClear", SUMO_ATTR_KEEP_CLEAR },
{ "color", SUMO_ATTR_COLOR },
{ "dir", SUMO_ATTR_DIR },
{ "state", SUMO_ATTR_STATE },
@@ -523,6 +533,7 @@ StringBijection<LinkState>::Entry SUMOXMLDefinitions::linkStateValues[] = {
StringBijection<LinkDirection>::Entry SUMOXMLDefinitions::linkDirectionValues[] = {
{ "s", LINKDIR_STRAIGHT },
{ "t", LINKDIR_TURN },
+ { "T", LINKDIR_TURN_LEFTHAND },
{ "l", LINKDIR_LEFT },
{ "r", LINKDIR_RIGHT },
{ "L", LINKDIR_PARTLEFT },
@@ -544,6 +555,20 @@ StringBijection<LaneChangeModel>::Entry SUMOXMLDefinitions::laneChangeModelValue
{ "JE2013", LCM_JE2013 },
};
+StringBijection<SumoXMLTag>::Entry SUMOXMLDefinitions::carFollowModelValues[] = {
+ { "IDM", SUMO_TAG_CF_IDM },
+ { "IDMM", SUMO_TAG_CF_IDMM },
+ { "Krauss", SUMO_TAG_CF_KRAUSS },
+ { "KraussPS", SUMO_TAG_CF_KRAUSS_PLUS_SLOPE },
+ { "KraussAB", SUMO_TAG_CF_KRAUSS_ACCEL_BOUND },
+ { "KraussOrig1", SUMO_TAG_CF_KRAUSS_ORIG1 },
+ { "SmartSK", SUMO_TAG_CF_SMART_SK },
+ { "Daniel1", SUMO_TAG_CF_DANIEL1 },
+ { "PWagner2009", SUMO_TAG_CF_PWAGNER2009 },
+ { "BKerner", SUMO_TAG_CF_BKERNER },
+ { "Wiedemann", SUMO_TAG_CF_WIEDEMANN },
+};
+
StringBijection<int> SUMOXMLDefinitions::Tags(
SUMOXMLDefinitions::tags, SUMO_TAG_NOTHING);
@@ -571,6 +596,9 @@ StringBijection<TrafficLightType> SUMOXMLDefinitions::TrafficLightTypes(
StringBijection<LaneChangeModel> SUMOXMLDefinitions::LaneChangeModels(
SUMOXMLDefinitions::laneChangeModelValues, LCM_JE2013);
+StringBijection<SumoXMLTag> SUMOXMLDefinitions::CarFollowModels(
+ SUMOXMLDefinitions::carFollowModelValues, SUMO_TAG_CF_WIEDEMANN);
+
std::string
SUMOXMLDefinitions::getJunctionIDFromInternalEdge(const std::string internalEdge) {
diff --git a/src/utils/xml/SUMOXMLDefinitions.h b/src/utils/xml/SUMOXMLDefinitions.h
index 0c79bd9..fb11ce0 100644
--- a/src/utils/xml/SUMOXMLDefinitions.h
+++ b/src/utils/xml/SUMOXMLDefinitions.h
@@ -7,7 +7,7 @@
/// @author Michael Behrisch
/// @author Walter Bamberger
/// @date Sept 2002
-/// @version $Id: SUMOXMLDefinitions.h 18096 2015-03-17 09:50:59Z behrisch $
+/// @version $Id: SUMOXMLDefinitions.h 18686 2015-08-21 14:52:03Z namdre $
///
// Definitions of elements and attributes known by SUMO
/****************************************************************************/
@@ -61,6 +61,8 @@ enum SumoXMLTag {
SUMO_TAG_POLY,
/** begin/end of the description of a junction */
SUMO_TAG_JUNCTION,
+ /** begin/end of the description of an edge restriction */
+ SUMO_TAG_RESTRICTION,
/** an e1 detector */
SUMO_TAG_E1DETECTOR,
SUMO_TAG_INDUCTION_LOOP,
@@ -92,6 +94,8 @@ enum SumoXMLTag {
SUMO_TAG_BUS_STOP,
/// @brief A container stop
SUMO_TAG_CONTAINER_STOP,
+ /// @brief A Charging Station
+ SUMO_TAG_CHRG_STN,
/** a vtypeprobe detector */
SUMO_TAG_VTYPEPROBE,
/** a routeprobe detector */
@@ -278,6 +282,7 @@ enum SumoXMLAttr {
SUMO_ATTR_ONEWAY,
SUMO_ATTR_WIDTH,
SUMO_ATTR_SIDEWALKWIDTH,
+ SUMO_ATTR_BIKELANEWIDTH,
SUMO_ATTR_REMOVE,
SUMO_ATTR_LENGTH,
SUMO_ATTR_X,
@@ -319,9 +324,15 @@ enum SumoXMLAttr {
SUMO_ATTR_SPEEDFACTOR,
SUMO_ATTR_SPEEDDEV,
SUMO_ATTR_LANE_CHANGE_MODEL,
+ SUMO_ATTR_CAR_FOLLOW_MODEL,
SUMO_ATTR_MINGAP,
SUMO_ATTR_BOARDING_DURATION,
SUMO_ATTR_LOADING_DURATION,
+ /* Charging Station */
+ SUMO_ATTR_CHRGPOWER, // charge in W of the Charging Stations
+ SUMO_ATTR_EFFICIENCY, // Eficiency of the charge inCharging Stations
+ SUMO_ATTR_CHRGINTRANSIT,// Allow/disallow charge in transit in Charging Stations
+ SUMO_ATTR_CHRGDELAY, // Delay in the charge of charging stations
/* Car following model attributes */
SUMO_ATTR_SIGMA, // used by: Krauss
SUMO_ATTR_TAU, // Krauss
@@ -381,6 +392,8 @@ enum SumoXMLAttr {
SUMO_ATTR_SPREADTYPE,
/// The turning radius at an intersection in m
SUMO_ATTR_RADIUS,
+ /// Whether vehicles must keep the junction clear
+ SUMO_ATTR_KEEP_CLEAR,
/// whether a given shape is user-defined
SUMO_ATTR_CUSTOMSHAPE,
/// A color information
@@ -685,6 +698,8 @@ enum LinkDirection {
LINKDIR_STRAIGHT = 0,
/// The link is a 180 degree turn
LINKDIR_TURN,
+ /// The link is a 180 degree turn (left-hand network)
+ LINKDIR_TURN_LEFTHAND,
/// The link is a (hard) left direction
LINKDIR_LEFT,
/// The link is a (hard) right direction
@@ -755,6 +770,8 @@ public:
static StringBijection<TrafficLightType> TrafficLightTypes;
static StringBijection<LaneChangeModel> LaneChangeModels;
+
+ static StringBijection<SumoXMLTag> CarFollowModels;
//@}
/// @name Helper functions for ID-string manipulations
@@ -784,6 +801,8 @@ private:
static StringBijection<LaneChangeModel>::Entry laneChangeModelValues[];
+ static StringBijection<SumoXMLTag>::Entry carFollowModelValues[];
+
};
#endif
diff --git a/src/version.h b/src/version.h
new file mode 100644
index 0000000..25c885e
--- /dev/null
+++ b/src/version.h
@@ -0,0 +1 @@
+#define VERSION_STRING "dev-SVN-r18765"
diff --git a/src/windows_config.h b/src/windows_config.h
index 324bbdc..47bbcb4 100644
--- a/src/windows_config.h
+++ b/src/windows_config.h
@@ -7,7 +7,7 @@
/// @author Felix Brack
/// @author Jakob Erdmann
/// @date Mon, 17 Dec 2001
-/// @version $Id: windows_config.h 18177 2015-03-30 21:32:20Z behrisch $
+/// @version $Id: windows_config.h 18753 2015-08-31 18:49:58Z behrisch $
///
// The general windows configuration file
/****************************************************************************/
@@ -52,9 +52,6 @@
/* defines the precision of floats */
#define SUMOReal double
-/* defines a long */
-#define SUMOLong long long
-
/* defines the epsilon to use on position comparison */
#define POSITION_EPS (SUMOReal)0.1
@@ -72,7 +69,7 @@
/* Version number of package */
#ifndef HAVE_VERSION_H
-#define VERSION_STRING "0.23.0"
+#define VERSION_STRING "0.24.0"
#endif
/* Define if junction internal lanes should be used. */
diff --git a/tools/assign/duaIterate.py b/tools/assign/duaIterate.py
index aaa83ad..4d0d65f 100755
--- a/tools/assign/duaIterate.py
+++ b/tools/assign/duaIterate.py
@@ -7,7 +7,7 @@
@author Jakob Erdmann
@author Yun-Pang Floetteroed
@date 2008-02-13
- at version $Id: duaIterate.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: duaIterate.py 18378 2015-05-15 07:43:59Z behrisch $
Run duarouter and sumo alternating to perform a dynamic user assignment.
Based on the Perl script dua_iterate.pl.
@@ -314,9 +314,11 @@ def writeSUMOConf(sumoBinary, step, options, additional_args, route_files):
sumoCmd += ['--device.hbefa.probability', '1']
if hasattr(options, "routefile"):
if options.routefile == "routesonly":
- sumoCmd += ['--vehroute-output', "vehroute_%03i.xml" % step]
+ sumoCmd += ['--vehroute-output', "vehroute_%03i.xml" % step,
+ '--vehroute-output.route-length']
elif options.routefile == "detailed":
sumoCmd += ['--vehroute-output', "vehroute_%03i.xml" % step,
+ '--vehroute-output.route-length',
'--vehroute-output.exit-times']
if hasattr(options, "lastroute") and options.lastroute:
sumoCmd += ['--vehroute-output.last-route', options.lastroute]
diff --git a/tools/build/buildHTMLDocs.py b/tools/build/buildHTMLDocs.py
index 9ee1820..227c0f3 100755
--- a/tools/build/buildHTMLDocs.py
+++ b/tools/build/buildHTMLDocs.py
@@ -4,7 +4,7 @@
@author Daniel Krajzewicz
@author Michael Behrisch
@date 2011-10-20
- at version $Id: buildHTMLDocs.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: buildHTMLDocs.py 18716 2015-08-25 12:20:48Z behrisch $
Converts wiki-documentation into HTML pages.
@@ -148,8 +148,7 @@ except:
images = set()
if len(args) == 0:
p = readParsePage("Special:AllPages")
- p = p[p.find("<input type=\"submit\" value=\"Go\" />"):]
- p = p[p.find("<table "):]
+ p = p[p.find('<ul class="mw-allpages-chunk">'):]
pages = p.split("<a ")
else:
pages = ['href="/wiki/%s"' % a for a in args]
diff --git a/tools/build/dailyBuildMSVC.py b/tools/build/dailyBuildMSVC.py
index d93884b..6f466f9 100755
--- a/tools/build/dailyBuildMSVC.py
+++ b/tools/build/dailyBuildMSVC.py
@@ -5,7 +5,7 @@
@author Jakob Erdmann
@author Laura Bieker
@date 2008
- at version $Id: dailyBuildMSVC.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: dailyBuildMSVC.py 18756 2015-08-31 19:16:33Z behrisch $
Does the nightly svn update on the windows server and the visual
studio build. The script is also used for the meso build.
@@ -63,6 +63,9 @@ sys.path.append(os.path.join(options.rootDir, options.testsDir))
import runInternalTests
env = os.environ
+if "SUMO_HOME" not in env:
+ env["SUMO_HOME"] = os.path.dirname(
+ os.path.dirname(os.path.dirname(__file__)))
env["SMTP_SERVER"] = "smtprelay.dlr.de"
env["TEMP"] = env["TMP"] = r"D:\Delphi\texttesttmp"
env["REMOTEDIR_BASE"] = 'O:/Daten/Sumo'
@@ -126,10 +129,9 @@ for platform, nightlyDir in [("Win32", r"O:\Daten\Sumo\Nightly"), ("x64", r"O:\D
if options.addSln:
subprocess.call(compiler + " /rebuild Release|%s %s\\%s /out %s" %
(platform, options.rootDir, options.addSln, makeLog))
- programSuffix = envSuffix = ""
+ envSuffix = ""
if platform == "x64":
envSuffix = "_64"
- programSuffix = "64"
# we need to use io.open here due to http://bugs.python.org/issue16273
log = io.open(makeLog, 'a')
try:
@@ -175,24 +177,21 @@ for platform, nightlyDir in [("Win32", r"O:\Daten\Sumo\Nightly"), ("x64", r"O:\D
print >> log, "I/O error(%s): %s" % (errno, strerror)
zipf.close()
shutil.copy2(binaryZip, options.remoteDir)
- wix.buildMSI(binaryZip, binaryZip.replace(
- ".zip", ".msi"), platformSuffix=programSuffix)
+ wix.buildMSI(binaryZip, binaryZip.replace(".zip", ".msi"))
shutil.copy2(binaryZip.replace(".zip", ".msi"), options.remoteDir)
except IOError, (errno, strerror):
print >> log, "Warning: Could not zip to %s!" % binaryZip
print >> log, "I/O error(%s): %s" % (errno, strerror)
if platform == "Win32" and options.sumoExe == "sumo":
try:
- setup = os.path.join(
- os.path.dirname(__file__), '..', 'game', 'setup.py')
+ setup = os.path.join(env["SUMO_HOME"], 'tools', 'game', 'setup.py')
subprocess.call(
['python', setup], stdout=log, stderr=subprocess.STDOUT)
except Exception as e:
print >> log, "Warning: Could not create nightly sumo-game.zip! (%s)" % e
if platform == "x64" and options.sumoExe == "meso":
try:
- setup = os.path.join(
- os.path.dirname(__file__), '..', 'game', 'setup.py')
+ setup = os.path.join(env["SUMO_HOME"], 'tools', 'game', 'setup.py')
subprocess.call(
['python', setup, 'internal'], stdout=log, stderr=subprocess.STDOUT)
except Exception as e:
@@ -208,16 +207,13 @@ for platform, nightlyDir in [("Win32", r"O:\Daten\Sumo\Nightly"), ("x64", r"O:\D
env["TEXTTEST_TMP"] = os.path.join(
options.rootDir, env["FILEPREFIX"] + "texttesttmp")
env["TEXTTEST_HOME"] = os.path.join(options.rootDir, options.testsDir)
- if "SUMO_HOME" not in env:
- env["SUMO_HOME"] = os.path.join(os.path.dirname(__file__), '..', '..')
shutil.rmtree(env["TEXTTEST_TMP"], True)
if not os.path.exists(env["SUMO_REPORT"]):
os.makedirs(env["SUMO_REPORT"])
for name in ["dfrouter", "duarouter", "jtrrouter", "marouter", "netconvert", "netgenerate",
"od2trips", "sumo", "polyconvert", "sumo-gui", "activitygen",
"emissionsDrivingCycle", "emissionsMap"]:
- binary = os.path.join(
- options.rootDir, options.binDir, name + programSuffix + ".exe")
+ binary = os.path.join(options.rootDir, options.binDir, name + ".exe")
if name == "sumo-gui":
if os.path.exists(binary):
env["GUISIM_BINARY"] = binary
@@ -225,20 +221,22 @@ for platform, nightlyDir in [("Win32", r"O:\Daten\Sumo\Nightly"), ("x64", r"O:\D
env[name.upper() + "_BINARY"] = binary
log = open(testLog, 'w')
# provide more information than just the date:
- nameopt = " -name %sr%s" % (date.today().strftime("%d%b%y"), svnrev)
+ fullOpt = ["-b", env["FILEPREFIX"], "-name", "%sr%s" %
+ (date.today().strftime("%d%b%y"), svnrev)]
+ ttBin = "texttestc.py"
if options.sumoExe == "meso":
- runInternalTests.runInternal(
- programSuffix, "-b " + env["FILEPREFIX"] + nameopt, log)
+ runInternalTests.runInternal("", fullOpt, log, console=True)
else:
subprocess.call(
- "texttest.py -b " + env["FILEPREFIX"] + nameopt, stdout=log, stderr=subprocess.STDOUT, shell=True)
- subprocess.call("texttest.py -a sumo.gui -b " +
- env["FILEPREFIX"] + nameopt, stdout=log, stderr=subprocess.STDOUT, shell=True)
- subprocess.call(
- "texttest.py -b " + env["FILEPREFIX"] + " -coll", stdout=log, stderr=subprocess.STDOUT, shell=True)
- ago = datetime.datetime.now() - datetime.timedelta(50)
- subprocess.call('texttest.py -s "batch.ArchiveRepository session=' + env["FILEPREFIX"] + ' before=%s"' % ago.strftime("%d%b%Y"),
+ [ttBin] + fullOpt, stdout=log, stderr=subprocess.STDOUT, shell=True)
+ subprocess.call([ttBin, "-a", "sumo.gui"] + fullOpt,
+ stdout=log, stderr=subprocess.STDOUT, shell=True)
+ subprocess.call([ttBin, "-b", env["FILEPREFIX"], "-coll"],
stdout=log, stderr=subprocess.STDOUT, shell=True)
+ ago = datetime.datetime.now() - datetime.timedelta(50)
+ subprocess.call('%s -s "batch.ArchiveRepository session=%s before=%s"' % (
+ ttBin, env["FILEPREFIX"], ago.strftime("%d%b%Y")),
+ stdout=log, stderr=subprocess.STDOUT, shell=True)
log.close()
log = open(statusLog, 'w')
status.printStatus(
diff --git a/tools/build/dailyUpdateMakeGCC.sh b/tools/build/dailyUpdateMakeGCC.sh
index 5a4175d..87faee0 100755
--- a/tools/build/dailyUpdateMakeGCC.sh
+++ b/tools/build/dailyUpdateMakeGCC.sh
@@ -74,7 +74,7 @@ if test -e $SUMO_BINDIR/sumo -a $SUMO_BINDIR/sumo -nt $PREFIX/sumo/configure; th
fi
tests/runTests.sh -b $FILEPREFIX -name `date +%d%b%y`r$SVNREV -coll >> $TESTLOG 2>&1
find $TEXTTEST_TMP -name batchreport."*" -exec echo -n '{} ' \; -exec head -1 '{}' \; | sort >> $STATUSLOG
- rsync -r $SUMO_REPORT $REMOTEDIR
+ rsync -rL $SUMO_REPORT $REMOTEDIR
fi
echo "--" >> $STATUSLOG
diff --git a/tools/build/typemap.py b/tools/build/typemap.py
new file mode 100755
index 0000000..3c77821
--- /dev/null
+++ b/tools/build/typemap.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+"""
+ at file typemap.py
+ at author Michael Behrisch
+ at date 2015-07-06
+ at version $Id: typemap.py 18756 2015-08-31 19:16:33Z behrisch $
+
+This script rebuilds "../../src/netimport/typemap.h", the file
+representing the default typemaps.
+It does this by parsing the data from the sumo data dir.
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2015-2015 DLR (http://www.dlr.de/) and contributors
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+
+from __future__ import print_function
+import sys
+from os.path import dirname, exists, getmtime, join
+
+
+def main():
+ typemapFile = join(
+ dirname(__file__), '..', '..', 'src', 'netimport', 'typemap.h')
+ typemapDir = join(dirname(__file__), '..', '..', 'data', 'typemap')
+ # determine output file
+ typemap = {}
+ maxTime = 0
+ for format in ("opendrive", "osm"):
+ typemap[format] = join(typemapDir, "%sNetconvert.typ.xml" % format)
+ if exists(typemap[format]):
+ maxTime = max(maxTime, getmtime(typemap[format]))
+ if not exists(typemapFile) or maxTime > getmtime(typemapFile):
+ with open(typemapFile, 'w') as f:
+ for format, mapFile in sorted(typemap.iteritems()):
+ print("const std::string %sTypemap =" % format, file=f)
+ for line in open(mapFile):
+ print('"%s"' %
+ line.replace('"', r'\"').replace('\n', r'\n'), file=f)
+ print(";", file=f)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/build/wix.py b/tools/build/wix.py
index 62abd70..d006113 100755
--- a/tools/build/wix.py
+++ b/tools/build/wix.py
@@ -4,7 +4,7 @@
@author Michael Behrisch
@author Jakob Erdmann
@date 2011
- at version $Id: wix.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: wix.py 18715 2015-08-25 11:24:13Z behrisch $
Builds the installer based on the nightly zip.
@@ -50,7 +50,7 @@ def buildFragment(wixBin, sourceDir, targetLabel, tmpDir):
def buildMSI(sourceZip=INPUT_DEFAULT, outFile=OUTPUT_DEFAULT, wixBin=WIX_DEFAULT, wxs=WXS_DEFAULT,
- license=LICENSE, platformSuffix=""):
+ license=LICENSE):
tmpDir = tempfile.mkdtemp()
zipfile.ZipFile(sourceZip).extractall(tmpDir)
sumoRoot = glob.glob(os.path.join(tmpDir, "sumo-*"))[0]
@@ -66,8 +66,6 @@ def buildMSI(sourceZip=INPUT_DEFAULT, outFile=OUTPUT_DEFAULT, wixBin=WIX_DEFAULT
wxsOut = open(os.path.join(tmpDir, "sumo.wxs"), "w")
for l in wxsIn:
l = l.replace("License.rtf", license)
- l = l.replace(".exe' />", "%s.exe' />" % platformSuffix).replace(
- r"Nightly\sumo-gui.exe", r"Nightly\sumo-gui%s.exe" % platformSuffix)
wxsOut.write(
l.replace(r"O:\Daten\Sumo\Nightly", os.path.join(sumoRoot, "bin")))
wxsOut.close()
diff --git a/tools/contributed/TraCI4Matlab/+traci/+areal/getContextSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+areal/getContextSubscriptionResults.m
deleted file mode 100644
index 5a213da..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+areal/getContextSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function contextSubscriptionResults = getContextSubscriptionResults(detID)
-%getContextSubscriptionResults Get the context subscription results for the
-% last time step.
-% contextSubscriptionResults = getContextSubscriptionResults(DETID)
-% Returns the context subscription results for the last time step and the
-% given areal detector. If no areal detector id is given, all subscription results are
-% returned in a containers.Map data struccure. If the areal detector id is unknown
-% or the subscription did for any reason return no data, 'None' is
-% returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global arealSubscriptionResults
-if isempty(arealSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- detID=None;
-end
-contextSubscriptionResults = arealSubscriptionResults.getContext(detID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+areal/getIDCount.m b/tools/contributed/TraCI4Matlab/+traci/+areal/getIDCount.m
deleted file mode 100644
index 4a19828..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+areal/getIDCount.m
+++ /dev/null
@@ -1,10 +0,0 @@
-function IDCount = getIDCount()
-%IDCount = getIDCount() Get the number of aeral detectors in the SUMO network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getIDCount.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-IDCount = traci.areal.getUniversal(constants.ID_COUNT, '');
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+areal/getIDList.m b/tools/contributed/TraCI4Matlab/+traci/+areal/getIDList.m
deleted file mode 100644
index d69fa66..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+areal/getIDList.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function IDList = getIDList()
-%getIDList Get the IDs of the areal detectors in the network.
-% IDList = getIDList() Returns a cell array of strings containing the IDs
-% of the areal detectors in the SUMO network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-IDList = traci.areal.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+areal/getJamLengthMeters.m b/tools/contributed/TraCI4Matlab/+traci/+areal/getJamLengthMeters.m
deleted file mode 100644
index 95d80b4..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+areal/getJamLengthMeters.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function JamLengthMeters = getJamLengthMeters(detID)
-%getJamLengthMeters Return the jam length in vehicles.
-% JamLengthVehicle = getJamLengthVehicle(DETID) Returns the
-% jam length in meters within the last simulation step on
-% the given areal detector.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getJamLengthMeters.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-JamLengthMeters = traci.areal.getUniversal(constants.JAM_LENGTH_METERS, detID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+areal/getJamLengthVehicle.m b/tools/contributed/TraCI4Matlab/+traci/+areal/getJamLengthVehicle.m
deleted file mode 100644
index c9ffb97..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+areal/getJamLengthVehicle.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function JamLengthVehicle = getJamLengthVehicle(detID)
-%getJamLengthVehicle Return the jam length in vehicles.
-% JamLengthVehicle = getJamLengthVehicle(DETID) Returns the
-% jam length in vehicles within the last simulation step on
-% the given areal detector.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getJamLengthVehicle.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-JamLengthVehicle = traci.areal.getUniversal(constants.JAM_LENGTH_VEHICLE, detID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+areal/getLastStepMeanSpeed.m b/tools/contributed/TraCI4Matlab/+traci/+areal/getLastStepMeanSpeed.m
deleted file mode 100644
index f7c2ebe..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+areal/getLastStepMeanSpeed.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function lastStepMeanSpeed = getLastStepMeanSpeed(detID)
-%getLastStepMeanSpeed Get the average speed on the areal detector.
-% lastStepMeanSpeed = getLastStepMeanSpeed(DETID) Returns the average
-% speed in m/s for the last time step on the given areal detector.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepMeanSpeed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepMeanSpeed = traci.areal.getUniversal(constants.LAST_STEP_MEAN_SPEED, detID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+areal/getLastStepOccupancy.m b/tools/contributed/TraCI4Matlab/+traci/+areal/getLastStepOccupancy.m
deleted file mode 100644
index 2c6001b..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+areal/getLastStepOccupancy.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function lastStepOccupancy = getLastStepOccupancy(detID)
-%getLastStepOccupancy Get the percentage of occupation on the areal detector.
-% lastStepOccupancy = getLastStepOccupancy(DETID) Returns the occupancy
-% in percentage for the last time step on the given areal detector.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepOccupancy.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepOccupancy = traci.areal.getUniversal(constants.LAST_STEP_OCCUPANCY, detID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+areal/getSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+areal/getSubscriptionResults.m
deleted file mode 100644
index 71abd93..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+areal/getSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function subscriptionResults = getSubscriptionResults(detID)
-%getSubscriptionResults Get the subscription results for the last time step.
-% subscriptionResults = getSubscriptionResults(DETID) Returns the
-% subscription results for the last time step and the given areal detector. If no
-% areal detector id is given, all subscription results are returned in a
-% containers.Map data structure.
-% If the areal detector id is unknown or the subscription did for any reason return
-% no data, 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global arealSubscriptionResults
-if isempty(arealSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- detID = 'None';
-end
-
-subscriptionResults = arealSubscriptionResults.get(detID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+areal/getUniversal.m b/tools/contributed/TraCI4Matlab/+traci/+areal/getUniversal.m
deleted file mode 100644
index 563b456..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+areal/getUniversal.m
+++ /dev/null
@@ -1,25 +0,0 @@
-function returnedValue = getUniversal(varID, detID)
-%getUniversal An internal function to send the get command and read the
-%variable value.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global arealSubscriptionResults
-
-if isempty(arealSubscriptionResults)
- ReturnValueFunc = traci.RETURN_VALUE_FUNC.areal;
-else
- ReturnValueFunc = aeralSubscriptionResults.valueFunc;
-end
-
-% Prepare the outgoing message and read the response. The result variable
-% is a traci.Storage object
-result = traci.sendReadOneStringCmd(constants.CMD_GET_AREAL_DETECTOR_VARIABLE,varID,detID);
-handleReturValueFunc = str2func(ReturnValueFunc(varID));
-
-% Use the proper method to read the variable of interest from the result
-returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+areal/subscribe.m b/tools/contributed/TraCI4Matlab/+traci/+areal/subscribe.m
deleted file mode 100644
index a45d4d1..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+areal/subscribe.m
+++ /dev/null
@@ -1,43 +0,0 @@
-function subscribe(detID, varargin)
-%subscribe Subscribe to areal detector variable.
-% subscribe(DETID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for
-% the maximum allowed interval.
-% subscribe(DETID,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS for the maximum allowed interval.
-% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
-% allowed end time.
-% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
-% END.
-% A call to this function clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $
-
-global arealSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'areal.subscribe';
-p.addRequired('detID', at ischar)
-p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(detID, varargin{:})
-detID = p.Results.detID;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-% Construct the subscription results object
-if isempty(arealSubscriptionResults)
- arealSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.areal);
-else
- arealSubscriptionResults.reset();
-end
-
-% Call the traci subscribe function
-traci.subscribe(constants.CMD_SUBSCRIBE_AREAL_DETECTOR_VARIABLE,...
- subscriptionBegin, subscriptionEnd, detID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+areal/subscribeContext.m b/tools/contributed/TraCI4Matlab/+traci/+areal/subscribeContext.m
deleted file mode 100644
index 9266614..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+areal/subscribeContext.m
+++ /dev/null
@@ -1,51 +0,0 @@
-function subscribeContext(detID, domain, dist, varargin)
-%subscribeContext Subscribe to an areal detector's context variable.
-% subscribeContext(DETID,DOMAIN,DIST) Subscribe to the
-% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the
-% areal detector specified by DETID at a distance given by DIST, for the maximum
-% allowed interval. The type of objets that surround the areal detector are defined
-% in the DOMAIN parameter. Note that not all the SUMO object types
-% support the variable LAST_STEP_VEHICLE_NUMBER.
-% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS.
-% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
-% maximum allowed end time.
-% subscribeContext(...,END) Subscribe for the time interval defined by
-% BEGIN and END.
-% A call to this method clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $
-
-global arealSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'areal.subscribeContext';
-p.addRequired('detID', at ischar)
-p.addRequired('domain', at ischar)
-p.addRequired('dist', at isnumeric)
-p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(detID, domain, dist, varargin{:})
-detID = p.Results.detID;
-domain = p.Results.domain;
-dist = p.Results.dist;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-% Construct the subscription results object
-if isempty(arealSubscriptionResults)
- arealSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.areal);
-else
- arealSubscriptionResults.reset();
-end
-
-% Call the traci subscribeContext function
-traci.subscribeContext(constants.CMD_SUBSCRIBE_AREAL_DETECTOR_CONTEXT,...
- subscriptionBegin, subscriptionEnd, detID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/adaptTraveltime.m b/tools/contributed/TraCI4Matlab/+traci/+edge/adaptTraveltime.m
deleted file mode 100644
index 56918cf..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/adaptTraveltime.m
+++ /dev/null
@@ -1,17 +0,0 @@
-function adaptTraveltime(edgeID, time)
-%adaptTraveltime Adapt the travel time value for the given edge.
-% adaptTraveltime(EDGEID,TIME) Adapt the travel time value used for
-% (re-) routing for the given edge in the SUMO server.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: adaptTraveltime.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_EDGE_VARIABLE, constants.VAR_EDGE_TRAVELTIME, edgeID, 1+4+1+8);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x'))...
- traci.packInt32(1) uint8(sscanf(constants.TYPE_DOUBLE,'%x'))...
- traci.packInt64(time)];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getAdaptedTraveltime.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getAdaptedTraveltime.m
deleted file mode 100644
index 43a33f3..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getAdaptedTraveltime.m
+++ /dev/null
@@ -1,19 +0,0 @@
-function adaptedTraveltime = getAdaptedTraveltime(edgeID, time)
-%getAdaptedTraveltime Return the travel time value.
-% adaptedTraveltime = getAdaptedTraveltime(EDGEID,TIME) Return the travel
-% time value (in s) used for (re-)routing which is valid on the specified
-% edge at the given time.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% $Id: getAdaptedTraveltime.m 20 2015-03-02 16:52:32Z afacostag $
-
-global message
-import traci.constants
-traci.beginMessage(constants.CMD_GET_EDGE_VARIABLE,...
- constants.VAR_EDGE_TRAVELTIME,edgeID, 1+4);
-message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x'))...
- traci.packInt32(traci.time2steps(time))];
-result = traci.checkResult(constants.CMD_GET_EDGE_VARIABLE,...
- constants.VAR_EDGE_TRAVELTIME, edgeID);
-adaptedTraveltime = result.readDouble();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getCO2Emission.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getCO2Emission.m
deleted file mode 100644
index 8bfde21..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getCO2Emission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function CO2Emission = getCO2Emission(edgeID)
-%getCO2Emission Returns the CO2 emission on the given edge.
-% CO2Emission = getCO2Emission(EDGEID) Returns the CO2 emission in mg for
-% the last time step on the given edge.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getCO2Emission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-CO2Emission = traci.edge.getUniversal(constants.VAR_CO2EMISSION, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getCOEmission.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getCOEmission.m
deleted file mode 100644
index 549a928..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getCOEmission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function COEmission = getCOEmission(edgeID)
-%getCOEmission Returns the CO emission on the given edge.
-% COEmission = getCOEmission(EDGEID) Returns the CO emission in mg for
-% the last time step on the given edge.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getCOEmission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-COEmission = traci.edge.getUniversal(constants.VAR_COEMISSION, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getContextSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getContextSubscriptionResults.m
deleted file mode 100644
index f021cec..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getContextSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function contextSubscriptionResults = getContextSubscriptionResults(edgeID)
-%getContextSubscriptionResults Get the context subscription results for the
-% last time step.
-% contextSubscriptionResults = getContextSubscriptionResults(EDGEID)
-% Returns the context subscription results for the last time step and the
-% given edge. If no edge id is given, all subscription results are
-% returned in a containers.Map data struccure. If the edge id is unknown
-% or the subscription did for any reason return no data, 'None' is
-% returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global edgeSubscriptionResults
-if isempty(edgeSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- edgeID=None;
-end
-contextSubscriptionResults = edgeSubscriptionResults.getContext(edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getEffort.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getEffort.m
deleted file mode 100644
index 6362a8d..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getEffort.m
+++ /dev/null
@@ -1,19 +0,0 @@
-function effort = getEffort(edgeID, time)
-%getEffort Get the effort used for (re-)routing.
-% effort = getEffort(EDGEID,TIME) Returns the effort value used for
-% (re-)routing which is valid on the edge at the given time.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getEffort.m 20 2015-03-02 16:52:32Z afacostag $
-
-global message
-import traci.constants
-traci.beginMessage(constants.CMD_GET_EDGE_VARIABLE, constants.VAR_EDGE_EFFORT,...
- edgeID, 1+4);
-message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x'))...
- traci.packInt32(traci.time2steps(time))];
-result = traci.checkResult(constants.CMD_GET_EDGE_VARIABLE,...
- constants.VAR_EDGE_EFFORT, edgeID);
-effort = result.readDouble();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getFuelConsumption.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getFuelConsumption.m
deleted file mode 100644
index 1912dc7..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getFuelConsumption.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function fuelConsumption = getFuelConsumption(edgeID)
-%getFuelConsumption Get the fuel consumption on the edge.
-% fuelConsumption = getFuelConsumption(EDGEID) Returns the fuel
-% consumption in ml for the last time step on the given edge.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getFuelConsumption.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-fuelConsumption = traci.edge.getUniversal(constants.VAR_FUELCONSUMPTION, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getHCEmission.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getHCEmission.m
deleted file mode 100644
index 3fb14d6..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getHCEmission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function HCEmission = getHCEmission(edgeID)
-%getHCEmission Returns the HC emission on the given edge.
-% HCEmission = getCOEmission(EDGEID) Returns the HC emission in mg for
-% the last time step on the given edge.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getHCEmission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-HCEmission = traci.edge.getUniversal(constants.VAR_HCEMISSION, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getIDCount.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getIDCount.m
deleted file mode 100644
index 6ca8afd..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getIDCount.m
+++ /dev/null
@@ -1,10 +0,0 @@
-function IDCount = getIDCount()
-%IDCount = getIDCount() Get the number of edges in the SUMO network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getIDCount.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-IDCount = traci.edge.getUniversal(constants.ID_COUNT, '');
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getIDList.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getIDList.m
deleted file mode 100644
index 570dbcd..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getIDList.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function IDList = getIDList()
-%getIDList Get the IDs of the edges in the network.
-% IDList = getIDList() Returns a cell array of strings containing the IDs
-% of the edges in the SUMO network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-IDList = traci.edge.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepHaltingNumber.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepHaltingNumber.m
deleted file mode 100644
index fcd876b..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepHaltingNumber.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function lastStepHaltingNumber = getLastStepHaltingNumber(edgeID)
-%getLastStepHaltingNumber Get the number of halting vehicles.
-% lastStepHaltingNumber = getLastStepHaltingNumber(EDGEID) Returns the
-% total number of halting vehicles for the last time step on the given
-% edge. A speed of less than 0.1 m/s is considered a halt.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepHaltingNumber.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepHaltingNumber = traci.edge.getUniversal(constants.LAST_STEP_VEHICLE_HALTING_NUMBER, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepLength.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepLength.m
deleted file mode 100644
index f9a9d90..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepLength.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function lastStepLength = getLastStepLength(edgeID)
-%getLastStepLength Get the mean vehicle length on the edge.
-% lastStepLength = getLastStepLength(EDGEID) Returns the mean vehicle
-% length in m for the last time step on the given edge.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepLength.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepLength = traci.edge.getUniversal(constants.LAST_STEP_LENGTH, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepMeanSpeed.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepMeanSpeed.m
deleted file mode 100644
index d499bd1..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepMeanSpeed.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function lastStepMeanSpeed = getLastStepMeanSpeed(edgeID)
-%getLastStepMeanSpeed Get the average speed on the edge.
-% lastStepMeanSpeed = getLastStepMeanSpeed(EDGEID) Returns the average
-% speed in m/s for the last time step on the given edge.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepMeanSpeed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepMeanSpeed = traci.edge.getUniversal(constants.LAST_STEP_MEAN_SPEED, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepOccupancy.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepOccupancy.m
deleted file mode 100644
index d24d888..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepOccupancy.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function lastStepOccupancy = getLastStepOccupancy(edgeID)
-%getLastStepOccupancy Get the percentage of occupation on the edge.
-% lastStepOccupancy = getLastStepOccupancy(EDGEID) Returns the occupancy
-% in percentage for the last time step on the given edge.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepOccupancy.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepOccupancy = traci.edge.getUniversal(constants.LAST_STEP_OCCUPANCY, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepVehicleIDs.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepVehicleIDs.m
deleted file mode 100644
index 275d4c0..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepVehicleIDs.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function lastStepVehicleIDs = getLastStepVehicleIDs(edgeID)
-%getLastStepVehicleIDs Get the IDs of the vehicles in the edge.
-% lastStepVehicleIDs = getLastStepVehicleIDs(EDGEID) Returns cell array
-% of strings containing the IDs of the vehicles for the last time step
-% on the given edge.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepVehicleIDs.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepVehicleIDs = traci.edge.getUniversal(constants.LAST_STEP_VEHICLE_ID_LIST, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepVehicleNumber.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepVehicleNumber.m
deleted file mode 100644
index c749b67..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepVehicleNumber.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function lastStepVehicleNumber = getLastStepVehicleNumber(edgeID)
-%getLastStepVehicleNumber Get the number vehicles in the edge.
-% lastStepVehicleNumber = getLastStepVehicleNumber(EDGEID) Returns the
-% total number of vehicles for the last time step on the given edge.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepVehicleNumber.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepVehicleNumber = traci.edge.getUniversal(...
- constants.LAST_STEP_VEHICLE_NUMBER, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getNOxEmission.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getNOxEmission.m
deleted file mode 100644
index cd0aefb..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getNOxEmission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function NOxEmission = getNOxEmission(edgeID)
-import traci.constants
-%getNOxEmission Get the NOx emission in the edge.
-% NOxEmission = getNOxEmission(EDGEID) Returns the NOx emission in mg for
-% the last time step on the given edge.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getNOxEmission.m 20 2015-03-02 16:52:32Z afacostag $
-
-NOxEmission = traci.edge.getUniversal(constants.VAR_NOXEMISSION, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getNoiseEmission.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getNoiseEmission.m
deleted file mode 100644
index 3b22f83..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getNoiseEmission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function noiseEmission = getNoiseEmission(edgeID)
-%getNoiseEmission Get the noise emission in the edge.
-% noiseEmission = getNoiseEmission(EDGEID) Returns the noise emission in
-% db for the last time step on the given edge.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getNoiseEmission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-noiseEmission = traci.edge.getUniversal(constants.VAR_NOISEEMISSION, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getPmxEmission.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getPmxEmission.m
deleted file mode 100644
index 4e31b92..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getPmxEmission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function pmxEmission = getPmxEmission(edgeID)
-%getPmxEmission Get the particular matter emission in the edge.
-% pmxEmission = getPmxEmission(EDGEID) Returns the particular matter
-% emission in mg for the last time step on the given edge.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getPmxEmission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-pmxEmission = traci.edge.getUniversal(constants.VAR_PMXEMISSION, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getSubscriptionResults.m
deleted file mode 100644
index e652f23..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function subscriptionResults = getSubscriptionResults(edgeID)
-%getSubscriptionResults Get the subscription results for the last time step.
-% subscriptionResults = getSubscriptionResults(EDGEID) Returns the
-% subscription results for the last time step and the given edge. If no
-% edge id is given, all subscription results are returned in a
-% containers.Map data structure.
-% If the edge id is unknown or the subscription did for any reason return
-% no data, 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global edgeSubscriptionResults
-if isempty(edgeSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- edgeID = 'None';
-end
-
-subscriptionResults = edgeSubscriptionResults.get(edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getTraveltime.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getTraveltime.m
deleted file mode 100644
index bbafbe2..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getTraveltime.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function traveltime = getTraveltime(edgeID)
-%getTraveltime Get estimated travel time in the edge.
-% traveltime = getTraveltime(EDGEID) Returns the estimated travel time in
-% seconds for the last time step on the given edge.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getTraveltime.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traveltime = traci.edge.getUniversal(constants.VAR_CURRENT_TRAVELTIME, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/getUniversal.m b/tools/contributed/TraCI4Matlab/+traci/+edge/getUniversal.m
deleted file mode 100644
index 8f460c3..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/getUniversal.m
+++ /dev/null
@@ -1,25 +0,0 @@
-function returnedValue = getUniversal(varID, edgeID)
-%getUniversal An internal function to send the get command and read the
-%variable value.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global edgeSubscriptionResults
-
-if isempty(edgeSubscriptionResults)
- ReturnValueFunc = traci.RETURN_VALUE_FUNC.edge;
-else
- ReturnValueFunc = edgeSubscriptionResults.valueFunc;
-end
-
-% Prepare the outgoing message and read the response. The result variable
-% is a traci.Storage object
-result = traci.sendReadOneStringCmd(constants.CMD_GET_EDGE_VARIABLE,varID,edgeID);
-handleReturValueFunc = str2func(ReturnValueFunc(varID));
-
-% Use the proper method to read the variable of interest from the result
-returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/setEffort.m b/tools/contributed/TraCI4Matlab/+traci/+edge/setEffort.m
deleted file mode 100644
index 8bf4046..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/setEffort.m
+++ /dev/null
@@ -1,17 +0,0 @@
-function setEffort(edgeID, effort)
-%setEffort Adapt the effort for (-re) routing.
-% setEffort(EDGEID,EFFORT) Adapt the effort value used for (re-)routing
-% for the given edge.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setEffort.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_EDGE_VARIABLE, constants.VAR_EDGE_EFFORT, edgeID, 1+4+1+8);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x'))...
- traci.packInt32(1) uint8(sscanf(constants.TYPE_DOUBLE,'%x'))...
- traci.packInt64(effort)];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/setMaxSpeed.m b/tools/contributed/TraCI4Matlab/+traci/+edge/setMaxSpeed.m
deleted file mode 100644
index 0291b8b..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/setMaxSpeed.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setMaxSpeed(edgeID, speed)
-%setMaxSpeed Set the maximum speed in the edge.
-% setMaxSpeed(EDGEID,SPEED) Set a new maximum speed (in m/s) for all
-% lanes of the edge.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setMaxSpeed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_EDGE_VARIABLE, constants.VAR_MAXSPEED, edgeID, speed)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/subscribe.m b/tools/contributed/TraCI4Matlab/+traci/+edge/subscribe.m
deleted file mode 100644
index fed034f..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/subscribe.m
+++ /dev/null
@@ -1,43 +0,0 @@
-function subscribe(edgeID, varargin)
-%subscribe Subscribe to edge variable.
-% subscribe(EDGEID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for
-% the maximum allowed interval.
-% subscribe(EDGEID,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS for the maximum allowed interval.
-% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
-% allowed end time.
-% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
-% END.
-% A call to this function clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $
-
-global edgeSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'edge.subscribe';
-p.addRequired('edgeID', at ischar)
-p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(edgeID, varargin{:})
-edgeID = p.Results.edgeID;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-% Construct the subscription results object
-if isempty(edgeSubscriptionResults)
- edgeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.edge);
-else
- edgeSubscriptionResults.reset();
-end
-
-% Call the traci subscribe function
-traci.subscribe(constants.CMD_SUBSCRIBE_EDGE_VARIABLE,...
- subscriptionBegin, subscriptionEnd, edgeID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+edge/subscribeContext.m b/tools/contributed/TraCI4Matlab/+traci/+edge/subscribeContext.m
deleted file mode 100644
index 26e02f8..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+edge/subscribeContext.m
+++ /dev/null
@@ -1,51 +0,0 @@
-function subscribeContext(edgeID, domain, dist, varargin)
-%subscribeContext Subscribe to an edge's context variable.
-% subscribeContext(EDGEID,DOMAIN,DIST) Subscribe to the
-% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the
-% edge specified by EDGEID at a distance given by DIST, for the maximum
-% allowed interval. The type of objets that surround the edge are defined
-% in the DOMAIN parameter. Note that not all the SUMO object types
-% support the variable LAST_STEP_VEHICLE_NUMBER.
-% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS.
-% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
-% maximum allowed end time.
-% subscribeContext(...,END) Subscribe for the time interval defined by
-% BEGIN and END.
-% A call to this method clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $
-
-global edgeSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'edge.subscribeContext';
-p.addRequired('edgeID', at ischar)
-p.addRequired('domain', at ischar)
-p.addRequired('dist', at isnumeric)
-p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(edgeID, domain, dist, varargin{:})
-edgeID = p.Results.edgeID;
-domain = p.Results.domain;
-dist = p.Results.dist;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-% Construct the subscription results object
-if isempty(edgeSubscriptionResults)
- edgeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.edge);
-else
- edgeSubscriptionResults.reset();
-end
-
-% Call the traci subscribeContext function
-traci.subscribeContext(constants.CMD_SUBSCRIBE_EDGE_CONTEXT,...
- subscriptionBegin, subscriptionEnd, edgeID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+gui/getBoundary.m b/tools/contributed/TraCI4Matlab/+traci/+gui/getBoundary.m
deleted file mode 100644
index d13e0fd..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+gui/getBoundary.m
+++ /dev/null
@@ -1,16 +0,0 @@
-function boundary = getBoundary(viewID)
-%getBoundary Get the coordinates of the view.
-% boundary = getBoundary(VIEWID) Returns the coordinates of the lower
-% left and the upper right corner of the currently visible view. If no
-% view ID is given, the function return the results for the default view.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getBoundary.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-if nargin < 1
- viewID = 'View #0';
-end
-boundary = traci.gui.getUniversal(constants.VAR_VIEW_BOUNDARY, viewID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+gui/getContextSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+gui/getContextSubscriptionResults.m
deleted file mode 100644
index 986d3c4..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+gui/getContextSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function ContextSubscriptionResults = getContextSubscriptionResults(viewID)
-%getContextSubscriptionResults Get the context subscription results for the
-% last time step.
-% contextSubscriptionResults = getContextSubscriptionResults(VIEWID)
-% Returns the context subscription results for the last time step and the
-% given view. If no view id is given, all subscription results are
-% returned in a containers.Map data struccure. If the view id is unknown
-% or the subscription did for any reason return no data, 'None' is
-% returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global guiSubscriptionResults
-if isempty(guiSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- viewID=None;
-end
-ContextSubscriptionResults = guiSubscriptionResults.getContext(viewID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+gui/getIDList.m b/tools/contributed/TraCI4Matlab/+traci/+gui/getIDList.m
deleted file mode 100644
index 94f4109..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+gui/getIDList.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function IDList = getIDList()
-%getIDList Get the IDs of the views in the network.
-% IDList = getIDList() Returns a cell array of strings containing the IDs
-% of the views in the SUMO network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-IDList = traci.gui.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+gui/getOffset.m b/tools/contributed/TraCI4Matlab/+traci/+gui/getOffset.m
deleted file mode 100644
index 4ebbee8..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+gui/getOffset.m
+++ /dev/null
@@ -1,16 +0,0 @@
-function offset = getOffset(viewID)
-%getOffset Get the offset of the view.
-% offset = getOffset(VIEWID) Returns the x and y offset of the center of
-% the current view. If no view ID is given, the function return the
-% results for the default view.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getOffset.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-if nargin < 1
- viewID = 'View #0';
-end
-offset = traci.gui.getUniversal(constants.VAR_VIEW_OFFSET, viewID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+gui/getSchema.m b/tools/contributed/TraCI4Matlab/+traci/+gui/getSchema.m
deleted file mode 100644
index b1cb0ea..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+gui/getSchema.m
+++ /dev/null
@@ -1,16 +0,0 @@
-function schema = getSchema(viewID)
-%getSchema Get the color schema of the view.
-% schema = getSchema(VIEWID) Returns the name of the current coloring
-% scheme. If no view ID is given, the function return the results for the
-% default view.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSchema.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-if nargin < 1
- viewID = 'View #0';
-end
-schema = traci.gui.getUniversal(constants.VAR_VIEW_SCHEMA, viewID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+gui/getSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+gui/getSubscriptionResults.m
deleted file mode 100644
index b0d6c02..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+gui/getSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function subscriptionResults = getSubscriptionResults(viewID)
-%getSubscriptionResults Get the subscription results for the last time step.
-% subscriptionResults = getSubscriptionResults(VIEWID) Returns the
-% subscription results for the last time step and the given view. If no
-% view id is given, all subscription results are returned in a
-% containers.Map data structure.
-% If the view id is unknown or the subscription did for any reason return
-% no data, 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global guiSubscriptionResults
-if isempty(guiSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- viewID = 'None';
-end
-
-subscriptionResults = guiSubscriptionResults.get(viewID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+gui/getUniversal.m b/tools/contributed/TraCI4Matlab/+traci/+gui/getUniversal.m
deleted file mode 100644
index fae2feb..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+gui/getUniversal.m
+++ /dev/null
@@ -1,25 +0,0 @@
-function returnedValue = getUniversal(varID, viewID)
-%getUniversal An internal function to send the get command and read the
-%variable value.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global guiSubscriptionResults
-
-if isempty(guiSubscriptionResults)
- returnValueFunc = traci.RETURN_VALUE_FUNC.gui;
-else
- returnValueFunc = guiSubscriptionResults.valueFunc;
-end
-
-% Prepare the outgoing message and read the response. The result variable
-% is a traci.Storage object
-result = traci.sendReadOneStringCmd(constants.CMD_GET_GUI_VARIABLE,varID,viewID);
-handleReturValueFunc = str2func(returnValueFunc(varID));
-
-% Use the proper method to read the variable of interest from the result
-returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+gui/getZoom.m b/tools/contributed/TraCI4Matlab/+traci/+gui/getZoom.m
deleted file mode 100644
index 9fffe1e..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+gui/getZoom.m
+++ /dev/null
@@ -1,16 +0,0 @@
-function zoom = getZoom(viewID)
-%getZoom Get the zoom of the view.
-% zoom = getZoom(viewID) Returns the current zoom factor of the view. If
-% no view ID is given, the function return the results for the default
-% view.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getZoom.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-if nargin < 1
- viewID = 'View #0';
-end
-zoom = traci.gui.getUniversal(constants.VAR_VIEW_ZOOM, viewID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+gui/screenshot.m b/tools/contributed/TraCI4Matlab/+traci/+gui/screenshot.m
deleted file mode 100644
index eb20931..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+gui/screenshot.m
+++ /dev/null
@@ -1,14 +0,0 @@
-function screenshot(viewID, filename)
-%screenshot Save a screenshot of the SUMO gui.
-% screenshot(VIEWID, FILENAME) Save a screenshot for the given view to
-% the given filename. The fileformat is guessed from the extension, the
-% available formats differ from platform to platform but should at least
-% include ps, svg and pdf, on linux probably gif, png and jpg as well.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: screenshot.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendStringCmd(constants.CMD_SET_GUI_VARIABLE, constants.VAR_SCREENSHOT, viewID, filename);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+gui/setBoundary.m b/tools/contributed/TraCI4Matlab/+traci/+gui/setBoundary.m
deleted file mode 100644
index 5923175..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+gui/setBoundary.m
+++ /dev/null
@@ -1,16 +0,0 @@
-function setBoundary(viewID, xmin, ymin, xmax, ymax)
-%setBoundary Set the coordinates of the view.
-% setBoundary(VIEWID, XMIN, YMIN, XMAX, YMAX) Set the current boundary
-% for the given view (see getBoundary).
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setBoundary.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_GUI_VARIABLE, constants.VAR_VIEW_BOUNDARY, viewID, 1+8+8+8+8);
-message.string = [message.string uint8(sscanf(constants.TYPE_BOUNDINGBOX,'%x'))...
- traci.packInt64([ymax xmax ymin xmin])];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+gui/setOffset.m b/tools/contributed/TraCI4Matlab/+traci/+gui/setOffset.m
deleted file mode 100644
index 79238bf..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+gui/setOffset.m
+++ /dev/null
@@ -1,15 +0,0 @@
-function setOffset(viewID, x, y)
-%setOffset Set the offset of the view.
-% setOffset(VIEWID, X, Y) Set the current offset for the given view.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setOffset.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_GUI_VARIABLE, constants.VAR_VIEW_OFFSET, viewID, 1+8+8);
-message.string = [message.string uint8(sscanf(constants.POSITION_2D,'%x'))...
- traci.packInt64([y x])];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+gui/setSchema.m b/tools/contributed/TraCI4Matlab/+traci/+gui/setSchema.m
deleted file mode 100644
index 031bcc3..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+gui/setSchema.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setSchema(viewID, schemeName)
-%setSchema Set the coloring scheme of the view.
-% setSchema(VIEWID, SCHEMENAME) Set the current coloring scheme for the
-% given view.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setSchema.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendStringCmd(constants.CMD_SET_GUI_VARIABLE, constants.VAR_VIEW_SCHEMA, viewID, schemeName);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+gui/setZoom.m b/tools/contributed/TraCI4Matlab/+traci/+gui/setZoom.m
deleted file mode 100644
index 5bd470c..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+gui/setZoom.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function setZoom(viewID, zoom)
-%setZoom Set the zoom of the view.
-% setZoom(VIEWID, ZOOM) Set the current zoom factor for the given view.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setZoom.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_GUI_VARIABLE, constants.VAR_VIEW_ZOOM, viewID, zoom);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+gui/subscribe.m b/tools/contributed/TraCI4Matlab/+traci/+gui/subscribe.m
deleted file mode 100644
index 54aa723..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+gui/subscribe.m
+++ /dev/null
@@ -1,37 +0,0 @@
-function subscribe(viewID, varargin)
-%subscribe Subscribe to view variable.
-% subscribe(VIEWID) Subscribe to the VAR_VIEW_OFFSET value for the
-% maximum allowed interval.
-% subscribe(VIEWID,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS for the maximum allowed interval.
-% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
-% allowed end time.
-% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
-% END.
-% A call to this function clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $
-
-global guiSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'gui.subscribe';
-p.addRequired('viewID', at ischar)
-p.addOptional('varIDs', {constants.VAR_VIEW_OFFSET}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(viewID, varargin{:})
-viewID = p.Results.viewID;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-guiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.gui);
-guiSubscriptionResults.reset()
-traci.subscribe(constants.CMD_SUBSCRIBE_GUI_VARIABLE,...
- subscriptionBegin, subscriptionEnd, viewID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+gui/subscribeContext.m b/tools/contributed/TraCI4Matlab/+traci/+gui/subscribeContext.m
deleted file mode 100644
index 5687097..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+gui/subscribeContext.m
+++ /dev/null
@@ -1,46 +0,0 @@
-function subscribeContext(viewID, domain, dist, varargin)
-%subscribeContext Subscribe to a view's context variable.
-% subscribeContext(VIEWID,DOMAIN,DIST) Subscribe to the VAR_VIEW_OFFSET
-% value of the SUMO objects that surround the view specified by VIEWID at
-% a distance given by DIST, for the maximum allowed interval. The type of
-% objets that surround the view are defined in the DOMAIN parameter. Note
-% that not all the SUMO object types support the variable
-% VAR_VIEW.
-% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS.
-% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
-% maximum allowed end time.
-% subscribeContext(...,END) Subscribe for the time interval defined by
-% BEGIN and END.
-% A call to this method clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $
-
-global guiSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'gui.subscribeContext';
-p.addRequired('viewID', at ischar)
-p.addRequired('domain', at ischar)
-p.addRequired('dist', at isnumeric)
-p.addOptional('varIDs', {constants.VAR_VIEW_OFFSET}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(viewID, domain, dist, varargin{:})
-viewID = p.Results.viewID;
-domain = p.Results.domain;
-dist = p.Results.dist;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-guiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.gui);
-
-guiSubscriptionResults.reset()
-traci.subscribeContext(constants.CMD_SUBSCRIBE_GUI_CONTEXT,...
- subscriptionBegin, subscriptionEnd, viewID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+gui/trackVehicle.m b/tools/contributed/TraCI4Matlab/+traci/+gui/trackVehicle.m
deleted file mode 100644
index 2ffd9ed..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+gui/trackVehicle.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function trackVehicle(viewID, vehID)
-%trackVehicle Track vehicle in SUMO gui.
-% trackVehicle(viewID, vehID) Start visually tracking the given vehicle
-% on the given view.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: trackVehicle.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendStringCmd(constants.CMD_SET_GUI_VARIABLE, constants.VAR_TRACK_VEHICLE, viewID, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getContextSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getContextSubscriptionResults.m
deleted file mode 100644
index 0d8f4fe..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getContextSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function ContextSubscriptionResults = getContextSubscriptionResults(loopID)
-%getContextSubscriptionResults Get the context subscription results for the
-% last time step.
-% contextSubscriptionResults = getContextSubscriptionResults(LOOPID)
-% Returns the context subscription results for the last time step and the
-% given induction loop. If no induction loop id is given, all
-% subscription results are returned in a containers.Map data struccure.
-% If the induction loop id is unknown or the subscription did for any
-% reason return no data, 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global loopSubscriptionResults
-if isempty(loopSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- loopID=None;
-end
-ContextSubscriptionResults = loopSubscriptionResults.getContext(loopID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getIDList.m b/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getIDList.m
deleted file mode 100644
index 5a07302..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getIDList.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function IDList = getIDList()
-%getIDList Get the IDs of the induction loops in the network.
-% IDList = getIDList() Returns a cell array of strings containing the IDs
-% of the induction loops in the SUMO network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-IDList = traci.inductionloop.getUniversal(constants.ID_LIST, '');
-
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLaneID.m b/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLaneID.m
deleted file mode 100644
index 3b0331f..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLaneID.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function laneID = getLaneID(loopID)
-%getLaneID Get the id of the lane the loop is on.
-% laneID = getLaneID(LOOPID) Returns the id of the lane the loop is on.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLaneID.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-laneID = traci.inductionloop.getUniversal(constants.VAR_LANE_ID, loopID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanLength.m b/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanLength.m
deleted file mode 100644
index 9351a21..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanLength.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function lastStepMeanLength = getLastStepMeanLength(loopID)
-%getLastStepMeanLength Get the mean length of the vehicles in the lane.
-% lastStepMeanLength = getLastStepMeanLength(LOOPID) Returns the mean
-% length in m of vehicles which were on the detector in the last step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepMeanLength.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepMeanLength = traci.inductionloop.getUniversal(constants.LAST_STEP_LENGTH, loopID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanSpeed.m b/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanSpeed.m
deleted file mode 100644
index 986eb9f..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanSpeed.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function lastStepMeanSpeed = getLastStepMeanSpeed(loopID)
-%getLastStepMeanSpeed Get the mean speed of the vehicles in the lane.
-% lastStepMeanSpeed = getLastStepMeanSpeed(LOOPID) Returns the mean
-% speed in m/s of vehicles that were on the named induction loop within
-% the last simulation step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepMeanSpeed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepMeanSpeed = traci.inductionloop.getUniversal(constants.LAST_STEP_MEAN_SPEED, loopID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepOccupancy.m b/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepOccupancy.m
deleted file mode 100644
index 0cd5756..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepOccupancy.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function lastStepOccupancy = getLastStepOccupancy(loopID)
-%getLastStepOccupancy Get the percentage of time the loop was occupied.
-% lastStepOccupancy = getLastStepOccupancy(LOOPID) Returns the percentage
-% of time the detector was occupied by a vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepOccupancy.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepOccupancy = traci.inductionloop.getUniversal(constants.LAST_STEP_OCCUPANCY, loopID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleIDs.m b/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleIDs.m
deleted file mode 100644
index c842fec..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleIDs.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function lastStepVehicleIDs = getLastStepVehicleIDs(loopID)
-%getLastStepVehicleIDs Get the IDs of the vehicles that were in the loop.
-% lastStepVehicleIDs = getLastStepVehicleIDs(LOOPID) Returns the list of
-% ids of vehicles that were on the named induction loop in the last
-% simulation step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepVehicleIDs.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepVehicleIDs = traci.inductionloop.getUniversal(constants.LAST_STEP_VEHICLE_ID_LIST, loopID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleNumber.m b/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleNumber.m
deleted file mode 100644
index b3bf400..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleNumber.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function lastStepVehicleNumber = getLastStepVehicleNumber(loopID)
-%getLastStepVehicleNumber Get number of vehicles in the loop.
-% lastStepVehicleNumber = getLastStepVehicleNumber(LOOPID) Returns the
-% number of vehicles that were on the named induction loop within the last simulation step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepVehicleNumber.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepVehicleNumber = traci.inductionloop.getUniversal(...
- constants.LAST_STEP_VEHICLE_NUMBER, loopID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getPosition.m b/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getPosition.m
deleted file mode 100644
index 7b65043..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getPosition.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function position = getPosition(loopID)
-%getPosition Get the position of the loop.
-% position = getPosition(LOOPID) Returns the position measured from the
-% beginning of the lane in meters.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getPosition.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-position = traci.inductionloop.getUniversal(constants.VAR_POSITION, loopID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getSubscriptionResults.m
deleted file mode 100644
index 981d885..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function subscriptionResults = getSubscriptionResults(loopID)
-%getSubscriptionResults Get the subscription results for the last time step.
-% subscriptionResults = getSubscriptionResults(LOOPID) Returns the
-% subscription results for the last time step and the given induction loop. If no
-% induction loop id is given, all subscription results are returned in a
-% containers.Map data structure.
-% If the induction loop id is unknown or the subscription did for any reason return
-% no data, 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global loopSubscriptionResults
-if isempty(loopSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- loopID = 'None';
-end
-
-subscriptionResults = loopSubscriptionResults.get(loopID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getTimeSinceDetection.m b/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getTimeSinceDetection.m
deleted file mode 100644
index 5bca97f..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getTimeSinceDetection.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function timeSinceDetection = getTimeSinceDetection(loopID)
-%getTimeSinceDetection Get the time since the last detection.
-% timeSinceDetection = getTimeSinceDetection(LOOPID) Returns the time in
-% seconds since last detection.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getTimeSinceDetection.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-timeSinceDetection = traci.inductionloop.getUniversal(constants.LAST_STEP_TIME_SINCE_DETECTION, loopID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getUniversal.m b/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getUniversal.m
deleted file mode 100644
index b251c1d..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getUniversal.m
+++ /dev/null
@@ -1,25 +0,0 @@
-function returnedValue = getUniversal(varID, loopID)
-%getUniversal An internal function to send the get command and read the
-%variable value.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global inductionloopSubscriptionResults
-
-if isempty(inductionloopSubscriptionResults)
- returnValueFunc = traci.RETURN_VALUE_FUNC.inductionloop;
-else
- returnValueFunc = inductionloopSubscriptionResults.valueFunc;
-end
-
-% Prepare the outgoing message and read the response. The result variable
-% is a traci.Storage object
-result = traci.sendReadOneStringCmd(constants.CMD_GET_INDUCTIONLOOP_VARIABLE,varID,loopID);
-handleReturValueFunc = str2func(returnValueFunc(varID));
-
-% Use the proper method to read the variable of interest from the result
-returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getVehicleData.m b/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getVehicleData.m
deleted file mode 100644
index f01d9f3..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getVehicleData.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function vehicleData = getVehicleData(loopID)
-%getVehicleData Get several data about passed vehicles.
-% vehicleData = getVehicleData(LOOPID) Returns a cell structure
-% containing several information about vehicles which passed the detector.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getVehicleData.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-vehicleData = traci.inductionloop.getUniversal(constants.LAST_STEP_VEHICLE_DATA, loopID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/readVehicleData.m b/tools/contributed/TraCI4Matlab/+traci/+inductionloop/readVehicleData.m
deleted file mode 100644
index 382c872..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/readVehicleData.m
+++ /dev/null
@@ -1,24 +0,0 @@
-function data = readVehicleData(result)
-%readVehicleData Internal function to read several vehicle information.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: readVehicleData.m 20 2015-03-02 16:52:32Z afacostag $
-
-result.readLength();
-nbData = result.readInt();
-data = {};
-for i=1:nbData
- result.read(1);
- vehID = result.readString();
- result.read(1);
- len = result.readDouble();
- result.read(1);
- entryTime = result.readDouble();
- result.read(1);
- leaveTime = result.readDouble();
- result.read(1);
- typeID = result.readString();
- data = [data, vehID, len, entryTime, leaveTime, typeID];
-end
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/subscribe.m b/tools/contributed/TraCI4Matlab/+traci/+inductionloop/subscribe.m
deleted file mode 100644
index 0032b95..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/subscribe.m
+++ /dev/null
@@ -1,38 +0,0 @@
-function subscribe(loopID, varargin)
-%subscribe Subscribe to induction loop variable.
-% subscribe(LOOPID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for
-% the maximum allowed interval.
-% subscribe(LOOPID,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS for the maximum allowed interval.
-% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
-% allowed end time.
-% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
-% END.
-% A call to this function clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $
-
-global loopSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'inductionloop.subscribe';
-p.addRequired('loopID', at ischar)
-p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(loopID, varargin{:})
-loopID = p.Results.loopID;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-loopSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.inductionloop);
-
-loopSubscriptionResults.reset()
-traci.subscribe(constants.CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE,...
- subscriptionBegin, subscriptionEnd, loopID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/subscribeContext.m b/tools/contributed/TraCI4Matlab/+traci/+inductionloop/subscribeContext.m
deleted file mode 100644
index 9606e9e..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+inductionloop/subscribeContext.m
+++ /dev/null
@@ -1,46 +0,0 @@
-function subscribeContext(loopID, domain, dist, varargin)
-%subscribeContext Subscribe to an induction loop's context variable.
-% subscribeContext(LOOPID,DOMAIN,DIST) Subscribe to the
-% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the
-% induction loop specified by LOOPID at a distance given by DIST, for the
-% maximum allowed interval. The type of objets that surround the
-% induction loop are defined in the DOMAIN parameter. Note that not all
-% the SUMO object types support the variable LAST_STEP_VEHICLE_NUMBER.
-% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS.
-% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
-% maximum allowed end time.
-% subscribeContext(...,END) Subscribe for the time interval defined by
-% BEGIN and END.
-% A call to this method clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $
-
-global loopSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'inductionloop.subscribeContext';
-p.addRequired('loopID', at ischar)
-p.addRequired('domain', at ischar)
-p.addRequired('dist', at isnumeric)
-p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(loopID, domain, dist, varargin{:})
-loopID = p.Results.loopID;
-domain = p.Results.domain;
-dist = p.Results.dist;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-loopSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.inductionloop);
-
-loopSubscriptionResults.reset()
-traci.subscribeContext(constants.CMD_SUBSCRIBE_INDUCTIONLOOP_CONTEXT,...
- subscriptionBegin, subscriptionEnd, loopID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+junction/getContextSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+junction/getContextSubscriptionResults.m
deleted file mode 100644
index c9caada..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+junction/getContextSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function ContextSubscriptionResults = getContextSubscriptionResults(junctionID)
-%getContextSubscriptionResults Get the context subscription results for the
-% last time step.
-% contextSubscriptionResults = getContextSubscriptionResults(JUNCTIONID)
-% Returns the context subscription results for the last time step and the
-% given junction. If no junction id is given, all subscription results are
-% returned in a containers.Map data struccure. If the junction id is unknown
-% or the subscription did for any reason return no data, 'None' is
-% returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global junctionSubscriptionResults
-if isempty(junctionSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- junctionID=None;
-end
-ContextSubscriptionResults = junctionSubscriptionResults.getContext(junctionID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+junction/getIDList.m b/tools/contributed/TraCI4Matlab/+traci/+junction/getIDList.m
deleted file mode 100644
index 40cbbd8..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+junction/getIDList.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function IDList = getIDList()
-%getIDList Get the IDs of the junctions in the network.
-% IDList = getIDList() Returns a cell array of strings containing the IDs
-% of the junctions in the SUMO network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-IDList = traci.junction.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+junction/getPosition.m b/tools/contributed/TraCI4Matlab/+traci/+junction/getPosition.m
deleted file mode 100644
index 4fcfd86..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+junction/getPosition.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function position = getPosition(junctionID)
-%getPosition Get the position of the junction.
-% position = getPosition(JUNCTIONID) Returns the coordinates of the
-% center of the junction.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getPosition.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-position = traci.junction.getUniversal(constants.VAR_POSITION, junctionID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+junction/getSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+junction/getSubscriptionResults.m
deleted file mode 100644
index 7a5fe2c..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+junction/getSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function subscriptionResults = getSubscriptionResults(junctionID)
-%getSubscriptionResults Get the subscription results for the last time step.
-% subscriptionResults = getSubscriptionResults(JUNCTIONID) Returns the
-% subscription results for the last time step and the given junction. If no
-% junction id is given, all subscription results are returned in a
-% containers.Map data structure.
-% If the junction id is unknown or the subscription did for any reason return
-% no data, 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global junctionSubscriptionResults
-if isempty(junctionSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- junctionID = 'None';
-end
-
-subscriptionResults = junctionSubscriptionResults.get(junctionID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+junction/getUniversal.m b/tools/contributed/TraCI4Matlab/+traci/+junction/getUniversal.m
deleted file mode 100644
index 46c1ed4..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+junction/getUniversal.m
+++ /dev/null
@@ -1,25 +0,0 @@
-function returnedValue = getUniversal(varID, junctionID)
-%getUniversal An internal function to send the get command and read the
-%variable value.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global junctionSubscriptionResults
-
-if isempty(junctionSubscriptionResults)
- returnValueFunc = traci.RETURN_VALUE_FUNC.junction;
-else
- returnValueFunc = junctionSubscriptionResults.valueFunc;
-end
-
-% Prepare the outgoing message and read the response. The result variable
-% is a traci.Storage object
-result = traci.sendReadOneStringCmd(constants.CMD_GET_JUNCTION_VARIABLE,varID,junctionID);
-handleReturValueFunc = str2func(returnValueFunc(varID));
-
-% Use the proper method to read the variable of interest from the result
-returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+junction/subscribe.m b/tools/contributed/TraCI4Matlab/+traci/+junction/subscribe.m
deleted file mode 100644
index f6fed3a..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+junction/subscribe.m
+++ /dev/null
@@ -1,38 +0,0 @@
-function subscribe(junctionID, varargin)
-%subscribe Subscribe to junction variable.
-% subscribe(JUNCTIONID) Subscribe to the VAR_POSITION value for the
-% maximum allowed interval.
-% subscribe(JUNCTIONID,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS for the maximum allowed interval.
-% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
-% allowed end time.
-% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
-% END.
-% A call to this function clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $
-
-global junctionSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'junction.subscribe';
-p.addRequired('junctionID', at ischar)
-p.addOptional('varIDs', {constants.VAR_POSITION}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(junctionID, varargin{:})
-junctionID = p.Results.junctionID;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-junctionSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.junction);
-
-junctionSubscriptionResults.reset()
-traci.subscribe(constants.CMD_SUBSCRIBE_JUNCTION_VARIABLE,...
- subscriptionBegin, subscriptionEnd, junctionID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+junction/subscribeContext.m b/tools/contributed/TraCI4Matlab/+traci/+junction/subscribeContext.m
deleted file mode 100644
index beae35e..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+junction/subscribeContext.m
+++ /dev/null
@@ -1,46 +0,0 @@
-function subscribeContext(junctionID, domain, dist, varargin)
-%subscribeContext Subscribe to a junction's context variable.
-% subscribeContext(JUNCTIONID,DOMAIN,DIST) Subscribe to the
-% VAR_POSITION value of the SUMO objects that surround the junction
-% specified by JUNCTIONID at a distance given by DIST, for the maximum
-% allowed interval. The type of objets that surround the junction are
-% defined in the DOMAIN parameter. Note that not all the SUMO object
-% types support the variable VAR_POSITION.
-% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS.
-% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
-% maximum allowed end time.
-% subscribeContext(...,END) Subscribe for the time interval defined by
-% BEGIN and END.
-% A call to this method clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $
-
-global junctionSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'junction.subscribeContext';
-p.addRequired('junctionID', at ischar)
-p.addRequired('domain', at ischar)
-p.addRequired('dist', at isnumeric)
-p.addOptional('varIDs', {constants.VAR_POSITION}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(junctionID, domain, dist, varargin{:})
-junctionID = p.Results.junctionID;
-domain = p.Results.domain;
-dist = p.Results.dist;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-junctionSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.junction);
-
-junctionSubscriptionResults.reset()
-traci.subscribeContext(constants.CMD_SUBSCRIBE_JUNCTION_CONTEXT,...
- subscriptionBegin, subscriptionEnd, junctionID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getAllowed.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getAllowed.m
deleted file mode 100644
index 3be19ea..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getAllowed.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function allowed = getAllowed(laneID)
-%getAllowed Get the allowed vehicle classes in the lane.
-% allowed = getAllowed(LANEID) Returns a cell array of strings containing
-% the allowed vehicle classes. An empty cell array means all vehicles are
-% allowed.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getAllowed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-allowed = traci.lane.getUniversal(constants.LANE_ALLOWED, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getCO2Emission.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getCO2Emission.m
deleted file mode 100644
index eafbe8a..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getCO2Emission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function CO2Emission = getCO2Emission(laneID)
-%getCO2Emission Returns the CO2 emission on the given lane.
-% CO2Emission = getCO2Emission(LANEID) Returns the CO2 emission in mg for
-% the last time step on the given lane.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getCO2Emission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-CO2Emission = traci.lane.getUniversal(constants.VAR_CO2EMISSION, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getCOEmission.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getCOEmission.m
deleted file mode 100644
index 8406344..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getCOEmission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function COEmission = getCOEmission(laneID)
-%getCOEmission Returns the CO emission on the given lane.
-% COEmission = getCOEmission(LANEID) Returns the CO emission in mg for
-% the last time step on the given lane.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getCOEmission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-COEmission = traci.lane.getUniversal(constants.VAR_COEMISSION, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getContextSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getContextSubscriptionResults.m
deleted file mode 100644
index 78297e7..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getContextSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function ContextSubscriptionResults = getContextSubscriptionResults(laneID)
-%getContextSubscriptionResults Get the context subscription results for the
-% last time step.
-% contextSubscriptionResults = getContextSubscriptionResults(LANEID)
-% Returns the context subscription results for the last time step and the
-% given lane. If no lane id is given, all subscription results are
-% returned in a containers.Map data struccure. If the lane id is unknown
-% or the subscription did for any reason return no data, 'None' is
-% returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global laneSubscriptionResults
-if isempty(laneSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- laneID=None;
-end
-ContextSubscriptionResults = laneSubscriptionResults.getContext(laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getDisallowed.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getDisallowed.m
deleted file mode 100644
index 34cd8e7..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getDisallowed.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function disallowed = getDisallowed(laneID)
-%getDisallowed Get the disallowed vehicle classes in the lane.
-% disallowed = getDisallowed(LANEID) Returns a cell array of strings containing
-% the disallowed vehicle classes.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getDisallowed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-disallowed = traci.lane.getUniversal(constants.LANE_DISALLOWED, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getEdgeID.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getEdgeID.m
deleted file mode 100644
index 7c2b9cf..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getEdgeID.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function edgeID = getEdgeID(laneID)
-%getEdgeID
-% edgeID = getEdgeID(LANEID) Returns the id of the edge the lane belongs
-% to.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getEdgeID.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-edgeID = traci.lane.getUniversal(constants.LANE_EDGE_ID, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getFuelConsumption.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getFuelConsumption.m
deleted file mode 100644
index c07bec0..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getFuelConsumption.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function FuelConsumption = getFuelConsumption(laneID)
-%getFuelConsumption Get the fuel consumption on the lane.
-% fuelConsumption = getFuelConsumption(LANEID) Returns the fuel
-% consumption in ml for the last time step on the given lane.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getFuelConsumption.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-FuelConsumption = traci.lane.getUniversal(constants.VAR_FUELCONSUMPTION, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getHCEmission.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getHCEmission.m
deleted file mode 100644
index 8d9ead0..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getHCEmission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function HCEmission = getHCEmission(laneID)
-%getHCEmission Returns the HC emission on the given lane.
-% HCEmission = getCOEmission(LANEID) Returns the HC emission in mg for
-% the last time step on the given lane.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getHCEmission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-HCEmission = traci.lane.getUniversal(constants.VAR_HCEMISSION, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getIDList.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getIDList.m
deleted file mode 100644
index 56c2e02..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getIDList.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function IDList = getIDList()
-%getIDList Get the IDs of the lanes in the network.
-% IDList = getIDList() Returns a cell array of strings containing the IDs
-% of the lanes in the SUMO network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-IDList = traci.lane.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepHaltingNumber.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepHaltingNumber.m
deleted file mode 100644
index 080412e..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepHaltingNumber.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function lastStepHaltingNumber = getLastStepHaltingNumber(laneID)
-%getLastStepHaltingNumber Get the number of halting vehicles.
-% lastStepHaltingNumber = getLastStepHaltingNumber(LANEID) Returns the
-% total number of halting vehicles for the last time step on the given
-% lane. A speed of less than 0.1 m/s is considered a halt.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepHaltingNumber.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepHaltingNumber = traci.lane.getUniversal(constants.LAST_STEP_VEHICLE_HALTING_NUMBER, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepLength.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepLength.m
deleted file mode 100644
index 57342c2..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepLength.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function lastStepLength = getLastStepLength(laneID)
-%getLastStepLength Get the mean vehicle length on the lane.
-% lastStepLength = getLastStepLength(LANEID) Returns the mean vehicle
-% length in m for the last time step on the given lane.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepLength.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepLength = traci.lane.getUniversal(constants.LAST_STEP_LENGTH, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepMeanSpeed.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepMeanSpeed.m
deleted file mode 100644
index 94241ad..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepMeanSpeed.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function lastStepMeanSpeed = getLastStepMeanSpeed(laneID)
-%getLastStepMeanSpeed Get the average speed on the lane.
-% lastStepMeanSpeed = getLastStepMeanSpeed(LANEID) Returns the average
-% speed in m/s for the last time step on the given lane.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepMeanSpeed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepMeanSpeed = traci.lane.getUniversal(constants.LAST_STEP_MEAN_SPEED, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepOccupancy.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepOccupancy.m
deleted file mode 100644
index f42e85b..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepOccupancy.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function lastStepOccupancy = getLastStepOccupancy(laneID)
-%getLastStepOccupancy Get the percentage of occupation on the lane.
-% lastStepOccupancy = getLastStepOccupancy(LANEID) Returns the occupancy
-% in percentage for the last time step on the given lane.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepOccupancy.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepOccupancy = traci.lane.getUniversal(constants.LAST_STEP_OCCUPANCY, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepVehicleIDs.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepVehicleIDs.m
deleted file mode 100644
index bf61d84..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepVehicleIDs.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function lastStepVehicleIDs = getLastStepVehicleIDs(laneID)
-%getLastStepVehicleIDs Get the IDs of the vehicles in the lane.
-% lastStepVehicleIDs = getLastStepVehicleIDs(LANEID) Returns cell array
-% of strings containing the IDs of the vehicles for the last time step
-% on the given lane.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepVehicleIDs.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepVehicleIDs = traci.lane.getUniversal(constants.LAST_STEP_VEHICLE_ID_LIST, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepVehicleNumber.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepVehicleNumber.m
deleted file mode 100644
index 4567244..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepVehicleNumber.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function lastStepVehicleNumber = getLastStepVehicleNumber(laneID)
-%getLastStepVehicleNumber Get the number vehicles in the lane.
-% lastStepVehicleNumber = getLastStepVehicleNumber(LANEID) Returns the
-% total number of vehicles for the last time step on the given lane.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepVehicleNumber.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepVehicleNumber = traci.lane.getUniversal(...
- constants.LAST_STEP_VEHICLE_NUMBER, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getLength.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getLength.m
deleted file mode 100644
index 1b5579b..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getLength.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function length = getLength(laneID)
-%getLength
-% length = getLength(LANEID) Returns the length of the lane in m.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLength.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-length = traci.lane.getUniversal(constants.VAR_LENGTH, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getLinkNumber.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getLinkNumber.m
deleted file mode 100644
index 1d2f2bf..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getLinkNumber.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function linkNumber = getLinkNumber(laneID)
-%getLinkNumber
-% linkNumber = getLinkNumber(LANEID) Returns the number of connections to
-% successive lanes.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLinkNumber.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-linkNumber = traci.lane.getUniversal(constants.LANE_LINK_NUMBER, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getLinks.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getLinks.m
deleted file mode 100644
index b2a3c70..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getLinks.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function links = getLinks(laneID)
-%getLinks
-% links = getLinks(LANEID) Returns a cell containing ids of successor
-% lanes together with priority, open and foe.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLinks.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-links = traci.lane.getUniversal(constants.LANE_LINKS, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getMaxSpeed.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getMaxSpeed.m
deleted file mode 100644
index 4fc31de..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getMaxSpeed.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function maxSpeed = getMaxSpeed(laneID)
-% getMaxSpeed Maximum allowed speed in the lane.
-% maxSpeed = getMaxSpeed(LANEID) Returns the maximum allowed speed on the
-% lane in m/s.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getMaxSpeed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-maxSpeed = traci.lane.getUniversal(constants.VAR_MAXSPEED, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getNOxEmission.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getNOxEmission.m
deleted file mode 100644
index a5a15b7..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getNOxEmission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function NOxEmission = getNOxEmission(laneID)
-%getNOxEmission Get the NOx emission in the lane.
-% NOxEmission = getNOxEmission(LANEID) Returns the NOx emission in mg for
-% the last time step on the given lane.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getNOxEmission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-NOxEmission = traci.lane.getUniversal(constants.VAR_NOXEMISSION, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getNoiseEmission.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getNoiseEmission.m
deleted file mode 100644
index d931433..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getNoiseEmission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function noiseEmission = getNoiseEmission(laneID)
-%getNoiseEmission Get the noise emission in the lane.
-% noiseEmission = getNoiseEmission(LANEID) Returns the noise emission in
-% db for the last time step on the given lane.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getNoiseEmission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-noiseEmission = traci.lane.getUniversal(constants.VAR_NOISEEMISSION, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getPMxEmission.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getPMxEmission.m
deleted file mode 100644
index 0af02e9..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getPMxEmission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function PMxEmission = getPMxEmission(laneID)
-%getPmxEmission Get the particular matter emission in the lane.
-% pmxEmission = getPmxEmission(LANEID) Returns the particular matter
-% emission in mg for the last time step on the given lane.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getPMxEmission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-PMxEmission = traci.lane.getUniversal(constants.VAR_PMXEMISSION, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getShape.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getShape.m
deleted file mode 100644
index a94151f..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getShape.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function shape = getShape(laneID)
-%getShape Get the shape of the lane.
-% shape = getShape(LANEID) Returns a list of 2D positions (cartesian)
-% describing the geometry of the given lane.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getShape.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-shape = traci.lane.getUniversal(constants.VAR_SHAPE, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getSubscriptionResults.m
deleted file mode 100644
index 2a0533d..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function subscriptionResults = getSubscriptionResults(laneID)
-%getSubscriptionResults Get the subscription results for the last time step.
-% subscriptionResults = getSubscriptionResults(LANEID) Returns the
-% subscription results for the last time step and the given lane. If no
-% lane id is given, all subscription results are returned in a
-% containers.Map data structure.
-% If the lane id is unknown or the subscription did for any reason return
-% no data, 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global laneSubscriptionResults
-if isempty(laneSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- laneID = 'None';
-end
-
-subscriptionResults = laneSubscriptionResults.get(laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getTraveltime.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getTraveltime.m
deleted file mode 100644
index 3518632..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getTraveltime.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function traveltime = getTraveltime(laneID)
-%getTraveltime Get estimated travel time in the lane.
-% traveltime = getTraveltime(LANEID) Returns the estimated travel time in
-% seconds for the last time step on the given lane.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getTraveltime.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traveltime = traci.lane.getUniversal(constants.VAR_CURRENT_TRAVELTIME, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getUniversal.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getUniversal.m
deleted file mode 100644
index 2fdc728..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getUniversal.m
+++ /dev/null
@@ -1,25 +0,0 @@
-function returnedValue = getUniversal(varID, laneID)
-%getUniversal An internal function to send the get command and read the
-%variable value.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global laneSubscriptionResults
-
-if isempty(laneSubscriptionResults)
- returnValueFunc = traci.RETURN_VALUE_FUNC.lane;
-else
- returnValueFunc = laneSubscriptionResults.valueFunc;
-end
-
-% Prepare the outgoing message and read the response. The result variable
-% is a traci.Storage object
-result = traci.sendReadOneStringCmd(constants.CMD_GET_LANE_VARIABLE,varID,laneID);
-handleReturValueFunc = str2func(returnValueFunc(varID));
-
-% Use the proper method to read the variable of interest from the result
-returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/getWidth.m b/tools/contributed/TraCI4Matlab/+traci/+lane/getWidth.m
deleted file mode 100644
index f930bcc..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/getWidth.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function width = getWidth(laneID)
-%getWidth
-% width = getWidth(LANEID) Returns the width of the lane in m.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getWidth.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-width = traci.lane.getUniversal(constants.VAR_WIDTH, laneID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/readLinks.m b/tools/contributed/TraCI4Matlab/+traci/+lane/readLinks.m
deleted file mode 100644
index 418eb68..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/readLinks.m
+++ /dev/null
@@ -1,30 +0,0 @@
-function links = readLinks(result)
-%readLinks Internal function to read information about the links.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: readLinks.m 20 2015-03-02 16:52:32Z afacostag $
-
-result.read(5) % Type Compound, Length
-nbLinks = result.readInt();
-links = {};
-for i=1:nbLinks
- result.read(1); % Type String
- approachedLane = result.readString();
- result.read(1); % Type String
- approachedInternal = result.readString();
- result.read(1); % Type Byte
- hasPrio = result.read(1);
- result.read(1); % Type Byte
- isOpen = result.read(1);
- result.read(1); % Type Byte
- hasFoe = result.read(1);
- result.read(1); % Type String
- state = result.readString();
- result.read(1); % Type String
- direction = result.readString();
- result.read(1); % Type Float
- len = result.readDouble();
- links = [links approachedLane, hasPrio, isOpen, hasFoe];
-end
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/setAllowed.m b/tools/contributed/TraCI4Matlab/+traci/+lane/setAllowed.m
deleted file mode 100644
index e1ff77b..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/setAllowed.m
+++ /dev/null
@@ -1,22 +0,0 @@
-function setAllowed(laneID, allowedClasses)
-import traci.constants
-%setAllowed Set the allowed vehicle classes in the lane.
-% setAllowed(LANEID,ALLOWEDCLASSES) Sets a list of allowed vehicle
-% classes contained in a cell array of strings. Setting an empty list
-% means all vehicles are allowed.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setAllowed.m 20 2015-03-02 16:52:32Z afacostag $
-
-global message
-traci.beginMessage(constants.CMD_SET_LANE_VARIABLE, constants.LANE_ALLOWED,...
-laneID, 1+4+sum(cellfun('length', allowedClasses))+4*length(allowedClasses));
-message.string = [message.string uint8(sscanf(constants.TYPE_STRINGLIST,'%x')) ...
- traci.packInt32(length(allowedClasses))];
-for i=1:length(allowedClasses)
- message.string = [message.string traci.packInt32(length(...
- allowedClasses{i})) uint8(allowedClasses{i})];
-end
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/setDisallowed.m b/tools/contributed/TraCI4Matlab/+traci/+lane/setDisallowed.m
deleted file mode 100644
index bb81ec1..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/setDisallowed.m
+++ /dev/null
@@ -1,21 +0,0 @@
-function setDisallowed(laneID, disallowedClasses)
-%setDisallowed Set the disallowed vehicle classes in the lane.
-% setDisallowed(LANEID,DISALLOWEDCLASSES) Sets a list of disallowed
-% vehicle classes contained in a cell array of strings.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setDisallowed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_LANE_VARIABLE, constants.LANE_DISALLOWED,...
-laneID, 1+4+sum(cellfun('length', disallowedClasses))+4*length(disallowedClasses));
-message.string = [message.string uint8(sscanf(constants.TYPE_STRINGLIST,'%x')) ...
- traci.packInt32(length(disallowedClasses))];
-for i=1:length(disallowedClasses)
- message.string = [message.string traci.packInt32(length(...
- disallowedClasses{i})) uint8(disallowedClasses{i})];
-end
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/setLength.m b/tools/contributed/TraCI4Matlab/+traci/+lane/setLength.m
deleted file mode 100644
index bc108fd..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/setLength.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function setLength(laneID, len)
-%setLength
-% setLength(LANEID,LENGTH) Sets the length of the lane in m.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setLength.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_LANE_VARIABLE, constants.VAR_LENGTH, laneID, len)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/setMaxSpeed.m b/tools/contributed/TraCI4Matlab/+traci/+lane/setMaxSpeed.m
deleted file mode 100644
index 5437c8c..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/setMaxSpeed.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setMaxSpeed(laneID, speed)
-%setMaxSpeed
-% setMaxSpeed(LANEID,SPEED) Sets a new maximum allowed speed on the lane
-% in m/s.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setMaxSpeed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_LANE_VARIABLE, constants.VAR_MAXSPEED, laneID, speed)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/subscribe.m b/tools/contributed/TraCI4Matlab/+traci/+lane/subscribe.m
deleted file mode 100644
index e90fadc..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/subscribe.m
+++ /dev/null
@@ -1,38 +0,0 @@
-function subscribe(laneID, varargin)
-%subscribe Subscribe to lane variable.
-% subscribe(LANEID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for
-% the maximum allowed interval.
-% subscribe(LANEID,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS for the maximum allowed interval.
-% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
-% allowed end time.
-% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
-% END.
-% A call to this function clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $
-
-global laneSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'lane.subscribe';
-p.addRequired('laneID', at ischar)
-p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(laneID, varargin{:})
-laneID = p.Results.laneID;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-laneSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.lane);
-
-laneSubscriptionResults.reset()
-traci.subscribe(constants.CMD_SUBSCRIBE_LANE_VARIABLE,...
- subscriptionBegin, subscriptionEnd, laneID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+lane/subscribeContext.m b/tools/contributed/TraCI4Matlab/+traci/+lane/subscribeContext.m
deleted file mode 100644
index bc35c79..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+lane/subscribeContext.m
+++ /dev/null
@@ -1,47 +0,0 @@
-function subscribeContext(laneID, domain, dist, varargin)
-%subscribeContext Subscribe to a lane's context variable.
-% subscribeContext(LANEID,DOMAIN,DIST) Subscribe to the
-% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the
-% lane specified by LANEID at a distance given by DIST, for the maximum
-% allowed interval. The type of objets that surround the lane are defined
-% in the DOMAIN parameter. Note that not all the SUMO object types
-% support the variable LAST_STEP_VEHICLE_NUMBER.
-% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS.
-% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
-% maximum allowed end time.
-% subscribeContext(...,END) Subscribe for the time interval defined by
-% BEGIN and END.
-% A call to this method clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $
-
-global laneSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'lane.subscribeContext';
-p.addRequired('laneID', at ischar)
-p.addRequired('domain', at ischar)
-p.addRequired('dist', at isnumeric)
-p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(laneID, domain, dist, varargin{:})
-laneID = p.Results.laneID;
-domain = p.Results.domain;
-dist = p.Results.dist;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-laneSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.lane);
-
-
-laneSubscriptionResults.reset()
-traci.subscribeContext(constants.CMD_SUBSCRIBE_LANE_CONTEXT,...
- subscriptionBegin, subscriptionEnd, laneID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getContextSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getContextSubscriptionResults.m
deleted file mode 100644
index 43201f9..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getContextSubscriptionResults.m
+++ /dev/null
@@ -1,27 +0,0 @@
-function ContextSubscriptionResults = getContextSubscriptionResults(detID)
-%getContextSubscriptionResults Get the context subscription results for the
-% last time step.
-% contextSubscriptionResults = getContextSubscriptionResults(DETID)
-% Returns the context subscription results for the last time step and the
-% given multi-entry/multi-exit detector. If no multi-entry/multi-exit
-% detector id is given, all subscription results are returned in a
-% containers.Map data struccure. If the multi-entry/multi-exit detector
-% id is unknown or the subscription did for any reason return no data,
-% 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global detSubscriptionResults
-if isempty(detSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the context variable'));
-end
-if nargin < 1
- detID=None;
-end
-ContextSubscriptionResults = detSubscriptionResults.getContext(detID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getIDList.m b/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getIDList.m
deleted file mode 100644
index 512e119..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getIDList.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function IDList = getIDList()
-%getIDList Get the IDs of the multi-entry/multi-exit detectors in the network.
-% IDList = getIDList() Returns a cell array of strings containing the IDs
-% of the multi-entry/multi-exit detectors in the SUMO network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-IDList = traci.multientryexit.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepHaltingNumber.m b/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepHaltingNumber.m
deleted file mode 100644
index 84b6ad4..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepHaltingNumber.m
+++ /dev/null
@@ -1,14 +0,0 @@
-function lastStepHaltingNumber = getLastStepHaltingNumber(detID)
-%getLastStepHaltingNumber Get the number of halting vehicles.
-% lastStepHaltingNumber = getLastStepHaltingNumber(DETID) Returns the
-% total number of halting vehicles for the last time step on the given
-% multi-entry/multi-exit detector. A speed of less than 0.1 m/s is
-% considered a halt.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepHaltingNumber.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepHaltingNumber = traci.multientryexit.getUniversal(constants.LAST_STEP_VEHICLE_HALTING_NUMBER, detID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepMeanSpeed.m b/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepMeanSpeed.m
deleted file mode 100644
index 04e5a68..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepMeanSpeed.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function lastStepMeanSpeed = getLastStepMeanSpeed(detID)
-%getLastStepMeanSpeed Get the average speed.
-% lastStepMeanSpeed = getLastStepMeanSpeed(DETID) Returns the average
-% speed in m/s for the last time step on the given multi-entry/multi-exit
-% detector.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepMeanSpeed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepMeanSpeed = traci.multientryexit.getUniversal(constants.LAST_STEP_MEAN_SPEED, detID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleIDs.m b/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleIDs.m
deleted file mode 100644
index 104e817..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleIDs.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function lastStepVehicleIDs = getLastStepVehicleIDs(detID)
-%getLastStepVehicleIDs Get the IDs of the vehicles.
-% lastStepVehicleIDs = getLastStepVehicleIDs(DETID) Returns cell array
-% of strings containing the IDs of the vehicles for the last time step
-% on the given multi-entry/multi-exit detector.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepVehicleIDs.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepVehicleIDs = traci.multientryexit.getUniversal(constants.LAST_STEP_VEHICLE_ID_LIST, detID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleNumber.m b/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleNumber.m
deleted file mode 100644
index 1c4d265..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleNumber.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function lastStepVehicleNumber = getLastStepVehicleNumber(detID)
-%getLastStepVehicleNumber Get the number vehicles.
-% lastStepVehicleNumber = getLastStepVehicleNumber(DETID) Returns the
-% total number of vehicles for the last time step on the given
-% multi-entry/multi-exit detector.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLastStepVehicleNumber.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lastStepVehicleNumber = traci.multientryexit.getUniversal(constants.LAST_STEP_VEHICLE_NUMBER, detID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getSubscriptionResults.m
deleted file mode 100644
index 40120f5..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getSubscriptionResults.m
+++ /dev/null
@@ -1,27 +0,0 @@
-function subscriptionResults = getSubscriptionResults(detID)
-%getSubscriptionResults Get the subscription results for the last time step.
-% subscriptionResults = getSubscriptionResults(DETID) Returns the
-% subscription results for the last time step and the given
-% multi-entry/multi-exit detector. If no multi-entry/multi-exit detector
-% id is given, all subscription results are returned in a containers.Map
-% data structure.
-% If the multi-entry/multi-exit detector id is unknown or the subscription did for any reason return
-% no data, 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global detSubscriptionResults
-if isempty(detSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- detID = 'None';
-end
-
-subscriptionResults = detSubscriptionResults.get(detID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getUniversal.m b/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getUniversal.m
deleted file mode 100644
index 6fa5351..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getUniversal.m
+++ /dev/null
@@ -1,25 +0,0 @@
-function returnedValue = getUniversal(varID, detID)
-%getUniversal An internal function to send the get command and read the
-%variable value.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global detSubscriptionResults
-
-if isempty(detSubscriptionResults)
- returnValueFunc = traci.RETURN_VALUE_FUNC.multientryexit;
-else
- returnValueFunc = detSubscriptionResults.valueFunc;
-end
-
-% Prepare the outgoing message and read the response. The result variable
-% is a traci.Storage object
-result = traci.sendReadOneStringCmd(constants.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE,varID,detID);
-handleReturValueFunc = str2func(returnValueFunc(varID));
-
-% Use the proper method to read the variable of interest from the result
-returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/subscribe.m b/tools/contributed/TraCI4Matlab/+traci/+multientryexit/subscribe.m
deleted file mode 100644
index b06d916..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/subscribe.m
+++ /dev/null
@@ -1,39 +0,0 @@
-function subscribe(detID, varargin)
-%subscribe Subscribe to multi-entry/multi-exit detector variable.
-% subscribe(DETID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for
-% the maximum allowed interval.
-% subscribe(DETID,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS for the maximum allowed interval.
-% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
-% allowed end time.
-% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
-% END.
-% A call to this function clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $
-
-global detSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'det.subscribe';
-p.addRequired('detID', at ischar)
-p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(detID, varargin{:})
-detID = p.Results.detID;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-detSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.multientryexit);
-
-
-detSubscriptionResults.reset()
-traci.subscribe(constants.CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE,...
- subscriptionBegin, subscriptionEnd, detID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/subscribeContext.m b/tools/contributed/TraCI4Matlab/+traci/+multientryexit/subscribeContext.m
deleted file mode 100644
index a258634..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+multientryexit/subscribeContext.m
+++ /dev/null
@@ -1,48 +0,0 @@
-function subscribeContext(detID, domain, dist, varargin)
-%subscribeContext Subscribe to a multi-entry/multi-exit detector's context
-% variable.
-% subscribeContext(EDGEID,DOMAIN,DIST) Subscribe to the
-% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the
-% multi-entry/multi-exit detector specified by EDGEID at a distance given
-% by DIST, for the maximum allowed interval. The type of objets that
-% surround the multi-entry/multi-exit detector are defined in the DOMAIN
-% parameter. Note that not all the SUMO object types support the variable
-% LAST_STEP_VEHICLE_NUMBER.
-% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS.
-% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
-% maximum allowed end time.
-% subscribeContext(...,END) Subscribe for the time interval defined by
-% BEGIN and END.
-% A call to this method clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $
-
-global detSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'multientryexit.subscribeContext';
-p.addRequired('detID', at ischar)
-p.addRequired('domain', at ischar)
-p.addRequired('dist', at isnumeric)
-p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(detID, domain, dist, varargin{:})
-detID = p.Results.detID;
-domain = p.Results.domain;
-dist = p.Results.dist;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-detSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.multientryexit);
-
-detSubscriptionResults.reset()
-traci.subscribeContext(constants.CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT,...
- subscriptionBegin, subscriptionEnd, detID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+poi/add.m b/tools/contributed/TraCI4Matlab/+traci/+poi/add.m
deleted file mode 100644
index 7f00b69..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+poi/add.m
+++ /dev/null
@@ -1,36 +0,0 @@
-function add(poiID, x, y, color, poiType, layer)
-%add Add a point of interest (poi) to the SUMO network.
-% add(POIID,X,Y,COLOR) Adds a poi with the id POIID to the coordinates
-% X and Y, with the specified color. COLOR is a four-element vector whose
-% elements range from 0 to 255, they represent the R, G, B and Alpha
-% (unused) components of the color.
-% add(...,POITYPE) Assigns a type POITYPE to the added poi.
-% add(...,LAYER) Adds the poi to the given layer.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: add.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-
-if nargin < 6
- layer = 0;
- if nargin < 5
- poiType = '';
- end
-end
-typeCompound = sscanf(constants.TYPE_COMPOUND,'%x');
-typeString = sscanf(constants.TYPE_STRING,'%x');
-typeColor = sscanf(constants.TYPE_COLOR,'%x');
-typeInteger = sscanf(constants.TYPE_INTEGER,'%x');
-position2D = sscanf(constants.POSITION_2D,'%x');
-traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.ADD, poiID,...
- 1+4 + 1+4+length(poiType) + 1+1+1+1+1 + 1+4 + 1+8+8);
-message.string = [message.string uint8(typeCompound) traci.packInt32(4)];
-message.string = [message.string uint8(typeString) traci.packInt32(length(poiType)) uint8(poiType)];
-message.string = [message.string uint8([typeColor color])];
-message.string = [message.string uint8(typeInteger) traci.packInt32(layer)];
-message.string = [message.string uint8(position2D) traci.packInt64([x y])];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+poi/getColor.m b/tools/contributed/TraCI4Matlab/+traci/+poi/getColor.m
deleted file mode 100644
index 3fe8349..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+poi/getColor.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function color = getColor(poiID)
-%getColor Get the color of the poi.
-% color = getColor(POIID) Returns the rgba color of the given poi.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getColor.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-color = traci.poi.getUniversal(constants.VAR_COLOR, poiID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+poi/getContextSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+poi/getContextSubscriptionResults.m
deleted file mode 100644
index 178f99d..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+poi/getContextSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function ContextSubscriptionResults = getContextSubscriptionResults(poiID)
-%getContextSubscriptionResults Get the context subscription results for the
-% last time step.
-% contextSubscriptionResults = getContextSubscriptionResults(POIID)
-% Returns the context subscription results for the last time step and the
-% given poi. If no poi id is given, all subscription results are
-% returned in a containers.Map data struccure. If the poi id is unknown
-% or the subscription did for any reason return no data, 'None' is
-% returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global poiSubscriptionResults
-if isempty(poiSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- poiID=None;
-end
-ContextSubscriptionResults = poiSubscriptionResults.getContext(poiID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+poi/getIDList.m b/tools/contributed/TraCI4Matlab/+traci/+poi/getIDList.m
deleted file mode 100644
index 1837cf8..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+poi/getIDList.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function IDList = getIDList()
-%getIDList Get the IDs of the pois in the network.
-% IDList = getIDList() Returns a cell array of strings containing the IDs
-% of the pois in the SUMO network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-IDList = traci.poi.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+poi/getPosition.m b/tools/contributed/TraCI4Matlab/+traci/+poi/getPosition.m
deleted file mode 100644
index a890807..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+poi/getPosition.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function position = getPosition(poiID)
-%getPosition Get the position of the poi.
-% position = getPosition(POIID) Returns the position coordinates of
-% the given poi.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getPosition.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-position = traci.poi.getUniversal(constants.VAR_POSITION, poiID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+poi/getSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+poi/getSubscriptionResults.m
deleted file mode 100644
index ba73b03..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+poi/getSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function subscriptionResults = getSubscriptionResults(poiID)
-%getSubscriptionResults Get the subscription results for the last time step.
-% subscriptionResults = getSubscriptionResults(POIID) Returns the
-% subscription results for the last time step and the given poi. If no
-% poi id is given, all subscription results are returned in a
-% containers.Map data structure.
-% If the poi id is unknown or the subscription did for any reason return
-% no data, 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global poiSubscriptionResults
-if isempty(poiSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- poiID = 'None';
-end
-
-subscriptionResults = poiSubscriptionResults.get(poiID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+poi/getType.m b/tools/contributed/TraCI4Matlab/+traci/+poi/getType.m
deleted file mode 100644
index 8892ead..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+poi/getType.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function type = getType(poiID)
-%getType
-% type = getType(POIID) Returns the (abstract) type of the poi.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getType.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-type = traci.poi.getUniversal(constants.VAR_TYPE, poiID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+poi/getUniversal.m b/tools/contributed/TraCI4Matlab/+traci/+poi/getUniversal.m
deleted file mode 100644
index 720613a..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+poi/getUniversal.m
+++ /dev/null
@@ -1,25 +0,0 @@
-function returnedValue = getUniversal(varID, poiID)
-%getUniversal An internal function to send the get command and read the
-%variable value.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global poiSubscriptionResults
-
-if isempty(poiSubscriptionResults)
- returnValueFunc = traci.RETURN_VALUE_FUNC.poi;
-else
- returnValueFunc = poiSubscriptionResults.valueFunc;
-end
-
-% Prepare the outgoing message and read the response. The result variable
-% is a traci.Storage object
-result = traci.sendReadOneStringCmd(constants.CMD_GET_POI_VARIABLE,varID,poiID);
-handleReturValueFunc = str2func(returnValueFunc(varID));
-
-% Use the proper method to read the variable of interest from the result
-returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+poi/remove.m b/tools/contributed/TraCI4Matlab/+traci/+poi/remove.m
deleted file mode 100644
index f32246d..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+poi/remove.m
+++ /dev/null
@@ -1,18 +0,0 @@
-function remove(poiID, layer)
-%remove Remove the poi from the SUMO network.
-% remove(POIID,LAYER) Removes the poi identified with POIID and
-% associated to the given layer. If no layer is given, it defaults to 0.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: remove.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-if nargin < 2
- layer = 0;
-end
-traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.REMOVE, poiID, 1+4);
-message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(layer)];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+poi/setColor.m b/tools/contributed/TraCI4Matlab/+traci/+poi/setColor.m
deleted file mode 100644
index 665ce4c..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+poi/setColor.m
+++ /dev/null
@@ -1,16 +0,0 @@
-function setColor(poiID, color)
-%setColor
-% setColor(POIID,COLOR) Sets the rgba color of the poi. COLOR is a
-% four-element vector whose elements range from 0 to 255, they represent
-% the R, G, B and Alpha (unused) components of the color.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setColor.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.VAR_COLOR, poiID, 1+1+1+1+1);
-message.string = [message.string uint8([sscanf(constants.TYPE_COLOR,'%x') color])];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+poi/setPosition.m b/tools/contributed/TraCI4Matlab/+traci/+poi/setPosition.m
deleted file mode 100644
index d293c2d..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+poi/setPosition.m
+++ /dev/null
@@ -1,14 +0,0 @@
-function setPosition(poiID, x, y)
-%setPosition
-% setPosition(POIID,X,Y) Sets the position coordinates of the poi.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setPosition.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.VAR_POSITION, poiID, 1+8+8);
-message.string = [message.string uint8(sscanf(constants.POSITION_2D,'%x')) traci.packInt64([y x])];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+poi/setType.m b/tools/contributed/TraCI4Matlab/+traci/+poi/setType.m
deleted file mode 100644
index b7da1c2..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+poi/setType.m
+++ /dev/null
@@ -1,15 +0,0 @@
-function setType(poiID, poiType)
-%setType
-% setType(POIID,POITYPE) Sets the (abstract) type of the poi.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setType.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.VAR_TYPE, poiID, 1+4+length(poiType));
-message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x'))...
- traci.packInt32(length(poiType)) uint8(poiType)];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+poi/subscribe.m b/tools/contributed/TraCI4Matlab/+traci/+poi/subscribe.m
deleted file mode 100644
index 6316fa2..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+poi/subscribe.m
+++ /dev/null
@@ -1,38 +0,0 @@
-function subscribe(poiID, varargin)
-%subscribe Subscribe to poi variable.
-% subscribe(POIID) Subscribe to the VAR_POSITION value for the maximum
-% allowed interval.
-% subscribe(POIID,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS for the maximum allowed interval.
-% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
-% allowed end time.
-% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
-% END.
-% A call to this function clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $
-
-global poiSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'poi.subscribe';
-p.addRequired('poiID', at ischar)
-p.addOptional('varIDs', {constants.VAR_POSITION}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(poiID, varargin{:})
-poiID = p.Results.poiID;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-poiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.poi);
-
-poiSubscriptionResults.reset()
-traci.subscribe(constants.CMD_SUBSCRIBE_POI_VARIABLE,...
- subscriptionBegin, subscriptionEnd, poiID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+poi/subscribeContext.m b/tools/contributed/TraCI4Matlab/+traci/+poi/subscribeContext.m
deleted file mode 100644
index 9bff938..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+poi/subscribeContext.m
+++ /dev/null
@@ -1,46 +0,0 @@
-function subscribeContext(poiID, domain, dist, varargin)
-%subscribeContext Subscribe to a poi's context variable.
-% subscribeContext(POIID,DOMAIN,DIST) Subscribe to the
-% VAR_POSITION value of the SUMO objects that surround the poi specified by
-% POIID at a distance given by DIST, for the maximum allowed interval.
-% The type of objets that surround the poi are defined in the DOMAIN
-% parameter. Note that not all the SUMO object types support the variable
-% VAR_POSITION.
-% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS.
-% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
-% maximum allowed end time.
-% subscribeContext(...,END) Subscribe for the time interval defined by
-% BEGIN and END.
-% A call to this method clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $
-
-global poiSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'poi.subscribeContext';
-p.addRequired('poiID', at ischar)
-p.addRequired('domain', at ischar)
-p.addRequired('dist', at isnumeric)
-p.addOptional('varIDs', {constants.VAR_POSITION}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(poiID, domain, dist, varargin{:})
-poiID = p.Results.poiID;
-domain = p.Results.domain;
-dist = p.Results.dist;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-poiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.poi);
-
-poiSubscriptionResults.reset()
-traci.subscribeContext(constants.CMD_SUBSCRIBE_POI_CONTEXT,...
- subscriptionBegin, subscriptionEnd, poiID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+polygon/add.m b/tools/contributed/TraCI4Matlab/+traci/+polygon/add.m
deleted file mode 100644
index de5cd56..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+polygon/add.m
+++ /dev/null
@@ -1,50 +0,0 @@
-function add(polygonID, shape, color, fill, polygonType, layer)
-%add Add a polygon to the SUMO network.
-% add(POLYGONID,SHAPE,COLOR) Adds a polygon with the id POLYGONID to the
-% with the given shape and color. SHAPE is a cell array whose elements
-% are 2-dimensional vectors that represent the x and y coordinates of the
-% points that define the shape of the polygon. COLOR is a four-element
-% vector whose elements range from 0 to 255, they represent the R, G, B
-% and Alpha (unused) components of the color.
-% add(...,FILL) Is a boolean value which specifies if the polygon has to
-% be filled.
-% add(...,POLYGONTYPE) Assigns a type POLYGONTYPE to the added polygon.
-% add(...,LAYER) Adds the poi to the given layer.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: add.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-
-if nargin < 6
- layer = 0;
- if nargin < 5
- polygonType = '';
- if nargin < 4
- fill = false;
- end
- end
-end
-
-typeCompound = sscanf(constants.TYPE_COMPOUND,'%x');
-typeString = sscanf(constants.TYPE_STRING,'%x');
-typeColor = sscanf(constants.TYPE_COLOR,'%x');
-typeInteger = sscanf(constants.TYPE_INTEGER,'%x');
-typeUbyte = sscanf(constants.TYPE_UBYTE,'%x');
-typePolygon = sscanf(constants.TYPE_POLYGON,'%x');
-
-traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.ADD, polygonID,...
- 1+4 + 1+4+length(polygonType) + 1+1+1+1+1 + 1+1 + 1+4 + 1+1+length(shape)*(8+8));
-message.string = [message.string uint8(typeCompound) traci.packInt32(4)];
-message.string = [message.string uint8(typeString) traci.packInt32(length(polygonType)) uint8(polygonType)];
-message.string = [message.string uint8([typeColor color])];
-message.string = [message.string uint8([typeUbyte fill])];
-message.string = [message.string uint8(typeInteger) traci.packInt32(layer)];
-message.string = [message.string uint8([typePolygon length(shape)])];
-for i=1:length(shape)
- message.string = [message.string traci.packInt64(fliplr(shape{i}))];
-end
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+polygon/getColor.m b/tools/contributed/TraCI4Matlab/+traci/+polygon/getColor.m
deleted file mode 100644
index 4d8cd8a..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+polygon/getColor.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function color = getColor(polygonID)
-%getColor Get the color of the polygon.
-% color = getColor(POLYGONID) Returns the rgba color of the given polygon.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getColor.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-color = traci.polygon.getUniversal(constants.VAR_COLOR, polygonID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+polygon/getContextSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+polygon/getContextSubscriptionResults.m
deleted file mode 100644
index ad9e02a..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+polygon/getContextSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function ContextSubscriptionResults = getContextSubscriptionResults(polygonID)
-%getContextSubscriptionResults Get the context subscription results for the
-% last time step.
-% contextSubscriptionResults = getContextSubscriptionResults(POLYGONID)
-% Returns the context subscription results for the last time step and the
-% given polygon. If no polygon id is given, all subscription results are
-% returned in a containers.Map data struccure. If the polygon id is unknown
-% or the subscription did for any reason return no data, 'None' is
-% returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global polygonSubscriptionResults
-if isempty(polygonSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- polygonID=None;
-end
-ContextSubscriptionResults = polygonSubscriptionResults.getContext(polygonID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+polygon/getIDList.m b/tools/contributed/TraCI4Matlab/+traci/+polygon/getIDList.m
deleted file mode 100644
index f5c105a..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+polygon/getIDList.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function IDList = getIDList()
-%getIDList Get the IDs of the polygons in the network.
-% IDList = getIDList() Returns a cell array of strings containing the IDs
-% of the polygons in the SUMO network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-IDList = traci.polygon.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+polygon/getShape.m b/tools/contributed/TraCI4Matlab/+traci/+polygon/getShape.m
deleted file mode 100644
index 58f82c8..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+polygon/getShape.m
+++ /dev/null
@@ -1,14 +0,0 @@
-function shape = getShape(polygonID)
-%getShape Get the shape of the polygon.
-% shape = getShape(POLYGONID) Returns the shape of the given polygon,
-% which is a cell array containing 2-dimensional vectors that represent
-% the x and y coordinates of the points that define the shape of the
-% polygon.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getShape.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-shape = traci.polygon.getUniversal(constants.VAR_SHAPE, polygonID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+polygon/getSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+polygon/getSubscriptionResults.m
deleted file mode 100644
index 858df83..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+polygon/getSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function subscriptionResults = getSubscriptionResults(polygonID)
-%getSubscriptionResults Get the subscription results for the last time step.
-% subscriptionResults = getSubscriptionResults(POLYGONID) Returns the
-% subscription results for the last time step and the given polygon. If no
-% polygon id is given, all subscription results are returned in a
-% containers.Map data structure.
-% If the polygon id is unknown or the subscription did for any reason return
-% no data, 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global polygonSubscriptionResults
-if isempty(polygonSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- polygonID = 'None';
-end
-
-subscriptionResults = polygonSubscriptionResults.get(polygonID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+polygon/getType.m b/tools/contributed/TraCI4Matlab/+traci/+polygon/getType.m
deleted file mode 100644
index 8ae6398..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+polygon/getType.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function type = getType(polygonID)
-%getType
-% type = getType(POLYGONID) Returns the (abstract) type of the polygon.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getType.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-type = traci.polygon.getUniversal(constants.VAR_TYPE, polygonID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+polygon/getUniversal.m b/tools/contributed/TraCI4Matlab/+traci/+polygon/getUniversal.m
deleted file mode 100644
index fae35f3..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+polygon/getUniversal.m
+++ /dev/null
@@ -1,25 +0,0 @@
-function returnedValue = getUniversal(varID, polygonID)
-%getUniversal An internal function to send the get command and read the
-%variable value.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global polygonSubscriptionResults
-
-if isempty(polygonSubscriptionResults)
- returnValueFunc = traci.RETURN_VALUE_FUNC.polygon;
-else
- returnValueFunc = polygonSubscriptionResults.valueFunc;
-end
-
-% Prepare the outgoing message and read the response. The result variable
-% is a traci.Storage object
-result = traci.sendReadOneStringCmd(constants.CMD_GET_POLYGON_VARIABLE,varID,polygonID);
-handleReturValueFunc = str2func(returnValueFunc(varID));
-
-% Use the proper method to read the variable of interest from the result
-returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+polygon/remove.m b/tools/contributed/TraCI4Matlab/+traci/+polygon/remove.m
deleted file mode 100644
index 68322d2..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+polygon/remove.m
+++ /dev/null
@@ -1,18 +0,0 @@
-function remove(polygonID, layer)
-%remove Remove the polygon from the SUMO network.
-% remove(POLYGONID,LAYER) Removes the polygon identified with POLYGONID
-% and associated to the given layer. If no layer is given, it defaults to 0.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: remove.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-if nargin < 2
- layer = 0;
-end
-traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.REMOVE, polygonID, 1+4);
-message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(layer)];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+polygon/setColor.m b/tools/contributed/TraCI4Matlab/+traci/+polygon/setColor.m
deleted file mode 100644
index 6707b49..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+polygon/setColor.m
+++ /dev/null
@@ -1,16 +0,0 @@
-function setColor(polygonID, color)
-%setColor
-% setColor(POLYGONID,COLOR) Sets the rgba color of the polygon. COLOR is
-% a four-element vector whose elements range from 0 to 255, they represent
-% the R, G, B and Alpha (unused) components of the color.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setColor.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.VAR_COLOR, polygonID, 1+1+1+1+1);
-message.string = [message.string uint8([sscanf(constants.TYPE_COLOR,'%x') color])];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+polygon/setShape.m b/tools/contributed/TraCI4Matlab/+traci/+polygon/setShape.m
deleted file mode 100644
index a06cc6f..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+polygon/setShape.m
+++ /dev/null
@@ -1,20 +0,0 @@
-function setShape(polygonID, shape)
-%setShape Sets the shape of the polygon.
-% setShape(POLYGONID,SHAPE) Sets the shape of the polygon to the given.
-% SHAPE is a cell array whose elements are 2-dimensional vectors that
-% represent the x and y coordinates of the points that define the shape
-% of the polygon.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setShape.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.VAR_SHAPE, polygonID, 1+1+length(shape)*(8+8));
-message.string = [message.string uint8([sscanf(constants.TYPE_POLYGON,'%x') length(shape)])];
-for i=1:length(shape)
- message.string = [message.string traci.packInt64(fliplr(shape{i}))];
-end
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+polygon/setType.m b/tools/contributed/TraCI4Matlab/+traci/+polygon/setType.m
deleted file mode 100644
index 7851c4e..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+polygon/setType.m
+++ /dev/null
@@ -1,15 +0,0 @@
-function setType(polygonID, polygonType)
-%setType
-% setType(POLYGONID,POLYGONTTYPE) Sets the (abstract) type of the polygon.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setType.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.VAR_TYPE, polygonID, 1+4+length(polygonType));
-message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
- traci.packInt32(length(polygonType)) uint8(polygonType)];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+polygon/subscribe.m b/tools/contributed/TraCI4Matlab/+traci/+polygon/subscribe.m
deleted file mode 100644
index 5890846..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+polygon/subscribe.m
+++ /dev/null
@@ -1,38 +0,0 @@
-function subscribe(polygonID, varargin)
-%subscribe Subscribe to polygon variable.
-% subscribe(POLYGONID) Subscribe to the VAR_SHAPE value for the maximum
-% allowed interval.
-% subscribe(POLYGONID,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS for the maximum allowed interval.
-% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
-% allowed end time.
-% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
-% END.
-% A call to this function clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $
-
-global polygonSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'polygon.subscribe';
-p.addRequired('polygonID', at ischar)
-p.addOptional('varIDs', {constants.VAR_SHAPE}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(polygonID, varargin{:})
-polygonID = p.Results.polygonID;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-polygonSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.polygon);
-
-polygonSubscriptionResults.reset()
-traci.subscribe(constants.CMD_SUBSCRIBE_POLYGON_VARIABLE,...
- subscriptionBegin, subscriptionEnd, polygonID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+polygon/subscribeContext.m b/tools/contributed/TraCI4Matlab/+traci/+polygon/subscribeContext.m
deleted file mode 100644
index 376d70a..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+polygon/subscribeContext.m
+++ /dev/null
@@ -1,46 +0,0 @@
-function subscribeContext(polygonID, domain, dist, varargin)
-%subscribeContext Subscribe to a polygon's context variable.
-% subscribeContext(POLYGONID,DOMAIN,DIST) Subscribe to the
-% VAR_SHAPE value of the SUMO objects that surround the polygon specified
-% by POLYGONID at a distance given by DIST, for the maximum allowed
-% interval. The type of objets that surround the polygon are defined in
-% the DOMAIN parameter. Note that not all the SUMO object types support
-% the variable VAR_SHAPE.
-% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS.
-% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
-% maximum allowed end time.
-% subscribeContext(...,END) Subscribe for the time interval defined by
-% BEGIN and END.
-% A call to this method clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $
-
-global polygonSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'polygon.subscribeContext';
-p.addRequired('polygonID', at ischar)
-p.addRequired('domain', at ischar)
-p.addRequired('dist', at isnumeric)
-p.addOptional('varIDs', {constants.VAR_SHAPE}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(polygonID, domain, dist, varargin{:})
-polygonID = p.Results.polygonID;
-domain = p.Results.domain;
-dist = p.Results.dist;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-polygonSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.polygon);
-
-polygonSubscriptionResults.reset()
-traci.subscribeContext(constants.CMD_SUBSCRIBE_POLYGON_CONTEXT,...
- subscriptionBegin, subscriptionEnd, polygonID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+route/add.m b/tools/contributed/TraCI4Matlab/+traci/+route/add.m
deleted file mode 100644
index 423c9ec..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+route/add.m
+++ /dev/null
@@ -1,22 +0,0 @@
-function add(routeID, edges)
-%add Add a route to the SUMO simulation.
-% add(ROUTEID,EDGES) Adds a route with the id ROUTEID comprised of the
-% given edges. EDGES is a cell array of strings containing the IDs of the
-% edges.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: add.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_ROUTE_VARIABLE, constants.ADD, routeID,...
- 1+4+sum(cellfun('length', edges))+4*length(edges));
-message.string = [message.string uint8(sscanf(constants.TYPE_STRINGLIST,'%x')) ...
- traci.packInt32(length(edges))];
-for i=1:length(edges)
- message.string = [message.string traci.packInt32(length(edges{i})) ...
- uint8(edges{i})];
-end
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+route/getContextSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+route/getContextSubscriptionResults.m
deleted file mode 100644
index 11aba3e..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+route/getContextSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function ContextSubscriptionResults = getContextSubscriptionResults(routeID)
-%getContextSubscriptionResults Get the context subscription results for the
-% last time step.
-% contextSubscriptionResults = getContextSubscriptionResults(ROUTEID)
-% Returns the context subscription results for the last time step and the
-% given route. If no route id is given, all subscription results are
-% returned in a containers.Map data struccure. If the route id is unknown
-% or the subscription did for any reason return no data, 'None' is
-% returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global routeSubscriptionResults
-if isempty(routeSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- routeID=None;
-end
-ContextSubscriptionResults = routeSubscriptionResults.getContext(routeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+route/getEdges.m b/tools/contributed/TraCI4Matlab/+traci/+route/getEdges.m
deleted file mode 100644
index 1c38093..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+route/getEdges.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function edges = getEdges(routeID)
-%getEdges Return the edges of the route.
-% edges = getEdges(ROUTEID) Returns a list of all edges in the route. The
-% list of edges is a cell array of strings whose elements are the IDs of
-% the edges.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getEdges.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-edges = traci.route.getUniversal(constants.VAR_EDGES, routeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+route/getIDList.m b/tools/contributed/TraCI4Matlab/+traci/+route/getIDList.m
deleted file mode 100644
index 81f53b0..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+route/getIDList.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function IDList = getIDList()
-%getIDList Get the IDs of the routes in the network.
-% IDList = getIDList() Returns a cell array of strings containing the IDs
-% of the routes in the SUMO network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-IDList = traci.route.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+route/getSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+route/getSubscriptionResults.m
deleted file mode 100644
index 7e2c4b2..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+route/getSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function subscriptionResults = getSubscriptionResults(routeID)
-%getSubscriptionResults Get the subscription results for the last time step.
-% subscriptionResults = getSubscriptionResults(ROUTEID) Returns the
-% subscription results for the last time step and the given route. If no
-% route id is given, all subscription results are returned in a
-% containers.Map data structure.
-% If the route id is unknown or the subscription did for any reason return
-% no data, 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global routeSubscriptionResults
-if isempty(routeSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- routeID = 'None';
-end
-
-subscriptionResults = routeSubscriptionResults.get(routeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+route/getUniversal.m b/tools/contributed/TraCI4Matlab/+traci/+route/getUniversal.m
deleted file mode 100644
index bc2974f..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+route/getUniversal.m
+++ /dev/null
@@ -1,25 +0,0 @@
-function returnedValue = getUniversal(varID, routeID)
-%getUniversal An internal function to send the get command and read the
-%variable value.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global routeSubscriptionResults
-
-if isempty(routeSubscriptionResults)
- returnValueFunc = traci.RETURN_VALUE_FUNC.route;
-else
- returnValueFunc = routeSubscriptionResults.valueFunc;
-end
-
-% Prepare the outgoing message and read the response. The result variable
-% is a traci.Storage object
-result = traci.sendReadOneStringCmd(constants.CMD_GET_ROUTE_VARIABLE,varID,routeID);
-handleReturValueFunc = str2func(returnValueFunc(varID));
-
-% Use the proper method to read the variable of interest from the result
-returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+route/subscribe.m b/tools/contributed/TraCI4Matlab/+traci/+route/subscribe.m
deleted file mode 100644
index 6dbc732..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+route/subscribe.m
+++ /dev/null
@@ -1,38 +0,0 @@
-function subscribe(routeID, varargin)
-%subscribe Subscribe to route variable.
-% subscribe(ROUTEID) Subscribe to the ID_LIST value for the maximum
-% allowed interval.
-% subscribe(ROUTEID,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS for the maximum allowed interval.
-% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
-% allowed end time.
-% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
-% END.
-% A call to this function clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $
-
-global routeSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'route.subscribe';
-p.addRequired('routeID', at ischar)
-p.addOptional('varIDs', {constants.ID_LIST}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(routeID, varargin{:})
-routeID = p.Results.routeID;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-routeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.route);
-
-routeSubscriptionResults.reset()
-traci.subscribe(constants.CMD_SUBSCRIBE_ROUTE_VARIABLE,...
- subscriptionBegin, subscriptionEnd, routeID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+route/subscribeContext.m b/tools/contributed/TraCI4Matlab/+traci/+route/subscribeContext.m
deleted file mode 100644
index d0b588c..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+route/subscribeContext.m
+++ /dev/null
@@ -1,45 +0,0 @@
-function subscribeContext(routeID, domain, dist, varargin)
-%subscribeContext Subscribe to a route's context variable.
-% subscribeContext(ROUTEID,DOMAIN,DIST) Subscribe to the ID_LIST value of
-% the SUMO objects that surround the route specified by ROUTEID at a
-% distance given by DIST, for the maximum allowed interval. The type of
-% objets that surround the route are defined in the DOMAIN parameter.
-% Note that not all the SUMO object types support the variable ID_LIST.
-% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS.
-% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
-% maximum allowed end time.
-% subscribeContext(...,END) Subscribe for the time interval defined by
-% BEGIN and END.
-% A call to this method clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $
-
-global routeSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'route.subscribeContext';
-p.addRequired('routeID', at ischar)
-p.addRequired('domain', at ischar)
-p.addRequired('dist', at isnumeric)
-p.addOptional('varIDs', {constants.ID_LIST}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(routeID, domain, dist, varargin{:})
-routeID = p.Results.routeID;
-domain = p.Results.domain;
-dist = p.Results.dist;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-routeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.route);
-
-routeSubscriptionResults.reset()
-traci.subscribeContext(constants.CMD_SUBSCRIBE_ROUTE_CONTEXT,...
- subscriptionBegin, subscriptionEnd, routeID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/convert2D.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/convert2D.m
deleted file mode 100644
index eda9907..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/convert2D.m
+++ /dev/null
@@ -1,38 +0,0 @@
-function [x y] = convert2D(edgeID, pos, laneIndex, toGeo)
-%convert2D Convert to absolute coordinates from those relative to an edge.
-% [X,Y] = convert2D(EDGEID,POS) Converts from the position POS relative
-% to the edge EDGEID to absolute coordinates.
-% [X,Y] = convert2D(...,LANEINDEX) Specify the index of the edge's lane.
-% [X,Y] = convert2D(...,TOGEO) Specify if the conversion is made to
-% geo-coordinates, in this case, X is the longitude and Y is the latitude.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: convert2D.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-if nargin < 4
- toGeo = false;
- if nargin < 3
- laneIndex = 0;
- end
-end
-
-posType = sscanf(constants.POSITION_2D,'%x');
-
-if toGeo
- posType = sscanf(constants.POSITION_LON_LAT,'%x');
-end
-traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION,...
- '', 1+4 + 1+4+length(edgeID)+8+1 + 1+1);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(2)];
-message.string = [message.string uint8(sscanf(constants.POSITION_ROADMAP,'%x')) ...
- traci.packInt32(length(edgeID)) uint8(edgeID)];
-message.string = [message.string traci.packInt64(pos) ...
- uint8([laneIndex sscanf(constants.TYPE_UBYTE,'%x') posType])];
-result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION, '');
-x = result.readDouble;
-y = result.readDouble;
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/convertGeo.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/convertGeo.m
deleted file mode 100644
index d68aed5..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/convertGeo.m
+++ /dev/null
@@ -1,38 +0,0 @@
-function [longitude latitude] = convertGeo(x, y, fromGeo)
-%convertGeo Convert to geo-coordinates.
-% [LONGITUDE,LATITUDE] = convertGeo(X,Y) Converts the position specified
-% by X and Y to geo-coordinates. Cartesian coordinates are assumed for
-% the input.
-% [X Y] = convert2D(...,FROMGEO) Specify if the conversion is to be
-% made from geo-coordinates, in this case, X is the longitude and Y is
-% the latitude.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: convertGeo.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-if nargin < 3
- fromGeo = false;
-end
-
-fromType = sscanf(constants.POSITION_2D,'%x');
-toType = sscanf(constants.POSITION_LON_LAT,'%x');
-
-if fromGeo
- fromType = sscanf(constants.POSITION_LON_LAT,'%x');
- toType = sscanf(constants.POSITION_2D,'%x');
-end
-
-traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION,...
- '', 1+4 + 1+8+8 + 1+1);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(2)];
-message.string = [message.string uint8(fromType) ...
- traci.packInt64([y x])];
-message.string = [message.string uint8([sscanf(constants.TYPE_UBYTE,'%x') toType])];
-result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION, '');
-longitude = result.readDouble;
-latitude = result.readDouble;
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/convertRoad.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/convertRoad.m
deleted file mode 100644
index 96f461d..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/convertRoad.m
+++ /dev/null
@@ -1,38 +0,0 @@
-function [roadID pos laneID] = convertRoad(x, y, isGeo)
-%convertRoad Convert to coordinates relative to a road from absolute coordinates.
-% [ROADID POS LANEID] = convertRoad(X,Y) Converts from the absolute
-% position defined by X and Y, to a position POS relative to the road
-% ROADID and the lane LANEID. Cartesian coordinates are assumed for the
-% input.
-% [ROADID POS LANEID] = convertRoad(...,ISGEO) Specify if the absolute
-% input position is in geo-coordinates.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: convertRoad.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-if nargin < 3
- isGeo = false;
-end
-
-posType = sscanf(constants.POSITION_2D,'%x');
-
-if isGeo
- posType = sscanf(constants.POSITION_LON_LAT,'%x');
-end
-
-traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION,...
- '', 1+4 + 1+8+8 + 1+1);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(2)];
-message.string = [message.string uint8(posType) ...
- traci.packInt64([y x])];
-message.string = [message.string uint8([sscanf(constants.TYPE_UBYTE,'%x') ...
- sscanf(constants.POSITION_ROADMAP,'%x')])];
-result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION, '');
-roadID = result.readString();
-pos = result.readDouble();
-laneID = result.read(1);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getArrivedIDList.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getArrivedIDList.m
deleted file mode 100644
index 20edaf4..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getArrivedIDList.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function arrivedIDList = getArrivedIDList()
-%getArrivedIDList Get the list of arrived vehicles.
-% arrivedIDList = getArrivedIDList() Returns a cell array of strings that
-% contains the IDs of the vehicles which arrived (have reached their
-% destination and are removed from the road network) in this time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getArrivedIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-arrivedIDList = traci.simulation.getUniversal(constants.VAR_ARRIVED_VEHICLES_IDS);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getArrivedNumber.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getArrivedNumber.m
deleted file mode 100644
index 642aa5d..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getArrivedNumber.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function arrivedNumber = getArrivedNumber()
-%getArrivedNumber Get the number of arrived vehicles.
-% arrivedNumber = getArrivedNumber() Returns the number of vehicles which
-% arrived (have reached their destination and are removed from the road
-% network) in this time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getArrivedNumber.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-arrivedNumber = traci.simulation.getUniversal(constants.VAR_ARRIVED_VEHICLES_NUMBER);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getCurrentTime.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getCurrentTime.m
deleted file mode 100644
index 8f2469a..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getCurrentTime.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function currentTime = getCurrentTime()
-%getCurrentTime
-% currentTime = getCurrentTime() Returns the current simulation time in
-% ms.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getCurrentTime.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-currentTime = traci.simulation.getUniversal(constants.VAR_TIME_STEP);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getDeltaT.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getDeltaT.m
deleted file mode 100644
index e596b15..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getDeltaT.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function deltaT = getDeltaT()
-%getDeltaT
-% deltaT = getDeltaT() Returns the time-step of the simulation in ms.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getDeltaT.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-deltaT = traci.simulation.getUniversal(constants.VAR_DELTA_T);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getDepartedIDList.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getDepartedIDList.m
deleted file mode 100644
index 5e1efb6..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getDepartedIDList.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function departedIDList = getDepartedIDList()
-%getDepartedIDList Get the IDs of departed vehicles.
-% departedIDList = getDepartedIDList() Returns a cell array of strings
-% containing the ids of vehicles which departed (were inserted into the
-% road network) in this time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getDepartedIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-departedIDList = traci.simulation.getUniversal(constants.VAR_DEPARTED_VEHICLES_IDS);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getDepartedNumber.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getDepartedNumber.m
deleted file mode 100644
index d3685ed..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getDepartedNumber.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function departedNumber = getDepartedNumber()
-%getDepartedNumber Get the number of departed vehicles.
-% departedNumber = getDepartedNumber() Returns the number of vehicles
-% which departed (were inserted into the road network) in this time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getDepartedNumber.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-departedNumber = traci.simulation.getUniversal(constants.VAR_DEPARTED_VEHICLES_NUMBER);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getDistance2D.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getDistance2D.m
deleted file mode 100644
index 5decf2c..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getDistance2D.m
+++ /dev/null
@@ -1,46 +0,0 @@
-function distance2D = getDistance2D(x1, y1, x2, y2, isGeo, isDriving)
-%getDistance2D Get the distance between two coordinates.
-% distance2D = getDistance2D(X1,Y1,X2,Y2) Returns the distance between
-% the points defined by the 2D coordinates (X1,Y1) and (X2,Y2).
-% Cartesian coordinates are assumed.
-% distance2D = getDistance2D(...,ISGEO) Specify wether the inputs are
-% in geo-coordinates.
-% distance2D = getDistance2D(...,ISDRIVING) Specify wether the air or the
-% driving distance shall be computed.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getDistance2D.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-if nargin < 6
- isDriving = false;
- if nargin < 5
- isGeo = false;
- end
-end
-
-posType = sscanf(constants.POSITION_2D,'%x');
-
-if isGeo
- posType = sscanf(constants.POSITION_LON_LAT,'%x');
-end
-
-distType = sscanf(constants.REQUEST_AIRDIST,'%x');
-
-if isDriving
- distType = sscanf(constants.REQUEST_DRIVINGDIST,'%x');
-end
-
-traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.DISTANCE_REQUEST,...
- '', 1+4 + 1+8+8 + 1+8+8 + 1);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(3)];
-message.string = [message.string uint8(posType) ...
- traci.packInt64([y1 x1])];
-message.string = [message.string uint8(posType) ...
- traci.packInt64([y2 x2]) uint8(distType)];
-result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.DISTANCE_REQUEST, '');
-distance2D = result.readDouble();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getDistanceRoad.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getDistanceRoad.m
deleted file mode 100644
index c4a36b3..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getDistanceRoad.m
+++ /dev/null
@@ -1,36 +0,0 @@
-function distanceRoad = getDistanceRoad(edgeID1, pos1, edgeID2, pos2, isDriving)
-%getDistanceRoad Get the distance between two relative-to-edge positions.
-% distanceRoad = getDistanceRoad(EDGEID1,POS1,EDGEID2,POS2) Returns the
-% distance between the points defined by the relative-to-edge positions
-% (EDGEID1,POS1) and (EDGEID2,POS2).
-% distance2D = getDistance2D(...,ISDRIVING) Specify wether the air or the
-% driving distance shall be computed.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getDistanceRoad.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-if nargin < 5
- isDriving = false;
-end
-
-distType = sscanf(constants.REQUEST_AIRDIST,'%x');
-
-if isDriving
- distType = sscanf(constants.REQUEST_DRIVINGDIST,'%x');
-end
-
-traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.DISTANCE_REQUEST,...
- '', 1+4 + 1+4+length(edgeID1)+8+1 + 1+4+length(edgeID2)+8+1 + 1);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(3)];
-message.string = [message.string uint8(sscanf(constants.POSITION_ROADMAP,'%x')) ...
- traci.packInt32(length(edgeID1)) uint8(edgeID1)];
-message.string = [message.string traci.packInt64(pos1) uint8([0 sscanf(constants.POSITION_ROADMAP,'%x')]) ...
- traci.packInt32(length(edgeID2)) uint8(edgeID2)];
-message.string = [message.string traci.packInt64(pos2) uint8([0 distType])];
-result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.DISTANCE_REQUEST, '');
-distanceRoad = result.readDouble;
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getEndingTeleportIDList.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getEndingTeleportIDList.m
deleted file mode 100644
index 7608cb0..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getEndingTeleportIDList.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function endingTeleportIDList = getEndingTeleportIDList()
-%getEndingTeleportIDList Get the IDs of teleported vehicles.
-% endingTeleportIDList = getEndingTeleportIDList() Returns a cell array
-% of strings containing the IDs of the vehicles which ended to be
-% teleported in this time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getEndingTeleportIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-endingTeleportIDList = traci.simulation.getUniversal(constants.VAR_TELEPORT_ENDING_VEHICLES_IDS);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getEndingTeleportNumber.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getEndingTeleportNumber.m
deleted file mode 100644
index dbfd5f4..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getEndingTeleportNumber.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function endingTeleportNumber = getEndingTeleportNumber()
-%getEndingTeleportNumber Get the number teleported vehicles.
-% endingTeleportNumber = getEndingTeleportNumber() Returns the number of
-% vehicles which ended to be teleported in this time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getEndingTeleportNumber.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-endingTeleportNumber = traci.simulation.getUniversal(constants.VAR_TELEPORT_ENDING_VEHICLES_NUMBER);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getLoadedIDList.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getLoadedIDList.m
deleted file mode 100644
index a095d24..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getLoadedIDList.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function loadedIDList = getLoadedIDList()
-%getLoadedIDList Get the IDs of loaded vehicles.
-% loadedIDList = getLoadedIDList() Returns a cell array of strings
-% cotaining the ids of the vehicles which were loaded in this time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLoadedIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-loadedIDList = traci.simulation.getUniversal(constants.VAR_LOADED_VEHICLES_IDS);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getLoadedNumber.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getLoadedNumber.m
deleted file mode 100644
index 030ad50..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getLoadedNumber.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function loadedNumber = getLoadedNumber()
-%getLoadedNumber Get the number loaded vehicles.
-% loadedNumber = getLoadedNumber() Returns the number of vehicles which
-% were loaded in this time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLoadedNumber.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-loadedNumber = traci.simulation.getUniversal(constants.VAR_LOADED_VEHICLES_NUMBER);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getMinExpectedNumber.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getMinExpectedNumber.m
deleted file mode 100644
index 769a978..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getMinExpectedNumber.m
+++ /dev/null
@@ -1,17 +0,0 @@
-function minExpectedNumber = getMinExpectedNumber()
-%getMinExpectedNumber Get the number of non-arrived vehicles.
-% minExpectedNumber = getMinExpectedNumber() Returns the number of
-% vehicles which are in the net plus the ones still waiting to start.
-% This number may be smaller than the actual number of vehicles still to
-% come because of delayed route file parsing. If the number is 0 however,
-% it is guaranteed that all route files have been parsed completely and
-% all vehicles have left the network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getMinExpectedNumber.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-minExpectedNumber = traci.simulation.getUniversal(...
- constants.VAR_MIN_EXPECTED_VEHICLES);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getNetBoundary.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getNetBoundary.m
deleted file mode 100644
index 79842d1..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getNetBoundary.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function netBoundary = getNetBoundary()
-%getNetBoundary Get the boundary box of the network.
-% netBoundary = getNetBoundary() Returns the coordinates of the
-% lower-left and the upper-right points that define the boundaries of the
-% network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getNetBoundary.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-netBoundary = traci.simulation.getUniversal(constants.VAR_NET_BOUNDING_BOX);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getStartingTeleportIDList.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getStartingTeleportIDList.m
deleted file mode 100644
index 67c96db..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getStartingTeleportIDList.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function startingTeleportIDList = getStartingTeleportIDList()
-%getStartingTeleportIDList Get the IDs of vehicles stsrting to teleport.
-% startingTeleportIDList = getStartingTeleportIDList() Returns a cell
-% array of strings containing the ids of vehicles which which started to
-% teleport in this time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getStartingTeleportIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-startingTeleportIDList = traci.simulation.getUniversal(constants.VAR_TELEPORT_STARTING_VEHICLES_IDS);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getStartingTeleportNumber.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getStartingTeleportNumber.m
deleted file mode 100644
index fb0e67e..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getStartingTeleportNumber.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function startingTeleportNumber = getStartingTeleportNumber()
-%getStartingTeleportNumber Get the number of vehicles stsrting to teleport.
-% startingTeleportNumber = getStartingTeleportNumber() Returns the number
-% of vehicles which started to teleport in this time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getStartingTeleportNumber.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-startingTeleportNumber = traci.simulation.getUniversal(constants.VAR_TELEPORT_STARTING_VEHICLES_NUMBER);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getSubscriptionResults.m
deleted file mode 100644
index c6fbd41..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getSubscriptionResults.m
+++ /dev/null
@@ -1,19 +0,0 @@
-function subscriptionResults = getSubscriptionResults()
-%getSubscriptionResults Get the subscription results for the last time step.
-% subscriptionResults = getSubscriptionResults() Returns the subscription
-% results for the last time step.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global simSubscriptionResults
-if isempty(simSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-
-subscriptionResults = simSubscriptionResults.get('x');
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/getUniversal.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/getUniversal.m
deleted file mode 100644
index 3e2d737..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/getUniversal.m
+++ /dev/null
@@ -1,25 +0,0 @@
-function returnedValue = getUniversal(varID)
-%getUniversal An internal function to send the get command and read the
-%variable value.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global simSubscriptionResults
-
-if isempty(simSubscriptionResults)
- returnValueFunc = traci.RETURN_VALUE_FUNC.simulation;
-else
- returnValueFunc = simSubscriptionResults.valueFunc;
-end
-
-% Prepare the outgoing message and read the response. The result variable
-% is a traci.Storage object
-result = traci.sendReadOneStringCmd(constants.CMD_GET_SIM_VARIABLE,varID,'');
-handleReturValueFunc = str2func(returnValueFunc(varID));
-
-% Use the proper method to read the variable of interest from the result
-returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+simulation/subscribe.m b/tools/contributed/TraCI4Matlab/+traci/+simulation/subscribe.m
deleted file mode 100644
index 7ddba71..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+simulation/subscribe.m
+++ /dev/null
@@ -1,36 +0,0 @@
-function subscribe(varargin)
-%subscribe Subscribe to simulation variable.
-% subscribe() Subscribe to the VAR_DEPARTED_VEHICLES_IDS value for
-% the maximum allowed interval.
-% subscribe(VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS for the maximum allowed interval.
-% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
-% allowed end time.
-% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
-% END.
-% A call to this function clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $
-
-global simSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'simulation.subscribe';
-p.addOptional('varIDs', {constants.VAR_DEPARTED_VEHICLES_IDS}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(varargin{:})
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-simSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.simulation);
-
-simSubscriptionResults.reset()
-traci.subscribe(constants.CMD_SUBSCRIBE_SIM_VARIABLE,...
- subscriptionBegin, subscriptionEnd, 'x', varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/Logic.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/Logic.m
deleted file mode 100644
index 32983eb..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/Logic.m
+++ /dev/null
@@ -1,43 +0,0 @@
-classdef Logic
-%Logic constructs a Logic object.
-% myLogic = Logic(SUBID,TYPE,SUBPARAMETER,CURRENTPHASEINDEX,PHASES)
-% constructs a Logic object myLogic containing an ID SUBID, astarting
-% phase index CURRENTPHASEINDEX, and a cell array of traci.Phase objects,
-% PHASES, which represent the phase definitions of trafic lights' program
-% myLogic. TYPE and SUBPARAMETER are not currently implemented in SUMO
-% server, therefore, the must be set to zero.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: Logic.m 20 2015-03-02 16:52:32Z afacostag $
-
- properties
- subID
- type
- subParameter
- currentPhaseIndex
- phases
- end
- methods
- function this = Logic(subID, type, subParameter, currentPhaseIndex, phases)
- this.subID = subID;
- this.type = type;
- this.subParameter = subParameter;
- this.currentPhaseIndex = currentPhaseIndex;
- this.phases = phases;
- end
-
- function display(this)
- disp('Logic:');
- disp(['subID: ' num2str(this.subID)]);
- disp(['type: ' num2str(this.type)]);
- disp(['subParameter: ' num2str(this.subParameter)]);
- disp(['currentPhaseIndex: ' num2str(this.currentPhaseIndex)]);
- for i=1:length(this.phases)
- display(this.phases{i});
- end
- end
-
- end
-end
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/Phase.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/Phase.m
deleted file mode 100644
index b99270e..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/Phase.m
+++ /dev/null
@@ -1,38 +0,0 @@
-classdef Phase
-%Phase Construct a Phase object for TraCI traffic lights.
-% myPhase = Phase(DURATION,DURATION1,DURATION2,PHASEDEF) Constructs a
-% Phase object with the properties DURATION, DURATION1, which is the min
-% duration in miliseconds; DURATION2, which is the max duration in
-% miliseconds and PHASEDEF, which is a string of light definitions from
-% rRgGyYoO for red, green, yellow, off, where lower case letters mean
-% that the stream has to decelerate.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: Phase.m 20 2015-03-02 16:52:32Z afacostag $
-
- properties
- duration
- duration1
- duration2
- phaseDef
- end
- methods
- function this = Phase(duration, duration1, duration2, phaseDef)
- this.duration = duration;
- this.duration1 = duration1;
- this.duration2 = duration2;
- this.phaseDef = phaseDef;
- end
-
- function display(this)
- disp('Phase:');
- disp(['duration: ' num2str(this.duration)]);
- disp(['duration1: ' num2str(this.duration1)]);
- disp(['duration2: ' num2str(this.duration1)]);
- disp(['phaseDef: ' num2str(this.phaseDef)]);
- end
-
- end
-end
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getCompleteRedYellowGreenDefinition.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getCompleteRedYellowGreenDefinition.m
deleted file mode 100644
index c84d6c8..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getCompleteRedYellowGreenDefinition.m
+++ /dev/null
@@ -1,14 +0,0 @@
-function completeRedYellowGreenDefinition = getCompleteRedYellowGreenDefinition(tlsID)
-%getCompleteRedYellowGreenDefinition Get the complete traffic lights definition.
-% completeRedYellowGreenDefinition =
-% getCompleteRedYellowGreenDefinition(TLSID) Returns a
-% traci.trafficlights.Logic object that describes the atributes of the
-% traffic light definition including all the phase definitions.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getCompleteRedYellowGreenDefinition.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-completeRedYellowGreenDefinition = traci.trafficlights.getUniversal(constants.TL_COMPLETE_DEFINITION_RYG, tlsID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getContextSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getContextSubscriptionResults.m
deleted file mode 100644
index 79fb701..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getContextSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function ContextSubscriptionResults = getContextSubscriptionResults(tlsID)
-%getContextSubscriptionResults Get the context subscription results for the
-% last time step.
-% contextSubscriptionResults = getContextSubscriptionResults(TLSID)
-% Returns the context subscription results for the last time step and the
-% given traffic light. If no traffic light id is given, all subscription
-% results are returned in a containers.Map data struccure. If the traffic
-% light id is unknown or the subscription did for any reason return no
-% data, 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global tlsSubscriptionResults
-if isempty(tlsSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- tlsID=None;
-end
-ContextSubscriptionResults = tlsSubscriptionResults.getContext(tlsID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getControlledLanes.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getControlledLanes.m
deleted file mode 100644
index 728f201..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getControlledLanes.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function controlledLanes = getControlledLanes(tlsID)
-%getControlledLanes Get the controlled lanes.
-% controlledLanes = getControlledLanes(TLSID) Returns a cell array of
-% strings containing the ids of the lanes controlled by the given traffic
-% lights.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getControlledLanes.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-controlledLanes = traci.trafficlights.getUniversal(constants.TL_CONTROLLED_LANES, tlsID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getControlledLinks.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getControlledLinks.m
deleted file mode 100644
index d9c6041..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getControlledLinks.m
+++ /dev/null
@@ -1,14 +0,0 @@
-function controlledLinks = getControlledLinks(tlsID)
-%getControlledLinks Get the links controlled by the traffic light.
-% controlledLinks = getControlledLinks(tlsID) Returns a cell array
-% containing the links controlled by the traffic light, sorted by the
-% signal index and described by giving the incoming, outgoing, and via
-% lane.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getControlledLinks.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-controlledLinks = traci.trafficlights.getUniversal(constants.TL_CONTROLLED_LINKS, tlsID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getIDList.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getIDList.m
deleted file mode 100644
index ac7ce7a..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getIDList.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function IDList = getIDList()
-%getIDList Get the IDs of the traffic lights in the network.
-% IDList = getIDList() Returns a cell array of strings containing the IDs
-% of the traffic lights in the SUMO network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-IDList = traci.trafficlights.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getNextSwitch.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getNextSwitch.m
deleted file mode 100644
index 2cf4317..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getNextSwitch.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function nextSwitch = getNextSwitch(tlsID)
-%getNextSwitch.
-% nextSwitch = getNextSwitch(TLSID) Returns the time in ms at which the
-% next phase change will be performed.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getNextSwitch.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-nextSwitch = traci.trafficlights.getUniversal(constants.TL_NEXT_SWITCH, tlsID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getPhase.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getPhase.m
deleted file mode 100644
index 8a5bbf4..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getPhase.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function phase = getPhase(tlsID)
-%getPhase Get the phase index.
-% phase = getPhase(TLSID) Returns the current phase index of
-% given trafficlights.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getPhase.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-phase = traci.trafficlights.getUniversal(constants.TL_CURRENT_PHASE, tlsID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getProgram.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getProgram.m
deleted file mode 100644
index ebb0f99..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getProgram.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function program = getProgram(tlsID)
-%getProgram
-% program = getProgram(TLSID) Returns the id of the current program.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getProgram.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-program = traci.trafficlights.getUniversal(constants.TL_CURRENT_PROGRAM, tlsID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getRedYellowGreenState.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getRedYellowGreenState.m
deleted file mode 100644
index dc5b024..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getRedYellowGreenState.m
+++ /dev/null
@@ -1,14 +0,0 @@
-function redYellowGreenState = getRedYellowGreenState(tlsID)
-%getRedYellowGreenState Get the traffic lights' state.
-% redYellowGreenState = getRedYellowGreenState(TLSID) Returns the named
-% tl's state as a string of light definitions from rRgGyYoO, for red,
-% green, yellow, off, where lower case letters mean that the stream has
-% to decelerate.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getRedYellowGreenState.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-redYellowGreenState = traci.trafficlights.getUniversal(constants.TL_RED_YELLOW_GREEN_STATE, tlsID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getSubscriptionResults.m
deleted file mode 100644
index 8ff406f..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getSubscriptionResults.m
+++ /dev/null
@@ -1,27 +0,0 @@
-function subscriptionResults = getSubscriptionResults(tlsID)
-%getSubscriptionResults Get the subscription results for the last time step.
-% subscriptionResults = getSubscriptionResults(TLSID) Returns the
-% subscription results for the last time step and the given traffic
-% lights. If no traffic lights id is given, all subscription results are
-% returned in a containers.Map data structure.
-% If the traffic lights id is unknown or the subscription did for any reason return
-% no data, 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global tlSubscriptionResults
-if isempty(tlSubscriptionResults)
- traci.close();
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- tlsID = 'None';
-end
-
-subscriptionResults = tlSubscriptionResults.get(tlsID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getUniversal.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getUniversal.m
deleted file mode 100644
index 9c8a0c3..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getUniversal.m
+++ /dev/null
@@ -1,25 +0,0 @@
-function returnedValue = getUniversal(varID, tlsID)
-%getUniversal An internal function to send the get command and read the
-%variable value.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global tlsSubscriptionResults
-
-if isempty(tlsSubscriptionResults)
- returnValueFunc = traci.RETURN_VALUE_FUNC.trafficlights;
-else
- returnValueFunc = tlsSubscriptionResults.valueFunc;
-end
-
-% Prepare the outgoing message and read the response. The result variable
-% is a traci.Storage object
-result = traci.sendReadOneStringCmd(constants.CMD_GET_TL_VARIABLE,varID,tlsID);
-handleReturValueFunc = str2func(returnValueFunc(varID));
-
-% Use the proper method to read the variable of interest from the result
-returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/readLinks.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/readLinks.m
deleted file mode 100644
index e687c48..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/readLinks.m
+++ /dev/null
@@ -1,22 +0,0 @@
-function signals = readLinks(result)
-%readLinks Internal function to read the links controlled by the traffic lights.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: readLinks.m 20 2015-03-02 16:52:32Z afacostag $
-
-result.readLength();
-nbSignals = result.readInt(); % Length
-signals = cell(1,nbSignals);
-for i=1:nbSignals
- result.read(1); % Type of Number of Controlled Links
- nbControlledLinks = result.readInt(); % Number of Controlled Links
- controlledLinks = cell(1,nbControlledLinks);
- for j=1:nbControlledLinks
- result.read(1); % Type of Link j
- link = result.readStringList(); % Link j
- controlledLinks{j} = link;
- end
- signals(i) = controlledLinks;
-end
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/readLogics.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/readLogics.m
deleted file mode 100644
index c4bd4c9..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/readLogics.m
+++ /dev/null
@@ -1,38 +0,0 @@
-function logics = readLogics(result)
-%readLogics Internal function to read the complete program of the traffic lights.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: readLogics.m 20 2015-03-02 16:52:32Z afacostag $
-
-result.readLength();
-nbLogics = result.readInt(); % Number of logics
-logics = cell(1,nbLogics);
-for i=1:nbLogics
- result.read(1); % Type of SubID
- subID = result.readString();
- result.read(1); % Type of Type
- type = result.readInt(); % Type
- result.read(1); % Type of SubParameter
- subParameter = result.readInt(); % SubParameter
- result.read(1); % Type of Current phase index
- currentPhaseIndex = result.readInt(); % Current phase index
- result.read(1); % Type of Number of phases
- nbPhases = result.readInt(); % Number of phases
- phases = cell(1,nbPhases);
- for j=1:nbPhases
- result.read(1); % Type of Duration
- duration = result.readInt(); % Duration
- result.read(1); % Type of Duration1
- duration1 = result.readInt(); % Duration1
- result.read(1); % Type of Duration2
- duration2 = result.readInt(); % Duration2
- result.read(1); % Type of Phase Definition
- phaseDef = result.readString(); % Phase Definition
- phase = traci.trafficlights.Phase(duration, duration1, duration2, phaseDef);
- phases{j} = phase;
- end
- logic = traci.trafficlights.Logic(subID, type, subParameter, currentPhaseIndex, phases);
- logics{i} = logic;
-end
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setCompleteRedYellowGreenDefinition.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setCompleteRedYellowGreenDefinition.m
deleted file mode 100644
index bfae9f4..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setCompleteRedYellowGreenDefinition.m
+++ /dev/null
@@ -1,44 +0,0 @@
-function setCompleteRedYellowGreenDefinition(tlsID, tls)
-%setCompleteRedYellowGreenDefinition Set the complete definition of the traffic light.
-% setCompleteRedYellowGreenDefinition(TLSID,TLS) Sets the attributes of
-% trafic lights' definition including all the phase definitions. Those
-% attributes are included in the TLS parameter, which is a
-% traci.trafficlights.Logic object.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setCompleteRedYellowGreenDefinition.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-len = 1+4 + 1+4+length(tls.subID) + 1+4 + 1+4 + 1+4 + 1+4; % tls parameter
-itemNo = 1+1+1+1+1;
-for p=1:length(tls.phases)
- len = len + 1+4 + 1+4 + 1+4 + 1+4+length(tls.phases{p}.phaseDef);
- itemNo = itemNo + 4;
-end
-traci.beginMessage(constants.CMD_SET_TL_VARIABLE, constants.TL_COMPLETE_PROGRAM_RYG, tlsID, len);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(itemNo)];
-message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
- traci.packInt32(length(tls.subID)) uint8(tls.subID)]; % Program ID
-message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
- traci.packInt32(0)]; % Type
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(0)]; % subitems
-message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
- traci.packInt32(tls.currentPhaseIndex)];
-message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
- traci.packInt32(length(tls.phases))]; % phaseNo
-
-for i=1:length(tls.phases)
- message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
- traci.packInt32(tls.phases{i}.duration) ...
- uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(tls.phases{i}.duration1) ...
- uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(tls.phases{i}.duration2)];
- message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
- traci.packInt32(length(tls.phases{i}.phaseDef)) ...
- uint8(tls.phases{i}.phaseDef)];
-end
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setPhase.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setPhase.m
deleted file mode 100644
index b372d4a..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setPhase.m
+++ /dev/null
@@ -1,14 +0,0 @@
-function setPhase(tlsID, index)
-%setPhase Set the phase index of the traffic light.
-% setPhase(TLSID,INDEX) Sets the index of the traffic lights with ID TLSID
-% to the given in the INDEX parameter. There are as many tls indexes as
-% phase definitions in the tls program. The tls index starts from zero.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setPhase.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendIntCmd(constants.CMD_SET_TL_VARIABLE,...
- constants.TL_PHASE_INDEX, tlsID, index);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setPhaseDuration.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setPhaseDuration.m
deleted file mode 100644
index 7ae077e..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setPhaseDuration.m
+++ /dev/null
@@ -1,14 +0,0 @@
-function setPhaseDuration(tlsID, phaseDuration)
-%setPhaseDuration Set the phase duration traffic light.
-% setPhaseDuration(TLSID,PHASEDURATION) Sets the current phase's duration
-% in miliseconds of the traffic lights with ID TLSID to the given in the
-% PHASEDURATION parameter.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setPhaseDuration.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendIntCmd(constants.CMD_SET_TL_VARIABLE,...
- constants.TL_PHASE_DURATION, tlsID, 1000*phaseDuration);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setProgram.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setProgram.m
deleted file mode 100644
index 85172be..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setProgram.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setProgram(tlsID, programID)
-%setProgram
-% setProgram(TLSID,PROGRAMID)Sets the id of the current program.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setProgram.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendStringCmd(constants.CMD_SET_TL_VARIABLE,...
- constants.TL_PROGRAM, tlsID, programID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setRedYellowGreenState.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setRedYellowGreenState.m
deleted file mode 100644
index 7612962..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setRedYellowGreenState.m
+++ /dev/null
@@ -1,14 +0,0 @@
-function setRedYellowGreenState(tlsID, state)
-%setRedYellowGreenState Set the state of the traffic lights.
-% setRedYellowGreenState(TLSID,STATE) Sets the named tl's state as a
-% string of light definitions from rRgGyYoO, for red, green, yellow, off,
-% where lower case letters mean that the stream has to decelerate.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setRedYellowGreenState.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendStringCmd(constants.CMD_SET_TL_VARIABLE,...
- constants.TL_RED_YELLOW_GREEN_STATE, tlsID, state);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/subscribe.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/subscribe.m
deleted file mode 100644
index d5b2386..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/subscribe.m
+++ /dev/null
@@ -1,38 +0,0 @@
-function subscribe(tlsID, varargin)
-%subscribe Subscribe to traffic lights variable.
-% subscribe(TLSID) Subscribe to the TL_CURRENT_PHASE value for the
-% maximum allowed interval.
-% subscribe(TLSID,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS for the maximum allowed interval.
-% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
-% allowed end time.
-% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
-% END.
-% A call to this function clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $
-
-global tlSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'trafficlights.subscribe';
-p.addRequired('tlsID', at ischar)
-p.addOptional('varIDs', {constants.TL_CURRENT_PHASE}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(tlsID, varargin{:})
-tlsID = p.Results.tlsID;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-tlSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.trafficlights);
-
-tlSubscriptionResults.reset()
-traci.subscribe(constants.CMD_SUBSCRIBE_TL_VARIABLE,...
- subscriptionBegin, subscriptionEnd, tlsID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/subscribeContext.m b/tools/contributed/TraCI4Matlab/+traci/+trafficlights/subscribeContext.m
deleted file mode 100644
index 365e0af..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+trafficlights/subscribeContext.m
+++ /dev/null
@@ -1,46 +0,0 @@
-function subscribeContext(tlsID, domain, dist, varargin)
-%subscribeContext Subscribe to a traffic lights's context variable.
-% subscribeContext(TLSID,DOMAIN,DIST) Subscribe to the TL_CURRENT_PHASE
-% value of the SUMO objects that surround the traffic lights specified by
-% TLSID at a distance given by DIST, for the maximum allowed interval.
-% The type of objets that surround the traffic lights are defined in the
-% DOMAIN parameter. Note that not all the SUMO object types support the
-% variable TL_CURRENT_PHASE.
-% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS.
-% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
-% maximum allowed end time.
-% subscribeContext(...,END) Subscribe for the time interval defined by
-% BEGIN and END.
-% A call to this method clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $
-
-global tlsSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'trafficlights.subscribeContext';
-p.addRequired('tlsID', at ischar)
-p.addRequired('domain', at ischar)
-p.addRequired('dist', at isnumeric)
-p.addOptional('varIDs', {constants.TL_CURRENT_PHASE}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(tlsID, domain, dist, varargin{:})
-tlsID = p.Results.tlsID;
-domain = p.Results.domain;
-dist = p.Results.dist;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-tlsSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.trafficlights);
-
-tlsSubscriptionResults.reset()
-traci.subscribeContext(constants.CMD_SUBSCRIBE_TL_CONTEXT,...
- subscriptionBegin, subscriptionEnd, tlsID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/add.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/add.m
deleted file mode 100644
index 13b0532..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/add.m
+++ /dev/null
@@ -1,57 +0,0 @@
-function add(vehID, routeID, varargin)
-%add Get the traffic lights' state.
-% add(VEHID,ROUTEID) Adds a vehicle in the current time-step with ID
-% VEHID and assigns the route with ID ROUTEID to it.
-% add(...,DEPART) Specify the departure time in seconds.
-% add(...,POS) Specify the position relative to the starting lane.
-% add(...,SPEED) Specify the starting speed of the vehicle.
-% add(...,LANE) Specify the lane number in which the vehicle will start.
-% add(...,TYPEID) Specify the type of the vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: add.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-
-p = inputParser;
-p.FunctionName = 'vehicle.add';
-p.addRequired('vehID', at ischar)
-p.addRequired('routeID', at ischar)
-p.addOptional('depart', -2, @isnumeric) % -2 = DEPART_NOW
-p.addOptional('pos', 0, @isnumeric)
-p.addOptional('speed', 0, @isnumeric)
-p.addOptional('lane', 0, @isnumeric)
-p.addOptional('typeID', 'DEFAULT_VEHTYPE', @ischar)
-p.parse(vehID, routeID, varargin{:})
-
-vehID = p.Results.vehID;
-routeID = p.Results.routeID;
-depart = p.Results.depart;
-pos = p.Results.pos;
-speed = p.Results.speed;
-lane = p.Results.lane;
-typeID = p.Results.typeID;
-
-
-traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.ADD, vehID,...
- 1+4 + 1+4+length(typeID) + 1+4+length(routeID) + 1+4 + 1+8 + 1+8 + 1+1);
-if depart > 0
- depart = depart*1000;
-end
-
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(6)];
-message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
- traci.packInt32(length(typeID)) uint8(typeID)];
-message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
- traci.packInt32(length(routeID)) uint8(routeID)];
-message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
- traci.packInt32(depart)];
-message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
- traci.packInt64(pos) uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
- traci.packInt64(speed)];
-message.string = [message.string uint8([sscanf(constants.TYPE_BYTE,'%x') uint8(lane)])];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/changeLane.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/changeLane.m
deleted file mode 100644
index dc32b0a..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/changeLane.m
+++ /dev/null
@@ -1,20 +0,0 @@
-function changeLane(vehID, laneIndex, duration)
-%add Make the vehicle to switch the lane.
-% changeLane(VEHID,LANEINDEX,DURATION) Makes the vehicle with ID VEHID to
-% change the lane to the specified in the index LANEINDEX for the given
-% time duration.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: changeLane.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_CHANGELANE,...
- vehID, 1+4+1+1+1+4);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(2) uint8([sscanf(constants.TYPE_BYTE,'%x') ...
- laneIndex sscanf(constants.TYPE_INTEGER,'%x')]) ...
- traci.packInt32(duration)];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/changeTarget.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/changeTarget.m
deleted file mode 100644
index cecd8c1..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/changeTarget.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function changeTarget(vehID, edgeID)
-%changeTarget Change the vehicle's destination.
-% changeTarget(VEHID,EDGEID) Changes the vehicle's destination edge to
-% the given. The route is rebuilt.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: changeTarget.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_CHANGETARGET, vehID, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAccel.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAccel.m
deleted file mode 100644
index f03b37a..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAccel.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function accel = getAccel(vehID)
-%getAccel Get the acceleration of the vehicle.
-% accel = getAccel(VEHID) Returns the maximum acceleration possibility in
-% m/s^2 of this vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getAccel.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-accel = traci.vehicle.getUniversal(constants.VAR_ACCEL, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAdaptedTraveltime.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAdaptedTraveltime.m
deleted file mode 100644
index 26530c5..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAdaptedTraveltime.m
+++ /dev/null
@@ -1,21 +0,0 @@
-function adaptedTraveltime = getAdaptedTraveltime(vehID, time, edgeID)
-%getAdaptedTraveltime
-% adaptedTraveltime = getAdaptedTraveltime(VEHID,TIME,EDGEID) Returns the
-% edge travel time for the given time as stored in the vehicle's internal
-% container. If such a value does not exist, -1 is returned.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getAdaptedTraveltime.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_EDGE_TRAVELTIME,...
- vehID, 1+4+1+4+1+4+length(edgeID));
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) traci.packInt32(2) ...
- uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(time) ...
- uint8(sscanf(constants.TYPE_STRING,'%x')) traci.packInt32(length(edgeID)) ...
- uint8(edgeID)];
-result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_EDGE_TRAVELTIME, vehID);
-adaptedTraveltime = result.readDouble();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAngle.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAngle.m
deleted file mode 100644
index 3a563ff..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAngle.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function angle = getAngle(vehID)
-%getAngle Get the angle of the vehicle.
-% angle = getAngle(VEHID) Returns the angle in degrees of the named
-% vehicle within the last step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getAngle.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-angle = traci.vehicle.getUniversal(constants.VAR_ANGLE, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getBestLanes.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getBestLanes.m
deleted file mode 100644
index 31fc31e..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getBestLanes.m
+++ /dev/null
@@ -1,14 +0,0 @@
-function bestLanes = getBestLanes(vehID)
-%getBestLanes
-% bestLanes = getBestLanes(VEHID) Returns information about the wish to
-% use subsequent edges' lanes, which is stored in a cell array. The
-% information includes laneID, length, occupation, offset,
-% allowsContinuation and nextLanes.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getBestLanes.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-bestLanes = traci.vehicle.getUniversal(constants.VAR_BEST_LANES, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getCO2Emission.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getCO2Emission.m
deleted file mode 100644
index 1063e93..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getCO2Emission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function CO2Emission = getCO2Emission(vehID)
-%getCO2Emission Returns the CO2 emission of the vehicle.
-% CO2Emission = getCO2Emission(VEHID) Returns the CO2 emission in mg for
-% the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getCO2Emission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-CO2Emission = traci.vehicle.getUniversal(constants.VAR_CO2EMISSION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getCOEmission.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getCOEmission.m
deleted file mode 100644
index a5affd4..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getCOEmission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function COEmission = getCOEmission(vehID)
-%getCOEmission Returns the CO emission of the vehicle.
-% COEmission = getCO2Emission(VEHID) Returns the CO emission in mg for
-% the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getCOEmission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-COEmission = traci.vehicle.getUniversal(constants.VAR_COEMISSION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getColor.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getColor.m
deleted file mode 100644
index 4e30f98..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getColor.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function color = getColor(vehID)
-%getColor Get the color of the vehicle.
-% color = getColor(VEHID) Returns the vehicle's rgba color.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getColor.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-color = traci.vehicle.getUniversal(constants.VAR_COLOR, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getContextSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getContextSubscriptionResults.m
deleted file mode 100644
index 77bf183..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getContextSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function ContextSubscriptionResults = getContextSubscriptionResults(vehID)
-%getContextSubscriptionResults Get the context subscription results for the
-% last time step.
-% contextSubscriptionResults = getContextSubscriptionResults(VEHICLEID)
-% Returns the context subscription results for the last time step and the
-% given vehicle. If no vehicle id is given, all subscription results are
-% returned in a containers.Map data struccure. If the vehicle id is unknown
-% or the subscription did for any reason return no data, 'None' is
-% returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global vehSubscriptionResults
-if isempty(vehSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- vehID=None;
-end
-ContextSubscriptionResults = vehSubscriptionResults.getContext(vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDecel.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDecel.m
deleted file mode 100644
index 8939598..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDecel.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function decel = getDecel(vehID)
-%getDecel Returns the deceleration of the vehicle.
-% decel = getDecel(VEHID) Returns the maximum deceleration possibility
-% in m/s^2 of this vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getDecel.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-decel = traci.vehicle.getUniversal(constants.VAR_DECEL, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDrivingDistance.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDrivingDistance.m
deleted file mode 100644
index 1cfaac6..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDrivingDistance.m
+++ /dev/null
@@ -1,24 +0,0 @@
-function drivingDistance = getDrivingDistance(vehID, edgeID, pos, laneID)
-%getDrivingDistance Returns the driving distance to relative coordinate.
-% drivingDistance = getDrivingDistance(VEHID,EDGEID,POS,LANEID) Returns
-% the driving distance from the current position to the given in POS. POS
-% is a position relative to the edge identified by EDGEID and the lane
-% index specified in LANEID. If no LANEID is given, it defaults to zero.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getDrivingDistance.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-if nargin < 4
- laneID=0;
-end
-traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, constants.DISTANCE_REQUEST,...
- vehID, 1+4+1+4+length(edgeID) + 8+1+1);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) traci.packInt32(2) ...
- uint8(sscanf(constants.POSITION_ROADMAP,'%x')) traci.packInt32(length(edgeID)) uint8(edgeID)];
-message.string = [message.string traci.packInt64(pos) uint8([laneID sscanf(constants.REQUEST_DRIVINGDIST,'%x')])];
-result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, constants.DISTANCE_REQUEST, vehID);
-drivingDistance = result.readDouble();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDrivingDistance2D.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDrivingDistance2D.m
deleted file mode 100644
index 0e99aa2..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDrivingDistance2D.m
+++ /dev/null
@@ -1,19 +0,0 @@
-function drivingDistance2D = getDrivingDistance2D(vehID, x, y)
-%getDrivingDistance2D Returns the driving distance to an absolute coordinate.
-% drivingDistance2D = getDrivingDistance2D(VEHID,X,Y) Returns
-% the driving distance from the current position to that defined by the
-% coordinates X and Y.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getDrivingDistance2D.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, constants.DISTANCE_REQUEST,...
- vehID, 1+4+1+8+8+1);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) traci.packInt32(2) ...
- uint8(sscanf(constants.POSITION_2D,'%x')) traci.packInt64([y x]) uint8(sscanf(constants.REQUEST_DRIVINGDIST,'%x'))];
-result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, constants.DISTANCE_REQUEST, vehID);
-drivingDistance2D = result.readDouble();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getEffort.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getEffort.m
deleted file mode 100644
index 301afa4..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getEffort.m
+++ /dev/null
@@ -1,21 +0,0 @@
-function effort = getEffort(vehID, time, edgeID)
-%getEffort
-% effort = getEffort(VEHID,TIME,EDGEID) Returns the edge effort for the
-% given time as stored in the vehicle's internal container. If such a
-% value does not exist, -1 is returned.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getEffort.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_EDGE_EFFORT,...
- vehID, 1+4+1+4+1+4+length(edgeID));
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) traci.packInt32(2) ...
- uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(time) ...
- uint8(sscanf(constants.TYPE_STRING,'%x')) traci.packInt32(length(edgeID)) ...
- uint8(edgeID)];
-result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_EDGE_EFFORT, vehID);
-effort = result.readDouble();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getEmissionClass.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getEmissionClass.m
deleted file mode 100644
index 4db5c04..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getEmissionClass.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function emissionClass = getEmissionClass(vehID)
-%getEmissionClass
-% emissionClass = getEmissionClass(VEHID) Returns the emission class of
-% this vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getEmissionClass.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-emissionClass = traci.vehicle.getUniversal(constants.VAR_EMISSIONCLASS, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getFuelConsumption.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getFuelConsumption.m
deleted file mode 100644
index c2b6004..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getFuelConsumption.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function fuelConsumption = getFuelConsumption(vehID)
-%getFuelConsumption Get the fuel consumption of the vehicle.
-% fuelConsumption = getFuelConsumption(VEHID) Returns the fuel
-% consumption in ml for the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getFuelConsumption.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-fuelConsumption = traci.vehicle.getUniversal(constants.VAR_FUELCONSUMPTION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getHCEmission.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getHCEmission.m
deleted file mode 100644
index bc03d81..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getHCEmission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function HCEmission = getHCEmission(vehID)
-%getHCEmission Returns the HC emission of the vehicle.
-% HCEmission = getHCEmission(VEHID) Returns the HC emission in mg for
-% the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getHCEmission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-HCEmission = traci.vehicle.getUniversal(constants.VAR_HCEMISSION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getIDList.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getIDList.m
deleted file mode 100644
index a620acc..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getIDList.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function IDList = getIDList()
-%getIDList Get the IDs of the vehicles in the network.
-% IDList = getIDList() Returns a cell array of strings containing the IDs
-% of the vehicles in the SUMO network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-IDList = traci.vehicle.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getImperfection.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getImperfection.m
deleted file mode 100644
index 82abddc..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getImperfection.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function imperfection = getImperfection(vehID)
-%getImperfection Returns driver's imperfection.
-% imperfection = getImperfection(VEHID) Returns the driver's imperfection
-% (dawdling) [0,1]
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getImperfection.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-imperfection = traci.vehicle.getUniversal(constants.VAR_IMPERFECTION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLaneID.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLaneID.m
deleted file mode 100644
index c10bf5b..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLaneID.m
+++ /dev/null
@@ -1,15 +0,0 @@
-function laneID = getLaneID(vehID)
-%getLaneID
-% laneID = getLaneID(VEHID) Returns the id of the lane the named vehicle
-% was at within the last step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLaneID.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-
-
-import traci.constants
-laneID = traci.vehicle.getUniversal(constants.VAR_LANE_ID, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLaneIndex.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLaneIndex.m
deleted file mode 100644
index 347ac7d..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLaneIndex.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function laneIndex = getLaneIndex(vehID)
-%getLaneIndex
-% laneIndex = getLaneIndex(VEHID) Returns the index of the lane the named
-% vehicle was at within the last step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLaneIndex.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-laneIndex = traci.vehicle.getUniversal(constants.VAR_LANE_INDEX, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLanePosition.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLanePosition.m
deleted file mode 100644
index cb21ee3..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLanePosition.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function lanePosition = getLanePosition(vehID)
-%getLanePosition Get the position of the vehicle along the lane.
-% lanePosition = getLanePosition(VEHID) Returns the position of the
-% vehicle along the lane measured in m.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLanePosition.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-lanePosition = traci.vehicle.getUniversal(constants.VAR_LANEPOSITION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLeader.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLeader.m
deleted file mode 100644
index c0effa4..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLeader.m
+++ /dev/null
@@ -1,30 +0,0 @@
-function [vehicleID, dist] = getLeader(vehID,dist)
-% [vehicleID, dist] = getLeader(VEHID,DIST) Return the leading vehicle id
-% together with the distance.
-% The DIST parameter defines the maximum lookahead, 0 calculates a
-% lookahead from the brake gap.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id$
-
-if nargin < 2
- dist = 0;
-end
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, '0x68',...
- vehID, 1+8);
-message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x'))...
- traci.packInt64(dist)];
-
-result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, '0x68', vehID);
-
-result.readInt();
-result.read(1);
-vehicleID = result.readString();
-result.read(1);
-dist = result.readDouble();
-
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLength.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLength.m
deleted file mode 100644
index 5e70908..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLength.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function length = getLength(vehID)
-%getLength
-% length = getLength(VEHID) Returns the length in m of the given vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLength.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-length = traci.vehicle.getUniversal(constants.VAR_LENGTH, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getMaxSpeed.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getMaxSpeed.m
deleted file mode 100644
index b6ec902..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getMaxSpeed.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function maxSpeed = getMaxSpeed(vehID)
-%getMaxSpeed
-% maxSpeed = getMaxSpeed(VEHID) Returns the maximum speed in m/s of this
-% vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getMaxSpeed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-maxSpeed = traci.vehicle.getUniversal(constants.VAR_MAXSPEED, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getMinGap.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getMinGap.m
deleted file mode 100644
index 7ffcf7e..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getMinGap.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function minGap = getMinGap(vehID)
-%getMinGap
-% minGap = getMinGap(VEHID) Returns the offset (gap to front vehicle if
-% halting) of this vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getMinGap.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-minGap = traci.vehicle.getUniversal(constants.VAR_MINGAP, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getNOxEmission.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getNOxEmission.m
deleted file mode 100644
index 15cb978..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getNOxEmission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function NOxEmission = getNOxEmission(vehID)
-%getNOxEmission Get the NOx emission of the vehicle.
-% NOxEmission = getNOxEmission(VEHID) Returns the NOx emission in mg for
-% the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getNOxEmission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-NOxEmission = traci.vehicle.getUniversal(constants.VAR_NOXEMISSION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getNoiseEmission.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getNoiseEmission.m
deleted file mode 100644
index 0fa6c4c..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getNoiseEmission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function noiseEmission = getNoiseEmission(vehID)
-%getNoiseEmission Get the noise emission of the vehicle.
-% noiseEmission = getNoiseEmission(VEHID) Returns the noise emission in
-% db for the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getNoiseEmission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-noiseEmission = traci.vehicle.getUniversal(constants.VAR_NOISEEMISSION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getPMxEmission.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getPMxEmission.m
deleted file mode 100644
index bb3b8cb..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getPMxEmission.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function PMxEmission = getPMxEmission(vehID)
-%getPmxEmission Get the particular matter emission of the vehicle.
-% pmxEmission = getPmxEmission(VEHID) Returns the particular matter
-% emission in mg for the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getPMxEmission.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-PMxEmission = traci.vehicle.getUniversal(constants.VAR_PMXEMISSION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getPosition.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getPosition.m
deleted file mode 100644
index 3dbbe70..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getPosition.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function position = getPosition(vehID)
-%getPosition
-% position = getPosition(VEHID) Returns the x,y position of the named
-% vehicle within the last step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getPosition.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-position = traci.vehicle.getUniversal(constants.VAR_POSITION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRoadID.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRoadID.m
deleted file mode 100644
index 5eea626..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRoadID.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function roadID = getRoadID(vehID)
-%getRoadID
-% roadID = getRoadID(VEHID) Returns the id of the edge the named vehicle
-% was at within the last step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getRoadID.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-roadID = traci.vehicle.getUniversal(constants.VAR_ROAD_ID, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRoute.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRoute.m
deleted file mode 100644
index 97210d3..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRoute.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function route = getRoute(vehID)
-%getRoute Get the vehicle route.
-% route = getRoute(VEHID) Returns a cell array of strings containing the
-% ids of the edges the vehicle's route is made of.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getRoute.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-route = traci.vehicle.getUniversal(constants.VAR_EDGES, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRouteID.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRouteID.m
deleted file mode 100644
index 6da58b6..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRouteID.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function routeID = getRouteID(vehID)
-%getRouteID
-% routeID = getRouteID(VEHID) Returns the id of the route of the named
-% vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getRouteID.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-routeID = traci.vehicle.getUniversal(constants.VAR_ROUTE_ID, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getShapeClass.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getShapeClass.m
deleted file mode 100644
index 4c227da..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getShapeClass.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function shapeClass = getShapeClass(vehID)
-%getShapeClass
-% shapeClass = getShapeClass(VEHID) Returns the shape class of this
-% vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getShapeClass.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-shapeClass = traci.vehicle.getUniversal(constants.VAR_SHAPECLASS, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSignals.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSignals.m
deleted file mode 100644
index de028ff..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSignals.m
+++ /dev/null
@@ -1,30 +0,0 @@
-function signals = getSignals(vehID)
-%getSignals Get the vehicle route.
-% signals = getSignals(VEHID) Returns an integer encoding the state of a
-% vehicle's signals.
-% The following table shows the defined signals.
-%
-% Name Bit
-% VEH_SIGNAL_BLINKER_RIGHT 0
-% VEH_SIGNAL_BLINKER_LEFT 1
-% VEH_SIGNAL_BLINKER_EMERGENCY 2
-% VEH_SIGNAL_BRAKELIGHT 3
-% VEH_SIGNAL_FRONTLIGHT 4
-% VEH_SIGNAL_FOGLIGHT 5
-% VEH_SIGNAL_HIGHBEAM 6
-% VEH_SIGNAL_BACKDRIVE 7
-% VEH_SIGNAL_WIPER 8
-% VEH_SIGNAL_DOOR_OPEN_LEFT 9
-% VEH_SIGNAL_DOOR_OPEN_RIGHT 10
-% VEH_SIGNAL_EMERGENCY_BLUE 11
-% VEH_SIGNAL_EMERGENCY_RED 12
-% VEH_SIGNAL_EMERGENCY_YELLOW 13
-
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSignals.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-signals = traci.vehicle.getUniversal(constants.VAR_SIGNALS, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeed.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeed.m
deleted file mode 100644
index 1a149b6..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeed.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function speed = getSpeed(vehID)
-%getSpeed Get the vehicle speed.
-% speed = getSpeed(VEHID) Returns the speed in m/s of the named vehicle
-% within the last step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSpeed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-speed = traci.vehicle.getUniversal(constants.VAR_SPEED, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedDeviation.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedDeviation.m
deleted file mode 100644
index 1a8a4e6..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedDeviation.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function speedDeviation = getSpeedDeviation(vehID)
-%getSpeedDeviation
-% speedDeviation = getSpeedDeviation(VEHID) Returns the maximum speed
-% deviation of the vehicle type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSpeedDeviation.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-speedDeviation = traci.vehicle.getUniversal(constants.VAR_SPEED_DEVIATION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedFactor.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedFactor.m
deleted file mode 100644
index 5565e7b..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedFactor.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function speedFactor = getSpeedFactor(vehID)
-%getSpeedFactor
-% speedFactor = getSpeedFactor(VEHID) Returns the chosen speed factor for
-% this vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSpeedFactor.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-speedFactor = traci.vehicle.getUniversal(constants.VAR_SPEED_FACTOR, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedWithoutTraCI.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedWithoutTraCI.m
deleted file mode 100644
index e5d7c4b..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedWithoutTraCI.m
+++ /dev/null
@@ -1,8 +0,0 @@
-function speedWithoutTraCI = getSpeedWithoutTraCI(vehID)
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSpeedWithoutTraCI.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-speedWithoutTraCI = traci.vehicle.getUniversal(constants.VAR_SPEED_WITHOUT_TRACI, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSubscriptionResults.m
deleted file mode 100644
index ffdcf22..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function subscriptionResults = getSubscriptionResults(vehID)
-%getSubscriptionResults Get the subscription results for the last time step.
-% subscriptionResults = getSubscriptionResults(VEHICLEID) Returns the
-% subscription results for the last time step and the given vehicle. If no
-% vehicle id is given, all subscription results are returned in a
-% containers.Map data structure.
-% If the vehicle id is unknown or the subscription did for any reason return
-% no data, 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global vehSubscriptionResults
-if isempty(vehSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- vehID = 'None';
-end
-
-subscriptionResults = vehSubscriptionResults.get(vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getTau.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getTau.m
deleted file mode 100644
index 24a8eb3..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getTau.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function tau = getTau(vehID)
-%getTau
-% tau = getTau(VEHID) Returns the driver's reaction time in s for this
-% vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getTau.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-tau = traci.vehicle.getUniversal(constants.VAR_TAU, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getTypeID.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getTypeID.m
deleted file mode 100644
index 0521dd7..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getTypeID.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function typeID = getTypeID(vehID)
-%getTypeID
-% typeID = getTypeID(VEHID) Returns the id of the type of the named
-% vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getTypeID.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-typeID = traci.vehicle.getUniversal(constants.VAR_TYPE, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getUniversal.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getUniversal.m
deleted file mode 100644
index e757aa2..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getUniversal.m
+++ /dev/null
@@ -1,25 +0,0 @@
-function returnedValue = getUniversal(varID, vehID)
-%getUniversal An internal function to send the get command and read the
-%variable value.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global vehSubscriptionResults
-
-if isempty(vehSubscriptionResults)
- returnValueFunc = traci.RETURN_VALUE_FUNC.vehicle;
-else
- returnValueFunc = vehSubscriptionResults.valueFunc;
-end
-
-% Prepare the outgoing message and read the response. The result variable
-% is a traci.Storage object
-result = traci.sendReadOneStringCmd(constants.CMD_GET_VEHICLE_VARIABLE,varID,vehID);
-handleReturValueFunc = str2func(returnValueFunc(varID));
-
-% Use the proper method to read the variable of interest from the result
-returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getVehicleClass.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getVehicleClass.m
deleted file mode 100644
index 16a633b..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getVehicleClass.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function vehicleClass = getVehicleClass(vehID)
-%getVehicleClass
-% vehicleClass = getVehicleClass(VEHID) Returns the vehicle class of this
-% vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getVehicleClass.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-vehicleClass = traci.vehicle.getUniversal(constants.VAR_VEHICLECLASS, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getWidth.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/getWidth.m
deleted file mode 100644
index dbd9a42..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/getWidth.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function width = getWidth(vehID)
-%getWidth
-% width = getWidth(VEHID) Returns the width in m of this vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getWidth.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-width = traci.vehicle.getUniversal(constants.VAR_WIDTH, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/isRouteValid.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/isRouteValid.m
deleted file mode 100644
index 7952f43..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/isRouteValid.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function isvalid = isRouteValid(vehID)
-%isRouteValid
-% isvalid = isRouteValid(VEHID) Determine whether the current route of the
-% vehicle is valid (i.e. all the edges along the route are connected).
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: isRouteValid.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-isvalid = traci.vehicle.getUniversal(constants.VAR_ROUTE_VALID, vehID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/moveTo.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/moveTo.m
deleted file mode 100644
index e63e561..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/moveTo.m
+++ /dev/null
@@ -1,21 +0,0 @@
-function moveTo(vehID, laneID, pos)
-%moveTo
-% moveTo(VEHID,LANEID,POS) Commands the vehicle to move to the specified
-% position on the given lane.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: moveTo.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MOVE_TO, vehID,...
- 1+4+1+4+length(laneID)+1+8);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(2)];
-message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
- traci.packInt32(length(laneID)) uint8(laneID)];
-message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
- traci.packInt32(pos)];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/moveToVTD.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/moveToVTD.m
deleted file mode 100644
index 674882f..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/moveToVTD.m
+++ /dev/null
@@ -1,22 +0,0 @@
-function moveToVTD(vehID, edgeID, lane, x, y)
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: moveToVTD.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-
-traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MOVE_TO_VTD,...
- vehID,1+4+1+4+length(edgeID)+1+4+1+8+1+8);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(4)];
-message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
- traci.packInt32(length(edgeID)) uint8(edgeID)];
-message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
- traci.packInt32(lane)];
-message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
- traci.packInt64(x)];
-message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
- traci.packInt64(y)];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/readBestLanes.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/readBestLanes.m
deleted file mode 100644
index deda8dd..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/readBestLanes.m
+++ /dev/null
@@ -1,31 +0,0 @@
-function lanes = readBestLanes(result)
-%readBestLanes Internal function to read information about the whish to use
-%subsequent edge's lanes.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: readBestLanes.m 20 2015-03-02 16:52:32Z afacostag $
-
-result.read(5);
-nbLanes = result.readInt(); % Length
-lanes = cell(1,nbLanes);
-for i=1:nbLanes
- result.read(1);
- laneID = result.readString();
- result.read(1);
- len = result.readDouble();
- result.read(1);
- occupation = result.readDouble();
- result.read(1);
- offset = result.read(1);
- result.read(1);
- allowsContinuation = result.read(1);
- result.read(1);
- nextLanesNo = result.readInt();
- nextLanes = cell(1,nextLanesNo);
- for j=1:nextLanesNo
- nextLanes{j} = result.readString();
- end
- lanes{i} = {laneID, len, occupation, offset, allowsContinuation, nextLanes};
-end
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/remove.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/remove.m
deleted file mode 100644
index 96e1a48..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/remove.m
+++ /dev/null
@@ -1,17 +0,0 @@
-function remove(vehID, reason)
-%remove Remove vehicle.
-% remove(VEHID,REASON) Remove vehicle with the given ID for the given
-% reason. Reasons are defined in traci.constants and start with REMOVE_
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: remove.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-
-if nargin < 2
- reason = sscanf(constants.REMOVE_VAPORIZED,'%x');
-end
-
-traci.sendByteCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.REMOVE, vehID, reason);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/rerouteEffort.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/rerouteEffort.m
deleted file mode 100644
index 8b156a8..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/rerouteEffort.m
+++ /dev/null
@@ -1,19 +0,0 @@
-function rerouteEffort(vehID)
-%rerouteEffort Compute new route based on the edges' assigned effort.
-% rerouteEffort(VEHID) Computes a new route using the vehicle's internal
-% and the global edge effort information. Replaces the current route by
-% the found.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: rerouteEffort.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-
-traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_REROUTE_EFFORT, vehID,...
- 1+4);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(0)];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/rerouteTraveltime.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/rerouteTraveltime.m
deleted file mode 100644
index 05b99a8..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/rerouteTraveltime.m
+++ /dev/null
@@ -1,19 +0,0 @@
-function rerouteTraveltime(vehID)
-%rerouteTraveltime Compute new route based on the edges' assigned travel time.
-% rerouteTraveltime(VEHID) Computes a new route using the vehicle's
-% internal and the global edge travel time information. Replaces the
-% current route by the found.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: rerouteTraveltime.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-
-traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_REROUTE_TRAVELTIME, vehID,...
- 1+4);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(0)];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setAccel.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setAccel.m
deleted file mode 100644
index 2e58e0e..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setAccel.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setAccel(vehID, accel)
-%setAccel Set the acceleration of the vehicle.
-% setAccel(VEHID,ACCEL) Sets the maximum acceleration in m/s^2 for this
-% vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setAccel.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_ACCEL, vehID, accel);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setAdaptedTraveltime.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setAdaptedTraveltime.m
deleted file mode 100644
index 64fcf40..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setAdaptedTraveltime.m
+++ /dev/null
@@ -1,24 +0,0 @@
-function setAdaptedTraveltime(vehID, begTime, endTime, edgeID, time)
-%setAdaptedTraveltime Assign edge's travel time to vehicle's container.
-% setAdaptedTraveltime(VEHID,BEGTIME,ENDTIME,EDGEID,TIME) Inserts the
-% information about the travel time of edge EDGEID valid from BEGTIME
-% time to ENDTIME time into the vehicle's internal edge weights container.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setAdaptedTraveltime.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-
-traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_EDGE_TRAVELTIME, vehID,...
- 1+4+1+4+1+4+1+4+length(edgeID)+1+8);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(4) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
- traci.packInt32(begTime) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
- traci.packInt32(endTime) uint8(sscanf(constants.TYPE_STRING,'%x')) ...
- traci.packInt32(length(edgeID)) uint8(edgeID)];
-message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
- traci.packInt64(time)];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setColor.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setColor.m
deleted file mode 100644
index 67132dd..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setColor.m
+++ /dev/null
@@ -1,16 +0,0 @@
-function setColor(vehID, color)
-%setColor Set the color of the vehicle.
-% setColor(VEHID,COLOR) Sets color for vehicle with the given ID, i.e.
-% (255,0,0,0) for the color red. The fourth integer (alpha) is currently
-% ignored
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setColor.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_COLOR, vehID, 1+1+1+1+1);
-message.string = [message.string uint8([sscanf(constants.TYPE_COLOR,'%x') color])];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setDecel.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setDecel.m
deleted file mode 100644
index 01e253c..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setDecel.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setDecel(vehID, decel)
-%setDecel
-% setDecel(VEHID,DECEL) Sets the maximum deceleration in m/s^2 for this
-% vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setDecel.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_DECEL, vehID, decel);
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setEffort.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setEffort.m
deleted file mode 100644
index 123c4ff..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setEffort.m
+++ /dev/null
@@ -1,24 +0,0 @@
-function setEffort(vehID, begTime, endTime, edgeID, effort)
-%setEffort
-% setEffort(VEHID,BEGTIME,ENDTIME,EDGEID,EFFORT) Inserts the information
-% about the effort of edge EDGEID valid from BEGTIME time to ENDTIME time
-% into the vehicle's internal edge weights container.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setEffort.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-
-traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_EDGE_EFFORT, vehID,...
- 1+4+1+4+1+4+1+4+length(edgeID)+1+4);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(int32(4)) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
- traci.packInt32(int32(begTime)) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
- traci.packInt32(int32(endTime)) uint8(sscanf(constants.TYPE_STRING,'%x')) ...
- traci.packInt32(int32(length(uint8(edgeID)))) uint8(edgeID)];
-message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
- traci.packInt64(effort)];
-traci.sendExact()
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setEmissionClass.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setEmissionClass.m
deleted file mode 100644
index 6d5aed7..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setEmissionClass.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function setEmissionClass(vehID, clazz)
-%setEmissionClass
-% setEmissionClass(VEHID,CLASS) Sets the emission class for this vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setEmissionClass.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_EMISSIONCLASS, vehID, clazz);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setImperfection.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setImperfection.m
deleted file mode 100644
index 6d4c999..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setImperfection.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function setImperfection(vehID, imperfection)
-%setImperfection
-% setImperfection(VEHID,IMPERFECTION) Sets the driver's imperfection
-% (dawdling). IMPERFECTION is a double precision integer ranging from
-% zero to one.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setImperfection.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_IMPERFECTION, vehID, imperfection);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setLaneChangeMode.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setLaneChangeMode.m
deleted file mode 100644
index fa463a2..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setLaneChangeMode.m
+++ /dev/null
@@ -1,18 +0,0 @@
-function setLaneChangeMode(vehID, lcm)
-
-% setLaneChangeMode(VEHID, LCM)Sets the vehicle's lane change mode as a
-% bitset. For further details, see 'lane change mode' in
-% http://sumo.dlr.de/wiki/TraCI/Change_Vehicle_State
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id$
-
-import traci.constants
-traci.sendIntCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_LANECHANGEMODE, vehID, lcm);
-
-
-
-
-
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setLength.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setLength.m
deleted file mode 100644
index 7580e77..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setLength.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function setLength(vehID, length)
-%setLength
-% setLength(VEHID,LENGTH) Sets the length in m for the given vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setLength.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_LENGTH, vehID, length);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setMaxSpeed.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setMaxSpeed.m
deleted file mode 100644
index 5bd7dbd..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setMaxSpeed.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function setMaxSpeed(vehID, speed)
-%setMaxSpeed
-% setMaxSpeed(VEHID,SPEED) Sets the maximum speed in m/s for this vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setMaxSpeed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MAXSPEED, vehID, speed);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setMinGap.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setMinGap.m
deleted file mode 100644
index 736056e..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setMinGap.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setMinGap(vehID, minGap)
-%setMinGap
-% setMinGap(VEHID,MINGAP) Sets the offset (gap to front vehicle if
-% halting) for this vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setMinGap.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MINGAP, vehID, minGap);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setRoute.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setRoute.m
deleted file mode 100644
index 39a9085..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setRoute.m
+++ /dev/null
@@ -1,28 +0,0 @@
-function setRoute(vehID, edgeList)
-%setRoute Set the route of the vehicle.
-% setRoute(VEHID,EDGELIST) changes the vehicle route to given edges list.
-% The first edge in the list has to be the one that the vehicle is at at
-% the moment.
-%
-% Example:
-% traci.vehicle.setRoute{'1', {'1', '2', '4', '6', '7'}}
-%
-% changes the route for vehicle id 1 to edges 1-2-4-6-7.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setRoute.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-
-traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_ROUTE, vehID,...
- 1+4+sum(cellfun('length', edgeList))+4*length(edgeList));
-message.string = [message.string uint8(sscanf(constants.TYPE_STRINGLIST,'%x')) ...
- traci.packInt32(length(edgeList))];
-for i=1:length(edgeList)
- message.string = [message.string traci.packInt32(length(edgeList{i})) ...
- uint8(edgeList{i})];
-end
-traci.sendExact()
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setRouteID.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setRouteID.m
deleted file mode 100644
index dd49ebc..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setRouteID.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setRouteID(vehID, routeID)
-%setRouteID
-% setRouteID(VEHID,ROUTEID) Sets the id of the route for the named
-% vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setRouteID.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_ROUTE_ID, vehID, routeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setShapeClass.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setShapeClass.m
deleted file mode 100644
index 7378394..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setShapeClass.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function setShapeClass(vehID, clazz)
-%setShapeClass
-% setShapeClass(VEHID,CLASS) Sets the shape class for this vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setShapeClass.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SHAPECLASS, vehID, clazz);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSignals.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSignals.m
deleted file mode 100644
index dd26147..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSignals.m
+++ /dev/null
@@ -1,29 +0,0 @@
-function setSignals(vehID, signals)
-%setSignals
-% setSignalsVEHID,SIGNALS) Sets an integer encoding the state of the
-% vehicle's signals.
-% The following table shows the defined signals.
-%
-% Name Bit
-% VEH_SIGNAL_BLINKER_RIGHT 0
-% VEH_SIGNAL_BLINKER_LEFT 1
-% VEH_SIGNAL_BLINKER_EMERGENCY 2
-% VEH_SIGNAL_BRAKELIGHT 3
-% VEH_SIGNAL_FRONTLIGHT 4
-% VEH_SIGNAL_FOGLIGHT 5
-% VEH_SIGNAL_HIGHBEAM 6
-% VEH_SIGNAL_BACKDRIVE 7
-% VEH_SIGNAL_WIPER 8
-% VEH_SIGNAL_DOOR_OPEN_LEFT 9
-% VEH_SIGNAL_DOOR_OPEN_RIGHT 10
-% VEH_SIGNAL_EMERGENCY_BLUE 11
-% VEH_SIGNAL_EMERGENCY_RED 12
-% VEH_SIGNAL_EMERGENCY_YELLOW 13
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setSignals.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendIntCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SIGNALS, vehID, signals);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeed.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeed.m
deleted file mode 100644
index 62bc092..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeed.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setSpeed(vehID, speed)
-%setSpeed
-% setSpeed(VEHID,SPEED) Sets the speed in m/s for the named vehicle
-% within the last step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setSpeed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SPEED, vehID, speed);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedDeviation.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedDeviation.m
deleted file mode 100644
index f728b75..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedDeviation.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setSpeedDeviation(vehID, deviation)
-%setSpeedDeviation
-% setSpeedDeviation(VEHID,DEVIATION) Sets the maximum speed deviation for
-% this vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setSpeedDeviation.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SPEED_DEVIATION, vehID, deviation);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedFactor.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedFactor.m
deleted file mode 100644
index be2f76c..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedFactor.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setSpeedFactor(vehID, factor)
-%setSpeedFactor
-% setSpeedFactor(VEHID,FACTOR) Sets the speed factor for the named
-% vehicle within the last step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setSpeedFactor.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SPEED_FACTOR, vehID, factor);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedMode.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedMode.m
deleted file mode 100644
index c1352f9..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedMode.m
+++ /dev/null
@@ -1,19 +0,0 @@
-function setSpeedMode(vehID, sm)
-
-% setSpeedMode(VEHID, SM) Sets the vehicle's speed mode as a bitset. For
-% further details, see 'speed mode' in http://sumo.dlr.de/wiki/TraCI/Change_Vehicle_State
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id$
-
-
-import traci.constants
-traci.sendIntCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SPEEDSETMODE, vehID, sm);
-
-
-
-
-
-
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setStop.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setStop.m
deleted file mode 100644
index 527cffd..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setStop.m
+++ /dev/null
@@ -1,38 +0,0 @@
-function setStop(vehID, edgeID, pos, laneIndex, duration)
-%setStop Set a stop for the vehicle.
-% setStop(VEHID,EDGEID) Sets a stop for the vehicle VEHID in the edge
-% EDGEID for the maximum allowed time. The position and the lane index
-% default to one and zero respectively.
-% setStop(...,POS) Specify the position of the stop in the lane.
-% setStop(...,LANEINDEX) Specify the lane index in which the stop will be
-% made.
-% setStop(...,DURATION) Specify the duration of the stop.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setStop.m 20 2015-03-02 16:52:32Z afacostag $
-
-
-import traci.constants
-global message
-if nargin < 5
- duration = 2^31-1;
- if nargin < 4
- laneIndex = 0;
- if nargin < 3
- pos = 1;
- end
- end
-end
-traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_STOP,...
- vehID, 1+4+1+4+length(edgeID)+1+8+1+1+1+4);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(4)];
-message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
- traci.packInt32(length(edgeID)) uint8(edgeID)];
-message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
- traci.packInt64(pos) uint8([sscanf(constants.TYPE_BYTE,'%x') ...
- laneIndex sscanf(constants.TYPE_INTEGER,'%x')]) ...
- traci.packInt32(duration)];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setTau.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setTau.m
deleted file mode 100644
index 0d843e5..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setTau.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function setTau(vehID, tau)
-%setTau
-% setTau(VEHID,TAU) Sets the driver's reaction time in s for this vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setTau.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_TAU, vehID, tau);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setVehicleClass.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setVehicleClass.m
deleted file mode 100644
index e6130be..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setVehicleClass.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setVehicleClass(vehID, clazz)
-%setVehicleClass
-% setVehicleClass(VEHID,CLASS) Sets the vehicle class for this vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setVehicleClass.m 20 2015-03-02 16:52:32Z afacostag $
-
-
-import traci.constants
-traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_VEHICLECLASS, vehID, clazz);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setWidth.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/setWidth.m
deleted file mode 100644
index ce53807..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/setWidth.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function setWidth(vehID, width)
-%setWidth
-% setWidth(VEHID,WIDTH) Sets the width in m for this vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setWidth.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_WIDTH, vehID, width);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/slowDown.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/slowDown.m
deleted file mode 100644
index 10ac06b..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/slowDown.m
+++ /dev/null
@@ -1,19 +0,0 @@
-function slowDown(vehID, speed, duration)
-%slowDown
-% slowDown(VEHID,SPEED,DURATION) Reduces the speed of the vehicle to the
-% given for the given amount of time.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: slowDown.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_SLOWDOWN,...
- vehID, 1+4+1+8+1+4);
-message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
- traci.packInt32(2) uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
- traci.packInt64(speed) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
- traci.packInt32(duration)];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/subscribe.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/subscribe.m
deleted file mode 100644
index 7562eec..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/subscribe.m
+++ /dev/null
@@ -1,38 +0,0 @@
-function subscribe(vehID, varargin)
-%subscribe Subscribe to vehicle variable.
-% subscribe(VEHID) Subscribe to the VAR_ROAD_ID and VAR_LANEPOSITION
-% values for the maximum allowed interval.
-% subscribe(VEHID,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS for the maximum allowed interval.
-% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
-% allowed end time.
-% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
-% END.
-% A call to this function clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $
-
-global vehSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'vehicle.subscribe';
-p.addRequired('vehID', at ischar)
-p.addOptional('varIDs', {constants.VAR_ROAD_ID, constants.VAR_LANEPOSITION}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(vehID, varargin{:})
-vehID = p.Results.vehID;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-vehSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicle);
-
-vehSubscriptionResults.reset()
-traci.subscribe(constants.CMD_SUBSCRIBE_VEHICLE_VARIABLE,...
- subscriptionBegin, subscriptionEnd, vehID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicle/subscribeContext.m b/tools/contributed/TraCI4Matlab/+traci/+vehicle/subscribeContext.m
deleted file mode 100644
index be6827b..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicle/subscribeContext.m
+++ /dev/null
@@ -1,46 +0,0 @@
-function subscribeContext(vehID, domain, dist, varargin)
-%subscribeContext Subscribe to a vehicle's context variable.
-% subscribeContext(VEHID,DOMAIN,DIST) Subscribe to the VAR_ROAD_ID and
-% VAR_LANEPOSITION value of the SUMO objects that surround the vehicle
-% specified by VEHID at a distance given by DIST, for the maximum allowed
-% interval. The type of objets that surround the vehicle are defined in
-% the DOMAIN parameter. Note that not all the SUMO object types support
-% the variables VAR_ROAD_ID and VAR_LANEPOSITION.
-% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS.
-% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
-% maximum allowed end time.
-% subscribeContext(...,END) Subscribe for the time interval defined by
-% BEGIN and END.
-% A call to this method clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $
-
-global vehSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'vehicle.subscribeContext';
-p.addRequired('vehID', at ischar)
-p.addRequired('domain', at ischar)
-p.addRequired('dist', at isnumeric)
-p.addOptional('varIDs', {constants.VAR_ROAD_ID, constants.VAR_LANEPOSITION}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(vehID, domain, dist, varargin{:})
-vehID = p.Results.vehID;
-domain = p.Results.domain;
-dist = p.Results.dist;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-vehSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicle);
-
-vehSubscriptionResults.reset()
-traci.subscribeContext(constants.CMD_SUBSCRIBE_VEHICLE_CONTEXT,...
- subscriptionBegin, subscriptionEnd, vehID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getAccel.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getAccel.m
deleted file mode 100644
index df31a80..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getAccel.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function accel = getAccel(typeID)
-%getAccel
-% accel = getAccel(TYPEID) Returns the maximum acceleration in m/s^2 of
-% vehicles of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getAccel.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-accel = traci.vehicletype.getUniversal(constants.VAR_ACCEL, typeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getColor.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getColor.m
deleted file mode 100644
index 5118e26..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getColor.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function color = getColor(typeID)
-%getColor
-% color = getColor(TYPEID)Returns the color of this type of vehicle.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getColor.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-color = traci.vehicletype.getUniversal(constants.VAR_COLOR, typeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getContextSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getContextSubscriptionResults.m
deleted file mode 100644
index d6d687f..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getContextSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function ContextSubscriptionResults = getContextSubscriptionResults(typeID)
-%getContextSubscriptionResults Get the context subscription results for the
-% last time step.
-% contextSubscriptionResults = getContextSubscriptionResults(TYPEID)
-% Returns the context subscription results for the last time step and the
-% given vehicle type. If no vehicle type id is given, all subscription
-% results are returned in a containers.Map data struccure. If the vehicle
-% type id is unknown or the subscription did for any reason return no
-% data, 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global typeSubscriptionResults
-if isempty(typeSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- typeID=None;
-end
-ContextSubscriptionResults = typeSubscriptionResults.getContext(typeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getDecel.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getDecel.m
deleted file mode 100644
index 41609bd..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getDecel.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function decel = getDecel(typeID)
-%getDecel
-% decel = getDecel(TYPEID) Returns the maximum deceleration in m/s^2 of
-% vehicles of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getDecel.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-decel = traci.vehicletype.getUniversal(constants.VAR_DECEL, typeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getEmissionClass.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getEmissionClass.m
deleted file mode 100644
index 9064ee2..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getEmissionClass.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function emissionClass = getEmissionClass(typeID)
-%getEmissionClass
-% emissionClass = getEmissionClass(TYPEID) Returns the emission class of
-% vehicles of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getEmissionClass.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-emissionClass = traci.vehicletype.getUniversal(constants.VAR_EMISSIONCLASS, typeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getIDList.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getIDList.m
deleted file mode 100644
index f59650c..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getIDList.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function IDList = getIDList()
-%getIDList Get the IDs of the vehicle types in the network.
-% IDList = getIDList() Returns a cell array of strings containing the IDs
-% of the vehicle types in the SUMO network.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-IDList = traci.vehicletype.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getImperfection.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getImperfection.m
deleted file mode 100644
index 507a20a..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getImperfection.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function imperfection = getImperfection(typeID)
-%getImperfection
-% imperfection = getImperfection(TYPEID) Returns the driver's imperfection
-% (dawdling) [0,1] of vehicles of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getImperfection.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-imperfection = traci.vehicletype.getUniversal(constants.VAR_IMPERFECTION, typeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getLength.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getLength.m
deleted file mode 100644
index 12e51c6..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getLength.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function length = getLength(typeID)
-%getLength
-% length = getLength(TYPEID) Returns the length in m of the vehicles of
-% this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getLength.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-length = traci.vehicletype.getUniversal(constants.VAR_LENGTH, typeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getMaxSpeed.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getMaxSpeed.m
deleted file mode 100644
index a0fa5c3..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getMaxSpeed.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function maxSpeed = getMaxSpeed(typeID)
-%getMaxSpeed
-% maxSpeed = getMaxSpeed(TYPEID) Returns the maximum speed in m/s of
-% vehicles of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getMaxSpeed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-maxSpeed = traci.vehicletype.getUniversal(constants.VAR_MAXSPEED, typeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getMinGap.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getMinGap.m
deleted file mode 100644
index c2214b0..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getMinGap.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function minGap = getMinGap(typeID)
-%getMinGap
-% minGap = getMinGap(TYPEID) Returns the offset (gap to front vehicle if
-% halting) of vehicles of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getMinGap.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-minGap = traci.vehicletype.getUniversal(constants.VAR_MINGAP, typeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getShapeClass.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getShapeClass.m
deleted file mode 100644
index 9c5d86f..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getShapeClass.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function shapeClass = getShapeClass(typeID)
-%getShapeClass
-% shapeClass = getShapeClass(TYPEID) Returns the shape class of vehicles
-% of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getShapeClass.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-shapeClass = traci.vehicletype.getUniversal(constants.VAR_SHAPECLASS, typeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSpeedDeviation.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSpeedDeviation.m
deleted file mode 100644
index 4c52b2a..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSpeedDeviation.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function speedDeviation = getSpeedDeviation(typeID)
-%getSpeedDeviation
-% speedDeviation = getSpeedDeviation(TYPEID) Returns the maximum speed
-% deviation of vehicles of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSpeedDeviation.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-speedDeviation = traci.vehicletype.getUniversal(constants.VAR_SPEED_DEVIATION, typeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSpeedFactor.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSpeedFactor.m
deleted file mode 100644
index c573a82..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSpeedFactor.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function speedFactor = getSpeedFactor(typeID)
-%getSpeedFactor
-% speedFactor = getSpeedFactor(TYPEID) Returns the chosen speed factor for
-% vehicles of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSpeedFactor.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-speedFactor = traci.vehicletype.getUniversal(constants.VAR_SPEED_FACTOR, typeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSubscriptionResults.m
deleted file mode 100644
index 004512f..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSubscriptionResults.m
+++ /dev/null
@@ -1,26 +0,0 @@
-function subscriptionResults = getSubscriptionResults(typeID)
-%getSubscriptionResults Get the subscription results for the last time step.
-% subscriptionResults = getSubscriptionResults(TYPEID) Returns the
-% subscription results for the last time step and the given vehicle type.
-% If no vehicle type id is given, all subscription results are returned
-% in a containers.Map data structure.
-% If the vehicle type id is unknown or the subscription did for any reason return
-% no data, 'None' is returned.
-% It is not possible to retrieve older subscription results than the ones
-% from the last time step.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
-global typeSubscriptionResults
-if isempty(typeSubscriptionResults)
- throw(MException('traci:FatalTraCIError',...
- 'You have to subscribe to the variable'));
-end
-if nargin < 1
- typeID = 'None';
-end
-
-subscriptionResults = typeSubscriptionResults.get(typeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getTau.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getTau.m
deleted file mode 100644
index 8f447bf..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getTau.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function tau = getTau(typeID)
-%getTau
-% tau = getTau(TYPEID) Returns the driver's reaction time in s for
-% vehicles of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getTau.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-tau = traci.vehicletype.getUniversal(constants.VAR_TAU, typeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getUniversal.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getUniversal.m
deleted file mode 100644
index 61c780f..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getUniversal.m
+++ /dev/null
@@ -1,25 +0,0 @@
-function returnedValue = getUniversal(varID, typeID)
-%getUniversal An internal function to send the get command and read the
-%variable value.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global typeSubscriptionResults
-
-if isempty(typeSubscriptionResults)
- returnValueFunc = traci.RETURN_VALUE_FUNC.vehicletype;
-else
- returnValueFunc = typeSubscriptionResults.valueFunc;
-end
-
-% Prepare the outgoing message and read the response. The result variable
-% is a traci.Storage object
-result = traci.sendReadOneStringCmd(constants.CMD_GET_VEHICLETYPE_VARIABLE,varID,typeID);
-handleReturValueFunc = str2func(returnValueFunc(varID));
-
-% Use the proper method to read the variable of interest from the result
-returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getVehicleClass.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getVehicleClass.m
deleted file mode 100644
index 7e344c0..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getVehicleClass.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function vehicleClass = getVehicleClass(typeID)
-%getVehicleClass
-% vehicleClass = getVehicleClass(TYPEID) Returns the class of vehicles of
-% this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getVehicleClass.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-vehicleClass = traci.vehicletype.getUniversal(constants.VAR_VEHICLECLASS, typeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getWidth.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getWidth.m
deleted file mode 100644
index f37e77b..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getWidth.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function width = getWidth(typeID)
-%getVehicleClass
-% vehicleClass = getVehicleClass(TYPEID) Returns the width in m of
-% vehicles of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getWidth.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-width = traci.vehicletype.getUniversal(constants.VAR_WIDTH, typeID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setAccel.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setAccel.m
deleted file mode 100644
index 39c89b3..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setAccel.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setAccel(typeID, accel)
-%setAccel
-% setAccel(TYPEID,ACCEL) Sets the maximum acceleration in m/s^2 of
-% vehicles of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setAccel.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_ACCEL, typeID, accel);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setColor.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setColor.m
deleted file mode 100644
index 28d6463..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setColor.m
+++ /dev/null
@@ -1,16 +0,0 @@
-function setColor(typeID, color)
-%setColor Set the color of the vehicle.
-% setColor(TYPEID,COLOR) Sets color for vehicle vehicles of this type,
-% i.e. (255,0,0,0) for the color red. The fourth integer (alpha) is
-% currently ignored
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setColor.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_COLOR, typeID, 1+1+1+1+1);
-message.string = [message.string uint8([sscanf(constants.TYPE_COLOR,'%x') color])];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setDecel.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setDecel.m
deleted file mode 100644
index 5e33d06..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setDecel.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setDecel(typeID, decel)
-%setDecel
-% setDecel(TYPEID,DECEL) Sets the maximum deceleration in m/s^2 of
-% vehicles of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setDecel.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_DECEL, typeID, decel);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setEmissionClass.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setEmissionClass.m
deleted file mode 100644
index 8d377a9..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setEmissionClass.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setEmissionClass(typeID, clazz)
-%setEmissionClass
-% setEmissionClass(TYPEID,CLASS) Sets the emission class of vehicles of
-% this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setEmissionClass.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendStringCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_EMISSIONCLASS, typeID, clazz);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setImperfection.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setImperfection.m
deleted file mode 100644
index e8d70b5..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setImperfection.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function setImperfection(typeID, imperfection)
-%setImperfection
-% setImperfection(TYPEID,IMPERFECTION) Sets the driver's imperfection
-% (dawdling) for vehicles of this class. IMPERFECTION is a double
-% precision integer rnging from zero to one.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setImperfection.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_IMPERFECTION, typeID, imperfection);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setLength.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setLength.m
deleted file mode 100644
index 777d32b..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setLength.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setLength(typeID, length)
-%setLength
-% setLength(TYPEID,LENGTH) Sets the length in m of the vehicles of this
-% type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setLength.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_LENGTH, typeID, length);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setMaxSpeed.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setMaxSpeed.m
deleted file mode 100644
index f313ce0..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setMaxSpeed.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setMaxSpeed(typeID, speed)
-%setMaxSpeed
-% setMaxSpeed(TYPEID,SPEED) Sets the maximum speed in m/s of vehicles of
-% this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setMaxSpeed.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_MAXSPEED, typeID, speed);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setMinGap.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setMinGap.m
deleted file mode 100644
index b6fa336..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setMinGap.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setMinGap(typeID, minGap)
-%setMinGap
-% setMinGap(TYPEID,MINGAP) Sets the offset (gap to front vehicle if
-% halting) of vehicles of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setMinGap.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_MINGAP, typeID, minGap);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setShapeClass.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setShapeClass.m
deleted file mode 100644
index 9cd488d..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setShapeClass.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setShapeClass(typeID, clazz)
-%setShapeClass
-% setShapeClass(TYPEID,CLASS) Sets the shape class of vehicles of this
-% type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setShapeClass.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendStringCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_SHAPECLASS, typeID, clazz);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setSpeedDeviation.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setSpeedDeviation.m
deleted file mode 100644
index debdc94..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setSpeedDeviation.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setSpeedDeviation(typeID, deviation)
-%setSpeedDeviation
-% setSpeedDeviation(TYPEID,DEVIATION) Sets the maximum speed deviation of
-% vehicles of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setSpeedDeviation.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_SPEED_DEVIATION, typeID, deviation);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setSpeedFactor.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setSpeedFactor.m
deleted file mode 100644
index ba64ede..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setSpeedFactor.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setSpeedFactor(typeID, factor)
-%setSpeedFactor
-% setSpeedFactor(TYPEID,FACTOR) Sets the speed factor for the vehicles of
-% this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setSpeedFactor.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_SPEED_FACTOR, typeID, factor);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setTau.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setTau.m
deleted file mode 100644
index 5d199d7..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setTau.m
+++ /dev/null
@@ -1,12 +0,0 @@
-function setTau(typeID, tau)
-%setTau
-% setTau(TYPEID,TAU) Sets the driver's reaction time in s for vehicles of
-% this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setTau.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_TAU, typeID, tau);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setVehicleClass.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setVehicleClass.m
deleted file mode 100644
index c377d39..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setVehicleClass.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function setVehicleClass(typeID, clazz)
-%setVehicleClass
-% setVehicleClass(TYPEID,CLASS) Sets the class of vehicles of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setVehicleClass.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendStringCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_VEHICLECLASS, typeID, clazz);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setWidth.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setWidth.m
deleted file mode 100644
index 55c3d36..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setWidth.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function setWidth(typeID, width)
-%setWidth
-% setWidth(TYPEID,WIDTH) Sets the width in m of vehicles of this type.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: setWidth.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_WIDTH, typeID, width);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/subscribe.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/subscribe.m
deleted file mode 100644
index a9bc108..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/subscribe.m
+++ /dev/null
@@ -1,38 +0,0 @@
-function subscribe(typeID, varargin)
-%subscribe Subscribe to vehicle type variable.
-% subscribe(TYPEID) Subscribe to the VAR_MAXSPEED value for the maximum
-% allowed interval.
-% subscribe(TYPEID,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS for the maximum allowed interval.
-% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
-% allowed end time.
-% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
-% END.
-% A call to this function clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $
-
-global typeSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'vehicletype.subscribe';
-p.addRequired('typeID', at ischar)
-p.addOptional('varIDs', {constants.VAR_MAXSPEED}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(typeID, varargin{:})
-typeID = p.Results.typeID;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-typeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicletype);
-
-typeSubscriptionResults.reset()
-traci.subscribe(constants.CMD_SUBSCRIBE_VEHICLETYPE_VARIABLE,...
- subscriptionBegin, subscriptionEnd, typeID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/subscribeContext.m b/tools/contributed/TraCI4Matlab/+traci/+vehicletype/subscribeContext.m
deleted file mode 100644
index 3cdd932..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/+vehicletype/subscribeContext.m
+++ /dev/null
@@ -1,46 +0,0 @@
-function subscribeContext(typeID, domain, dist, varargin)
-%subscribeContext Subscribe to a vehicle type's context variable.
-% subscribeContext(TYPEID,DOMAIN,DIST) Subscribe to the VAR_MAXSPEED
-% value of the SUMO objects that surround the vehicle type specified by
-% TYPEID at a distance given by DIST, for the maximum allowed interval.
-% The type of objets that surround the vehicle type are defined in the
-% DOMAIN parameter. Note that not all the SUMO object types support the
-% variable VAR_MAXSPEED.
-% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
-% array of strings VARIDS.
-% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
-% maximum allowed end time.
-% subscribeContext(...,END) Subscribe for the time interval defined by
-% BEGIN and END.
-% A call to this method clears all previous subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $
-
-global typeSubscriptionResults
-import traci.constants
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'type.subscribeContext';
-p.addRequired('typeID', at ischar)
-p.addRequired('domain', at ischar)
-p.addRequired('dist', at isnumeric)
-p.addOptional('varIDs', {constants.VAR_MAXSPEED}, @iscell)
-p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
-p.parse(typeID, domain, dist, varargin{:})
-typeID = p.Results.typeID;
-domain = p.Results.domain;
-dist = p.Results.dist;
-varIDs = p.Results.varIDs;
-subscriptionBegin = p.Results.subscriptionBegin;
-subscriptionEnd = p.Results.subscriptionEnd;
-
-typeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicletype);
-
-typeSubscriptionResults.reset()
-traci.subscribeContext(constants.CMD_SUBSCRIBE_VEHICLETYPE_CONTEXT,...
- subscriptionBegin, subscriptionEnd, typeID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/Message.m b/tools/contributed/TraCI4Matlab/+traci/Message.m
deleted file mode 100644
index c9bdf65..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/Message.m
+++ /dev/null
@@ -1,13 +0,0 @@
-classdef Message
-%Message A container for outgoing TraCI messages.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: Message.m 20 2015-03-02 16:52:32Z afacostag $
-
- properties
- string
- queue
- end
-end
diff --git a/tools/contributed/TraCI4Matlab/+traci/RETURN_VALUE_FUNC.m b/tools/contributed/TraCI4Matlab/+traci/RETURN_VALUE_FUNC.m
deleted file mode 100644
index a2d1e62..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/RETURN_VALUE_FUNC.m
+++ /dev/null
@@ -1,222 +0,0 @@
-classdef RETURN_VALUE_FUNC
- %RETURN_VALUE_FUNC A class to store the functions to read the TraCI
- %results for each SUMO object.
-
- % Copyright 2015 Universidad Nacional de Colombia,
- % Politecnico Jaime Isaza Cadavid.
- % Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
- % $Id: RETURN_VALUE_FUNC.m 20 2015-03-02 16:52:32Z afacostag $
-
- properties (Constant)
- areal = containers.Map({...
- traci.constants.ID_LIST...
- traci.constants.ID_COUNT,...
- traci.constants.JAM_LENGTH_METERS,...
- traci.constants.JAM_LENGTH_VEHICLE,...
- traci.constants.LAST_STEP_MEAN_SPEED,...
- traci.constants.LAST_STEP_OCCUPANCY},...
- {'readStringList','readInt','readDouble','readInt','readDouble','readDouble'});
- edge = containers.Map({...
- traci.constants.ID_LIST,...
- traci.constants.ID_COUNT,...
- traci.constants.VAR_EDGE_TRAVELTIME,...
- traci.constants.VAR_EDGE_EFFORT,...
- traci.constants.VAR_CO2EMISSION,...
- traci.constants.VAR_COEMISSION,...
- traci.constants.VAR_HCEMISSION,...
- traci.constants.VAR_PMXEMISSION,...
- traci.constants.VAR_NOXEMISSION,...
- traci.constants.VAR_FUELCONSUMPTION,...
- traci.constants.VAR_NOISEEMISSION,...
- traci.constants.LAST_STEP_MEAN_SPEED,...
- traci.constants.LAST_STEP_OCCUPANCY,...
- traci.constants.LAST_STEP_LENGTH,...
- traci.constants.VAR_CURRENT_TRAVELTIME,...
- traci.constants.LAST_STEP_VEHICLE_NUMBER,...
- traci.constants.LAST_STEP_VEHICLE_HALTING_NUMBER,...
- traci.constants.LAST_STEP_VEHICLE_ID_LIST},...
- {'readStringList','readInt','readDouble','readDouble','readDouble',...
- 'readDouble','readDouble','readDouble','readDouble','readDouble',...
- 'readDouble','readDouble','readDouble','readDouble','readDouble',...
- 'readInt','readInt','readStringList'});
- gui = containers.Map({...
- traci.constants.ID_LIST,...
- traci.constants.VAR_VIEW_ZOOM,...
- traci.constants.VAR_VIEW_OFFSET,...
- traci.constants.VAR_VIEW_SCHEMA,...
- traci.constants.VAR_VIEW_BOUNDARY},...
- {'readStringList','readDouble','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')',...
- 'readString','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8)) fliplr(result.read(8)) fliplr(result.read(8))],''double'')'});
- inductionloop = containers.Map({...
- traci.constants.ID_LIST,...
- traci.constants.VAR_POSITION,...
- traci.constants.VAR_LANE_ID,...
- traci.constants.LAST_STEP_VEHICLE_NUMBER,...
- traci.constants.LAST_STEP_MEAN_SPEED,...
- traci.constants.LAST_STEP_VEHICLE_ID_LIST,...
- traci.constants.LAST_STEP_OCCUPANCY,...
- traci.constants.LAST_STEP_LENGTH,...
- traci.constants.LAST_STEP_TIME_SINCE_DETECTION,...
- traci.constants.LAST_STEP_VEHICLE_DATA},...
- {'readStringList','readDouble','readString',...
- 'readInt','readDouble','readStringList',...
- 'readDouble','readDouble','readDouble',...
- 'traci.inductionloop.readVehicleData'});
- junction = containers.Map({...
- traci.constants.ID_LIST,...
- traci.constants.VAR_POSITION},...
- {'readStringList','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')'});
- lane = containers.Map({...
- traci.constants.ID_LIST,...
- traci.constants.VAR_LENGTH,...
- traci.constants.VAR_MAXSPEED,...
- traci.constants.VAR_WIDTH,...
- traci.constants.LANE_ALLOWED,...
- traci.constants.LANE_DISALLOWED,...
- traci.constants.LANE_LINK_NUMBER,...
- traci.constants.LANE_LINKS,...
- traci.constants.VAR_SHAPE,...
- traci.constants.LANE_EDGE_ID,...
- traci.constants.VAR_CO2EMISSION,...
- traci.constants.VAR_COEMISSION,...
- traci.constants.VAR_HCEMISSION,...
- traci.constants.VAR_PMXEMISSION,...
- traci.constants.VAR_NOXEMISSION,...
- traci.constants.VAR_FUELCONSUMPTION,...
- traci.constants.VAR_NOISEEMISSION,...
- traci.constants.LAST_STEP_MEAN_SPEED,...
- traci.constants.LAST_STEP_OCCUPANCY,...
- traci.constants.LAST_STEP_LENGTH,...
- traci.constants.VAR_CURRENT_TRAVELTIME,...
- traci.constants.LAST_STEP_VEHICLE_NUMBER,...
- traci.constants.LAST_STEP_VEHICLE_HALTING_NUMBER,...
- traci.constants.LAST_STEP_VEHICLE_ID_LIST},...
- {'readStringList','readDouble','readDouble','readDouble','readStringList',...
- 'readStringList','@(result) result.read(1)','traci.lane.readLinks','readShape','readString',...
- 'readDouble','readDouble','readDouble','readDouble','readDouble',...
- 'readDouble','readDouble','readDouble','readDouble','readDouble',...
- 'readDouble','readInt','readInt','readStringList'});
- multientryexit = containers.Map({...
- traci.constants.ID_LIST,...
- traci.constants.LAST_STEP_VEHICLE_NUMBER,...
- traci.constants.LAST_STEP_MEAN_SPEED,...
- traci.constants.LAST_STEP_VEHICLE_ID_LIST,...
- traci.constants.LAST_STEP_VEHICLE_HALTING_NUMBER},...
- {'readStringList','readInt','readDouble','readStringList','readInt'});
- poi = containers.Map({...
- traci.constants.ID_LIST,...
- traci.constants.VAR_TYPE,...
- traci.constants.VAR_POSITION,...
- traci.constants.VAR_COLOR},...
- {'readStringList','readString','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')',...
- '@(result) result.read(4)'});
- polygon = containers.Map({...
- traci.constants.ID_LIST,...
- traci.constants.VAR_TYPE,...
- traci.constants.VAR_SHAPE,...
- traci.constants.VAR_COLOR},...
- {'readStringList','readString','readShape','@(result) result.read(4)'});
- route = containers.Map({...
- traci.constants.ID_LIST,...
- traci.constants.VAR_EDGES},...
- {'readStringList','readStringList'});
- simulation = containers.Map({...
- traci.constants.VAR_TIME_STEP,...
- traci.constants.VAR_LOADED_VEHICLES_NUMBER,...
- traci.constants.VAR_LOADED_VEHICLES_IDS,...
- traci.constants.VAR_DEPARTED_VEHICLES_NUMBER,...
- traci.constants.VAR_DEPARTED_VEHICLES_IDS,...
- traci.constants.VAR_ARRIVED_VEHICLES_NUMBER,...
- traci.constants.VAR_ARRIVED_VEHICLES_IDS,...
- traci.constants.VAR_MIN_EXPECTED_VEHICLES,...
- traci.constants.VAR_TELEPORT_STARTING_VEHICLES_NUMBER,...
- traci.constants.VAR_TELEPORT_STARTING_VEHICLES_IDS,...
- traci.constants.VAR_TELEPORT_ENDING_VEHICLES_NUMBER,...
- traci.constants.VAR_TELEPORT_ENDING_VEHICLES_IDS,...
- traci.constants.VAR_DELTA_T,...
- traci.constants.VAR_NET_BOUNDING_BOX},...
- {'readInt','readInt','readStringList','readInt',...
- 'readStringList','readInt','readStringList','readInt',...
- 'readInt','readStringList','readInt','readStringList',...
- 'readInt','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8)) fliplr(result.read(8)) fliplr(result.read(8))],''double'')'});
- trafficlights = containers.Map({...
- traci.constants.ID_LIST,...
- traci.constants.TL_RED_YELLOW_GREEN_STATE,...
- traci.constants.TL_COMPLETE_DEFINITION_RYG,...
- traci.constants.TL_CONTROLLED_LANES,...
- traci.constants.TL_CONTROLLED_LINKS,...
- traci.constants.TL_CURRENT_PROGRAM,...
- traci.constants.TL_CURRENT_PHASE,...
- traci.constants.TL_NEXT_SWITCH},...
- {'readStringList','readString','traci.trafficlights.readLogics',...
- 'readStringList','traci.trafficlights.readLinks','readString',...
- 'readInt','readInt'});
- vehicle = containers.Map({...
- traci.constants.ID_LIST,...
- traci.constants.VAR_SPEED,...
- traci.constants.VAR_SPEED_WITHOUT_TRACI,...
- traci.constants.VAR_POSITION,...
- traci.constants.VAR_ANGLE,...
- traci.constants.VAR_ROAD_ID,...
- traci.constants.VAR_LANE_ID,...
- traci.constants.VAR_LANE_INDEX,...
- traci.constants.VAR_TYPE,...
- traci.constants.VAR_ROUTE_ID,...
- traci.constants.VAR_COLOR,...
- traci.constants.VAR_LANEPOSITION,...
- traci.constants.VAR_CO2EMISSION,...
- traci.constants.VAR_COEMISSION,...
- traci.constants.VAR_HCEMISSION,...
- traci.constants.VAR_PMXEMISSION,...
- traci.constants.VAR_NOXEMISSION,...
- traci.constants.VAR_FUELCONSUMPTION,...
- traci.constants.VAR_NOISEEMISSION,...
- traci.constants.VAR_EDGE_TRAVELTIME,...
- traci.constants.VAR_EDGE_EFFORT,...
- traci.constants.VAR_ROUTE_VALID,...
- traci.constants.VAR_EDGES,...
- traci.constants.VAR_SIGNALS,...
- traci.constants.VAR_LENGTH,...
- traci.constants.VAR_MAXSPEED,...
- traci.constants.VAR_VEHICLECLASS,...
- traci.constants.VAR_SPEED_FACTOR,...
- traci.constants.VAR_SPEED_DEVIATION,...
- traci.constants.VAR_EMISSIONCLASS,...
- traci.constants.VAR_WIDTH,...
- traci.constants.VAR_MINGAP,...
- traci.constants.VAR_SHAPECLASS,...
- traci.constants.VAR_ACCEL,...
- traci.constants.VAR_DECEL,...
- traci.constants.VAR_IMPERFECTION,...
- traci.constants.VAR_TAU,...
- traci.constants.VAR_BEST_LANES,...
- traci.constants.DISTANCE_REQUEST},...
- {'readStringList','readDouble','readDouble','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')',...
- 'readDouble','readString','readString','readInt','readString',...
- 'readString','@(result) result.read(4)','readDouble','readDouble','readDouble',...
- 'readDouble','readDouble','readDouble','readDouble','readDouble',...
- 'readDouble','readDouble','@(result) result.read(1)','readStringList',...
- 'readInt','readDouble','readDouble','readString','readDouble','readDouble',...
- 'readString','readDouble','readDouble','readString','readDouble','readDouble',...
- 'readDouble','readDouble','traci.vehicle.readBestLanes','readDouble'});
- vehicletype = containers.Map({...
- traci.constants.ID_LIST,...
- traci.constants.VAR_LENGTH,...
- traci.constants.VAR_MAXSPEED,...
- traci.constants.VAR_SPEED_FACTOR,...
- traci.constants.VAR_SPEED_DEVIATION,...
- traci.constants.VAR_ACCEL,...
- traci.constants.VAR_DECEL,...
- traci.constants.VAR_IMPERFECTION,...
- traci.constants.VAR_TAU,...
- traci.constants.VAR_VEHICLECLASS,...
- traci.constants.VAR_EMISSIONCLASS,...
- traci.constants.VAR_SHAPECLASS,...
- traci.constants.VAR_MINGAP,...
- traci.constants.VAR_WIDTH,...
- traci.constants.VAR_COLOR},...
- {'readStringList','readDouble','readDouble','readDouble','readDouble',...
- 'readDouble','readDouble','readDouble','readDouble','readString',...
- 'readString','readString','readDouble','readDouble','@(result) result.read(4)'});
- end
-end
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/Socket.m b/tools/contributed/TraCI4Matlab/+traci/Socket.m
deleted file mode 100644
index ddba2f2..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/Socket.m
+++ /dev/null
@@ -1,35 +0,0 @@
-classdef Socket < handle
-%Socket A class which wraps a Java socket to implement
-% TCP/IP communications in Matlab.
-
-% Copyright 2014 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: Socket.m 20 2015-03-02 16:52:32Z afacostag $
-
- properties
- socket
- dis
- dos
- dataReader
- end
- methods
- function this = connect(this, host, port)
- import co.edu.unalmed.gaunal.traci4matlab.utils.*
- import java.net.*
- import java.io.*
- this.socket = Socket();
- inetSocketAddress = InetSocketAddress(...
- InetAddress.getByName(host), port);
- try
- this.socket.connect(inetSocketAddress);
- catch err
- disp(err.getReport);
-% throw(MException('Connection:ConnectionRefused', err.getReport));
- end
- this.dis = DataInputStream(this.socket.getInputStream());
- this.dataReader = DataReader(this.dis);
- this.dos = DataOutputStream(this.socket.getOutputStream());
- end
- end
-end
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/Storage.m b/tools/contributed/TraCI4Matlab/+traci/Storage.m
deleted file mode 100644
index ccccc24..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/Storage.m
+++ /dev/null
@@ -1,70 +0,0 @@
-classdef Storage < handle
-%Storage A container for responses from SUMO server.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: Storage.m 20 2015-03-02 16:52:32Z afacostag $
-
- properties
- content
- pos
- end
- methods
- function this = Storage(content)
- this.content = content;
- this.pos = 1;
- end
- function value = read(this,numbytes)
- oldpos = this.pos;
- this.pos = this.pos + numbytes;
- value = this.content(oldpos:this.pos-1);
-
-% interval = round(numbytes/nargout);
-% for i=1:nargout
-% oldpos = this.pos;
-% this.pos = this.pos + interval;
-% varargout{i} = this.content(oldpos:this.pos-1);
-% end
- end
- function value = readInt(this)
- value = double(typecast(fliplr(uint8(this.read(4))),'int32'));
- end
-
- function value = readDouble(this)
- value = typecast(fliplr(this.read(8)),'double');
- end
-
- function len = readLength(this)
- len = this.read(1);
- if len > 0
- return
- end
- len = this.readInt();
- end
- function value = readString(this)
- len = typecast(fliplr(this.read(4)),'int32');
- if len == 0
- value = '';
- return
- end
- value = char(this.read(len));
- end
- function stringList = readStringList(this)
- n = this.readInt();
- stringList = cell(1,n);
- for i=1:n
- stringList{i} = this.readString();
- end
- end
-
- function shape = readShape(this)
- len = this.read(1);
- shape = cell(1,len);
- for i=1:len
- shape{i} = typecast([fliplr(this.read(8)) fliplr(this.read(8))],'double');
- end
- end
-
- end
-end
diff --git a/tools/contributed/TraCI4Matlab/+traci/SubscriptionResults.m b/tools/contributed/TraCI4Matlab/+traci/SubscriptionResults.m
deleted file mode 100644
index e049e0c..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/SubscriptionResults.m
+++ /dev/null
@@ -1,87 +0,0 @@
-classdef SubscriptionResults < handle
-%SubscriptionResults A container for the subscription results.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: SubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $
-
- properties
- results
- contextResults
- valueFunc
- end
-
- methods
- function this = SubscriptionResults(valueFunc)
- this.results = containers.Map;
- this.contextResults = containers.Map;
- this.valueFunc = valueFunc;
- end
-
- function result = parse(this, varID, data)
- if ~isKey(this.valueFunc, varID)
- throw(MException('traci:FatalTraCIError', 'Unknown variable %.2x',varID))
- end
- resultHandle = str2func(this.valueFunc(varID));
- result = resultHandle(data);
- end
-
- function reset(this)
- this.results = containers.Map;
- this.contextResults = containers.Map;
- end
-
- function add(this, refID, varID, data)
- if ~isKey(this.results, refID)
- this.results(refID) = containers.Map;
- end
- handle1results = this.results(refID);
- handle1results(varID) = this.parse(varID, data);
- end
-
- function subscriptionResults = get(this, refID)
- refID = num2str(refID);
- if nargin < 2
- refID = 'None';
- end
- if strcmp(refID,'None') == 1
- subscriptionResults = this.results;
- return
- end
- if isKey(this.results, refID)
- subscriptionResults = this.results(refID);
- else
- subscriptionResults = 'None';
- end
- end
-
- function addContext(this, refID, domain, objID, varID, data)
- if ~isKey(this.contextResults, refID)
- this.contextResults(refID) = containers.Map;
- end
- if ~isKey(this.contextResults(refID), objID)
- this.contextResults(refID) = subsasgn(this.contextResults(refID),...
- struct('type','()','subs',{objID}),containers.Map);
- end
- handle1ContextResults = this.contextResults(refID);
- handle2ContextResults = handle1ContextResults(objID);
- handle2ContextResults(varID) = domain.parse(varID, data);
- end
-
- function context = getContext(this, refID)
- if nargin < 2
- refID = 'None';
- end
- if strcmp(refID, 'None') == 1
- context = this.contextResults;
- return
- end
- if isKey(this.contextResults, refID)
- context = this.contextResults(refID);
- else
- context = 'None';
- end
- end
- end
-end
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/beginMessage.m b/tools/contributed/TraCI4Matlab/+traci/beginMessage.m
deleted file mode 100644
index 4e3dc11..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/beginMessage.m
+++ /dev/null
@@ -1,29 +0,0 @@
-function beginMessage(cmdID, varID, objID, len)
-%beginMessage Internal function to build the TraCI message.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: beginMessage.m 20 2015-03-02 16:52:32Z afacostag $
-
-global message
-if nargin < 4
- len = 0;
-end
-
-% Put the command in the queue
-message.queue = [message.queue uint8(sscanf(cmdID,'%x'))];
-
-% Compute the command length
-len = len+1+1+1+4+length(objID);
-
-% Build the message string depending on the length of the message
-if len <= 255
- message.string = [message.string uint8([len sscanf(cmdID,'%x') sscanf(varID,'%x')])...
- traci.packInt32(length(objID)) uint8(objID)];
-else
- message.string = [message.string uint8(0) traci.packInt32(len+4) ...
- uint8([sscanf(cmdID,'%x') sscanf(varID,'%x')])...
- traci.packInt32(length(objID)) uint8(objID)];
-end
-
diff --git a/tools/contributed/TraCI4Matlab/+traci/checkResult.m b/tools/contributed/TraCI4Matlab/+traci/checkResult.m
deleted file mode 100644
index bd8dbd4..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/checkResult.m
+++ /dev/null
@@ -1,33 +0,0 @@
-function result = checkResult(cmdID, varID, objID)
-%checkResult Internal function to receive and parse the response from SUMO
-%server.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: checkResult.m 20 2015-03-02 16:52:32Z afacostag $
-
-% Send the message and read the result
-result = traci.sendExact();
-
-% Read the response length
-result.readLength();
-
-% Read the response and the id of the returned variable
-response = result.read(1);
-retVarID = result.read(1);
-
-% Read the acknowledged object ID
-objectID = result.readString();
-
-% Check whether the response corresponds to the requested command. The
-% TraCI protocol is designed so that the response and the command ID
-% difference is 16
-if response - uint8(sscanf(cmdID,'%x')) ~= 16 || retVarID ~= uint8(sscanf(varID,'%x'))...
- || ~strcmp(objectID,objID)
- fprintf('Received answer %s,%s,%s for command %s,%s,%s.'...
- ,response, retVarID, objectID, cmdID, varID, objID);
-end
-
-% Read the type of the variable
-result.read(1);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/close.m b/tools/contributed/TraCI4Matlab/+traci/close.m
deleted file mode 100644
index 81ba0fd..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/close.m
+++ /dev/null
@@ -1,28 +0,0 @@
-function close()
-%CLOSE Close the connection with the SUMO server.
-% CLOSE() Close the default connection with the SUMO server. If several
-% connections have to be closed, they must be enabled through the
-% traci.switch() command, and closed with CLOSE().
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: close.m 20 2015-03-02 16:52:32Z afacostag $
-
-global connections message
-import traci.constants
-
-% Build the close command
-command = uint8(sscanf(constants.CMD_CLOSE,'%x'));
-message.queue = [message.queue command];
-message.string = [message.string uint8(1+1) command];
-
-% Send the close command
-traci.sendExact();
-
-% Close and clear the tcp object
-if isKey(connections,'')
- activeConnection = connections('');
- activeConnection.socket.close();
- clear connections('')
-end
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/constants.m b/tools/contributed/TraCI4Matlab/+traci/constants.m
deleted file mode 100644
index f35d99a..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/constants.m
+++ /dev/null
@@ -1,676 +0,0 @@
-classdef constants
- %The SUMO hexadecimal constants.
-
- % Copyright 2014 Universidad Nacional de Colombia,
- % Politecnico Jaime Isaza Cadavid.
- % Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
- % $Id: constants.m 20 2015-03-02 16:52:32Z afacostag $
-
- properties (Constant = true)
- % ****************************************
- % VERSION
- % ****************************************
- TRACI_VERSION = 6
-
-
- % ****************************************
- % COMMANDS
- % ****************************************
- % command: get version
- CMD_GETVERSION = '0x00'
-
- % command: simulation step
- CMD_SIMSTEP2 = '0x02'
-
- % command: stop node
- CMD_STOP = '0x12'
-
- % command: Resume from parking
- CMD_RESUME = '0x19'
-
- % command: set lane
- CMD_CHANGELANE = '0x13'
-
- % command: slow down
- CMD_SLOWDOWN = '0x14'
-
- % command: change target
- CMD_CHANGETARGET = '0x31'
-
- % command: add vehicle
- CMD_ADDVEHICLE = '0x74'
-
- % command: close sumo
- CMD_CLOSE = '0x7F'
-
-
- % command: subscribe induction loop (e1) context
- CMD_SUBSCRIBE_INDUCTIONLOOP_CONTEXT = '0x80'
- % response: subscribe induction loop (e1) context
- RESPONSE_SUBSCRIBE_INDUCTIONLOOP_CONTEXT = '0x90'
- % command: get induction loop (e1) variable
- CMD_GET_INDUCTIONLOOP_VARIABLE = '0xa0'
- % response: get induction loop (e1) variable
- RESPONSE_GET_INDUCTIONLOOP_VARIABLE = '0xb0'
- % command: subscribe induction loop (e1) variable
- CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE = '0xd0'
- % response: subscribe induction loop (e1) variable
- RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE = '0xe0'
-
- % command: subscribe areal detector (e2) context
- CMD_SUBSCRIBE_AREAL_DETECTOR_CONTEXT = '0x8D'
- % response: subscribe areal detector (e2) context
- RESPONSE_SUBSCRIBE_AREAL_DETECTOR_CONTEXT = '0x9D'
- % command: get areal detector (e2) variable
- CMD_GET_AREAL_DETECTOR_VARIABLE = '0x8E'
- % response: get areal detector (e2) variable
- RESPONSE_GET_AREAL_DETECTOR_VARIABLE = '0x9E'
- % command: subscribe areal detector (e2) variable
- CMD_SUBSCRIBE_AREAL_DETECTOR_VARIABLE = '0x8F'
- % response: subscribe areal detector (e2) variable
- RESPONSE_SUBSCRIBE_AREAL_DETECTOR_VARIABLE = '0x9F'
-
- % command: subscribe multi-entry/multi-exit detector (e3) context
- CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT = '0x81'
- % response: subscribe multi-entry/multi-exit detector (e3) context
- RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT = '0x91'
- % command: get multi-entry/multi-exit detector (e3) variable
- CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE = '0xa1'
- % response: get multi-entry/multi-exit detector (e3) variable
- RESPONSE_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE = '0xb1'
- % command: subscribe multi-entry/multi-exit detector (e3) variable
- CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE = '0xd1'
- % response: subscribe multi-entry/multi-exit detector (e3) variable
- RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE = '0xe1'
-
- % command: subscribe traffic lights context
- CMD_SUBSCRIBE_TL_CONTEXT = '0x82'
- % response: subscribe traffic lights context
- RESPONSE_SUBSCRIBE_TL_CONTEXT = '0x92'
- % command: get traffic lights variable
- CMD_GET_TL_VARIABLE = '0xa2'
- % response: get traffic lights variable
- RESPONSE_GET_TL_VARIABLE = '0xb2'
- % command: set traffic lights variable
- CMD_SET_TL_VARIABLE = '0xc2'
- % command: subscribe traffic lights variable
- CMD_SUBSCRIBE_TL_VARIABLE = '0xd2'
- % response: subscribe traffic lights variable
- RESPONSE_SUBSCRIBE_TL_VARIABLE = '0xe2'
-
- % command: subscribe lane context
- CMD_SUBSCRIBE_LANE_CONTEXT = '0x83'
- % response: subscribe lane context
- RESPONSE_SUBSCRIBE_LANE_CONTEXT = '0x93'
- % command: get lane variable
- CMD_GET_LANE_VARIABLE = '0xa3'
- % response: get lane variable
- RESPONSE_GET_LANE_VARIABLE = '0xb3'
- % command: set lane variable
- CMD_SET_LANE_VARIABLE = '0xc3'
- % command: subscribe lane variable
- CMD_SUBSCRIBE_LANE_VARIABLE = '0xd3'
- % response: subscribe lane variable
- RESPONSE_SUBSCRIBE_LANE_VARIABLE = '0xe3'
-
- % command: subscribe vehicle context
- CMD_SUBSCRIBE_VEHICLE_CONTEXT = '0x84'
- % response: subscribe vehicle context
- RESPONSE_SUBSCRIBE_VEHICLE_CONTEXT = '0x94'
- % command: get vehicle variable
- CMD_GET_VEHICLE_VARIABLE = '0xa4'
- % response: get vehicle variable
- RESPONSE_GET_VEHICLE_VARIABLE = '0xb4'
- % command: set vehicle variable
- CMD_SET_VEHICLE_VARIABLE = '0xc4'
- % command: subscribe vehicle variable
- CMD_SUBSCRIBE_VEHICLE_VARIABLE = '0xd4'
- % response: subscribe vehicle variable
- RESPONSE_SUBSCRIBE_VEHICLE_VARIABLE = '0xe4'
-
- % command: subscribe vehicle type context
- CMD_SUBSCRIBE_VEHICLETYPE_CONTEXT = '0x85'
- % response: subscribe vehicle type context
- RESPONSE_SUBSCRIBE_VEHICLETYPE_CONTEXT = '0x95'
- % command: get vehicle type variable
- CMD_GET_VEHICLETYPE_VARIABLE = '0xa5'
- % response: get vehicle type variable
- RESPONSE_GET_VEHICLETYPE_VARIABLE = '0xb5'
- % command: set vehicle type variable
- CMD_SET_VEHICLETYPE_VARIABLE = '0xc5'
- % command: subscribe vehicle type variable
- CMD_SUBSCRIBE_VEHICLETYPE_VARIABLE = '0xd5'
- % response: subscribe vehicle type variable
- RESPONSE_SUBSCRIBE_VEHICLETYPE_VARIABLE = '0xe5'
-
- % command: subscribe route context
- CMD_SUBSCRIBE_ROUTE_CONTEXT = '0x86'
- % response: subscribe route context
- RESPONSE_SUBSCRIBE_ROUTE_CONTEXT = '0x96'
- % command: get route variable
- CMD_GET_ROUTE_VARIABLE = '0xa6'
- % response: get route variable
- RESPONSE_GET_ROUTE_VARIABLE = '0xb6'
- % command: set route variable
- CMD_SET_ROUTE_VARIABLE = '0xc6'
- % command: subscribe route variable
- CMD_SUBSCRIBE_ROUTE_VARIABLE = '0xd6'
- % response: subscribe route variable
- RESPONSE_SUBSCRIBE_ROUTE_VARIABLE = '0xe6'
-
- % command: subscribe poi context
- CMD_SUBSCRIBE_POI_CONTEXT = '0x87'
- % response: subscribe poi context
- RESPONSE_SUBSCRIBE_POI_CONTEXT = '0x97'
- % command: get poi variable
- CMD_GET_POI_VARIABLE = '0xa7'
- % response: get poi variable
- RESPONSE_GET_POI_VARIABLE = '0xb7'
- % command: set poi variable
- CMD_SET_POI_VARIABLE = '0xc7'
- % command: subscribe poi variable
- CMD_SUBSCRIBE_POI_VARIABLE = '0xd7'
- % response: subscribe poi variable
- RESPONSE_SUBSCRIBE_POI_VARIABLE = '0xe7'
-
- % command: subscribe polygon context
- CMD_SUBSCRIBE_POLYGON_CONTEXT = '0x88'
- % response: subscribe polygon context
- RESPONSE_SUBSCRIBE_POLYGON_CONTEXT = '0x98'
- % command: get polygon variable
- CMD_GET_POLYGON_VARIABLE = '0xa8'
- % response: get polygon variable
- RESPONSE_GET_POLYGON_VARIABLE = '0xb8'
- % command: set polygon variable
- CMD_SET_POLYGON_VARIABLE = '0xc8'
- % command: subscribe polygon variable
- CMD_SUBSCRIBE_POLYGON_VARIABLE = '0xd8'
- % response: subscribe polygon variable
- RESPONSE_SUBSCRIBE_POLYGON_VARIABLE = '0xe8'
-
- % command: subscribe junction context
- CMD_SUBSCRIBE_JUNCTION_CONTEXT = '0x89'
- % response: subscribe junction context
- RESPONSE_SUBSCRIBE_JUNCTION_CONTEXT = '0x99'
- % command: get junction variable
- CMD_GET_JUNCTION_VARIABLE = '0xa9'
- % response: get junction variable
- RESPONSE_GET_JUNCTION_VARIABLE = '0xb9'
- % command: set junction variable
- CMD_SET_JUNCTION_VARIABLE = '0xc9'
- % command: subscribe junction variable
- CMD_SUBSCRIBE_JUNCTION_VARIABLE = '0xd9'
- % response: subscribe junction variable
- RESPONSE_SUBSCRIBE_JUNCTION_VARIABLE = '0xe9'
-
- % command: subscribe edge context
- CMD_SUBSCRIBE_EDGE_CONTEXT = '0x8a'
- % response: subscribe edge context
- RESPONSE_SUBSCRIBE_EDGE_CONTEXT = '0x9a'
- % command: get edge variable
- CMD_GET_EDGE_VARIABLE = '0xaa'
- % response: get edge variable
- RESPONSE_GET_EDGE_VARIABLE = '0xba'
- % command: set edge variable
- CMD_SET_EDGE_VARIABLE = '0xca'
- % command: subscribe edge variable
- CMD_SUBSCRIBE_EDGE_VARIABLE = '0xda'
- % response: subscribe edge variable
- RESPONSE_SUBSCRIBE_EDGE_VARIABLE = '0xea'
-
- % command: subscribe simulation context
- CMD_SUBSCRIBE_SIM_CONTEXT = '0x8b'
- % response: subscribe simulation context
- RESPONSE_SUBSCRIBE_SIM_CONTEXT = '0x9b'
- % command: get simulation variable
- CMD_GET_SIM_VARIABLE = '0xab'
- % response: get simulation variable
- RESPONSE_GET_SIM_VARIABLE = '0xbb'
- % command: set simulation variable
- CMD_SET_SIM_VARIABLE = '0xcb'
- % command: subscribe simulation variable
- CMD_SUBSCRIBE_SIM_VARIABLE = '0xdb'
- % response: subscribe simulation variable
- RESPONSE_SUBSCRIBE_SIM_VARIABLE = '0xeb'
-
- % command: subscribe GUI context
- CMD_SUBSCRIBE_GUI_CONTEXT = '0x8c'
- % response: subscribe GUI context
- RESPONSE_SUBSCRIBE_GUI_CONTEXT = '0x9c'
- % command: get GUI variable
- CMD_GET_GUI_VARIABLE = '0xac'
- % response: get GUI variable
- RESPONSE_GET_GUI_VARIABLE = '0xbc'
- % command: set GUI variable
- CMD_SET_GUI_VARIABLE = '0xcc'
- % command: subscribe GUI variable
- CMD_SUBSCRIBE_GUI_VARIABLE = '0xdc'
- % response: subscribe GUI variable
- RESPONSE_SUBSCRIBE_GUI_VARIABLE = '0xec'
-
-
- % ****************************************
- % POSITION REPRESENTATIONS
- % ****************************************
- % Position in geo-coordinates
- POSITION_LON_LAT = '0x00'
- % 2D cartesian coordinates
- POSITION_2D = '0x01'
- % Position in geo-coordinates with altitude
- POSITION_LON_LAT_ALT = '0x02'
- % 3D cartesian coordinates
- POSITION_3D = '0x03'
- % Position on road map
- POSITION_ROADMAP = '0x04'
-
-
- % ****************************************
- % DATA TYPES
- % ****************************************
- % Boundary Box (4 doubles)
- TYPE_BOUNDINGBOX = '0x05'
- % Polygon (2*n doubles)
- TYPE_POLYGON = '0x06'
- % unsigned byte
- TYPE_UBYTE = '0x07'
- % signed byte
- TYPE_BYTE = '0x08'
- % 32 bit signed integer
- TYPE_INTEGER = '0x09'
- % float
- TYPE_FLOAT = '0x0A'
- % double
- TYPE_DOUBLE = '0x0B'
- % 8 bit ASCII string
- TYPE_STRING = '0x0C'
- % list of traffic light phases
- TYPE_TLPHASELIST = '0x0D'
- % list of strings
- TYPE_STRINGLIST = '0x0E'
- % compound object
- TYPE_COMPOUND = '0x0F'
- % color (four ubytes)
- TYPE_COLOR = '0x11'
-
-
- % ****************************************
- % RESULT TYPES
- % ****************************************
- % result type: Ok
- RTYPE_OK = '0x00'
- % result type: not implemented
- RTYPE_NOTIMPLEMENTED = '0x01'
- % result type: error
- RTYPE_ERR = '0xFF'
-
- % return value for invalid queries (especially vehicle is not on the road)
- INVALID_DOUBLE_VALUE = -1001.
- % return value for invalid queries (especially vehicle is not on the road)
- INVALID_INT_VALUE = -1
-
-
- % ****************************************
- % TRAFFIC LIGHT PHASES
- % ****************************************
- % red phase
- TLPHASE_RED = '0x01'
- % yellow phase
- TLPHASE_YELLOW = '0x02'
- % green phase
- TLPHASE_GREEN = '0x03'
- % tl is blinking
- TLPHASE_BLINKING = '0x04'
- % tl is off and not blinking
- TLPHASE_NOSIGNAL = '0x05'
-
-
- % ****************************************
- % DIFFERENT DISTANCE REQUESTS
- % ****************************************
- % air distance
- REQUEST_AIRDIST = '0x00'
- % driving distance
- REQUEST_DRIVINGDIST = '0x01'
-
-
- % ****************************************
- % VEHICLE REMOVAL REASONS
- % ****************************************
- % vehicle started teleport
- REMOVE_TELEPORT = '0x00'
- % vehicle removed while parking
- REMOVE_PARKING = '0x01'
- % vehicle arrived
- REMOVE_ARRIVED = '0x02'
- % vehicle was vaporized
- REMOVE_VAPORIZED = '0x03'
- % vehicle finished route during teleport
- REMOVE_TELEPORT_ARRIVED = '0x04'
-
-
- % ****************************************
- % VARIABLE TYPES (for CMD_GET_*_VARIABLE)
- % ****************************************
- % list of instances' ids (get: all)
- ID_LIST = '0x00'
-
- % count of instances (get: all)
- ID_COUNT = '0x01'
-
- % subscribe object variables (get: all)
- OBJECT_VARIABLES_SUBSCRIPTION = '0x02'
-
- % subscribe context variables (get: all)
- SURROUNDING_VARIABLES_SUBSCRIPTION = '0x03'
-
- % last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges)
- LAST_STEP_VEHICLE_NUMBER = '0x10'
-
- % last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges)
- LAST_STEP_MEAN_SPEED = '0x11'
-
- % last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges)
- LAST_STEP_VEHICLE_ID_LIST = '0x12'
-
- % last step occupancy (get: induction loops, lanes, edges)
- LAST_STEP_OCCUPANCY = '0x13'
-
- % last step vehicle halting number (get: multi-entry/multi-exit detector, lanes, edges)
- LAST_STEP_VEHICLE_HALTING_NUMBER = '0x14'
-
- % last step mean vehicle length (get: induction loops, lanes, edges)
- LAST_STEP_LENGTH = '0x15'
-
- % last step time since last detection (get: induction loops)
- LAST_STEP_TIME_SINCE_DETECTION = '0x16'
-
- % entry times
- LAST_STEP_VEHICLE_DATA = '0x17'
-
- % last step jam length in vehicles
- JAM_LENGTH_VEHICLE = '0x18'
-
- % last step jam length in meters
- JAM_LENGTH_METERS = '0x19'
-
- % traffic light states, encoded as rRgGyYoO tuple (get: traffic lights)
- TL_RED_YELLOW_GREEN_STATE = '0x20'
-
- % index of the phase (set: traffic lights)
- TL_PHASE_INDEX = '0x22'
-
- % traffic light program (set: traffic lights)
- TL_PROGRAM = '0x23'
-
- % phase duration (set: traffic lights)
- TL_PHASE_DURATION = '0x24'
-
- % controlled lanes (get: traffic lights)
- TL_CONTROLLED_LANES = '0x26'
-
- % controlled links (get: traffic lights)
- TL_CONTROLLED_LINKS = '0x27'
-
- % index of the current phase (get: traffic lights)
- TL_CURRENT_PHASE = '0x28'
-
- % name of the current program (get: traffic lights)
- TL_CURRENT_PROGRAM = '0x29'
-
- % controlled junctions (get: traffic lights)
- TL_CONTROLLED_JUNCTIONS = '0x2a'
-
- % complete definition (get: traffic lights)
- TL_COMPLETE_DEFINITION_RYG = '0x2b'
-
- % complete program (set: traffic lights)
- TL_COMPLETE_PROGRAM_RYG = '0x2c'
-
- % assumed time to next switch (get: traffic lights)
- TL_NEXT_SWITCH = '0x2d'
-
-
-
- % outgoing link number (get: lanes)
- LANE_LINK_NUMBER = '0x30'
-
- % id of parent edge (get: lanes)
- LANE_EDGE_ID = '0x31'
-
- % outgoing link definitions (get: lanes)
- LANE_LINKS = '0x33'
-
- % list of allowed vehicle classes (get&set: lanes)
- LANE_ALLOWED = '0x34'
-
- % list of not allowed vehicle classes (get&set: lanes)
- LANE_DISALLOWED = '0x35'
-
-
- % speed (get: vehicle)
- VAR_SPEED = '0x40'
-
- % maximum allowed/possible speed (get: vehicle types, lanes, set: edges, lanes)
- VAR_MAXSPEED = '0x41'
-
- % position (2D) (get: vehicle, poi, set: poi)
- VAR_POSITION = '0x42'
-
- % angle (get: vehicle)
- VAR_ANGLE = '0x43'
-
- % angle (get: vehicle types, lanes, set: lanes)
- VAR_LENGTH = '0x44'
-
- % color (get: vehicles, vehicle types, polygons, pois)
- VAR_COLOR = '0x45'
-
- % max. acceleration (get: vehicle types)
- VAR_ACCEL = '0x46'
-
- % max. deceleration (get: vehicle types)
- VAR_DECEL = '0x47'
-
- % driver reaction time (get: vehicle types)
- VAR_TAU = '0x48'
-
- % vehicle class (get: vehicle types)
- VAR_VEHICLECLASS = '0x49'
-
- % emission class (get: vehicle types)
- VAR_EMISSIONCLASS = '0x4a'
-
- % shape class (get: vehicle types)
- VAR_SHAPECLASS = '0x4b'
-
- % minimum gap (get: vehicle types)
- VAR_MINGAP = '0x4c'
-
- % width (get: vehicle types, lanes)
- VAR_WIDTH = '0x4d'
-
- % shape (get: polygons)
- VAR_SHAPE = '0x4e'
-
- % type id (get: vehicles, polygons, pois)
- VAR_TYPE = '0x4f'
-
- % road id (get: vehicles)
- VAR_ROAD_ID = '0x50'
-
- % lane id (get: vehicles)
- VAR_LANE_ID = '0x51'
-
- % lane index (get: vehicles)
- VAR_LANE_INDEX = '0x52'
-
- % route id (get & set: vehicles)
- VAR_ROUTE_ID = '0x53'
-
- % edges (get: routes)
- VAR_EDGES = '0x54'
-
- % filled? (get: polygons)
- VAR_FILL = '0x55'
-
- % position (1D along lane) (get: vehicle)
- VAR_LANEPOSITION = '0x56'
-
- % route (set: vehicles)
- VAR_ROUTE = '0x57'
-
- % travel time information (get&set: vehicle)
- VAR_EDGE_TRAVELTIME = '0x58'
-
- % effort information (get&set: vehicle)
- VAR_EDGE_EFFORT = '0x59'
-
- % last step travel time (get: edge, lane)
- VAR_CURRENT_TRAVELTIME = '0x5a'
-
- % signals state (get/set: vehicle)
- VAR_SIGNALS = '0x5b'
-
- % new lane/position along (set: vehicle)
- VAR_MOVE_TO = '0x5c'
-
- % driver imperfection (set: vehicle)
- VAR_IMPERFECTION = '0x5d'
-
- % speed factor (set: vehicle)
- VAR_SPEED_FACTOR = '0x5e'
-
- % speed deviation (set: vehicle)
- VAR_SPEED_DEVIATION = '0x5f'
-
- % speed without TraCI influence (get: vehicle)
- VAR_SPEED_WITHOUT_TRACI = '0xb1'
-
- % best lanes (get: vehicle)
- VAR_BEST_LANES = '0xb2'
-
- % how speed is set (set: vehicle)
- VAR_SPEEDSETMODE = '0xb3'
-
- % move vehicle, VTD version (set: vehicle)
- VAR_MOVE_TO_VTD = '0xb4'
-
- % is the vehicle stopped, and if so parked and/or triggered?
- % value = stopped + 2 * parking + 4 * triggered
- VAR_STOPSTATE = '0xb5'
-
- % current CO2 emission of a node (get: vehicle, lane, edge)
- VAR_CO2EMISSION = '0x60'
-
- % current CO emission of a node (get: vehicle, lane, edge)
- VAR_COEMISSION = '0x61'
-
- % current HC emission of a node (get: vehicle, lane, edge)
- VAR_HCEMISSION = '0x62'
-
- % current PMx emission of a node (get: vehicle, lane, edge)
- VAR_PMXEMISSION = '0x63'
-
- % current NOx emission of a node (get: vehicle, lane, edge)
- VAR_NOXEMISSION = '0x64'
-
- % current fuel consumption of a node (get: vehicle, lane, edge)
- VAR_FUELCONSUMPTION = '0x65'
-
- % current noise emission of a node (get: vehicle, lane, edge)
- VAR_NOISEEMISSION = '0x66'
-
- % current person number (get: vehicle)
- VAR_PERSON_NUMBER = '0x67'
- VAR_BUS_STOP_WAITING = '0x67'
-
- % current leader together with gap (get: vehicle)
- VAR_LEADER = '0x68'
-
- % current time step (get: simulation)
- VAR_TIME_STEP = '0x70'
-
- % number of loaded vehicles (get: simulation)
- VAR_LOADED_VEHICLES_NUMBER = '0x71'
-
- % loaded vehicle ids (get: simulation)
- VAR_LOADED_VEHICLES_IDS = '0x72'
-
- % number of departed vehicle (get: simulation)
- VAR_DEPARTED_VEHICLES_NUMBER = '0x73'
-
- % departed vehicle ids (get: simulation)
- VAR_DEPARTED_VEHICLES_IDS = '0x74'
-
- % number of vehicles starting to teleport (get: simulation)
- VAR_TELEPORT_STARTING_VEHICLES_NUMBER = '0x75'
-
- % ids of vehicles starting to teleport (get: simulation)
- VAR_TELEPORT_STARTING_VEHICLES_IDS = '0x76'
-
- % number of vehicles ending to teleport (get: simulation)
- VAR_TELEPORT_ENDING_VEHICLES_NUMBER = '0x77'
-
- % ids of vehicles ending to teleport (get: simulation)
- VAR_TELEPORT_ENDING_VEHICLES_IDS = '0x78'
-
- % number of arrived vehicles (get: simulation)
- VAR_ARRIVED_VEHICLES_NUMBER = '0x79'
-
- % ids of arrived vehicles (get: simulation)
- VAR_ARRIVED_VEHICLES_IDS = '0x7a'
-
- % delta t (get: simulation)
- VAR_DELTA_T = '0x7b'
-
- % bounding box (get: simulation)
- VAR_NET_BOUNDING_BOX = '0x7c'
-
- % minimum number of expected vehicles (get: simulation)
- VAR_MIN_EXPECTED_VEHICLES = '0x7d'
-
-
-
- % add an instance (poi, polygon, vehicle, route)
- ADD = '0x80'
-
- % remove an instance (poi, polygon)
- REMOVE = '0x81'
-
- % convert coordinates
- POSITION_CONVERSION = '0x82'
-
- % distance between points or vehicles
- DISTANCE_REQUEST = '0x83'
-
-
- % force rerouting based on travel time (vehicles)
- CMD_REROUTE_TRAVELTIME = '0x90'
-
- % force rerouting based on effort (vehicles)
- CMD_REROUTE_EFFORT = '0x91'
-
- % validates current route (vehicles)
- VAR_ROUTE_VALID = '0x92'
-
-
- % zoom
- VAR_VIEW_ZOOM = '0xa0'
-
- % view position
- VAR_VIEW_OFFSET = '0xa1'
-
- % view schema
- VAR_VIEW_SCHEMA = '0xa2'
-
- % view by boundary
- VAR_VIEW_BOUNDARY = '0xa3'
-
- % screenshot
- VAR_SCREENSHOT = '0xa5'
-
- % track vehicle
- VAR_TRACK_VEHICLE = '0xa6'
-
- end
-end
diff --git a/tools/contributed/TraCI4Matlab/+traci/getVersion.m b/tools/contributed/TraCI4Matlab/+traci/getVersion.m
deleted file mode 100644
index 342e793..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/getVersion.m
+++ /dev/null
@@ -1,33 +0,0 @@
-function [traciversion, sumoversion] = getVersion()
-%getVersion Get the TraCI and SUMO versions.
-% [TRACIVERSION SUMOVERSION] = getVersion() Returns the current TraCI and
-% SUMO versions.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: getVersion.m 20 2015-03-02 16:52:32Z afacostag $
-
-global message
-import traci.constants
-message = traci.Message();
-% Get the command ID from the traci Constants.
-strcommand = constants.CMD_GETVERSION;
-command = sscanf(strcommand,'%x');
-
-% Prepare the outgoing message
-message.queue = [message.queue command];
-message.string = uint8([message.string 1+1 command]);
-
-% Send the outgoing message and receive the result
-result = traci.sendExact();
-
-result.readLength();
-response = result.read(1);
-if response~=command
- throw(MException('traci:FatalTraciError','Received answer 0x%.2X for command 0x%.2X.\n',...
- response, command));
-else
- traciversion = result.readInt();
- sumoversion = result.readString();
-end
diff --git a/tools/contributed/TraCI4Matlab/+traci/init.m b/tools/contributed/TraCI4Matlab/+traci/init.m
deleted file mode 100644
index d89ee27..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/init.m
+++ /dev/null
@@ -1,70 +0,0 @@
-function [traciVersion sumoVersion] = init(varargin)
-%INIT Initialize the connection to the SUMO server.
-% INIT() Initialize the connection to the SUMO server using the socket
-% localhost:8813. The SUMO server must be listening on the same socket.
-% The label of the connection is 'default'. The connection is attempted
-% for a number of retries of ten.
-%
-% INIT(PORT) Initialize the connection to the SUMO server in the
-% localhost:PORT socket.
-%
-% INIT(PORT,NUMRETRIES) Try the connection for the given number of
-% retries.
-%
-% INIT(...,HOST) Specify the ip address of the SUMO server as a string
-% e.g. '192.168.1.15'.
-%
-% INIT(...,LABEL) Specify a label for the connection.
-%
-% [TRACIVERSION,SUMOVERSION] = INIT(...) Returns the TRACIVERSION and the
-% SUMOVERSION.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: init.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-
-% Add the DataReader class
-[pathstr,~,~] = fileparts(which('traci.init'));
-javaaddpath([pathstr '\..\traci4matlab.jar']);
-
-global connections
-
-% Parse the input
-p = inputParser;
-p.FunctionName = 'traci.init';
-p.addOptional('port', 8873, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('numRetries', 10, @(x)isnumeric(x) && length(x)==1)
-p.addOptional('host', '127.0.0.1', @ischar)
-p.addOptional('label', 'default', @ischar)
-p.parse(varargin{:})
-
-port = p.Results.port;
-numRetries = p.Results.numRetries;
-host = p.Results.host;
-label = p.Results.label;
-
-% Create the tcp object
-if isempty(connections)
- connections = containers.Map();
- connections(label) = traci.Socket();
- connections('') = connections(label);
-end
-
-% Connect to the SUMO server within the given number of retries
-err = [];
-for i=1:numRetries
- try
- connections(label).connect(host, port);
- break
- catch err
- pause(i)
- end
-end
-if ~isempty(err)
- disp(err);
-end
-
-[traciVersion sumoVersion] = traci.getVersion();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/packInt32.m b/tools/contributed/TraCI4Matlab/+traci/packInt32.m
deleted file mode 100644
index 4918521..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/packInt32.m
+++ /dev/null
@@ -1,14 +0,0 @@
-function packedData = packInt32(data)
-%packInt32 Internal function to cast an int32 into
-% an uint8 array
-
-% Copyright 2014 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: packInt32.m 19 2014-05-30 15:08:25Z afacostag $
-
-if isa(data,'int32')
- packedData = fliplr(typecast(data,'uint8'));
-else
- packedData = fliplr(typecast(int32(data),'uint8'));
-end
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/packInt64.m b/tools/contributed/TraCI4Matlab/+traci/packInt64.m
deleted file mode 100644
index 01d8bac..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/packInt64.m
+++ /dev/null
@@ -1,10 +0,0 @@
-function packedData = packInt64(data)
-%packInt32 Internal function to cast an int64 into
-% an uint8 array
-
-% Copyright 2014 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: packInt64.m 19 2014-05-30 15:08:25Z afacostag $
-
-packedData = fliplr(typecast(data,'uint8'));
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/readSubscription.m b/tools/contributed/TraCI4Matlab/+traci/readSubscription.m
deleted file mode 100644
index edd1858..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/readSubscription.m
+++ /dev/null
@@ -1,136 +0,0 @@
-function [response, objectID] = readSubscription(result)
-%readSubscription Internal function to read the TraCI subscriptions.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: readSubscription.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global edgeSubscriptionResults guiSubscriptionResults ...
- loopSubscriptionResults junctionSubscriptionResults ...
- laneSubscriptionResults detSubscriptionResults ...
- poiSubscriptionResults polygonSubscriptionResults ...
- routeSubscriptionResults simSubscriptionResults ...
- tlSubscriptionResults vehSubscriptionResults ...
- typeSubscriptionResults
-
-subscriptionResults = containers.Map({...
- constants.RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE,...
- constants.RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE,...
- constants.RESPONSE_SUBSCRIBE_TL_VARIABLE,...
- constants.RESPONSE_SUBSCRIBE_LANE_VARIABLE,...
- constants.RESPONSE_SUBSCRIBE_VEHICLE_VARIABLE,...
- constants.RESPONSE_SUBSCRIBE_VEHICLETYPE_VARIABLE,...
- constants.RESPONSE_SUBSCRIBE_ROUTE_VARIABLE,...
- constants.RESPONSE_SUBSCRIBE_POI_VARIABLE,...
- constants.RESPONSE_SUBSCRIBE_POLYGON_VARIABLE,...
- constants.RESPONSE_SUBSCRIBE_JUNCTION_VARIABLE,...
- constants.RESPONSE_SUBSCRIBE_EDGE_VARIABLE,...
- constants.RESPONSE_SUBSCRIBE_SIM_VARIABLE,...
- constants.RESPONSE_SUBSCRIBE_GUI_VARIABLE,...
- constants.RESPONSE_SUBSCRIBE_INDUCTIONLOOP_CONTEXT,...
- constants.RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT,...
- constants.RESPONSE_SUBSCRIBE_TL_CONTEXT,...
- constants.RESPONSE_SUBSCRIBE_LANE_CONTEXT,...
- constants.RESPONSE_SUBSCRIBE_VEHICLE_CONTEXT,...
- constants.RESPONSE_SUBSCRIBE_VEHICLETYPE_CONTEXT,...
- constants.RESPONSE_SUBSCRIBE_ROUTE_CONTEXT,...
- constants.RESPONSE_SUBSCRIBE_POI_CONTEXT,...
- constants.RESPONSE_SUBSCRIBE_POLYGON_CONTEXT,...
- constants.RESPONSE_SUBSCRIBE_JUNCTION_CONTEXT,...
- constants.RESPONSE_SUBSCRIBE_EDGE_CONTEXT,...
- constants.RESPONSE_SUBSCRIBE_SIM_CONTEXT,...
- constants.RESPONSE_SUBSCRIBE_GUI_CONTEXT,...
- constants.CMD_GET_INDUCTIONLOOP_VARIABLE,...
- constants.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE,...
- constants.CMD_GET_TL_VARIABLE,...
- constants.CMD_GET_LANE_VARIABLE,...
- constants.CMD_GET_VEHICLE_VARIABLE,...
- constants.CMD_GET_VEHICLETYPE_VARIABLE,...
- constants.CMD_GET_ROUTE_VARIABLE,...
- constants.CMD_GET_POI_VARIABLE,...
- constants.CMD_GET_POLYGON_VARIABLE,...
- constants.CMD_GET_JUNCTION_VARIABLE,...
- constants.CMD_GET_EDGE_VARIABLE,...
- constants.CMD_GET_SIM_VARIABLE,...
- constants.CMD_GET_GUI_VARIABLE},...
- {loopSubscriptionResults, detSubscriptionResults,...
- tlSubscriptionResults, laneSubscriptionResults,...
- vehSubscriptionResults, typeSubscriptionResults,...
- routeSubscriptionResults, poiSubscriptionResults,...
- polygonSubscriptionResults, junctionSubscriptionResults,...
- edgeSubscriptionResults, simSubscriptionResults,...
- guiSubscriptionResults,...
- loopSubscriptionResults, detSubscriptionResults,...
- tlSubscriptionResults, laneSubscriptionResults,...
- vehSubscriptionResults, typeSubscriptionResults,...
- routeSubscriptionResults, poiSubscriptionResults,...
- polygonSubscriptionResults, junctionSubscriptionResults,...
- edgeSubscriptionResults, simSubscriptionResults,...
- guiSubscriptionResults,...
- loopSubscriptionResults, detSubscriptionResults,...
- tlSubscriptionResults, laneSubscriptionResults,...
- vehSubscriptionResults, typeSubscriptionResults,...
- routeSubscriptionResults, poiSubscriptionResults,...
- polygonSubscriptionResults, junctionSubscriptionResults,...
- edgeSubscriptionResults, simSubscriptionResults,...
- guiSubscriptionResults,...
- });
-result.readLength();
-response = result.read(1);
-strresponse = ['0x' sprintf('%x',response)];
-% Determine if the subscription is context related.
-isVariableSubscription = response>=sscanf(...
- traci.constants.RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE,'%x')...
- && response<=sscanf(traci.constants.RESPONSE_SUBSCRIBE_GUI_VARIABLE,'%x');
-objectID = result.readString();
-
-% Read the domain if the subscription was made to a context
-if ~isVariableSubscription
- domain = result.read(1);
- strdomain = ['0x' sprintf('%.2x',domain)];
-end
-
-% Read the number of variables to which the client is subscribed
-numVars = result.read(1);
-
-% Populate the global TraCI modules
-if isVariableSubscription
- while numVars > 0
- varID = result.read(1);
- status = result.read(1);
- result.read(1);
- if status
- traci.close();
- throw(MException('traci:FatalTraciError','Error %s', result.readString()));
- elseif isKey(subscriptionResults, strresponse)
- subsResultsHandle = subscriptionResults(strresponse);
- subsResultsHandle.add(objectID,...
- ['0x' sprintf('%.2x',varID)], result);
- else
- throw(MException('traci:FatalTraciError','Cannot handle subscription response %s for %s\n',...
- num2str(response), objectID));
- end
- numVars = numVars - 1;
- end
-else
- objectNo = result.readInt();
- for o=1:objectNo
- oid = result.readString();
- for v=1:numVars
- varID = result.read(1);
- status = result.read(1);
- result.read(1);
- if status
- throw(MException('traci:FatalTraciError','Error %s', result.readString()));
- elseif isKey(subscriptionResults, strresponse)
- subsResultsHandle = subscriptionResults(strresponse);
- domainHandle = subscriptionResults(strdomain);
- subsResultsHandle.addContext(objectID, domainHandle, oid, ['0x' sprintf('%.2x',varID)], result);
- else
- throw(MException('traci:FatalTraciError','Cannot handle subscription response %.2x for %s.', num2str(response), objectID));
- end
- end
- end
-end
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/recvExact.m b/tools/contributed/TraCI4Matlab/+traci/recvExact.m
deleted file mode 100644
index 77bc92a..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/recvExact.m
+++ /dev/null
@@ -1,52 +0,0 @@
-function result = recvExact()
-%recvExact Internal function to receive the response from SUMO server.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: recvExact.m 20 2015-03-02 16:52:32Z afacostag $
-
-global connections
-
-% recvlength = [];
-% connections('').BytesAvailable
-
-% Receive the total length of the response
-% while length(recvlength) < 1
-
-% We tried to address the issue that arises when the user closes
-% the SUMO GUI without closing the connection from the client through
-% this workaround. Unfortunately, it leads to an incredibly high
-% slowdown.
-% connClosed = strcmp(system('netstat | findstr 8813'),'');
-% if connClosed
-% result = [];
-% break
-% end
-% t = connections('').readInt();
-% if isempty(t)
-% result = [];
-% return
-% end
-% recvlength = [recvlength t];
-% end
-
-activeConnection = connections('');
-recvLength = activeConnection.dis.readInt() - 4;
-
-% Receive the response
-
-result = typecast(activeConnection.dataReader.readBuffer(recvLength),'uint8');
-
-% while length(result) < recvlength
-% t = fread(connections(''),recvlength-length(result),'uint8');
-% % flushinput(connections(''));
-% if isempty(t)
-% result = [];
-% return
-% end
-% result = [result t];
-% end
-
-% Construct the traci.Storage object containing the result
-result = traci.Storage(uint8(result'));
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/sendByteCmd.m b/tools/contributed/TraCI4Matlab/+traci/sendByteCmd.m
deleted file mode 100644
index 15666ba..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/sendByteCmd.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function sendByteCmd(cmdID, varID, objID, value)
-%sendByteCmd An internal function to build a message which sends a byte.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: sendByteCmd.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(cmdID, varID, objID, 1+1);
-message.string = [message.string uint8([sscanf(constants.TYPE_BYTE,'%x') value])];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/sendDoubleCmd.m b/tools/contributed/TraCI4Matlab/+traci/sendDoubleCmd.m
deleted file mode 100644
index cd773a0..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/sendDoubleCmd.m
+++ /dev/null
@@ -1,14 +0,0 @@
-function sendDoubleCmd(cmdID, varID, objID, value)
-%sendDoubleCmd An internal function to build a message which sends a double.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: sendDoubleCmd.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(cmdID, varID, objID, 1+8);
-message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
- traci.packInt64(value)];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/sendExact.m b/tools/contributed/TraCI4Matlab/+traci/sendExact.m
deleted file mode 100644
index 6f79755..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/sendExact.m
+++ /dev/null
@@ -1,62 +0,0 @@
-function result = sendExact()
-%sendExact An internal function to send a message to the SUMO server and
-%parse the result.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: sendExact.m 20 2015-03-02 16:52:32Z afacostag $
-
-global message connections
-import traci.constants
-% warning('off','instrument:fread:unsuccessfulRead');
-
-% Length of the command
-len = 4 + length(message.string);
-activeConnection = connections('');
-
-% Write the message to the tcp socket
-activeConnection.dos.writeInt(len);
-activeConnection.dos.write(message.string);
-
-% Read the result from the socket
-result = traci.recvExact();
-
-if isempty(result)
- fclose(connections(''));
- clear connections('')
- throw(MException('traci:FatalTraciError','Connection closed by SUMO\n'))
-end
-
-% Parse the result
-for i= 1:length(message.queue)
- prefix = result.read(3);
- if prefix(3)==0
- strresult = 'OK';
- elseif prefix(3)==1
- strresult = 'Not Implemented';
- else
- strresult = 'Error';
- end
- err = result.readString();
- if prefix(3) || ~isempty(err)
- message.string = [];
- message.queue = [];
- traci.close();
- throw(MException('traci:FatalTraciError','%s %s %s\n', num2str(prefix), strresult, err));
- elseif prefix(2) ~= message.queue(i)
- traci.close();
- throw(MException('traci:FatalTraciError','Received answer 0x%.2X for command 0x%.2x.\n',...
- prefix(2), message.queue(i)));
- elseif strcmp(prefix(2),constants.CMD_STOP)
- len = result.read(1) - 1;
- result.read(len + 1);
- end
-end
-
-% Clear the message contents
-message.string = [];
-message.queue = [];
-
-
-
diff --git a/tools/contributed/TraCI4Matlab/+traci/sendIntCmd.m b/tools/contributed/TraCI4Matlab/+traci/sendIntCmd.m
deleted file mode 100644
index 686278b..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/sendIntCmd.m
+++ /dev/null
@@ -1,14 +0,0 @@
-function sendIntCmd(cmdID, varID, objID, value)
-%sendIntCmd An internal function to build a message which sends an int.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: sendIntCmd.m 20 2015-03-02 16:52:32Z afacostag $
-
-import traci.constants
-global message
-traci.beginMessage(cmdID, varID, objID, 1+4);
-message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
- traci.packInt32(value)];
-traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/sendReadOneStringCmd.m b/tools/contributed/TraCI4Matlab/+traci/sendReadOneStringCmd.m
deleted file mode 100644
index 5ce5286..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/sendReadOneStringCmd.m
+++ /dev/null
@@ -1,11 +0,0 @@
-function result = sendReadOneStringCmd(cmdID, varID, objID)
-%sendReadOneStringCmd An internal function to build an outgoing message to
-%the SUMO server and parse the response.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: sendReadOneStringCmd.m 20 2015-03-02 16:52:32Z afacostag $
-
-traci.beginMessage(cmdID, varID, objID);
-result = traci.checkResult(cmdID, varID, objID);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/sendStringCmd.m b/tools/contributed/TraCI4Matlab/+traci/sendStringCmd.m
deleted file mode 100644
index 4e18179..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/sendStringCmd.m
+++ /dev/null
@@ -1,18 +0,0 @@
-function sendStringCmd(cmdID, varID, objID, value)
-%sendStringCmd An internal function to build a message which sends a string.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: sendStringCmd.m 20 2015-03-02 16:52:32Z afacostag $
-
-global message
-import traci.constants
-
-% Construct the TraCI message
-traci.beginMessage(cmdID, varID, objID, 1+4+length(value))
-message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
- traci.packInt32(length(value)) uint8(value)];
-
-% Send the TraCI message
-traci.sendExact();
diff --git a/tools/contributed/TraCI4Matlab/+traci/simulationStep.m b/tools/contributed/TraCI4Matlab/+traci/simulationStep.m
deleted file mode 100644
index a522ef0..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/simulationStep.m
+++ /dev/null
@@ -1,58 +0,0 @@
-function responses = simulationStep(timeStep)
-%simulationStep Perform a simulation step in the SUMO server.
-%
-% simulationStep() Perform a simulation step in the SUMO server with
-% a time step of one second.
-%
-% simulationStep(STEP) Perform a simulation step in the SUMO server with
-% a time step STEP.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: simulationStep.m 20 2015-03-02 16:52:32Z afacostag $
-
-
-global message edgeSubscriptionResults guiSubscriptionResults ...
- loopSubscriptionResults junctionSubscriptionResults ...
- laneSubscriptionResults detSubscriptionResults ...
- poiSubscriptionResults polygonSubscriptionResults ...
- routeSubscriptionResults simSubscriptionResults ...
- tlSubscriptionResults vehSubscriptionResults ...
- typeSubscriptionResults
-
-modules = {edgeSubscriptionResults guiSubscriptionResults ...
- loopSubscriptionResults junctionSubscriptionResults ...
- laneSubscriptionResults detSubscriptionResults ...
- poiSubscriptionResults polygonSubscriptionResults ...
- routeSubscriptionResults simSubscriptionResults ...
- tlSubscriptionResults vehSubscriptionResults ...
- typeSubscriptionResults};
-
-if nargin < 1
- timeStep = 0;
-end
-import traci.constants
-
-% Prepare the message to be sent to the SUMO server
-message.queue = [message.queue uint8(sscanf(constants.CMD_SIMSTEP2,'%x'))];
-message.string = [message.string uint8([1+1+4 sscanf(constants.CMD_SIMSTEP2,'%x')]) ...
- traci.packInt32(timeStep)];
-
-% Send the message
-result = traci.sendExact();
-
-% Clear the TraCI subscriptions
-for i=1:length(modules)
- if ~isempty(modules{i})
- modules{i}.reset();
- end
-end
-
-% Get the number of subscriptions and populate them
-numSubs = result.readInt();
-responses = cell(1,2*numSubs);
-for i=1:numSubs
- [response, objectID] = traci.readSubscription(result);
- responses(2*i-1:2*i) = {response objectID};
-end
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/subscribe.m b/tools/contributed/TraCI4Matlab/+traci/subscribe.m
deleted file mode 100644
index ac82844..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/subscribe.m
+++ /dev/null
@@ -1,36 +0,0 @@
-function subscribe(cmdID, subscriptionBegin, subscriptionEnd, objID, varIDs)
-%subscribe An internal function to build a subscription message and parse
-%the response.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $
-
-global message
-
-% Construct the TraCI message
-message.queue = [message.queue uint8(sscanf(cmdID,'%x'))];
-len = 1+1+4+4+4+length(objID)+1+length(varIDs);
-if len <= 255
- message.string = [message.string uint8(len)];
-else
- message.string = [message.string uint8(0) traci.packInt32(len+4)];
-end
-message.string = [message.string uint8(sscanf(cmdID,'%x')),...
- traci.packInt32([length(objID) subscriptionEnd ...
- subscriptionBegin]) uint8(objID)];
-message.string = [message.string uint8(length(varIDs))];
-for v=1:length(varIDs)
- message.string = [message.string sscanf(varIDs{v},'%x')];
-end
-
-% Send the TraCI message and receive the result
-result = traci.sendExact();
-
-% Populate the subsctiptions and parse the result
-[response, objectID] = traci.readSubscription(result);
-if response - uint8(sscanf(cmdID,'%x'))~=16 || ~strcmp(objectID,objID)
- raise(MException('traci:FatalTraciError',['Received answer ' response ...
- ', ' objectID 'for subscription command ' cmdID ', ' objID]));
-end
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/subscribeContext.m b/tools/contributed/TraCI4Matlab/+traci/subscribeContext.m
deleted file mode 100644
index 57d2319..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/subscribeContext.m
+++ /dev/null
@@ -1,51 +0,0 @@
-function subscribeContext(cmdID, subscriptionBegin, subscriptionEnd, objID, domain, dist, varIDs)
-%subscribeContext An internal function to build a context subscription
-%command and parse the response.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $
-
-global message
-global loopSubscriptionResults laneSubscriptionResults vehSubscriptionResults ...
- poiSubscriptionResults polygonSubscriptionResults junctionSubscriptionResults ...
- edgeSubscriptionResults
-
-if strcmp(domain,'0xa0')
- loopSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.inductionloop);
-elseif strcmp(domain,'0xa3')
- laneSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.lane);
-elseif strcmp(domain,'0xa4')
- vehSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicle);
-elseif strcmp(domain,'0xa7')
- poiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.poi);
-elseif strcmp(domain,'0xa8')
- polygonSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.polygon);
-elseif strcmp(domain,'0xa9')
- junctionSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.junction);
-elseif strcmp(domain,'0xaa')
- edgeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.edge);
-end
-
-message.queue = [message.queue uint8(sscanf(cmdID,'%x'))];
-len = 1+1+4+4+4+length(objID)+1+8+1+length(varIDs);
-if len<=255
- message.string = [message.string uint8(len)];
-else
- message.string = [message.string uint8(0) traci.packInt64(len+4)];
-end
-message.string = [message.string uint8(sscanf(cmdID,'%x')),...
- traci.packInt32([length(objID)...
- subscriptionEnd subscriptionBegin]) uint8(objID)];
-message.string = [message.string uint8(sscanf(domain,'%x')) ...
- traci.packInt64(dist) uint8(length(varIDs))];
-for i=1:length(varIDs)
- message.string = [message.string uint8(sscanf(varIDs{i},'%x'))];
-end
-result = traci.sendExact();
-[response, objectID] = traci.readSubscription(result);
-if response - uint8(sscanf(cmdID,'%x'))~=16 || ~strcmp(objectID,objID)
- raise(MException('traci:FatalTraciError','Received answer %.2X,%s for context subscription command %.2X,%s\n',...
- response, objectID, cmdID, objID));
-end
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/switchConnection.m b/tools/contributed/TraCI4Matlab/+traci/switchConnection.m
deleted file mode 100644
index 7f7fba1..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/switchConnection.m
+++ /dev/null
@@ -1,13 +0,0 @@
-function switchConnection(label)
-%switchConnection Switch to another connection with SUMO.
-%
-% switchConnection(label) Switch to the connection specified in LABEL
-% with the SUMO server.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: switchConnection.m 20 2015-03-02 16:52:32Z afacostag $
-
-global connections
-connections('') = connections(label);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/+traci/time2steps.m b/tools/contributed/TraCI4Matlab/+traci/time2steps.m
deleted file mode 100644
index 3556730..0000000
--- a/tools/contributed/TraCI4Matlab/+traci/time2steps.m
+++ /dev/null
@@ -1,10 +0,0 @@
-function timeInMiliseconds = time2steps(time)
-%timeInMiliseconds An internal function to convert time in seconds to
-%miliseconds.
-
-% Copyright 2015 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: time2steps.m 20 2015-03-02 16:52:32Z afacostag $
-
-timeInMiliseconds = int32(time*1000);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/examples/traci_test.m b/tools/contributed/TraCI4Matlab/examples/traci_test.m
deleted file mode 100644
index e696ab0..0000000
--- a/tools/contributed/TraCI4Matlab/examples/traci_test.m
+++ /dev/null
@@ -1,19 +0,0 @@
-%% SUMO TRACI TEST
-% THIS FILE AIMS TO TEST THE TRACI PROTOCOL FOR SUMO.
-
-% Copyright 2013 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: traci_test.m 4 2014-03-03 15:18:05Z afacostag $
-
-clear all
-close all
-clc
-
-%% MAIN
-% HERE, WE START THE SUMO SIMULATOR AND INITIALIZE IT, ACCORDING TO
-% THE EXAMPLE FOUND IN http://sumo-sim.org/userdoc/Tutorials/TraCI4Traffic_Lights.html
-system(['sumo-gui -c ' getenv('SUMO_HOME') '\docs\tutorial\traci_tls\data\cross.sumocfg&']);
-[traciVersion sumoVersion] = traci.init();
-traci.close();
-fprintf('SUMO version: %s\nTraCI version: %d\n',sumoVersion,traciVersion);
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/examples/traci_test2.m b/tools/contributed/TraCI4Matlab/examples/traci_test2.m
deleted file mode 100644
index e42553d..0000000
--- a/tools/contributed/TraCI4Matlab/examples/traci_test2.m
+++ /dev/null
@@ -1,608 +0,0 @@
-%% TRACI TEST 2
-% This m-file shows how to use Traci4Matlab.
-% This example uses the files of the SUMO traci tutorial, see
-% http://sumo-sim.org/userdoc/Tutorials/TraCI4Traffic_Lights.html. If you
-% want to test a TraCI command, just uncomment it. The commands are
-% organized by SUMO object type, some of them needed to be included in
-% the main loop of the script.
-
-% Copyright 2013 Universidad Nacional de Colombia,
-% Politecnico Jaime Isaza Cadavid.
-% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
-% $Id: traci_test2.m 20 2015-03-02 16:52:32Z afacostag $
-
-clear all
-close all
-clc
-
-%% MAIN
-% The scenario consists of a single intersection controlled by a traffic light
-% whose phases are changed if vehicles pass through an induction loop.
-
-% Initialize SUMO from the system. note that it is initialized in graphical
-% interface mode. You have to set the SUMO_HOME environment variable
-% pointing to your SUMO root directory and modify the windows path to
-% include the %SUMO_HOME%/bin directory.
-
-try
- system(['sumo-gui -c ' getenv('SUMO_HOME') '\docs\tutorial\traci_tls\data\cross.sumocfg&']);
-catch err
-end
-
-
-% To test sine vehicle commands, we have to check wether the sumo 0.20.0
-% version is installed, because in that version the prefix of the vehicle
-% names has changed.
-if isempty(strfind(getenv('SUMO_HOME'),'sumo-0.21.0'))
- testVehicle = '10';
-else
- testVehicle = 'right_10';
-end
-
-import traci.constants
-
-% Initialize TraCI
-traci.init();
-
-% Define the traffic light phases in a sumo-readable way
-NSGREEN = 'GrGr';
-NSYELLOW = 'yryr';
-WEGREEN = 'rGrG';
-WEYELLOW = 'ryry';
-
-% Define the traffic light program. The duration of the phases is based on
-% the time required for a car to cross the traffic light from north to
-% south
-PROGRAM = {WEYELLOW,WEYELLOW,WEYELLOW,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSYELLOW,NSYELLOW,WEGREEN};
-
-programPointer = length(PROGRAM);
-% step = 0;
-% steps = zeros(1,800);
-
-
-%% GETIDLIST COMMANDS
-
-
-% areal_dets = traci.areal.getIDList();
-% fprintf('IDs of the areal detectors in the simulation:\n')
-% for i=1:length(areal_dets)
-% fprintf('%s\n',areal_dets{i});
-% end
-% edges = traci.edge.getIDList();
-% fprintf('IDs of the edges in the simulation:\n')
-% for i=1:length(edges)
-% fprintf('%s\n',edges{i});
-% end
-% views = traci.gui.getIDList();
-% fprintf('IDs of the views in the simulacion:\n')
-% for i=1:length(views)
-% fprintf('%s\n',views{i});
-% end
-% inductionloops = traci.inductionloop.getIDList();
-% fprintf('IDs of the induction loops in the simulation:\n')
-% for i=1:length(inductionloops)
-% fprintf('%s\n',inductionloops{i});
-% end
-% junctions = traci.junction.getIDList();
-% fprintf('IDs of the junctions in the simulation:\n')
-% for i=1:length(junctions)
-% fprintf('%s\n',junctions{i});
-% end
-% lanes = traci.lane.getIDList();
-% fprintf('IDs of the lanes in the simulation:\n')
-% for i=1:length(lanes)
-% fprintf('%s\n',lanes{i});
-% end
-% detectors = traci.multientryexit.getIDList();
-% fprintf('IDs of the multi-entry/multi-exit detectors in the simulation:\n')
-% for i=1:length(detectors)
-% fprintf('%s\n',detectors{i});
-% end
-% polygons = traci.polygon.getIDList();
-% fprintf('IDs of te polygons in the simulation:\n')
-% for i=1:length(polygons)
-% fprintf('%s\n',polygons{i});
-% end
-% routes = traci.route.getIDList();
-% fprintf('IDs of the routes in the simulation:\n')
-% for i=1:length(routes)
-% fprintf('%s\n',routes{i});
-% end
-% trafficlights = traci.trafficlights.getIDList();
-% fprintf('IDs of the traffic lights in the simulation:\n')
-% for i=1:length(trafficlights)
-% fprintf('%s\n',trafficlights{i});
-% end
-% vehicletypes = traci.vehicletype.getIDList();
-% fprintf('IDs of the vehicle types in the simulation:\n')
-% for i=1:length(vehicletypes)
-% fprintf('%s\n',vehicletypes{i});
-% end
-
-% THE GETIDLIST COMMAND FOR POIS AND POLYGONS IS TESTED AFTER ADDING THOSE
-% OBJECTS TO THE SIMULATION
-%
-% THE GETIDLIST COMMAND FOR VEHICLES IS PERFOMED ONCE THE VEHICLES ARE
-% LOADED IN THE NETWORK, IN THE MAIN LOOP
-
-
-%% SUBSCIBE COMMANDS: Note that you have to create the required detectors in the cross.det.xml file
-
-% traci.edge.subscribe('1i');
-% traci.gui.subscribe('View #0');
-% traci.inductionloop.subscribe('0');
-% traci.junction.subscribe('0');
-% traci.lane.subscribe('1i_0');
-% traci.multientryexit.subscribe('e3_0_1i');
-% traci.route.subscribe('down');
-% traci.simulation.subscribe();
-% traci.trafficlights.subscribe('0',{constants.TL_RED_YELLOW_GREEN_STATE});
-% tlsCurrentPhaseHandle = traci.trafficlights.getSubscriptionResults('0');
-% tlsCurrentPhase = tlsCurrentPhaseHandle(constants.TL_RED_YELLOW_GREEN_STATE);
-% fprintf('Traffic lights phase: %s\n', tlsCurrentPhase)
-% traci.vehicle.subscribe(testVehicle);
-% traci.vehicletype.subscribe('typeWE');
-% maxSpeedWEHandle = traci.vehicletype.getSubscriptionResults('typeWE');
-% maxSpeedWE = maxSpeedWEHandle(constants.VAR_MAXSPEED);
-
-%% POI AND POLYGON COMMANDS
-
-% traci.poi.add('mypoi', 550, 550, [255 255 0 0], '', 1);
-% pois = traci.poi.getIDList();
-% fprintf('IDs of the pois in the simulation:\n')
-% for i=1:length(pois)
-% fprintf('%s\n',pois{i});
-% end
-% traci.poi.subscribe('mypoi');
-% poiposition = traci.poi.getPosition('mypoi')
-% poiColor = traci.poi.getColor('mypoi')
-% traci.poi.setType('mypoi', 'mypoitype');
-% poitype = traci.poi.getType('mypoi')
-% traci.poi.setPosition('mypoi', 550, 580);
-% poiposition = traci.poi.getPosition('mypoi')
-% traci.poi.setColor('mypoi', [255 255 255 0]);
-% % traci.poi.remove('mypoi', 1);
-%
-% traci.polygon.add('mypolygon', {[440,440],[440,450],[450,440],[450,450]},...
-% [0 255 255 0], false, '', 1);
-% traci.polygon.add('my2ndpolygon', {[400,400],[400,420],[430,420],[430,400],[400,400]},...
-% [255 0 0 0], true, '', 1);
-% polygons = traci.polygon.getIDList();
-% fprintf('IDs of the polygons in the simulation:\n')
-% for i=1:length(polygons)
-% fprintf('%s\n',polygons{i});
-% end
-% traci.polygon.subscribe('mypolygon');
-% polygonColor = traci.polygon.getColor('mypolygon')
-% traci.polygon.setType('mypolygon', 'mypolygontype');
-% polygontype = traci.polygon.getType('mypolygon')
-% traci.polygon.setShape('mypolygon', {[400,400],[400,420],[430,420],[430,400],[400,400]});
-% polygonshape = traci.polygon.getShape('mypolygon')
-% traci.polygon.setColor('mypolygon', [255 255 255 0]);
-% traci.polygon.remove('mypolygon', 1);
-
-
-%% CONTEXT SUBSCRIPTIONS
-% It's worth noting that, according to
-% http://sumo-sim.org/userdoc/TraCI/Object_Context_Subscription.html, only
-% the following SUMO objects are supported: inductive loops, lanes,
-% vehicles, points-of-interest, polygons, junctions, edges.
-
-% traci.edge.subscribeContext('4i',constants.CMD_GET_LANE_VARIABLE,50);
-% traci.inductionloop.subscribeContext('0',constants.CMD_GET_LANE_VARIABLE,20);
-% traci.junction.subscribeContext('0',constants.CMD_GET_VEHICLE_VARIABLE,20);
-% traci.lane.subscribeContext('4i_0',constants.CMD_GET_LANE_VARIABLE,50);
-% traci.poi.subscribeContext('mypoi',constants.CMD_GET_VEHICLE_VARIABLE,50);
-% traci.polygon.subscribeContext('mypolygon',constants.CMD_GET_POLYGON_VARIABLE,30);
-% traci.vehicle.subscribeContext(testVehicle,constants.CMD_GET_VEHICLE_VARIABLE,10);
-%
-% WElaneoccupancy = zeros(1,800);
-% NSlaneoccupancy = zeros(1,800);
-
-% getminexectednumber returns the number of expected vehicles to leave the
-% network, which will be the condition to execute the simulation.
-% MinExpectedNumber = traci.simulation.getMinExpectedNumber();
-
-%% GUI SET COMMANDS
-% traci.gui.setZoom('View #0', 1000);
-% traci.gui.setOffset('View #0', 523.7211, 525.9342);
-traci.gui.setSchema('View #0', 'real world');
-% traci.gui.setBoundary('View #0', 386.95, 485.88, 651.64, 589.01);
-% traci.gui.trackVehicle('View #0', testVehicle);
-
-%% LANE SET COMMANDS
-% traci.lane.setAllowed('1i_0',{'unknown'});
-% traci.lane.setDisallowed('1i_0',{'unknown'});
-% traci.lane.setMaxSpeed('1i_0',5);
-% traci.lane.setLength('1i_0',450);
-
-%% ROUTE COMMANDS
-% traci.route.add('up',{'53o','3i','4o','54i'});
-% routeUpEdges = traci.route.getEdges('up')
-
-%% VEHICLE SET COMMANDS
-% traci.vehicle.setMaxSpeed(testVehicle,5);
-% traci.vehicle.setStop(testVehicle,'1i',50,0,40000);
-% traci.vehicle.changeLane(testVehicle,0,40000);
-% traci.vehicle.slowDown(testVehicle,1,180000);
-% traci.vehicle.changeTarget(testVehicle,'2o');
-% traci.vehicle.setRouteID(testVehicle,'down');
-% traci.vehicle.setRoute(testVehicle,{'51o' '1i' '2o'});
-% traci.vehicle.setAdaptedTraveltime(testVehicle,10000,50000,'1i',15000);
-% % traci.vehicle.setEffort(testVehicle,10000,50000,'1i',0.125); %Not online
-% % traci.vehicle.rerouteTraveltime(testVehicle); %Not online
-% % traci.vehicle.rerouteEffort(testVehicle); %Not online
-% traci.vehicle.setSignals(testVehicle,2);
-% traci.vehicle.setSpeed(testVehicle,5);
-% traci.vehicle.setColor(testVehicle,[0 0 255 0]);
-% traci.vehicle.setLength(testVehicle,10);
-% traci.vehicle.setVehicleClass(testVehicle,'unknown');
-% traci.vehicle.setSpeedFactor(testVehicle,0.6);
-% % traci.vehicle.setSpeedDeviation(testVehicle,5); %Not online
-% traci.vehicle.setEmissionClass(testVehicle,'unknown');
-% traci.vehicle.setWidth(testVehicle,3);
-% traci.vehicle.setMinGap(testVehicle,10);
-% traci.vehicle.setShapeClass(testVehicle,'');
-% traci.vehicle.setAccel(testVehicle,2);
-% traci.vehicle.setDecel(testVehicle,2);
-% traci.vehicle.setImperfection(testVehicle,1);
-% traci.vehicle.setTau(testVehicle,1);
-% traci.vehicle.add('myvehicle','down');
-% traci.vehicle.remove('myvehicle');
-% traci.gui.trackVehicle('View #0', 'myvehicle');
-% traci.vehicle.moveToVTD('right_10','2o',0,608,509);
-
-%% VEHICLE TYPE COMMANDS
-
-% typeLength = traci.vehicletype.getLength('typeWE')
-% typeMaxSpeed = traci.vehicletype.getMaxSpeed('typeWE')
-% typeSpeedFactor = traci.vehicletype.getSpeedFactor('typeWE')
-% typeSpeedDeviation = traci.vehicletype.getSpeedDeviation('typeWE')
-% typeAccel = traci.vehicletype.getAccel('typeWE')
-% typeDecel = traci.vehicletype.getDecel('typeWE')
-% typeImperfection = traci.vehicletype.getImperfection('typeWE')
-% typeTau = traci.vehicletype.getTau('typeWE')
-% typeClass = traci.vehicletype.getVehicleClass('typeWE')
-% typeEmissionClass = traci.vehicletype.getEmissionClass('typeWE')
-% typeShapeClass = traci.vehicletype.getShapeClass('typeWE')
-% typeMinGap = traci.vehicletype.getShapeClass('typeWE')
-% typeWidth = traci.vehicletype.getWidth('typeWE')
-% typeColor = traci.vehicletype.getColor('typeWE')
-%
-% traci.vehicletype.setLength('typeWE',8);
-% traci.vehicletype.setMaxSpeed('typeWE',10);
-% traci.vehicletype.setVehicleClass('typeWE','passenger');
-% traci.vehicletype.setSpeedFactor('typeWE',0.8);
-% traci.vehicletype.setSpeedDeviation('typeWE',0.2);
-% traci.vehicletype.setEmissionClass('typeWE','unknown');
-% traci.vehicletype.setWidth('typeWE',1);
-% traci.vehicletype.setMinGap('typeWE',1);
-% traci.vehicletype.setShapeClass('typeWE','');
-% traci.vehicletype.setAccel('typeWE',5);
-% traci.vehicletype.setDecel('typeWE',3);
-% traci.vehicletype.setImperfection('typeWE',0.6);
-% traci.vehicletype.setTau('typeWE',0.1);
-% traci.vehicletype.setColor('typeWE',[255 255 255 0]);
-
-step = 1;
-% for i=1:length(steps)
-while traci.simulation.getMinExpectedNumber()>0
- % Here, we demonstrate how to use the simulationStep command using an
- % argument. In this case, the simulation is performed each 5 seconds,
- % note the behavior when you increase the delay in the gui
- traci.simulationStep(5000*step);
- pause(1);
- programPointer = min(programPointer+1, length(PROGRAM));
-
- % Get the number of vehicles that passed through the induction loop in
- % the last simulation step
- numPriorityVehicles = traci.inductionloop.getLastStepVehicleNumber('0');
-
- % SHOW THE VEHICLES IDS INSIDE THE NETWORK
- vehicles = traci.vehicle.getIDList();
- % fprintf('IDs of the vehicles in the simulation\n')
- % for j=1:length(vehicles)
- % fprintf('%s\n',vehicles{j});
- % end
-
- % Subscribe to the vehicle with the id contained in the variable "testVehicle"
- % when it is loaded in the network
- % if ismember(testVehicle,vehicles)
- % testVehicleHandle = traci.vehicle.getSubscriptionResults(testVehicle);
- % testVehicleHandle = {testVehicleHandle(constants.VAR_ROAD_ID) testVehicleHandle(constants.VAR_LANEPOSITION)};
- % end
-
- %% GETSUBSCRIPTIONRESULTS COMMANDS: Note that you have to create the required detectors in the cross.det.xml file
-
-% occupancyEdge1Handle = traci.edge.getSubscriptionResults('1i');
-% WElaneoccupancy(i) = occupancyEdge1Handle(constants.LAST_STEP_VEHICLE_NUMBER);
- % offsethandle = traci.gui.getSubscriptionResults('View #0');
- % offset = offsethandle(traci.constants.VAR_VIEW_OFFSET);
- % indloopSubsResults = traci.inductionloop.getSubscriptionResults('0');
- % no = indloopSubsResults(constants.LAST_STEP_VEHICLE_NUMBER);
- % junctionPositionHandle = traci.junction.getSubscriptionResults('0');
- % junctionPosition = junctionPositionHandle(constants.VAR_POSITION);
-% occupancyLane1Handle = traci.lane.getSubscriptionResults('1i_0');
-% WElaneoccupancy(i) = occupancyLane1Handle(constants.LAST_STEP_VEHICLE_NUMBER);
- % occupancyLane1Handle = traci.multientryexit.getSubscriptionResults('e3_0_1i');
-% WElaneoccupancy(i) = occupancyLane1Handle(constants.LAST_STEP_VEHICLE_NUMBER);
- % poiPositionHandle = traci.poi.getSubscriptionResults('mypoi');
- % poiPosition = poiPositionHandle(constants.VAR_POSITION);
- % polygonPositionHandle = traci.polygon.getSubscriptionResults('mypolygon');
- % polygonPosition = polygonPositionHandle(constants.VAR_SHAPE);
- % routeListHandle = traci.route.getSubscriptionResults('down');
- % routeList = routeListHandle(constants.ID_LIST);
- % departedVehicleIDsHandle = traci.simulation.getSubscriptionResults();
- % departedVehicleIDs = departedVehicleIDsHandle(constants.VAR_DEPARTED_VEHICLES_IDS);
-
- %% GET CONTEXT SUBSCRIPTION RESULTS COMMANDS
-
- % edge4i0ContextResults = traci.edge.getContextSubscriptionResults('4i');
- % occupancy4i0Handle1 = edge4i0ContextResults('4i_0');
- % occupancy4i0 = occupancy4i0Handle1(constants.LAST_STEP_VEHICLE_NUMBER);
- % fprintf('%d\n',occupancy4i0);
-
- % loop0ContextResults = traci.inductionloop.getContextSubscriptionResults('0');
- % priorityVehiclesPassedHandle = loop0ContextResults('4i_0');
- % priorityVehiclesPassed = priorityVehiclesPassedHandle(constants.LAST_STEP_VEHICLE_NUMBER);
- % fprintf('%d\n',priorityVehiclesPassed);
-
- % junctionContextResults = traci.junction.getContextSubscriptionResults('0');
-
- % laneContextSubscriptionResults = traci.lane.getContextSubscriptionResults('4i_0');
- % poiContextSubscriptionResults = traci.poi.getContextSubscriptionResults('mypoi');
- % polygonContextSubscriptionResults = traci.polygon.getContextSubscriptionResults('mypolygon');
- % vehicleContextSubscriptionResults = traci.vehicle.getContextSubscriptionResults(testVehicle);
-
- %% AREAL DETECTOR COMMANDS: Note that you have to create the detector in the cross.det.xml file
- % arealDetectorIDCount = traci.areal.getIDCount();
- % fprintf('Number of areal detectors in the simulation: %d\n',arealDetectorIDCount);
-
- % JamLengthVehicle = traci.areal.getJamLengthVehicle('0');
- % fprintf('Jam lenght in vehicles in the areal detector 0: %d\n',JamLengthVehicle);
-
- % JamLengthMeters = traci.areal.getJamLengthMeters('0');
- % fprintf('Jam lenght in meters in the areal detector 0: %d\n',JamLengthMeters);
-
- % vehicleMeanSpeedAreal0 = traci.areal.getLastStepMeanSpeed('0');
- % fprintf('Average speed in the areal detector 0: %d\n',vehicleMeanSpeedAreal0);
-
- % vehicleOccupancyAreal0 = traci.areal.getLastStepOccupancy('0');
- % fprintf('Occupancy in the areal detector 0 1i: %d\n',vehicleOccupancyAreal0);
-
-
- %% EDGE COMMANDS
-
- % edgeIDCount = traci.edge.getIDCount();
- % fprintf('Number of edges in the simulation: %d\n',edgeIDCount);
-
- % travelTime = traci.edge.getAdaptedTraveltime('1i',10);
- % fprintf('Travel time in 10 seconfs in the edge 1i: %d\n',travelTime);
-
- % effort = traci.edge.getEffort('1i',10);
- % fprintf('Travel effort in 10 seconds in the edge 1i: %d\n',effort);
-
- % CO2EmissionEdge1i = traci.edge.getCO2Emission('1i');
- % fprintf('CO2 emission in the edge 1i: %d\n',CO2EmissionEdge1i);
-
- % COEmissionEdge1i = traci.edge.getCOEmission('1i');
- % fprintf('CO emission in the edge 1i: %d\n',COEmissionEdge1i);
-
- % HCEmissionEdge1i = traci.edge.getHCEmission('1i');
- % fprintf('HC emission in the edge 1i: %d\n',HCEmissionEdge1i);
-
- % PMxEmissionEdge1i = traci.edge.getPmxEmission('1i');
- % fprintf('PMx emission in the edge 1i: %d\n',PMxEmissionEdge1i);
-
- % NOxEmissionEdge1i = traci.edge.getNOxEmission('1i');
- % fprintf('NOx emission in the edge 1i: %d\n',NOxEmissionEdge1i);
-
- % fuelConsumptionEdge1i = traci.edge.getFuelConsumption('1i');
- % fprintf('Fuel consumption in the edge 1i: %d\n',fuelConsumptionEdge1i);
-
- % noiseEmissionEdge1i = traci.edge.getNoiseEmission('1i');
- % fprintf('Noise emission in the edge 1i: %d\n',noiseEmissionEdge1i);
-
- % vehicleMeanSpeedEdge1i = traci.edge.getLastStepMeanSpeed('1i');
- % fprintf('Average speed in the edge 1i: %d\n',vehicleMeanSpeedEdge1i);
-
- % vehicleOccupancyEdge1i = traci.edge.getLastStepOccupancy('1i');
- % fprintf('Occupancy in the edge 1i: %d\n',vehicleOccupancyEdge1i);
-
- % vehicleMeanLengthEdge1i = traci.edge.getLastStepLength('1i');
- % fprintf('Average length in the edge 1i: %d\n',vehicleMeanLengthEdge1i);
-
- % vehicleTravelTimeEdge1i = traci.edge.getTraveltime('1i');
- % fprintf('Average time of the vehicles in the edge 1i: %d\n',vehicleTravelTimeEdge1i);
-
- % vehicleHaltingEdge1i = traci.edge.getLastStepHaltingNumber('1i');
- % fprintf('Stopped vehicles in the edge 1i: %d\n',vehicleHaltingEdge1i);
-
- % vehicleIDsEdge1i = traci.edge.getLastStepVehicleIDs('1i');
- % fprintf('IDs of the vehicles in the edge 1i: \n');
- % disp(vehicleIDsEdge1i)
-
- % traci.edge.adaptTraveltime('1i',15);
-
- % traci.edge.setEffort('1i',1.343);
-
- % traci.edge.setMaxSpeed('1i',5);
-
- %% GUI GET COMMANDS
-
- % guizoom = traci.gui.getZoom()
- % offset = traci.gui.getOffset()
- % schema = traci.gui.getSchema()
- % boundary = traci.gui.getBoundary()
-
- %% INDUCTION LOOP COMMANDS
-
- % loop0position = traci.inductionloop.getPosition('0');
- % loop0LaneID = traci.inductionloop.getLaneID('0')
- % loop0MeanSpeed = traci.inductionloop.getLastStepMeanSpeed('0')
- % loop0VehicleIDs = traci.inductionloop.getLastStepVehicleIDs('0')
- % loop0Occupancy = traci.inductionloop.getLastStepOccupancy('0')
- % loop0MeanLength = traci.inductionloop.getLastStepMeanLength('0')
- % loop0TimeSinceDetection = traci.inductionloop.getTimeSinceDetection('0')
-
- %% JUNCTION COMMANDS
-
- % junctionPosition = traci.junction.getPosition('0');
-
- %% LANE GET COMMANDS
-
- % lane1i0Length = traci.lane.getLength('1i_0');
- % lane1i0MaxSpeed = traci.lane.getMaxSpeed('1i_0');
- % lane1i0Width = traci.lane.getWidth('1i_0');
- % lane1i0AllowedVehicles = traci.lane.getAllowed('1i_0');
- % lane1i0DisallowedVehicles = traci.lane.getDisallowed('1i_0');
- % lane1i0LinkNumber = traci.lane.getLinkNumber('1i_0');
- % lane1i0Links = traci.lane.getLinks('1i_0');
- % lane1i0Shape = traci.lane.getShape('1i_0');
- % lane1i0EdgeID = traci.lane.getEdgeID('1i_0');
- % lane1i0CO2Emmision = traci.lane.getCO2Emission('1i_0')
- % lane1i0COEmmision = traci.lane.getCOEmission('1i_0')
- % lane1i0HCEmmision = traci.lane.getHCEmission('1i_0')
- % lane1i0PMxEmmision = traci.lane.getPMxEmission('1i_0')
- % lane1i0NOxEmmision = traci.lane.getNOxEmission('1i_0')
- % lane1i0FuelConsumption = traci.lane.getFuelConsumption('1i_0')
- % lane1i0NoiseEmission = traci.lane.getNoiseEmission('1i_0')
- % lane1i0MeanSpeed = traci.lane.getLastStepMeanSpeed('1i_0')
- % lane1i0Occupancy = traci.lane.getLastStepOccupancy('1i_0')
- % lane1i0MeanVehicleLength = traci.lane.getLastStepLength('1i_0')
- % lane1i0TravelTime = traci.lane.getTraveltime('1i_0')
- % lane1i0HalringNumber = traci.lane.getLastStepHaltingNumber('1i_0')
- % lane1i0VehicleIDs = traci.lane.getLastStepVehicleIDs('1i_0')
-
- %% MULTIENTRY=EXIT COMMANDS: Note that you have to create the detector in the cross.det.xml file
-
- % muiVehicleNumber = traci.multientryexit.getLastStepVehicleNumber('e3_0_1i')
- % muiMeanSpeed = traci.multientryexit.getLastStepMeanSpeed('e3_0_1i')
- % muiVehIDs = traci.multientryexit.getLastStepVehicleIDs('e3_0_1i')
- % muiHaltingVehicles = traci.multientryexit.getLastStepHaltingNumber('e3_0_1i')
-
- %% SIMULATION COMMANDS
-
- % clc
- % currentTime = traci.simulation.getCurrentTime()
- % loadedNumber = traci.simulation.getLoadedNumber()
- % loadedIDList = traci.simulation.getLoadedIDList();
- % departedNumber = traci.simulation.getDepartedNumber()
- % departedIDList = traci.simulation.getDepartedIDList();
- % if ismember(testVehicle,departedIDList)
- % traci.vehicle.moveTo(testVehicle,'1i_0',20);
- % end
- % arrivedNumber = traci.simulation.getArrivedNumber()
- % arrivedIDList = traci.simulation.getArrivedIDList()
- % startingTeleportNumber = traci.simulation.getStartingTeleportNumber()
- % startingTeleportIDList = traci.simulation.getStartingTeleportIDList()
- % endingTeleportNumber = traci.simulation.getEndingTeleportNumber()
- % deltaT = traci.simulation.getDeltaT()
- % netBoundary = traci.simulation.getNetBoundary()
- % [x y] = traci.simulation.convert2D('1i',10)
- % [roadID pos laneID] = traci.simulation.convertRoad(20, 508.35)
- % [longitude latitude] = traci.simulation.convertGeo(20, 508.35)
- % distance2D = traci.simulation.getDistance2D(20, 508.35, 30, 508.35)
- % distanceRoad = traci.simulation.getDistanceRoad('1i', 10, '1i', 20)
-
- %% TRAFFIC LIGHTS COMMANDS
-
- % tlsRYGState = traci.trafficlights.getRedYellowGreenState('0')
- % tlsRYGDefinition = traci.trafficlights.getCompleteRedYellowGreenDefinition('0')
- % tlscontrolledLanes = traci.trafficlights.getControlledLanes('0')
- % tlscontrolledLinks = traci.trafficlights.getControlledLinks('0')
- % tlsProgram = traci.trafficlights.getProgram('0')
- % tlsPhase = traci.trafficlights.getPhase('0')
- % traci.trafficlights.setPhase('0',0);
- % traci.trafficlights.setProgram('0','0');
- % traci.trafficlights.setPhaseDuration('0',5);
-% myRYGDefinition = traci.trafficlights.Logic('0',0,0,0,...
-% {traci.trafficlights.Phase(31000,31000,31000,'GrGr'),...
-% traci.trafficlights.Phase(31000,31000,31000,'rGrG'),...
-% traci.trafficlights.Phase(6000,6000,6000,'ryry')});
- % traci.trafficlights.setCompleteRedYellowGreenDefinition('0',tlsRYGDefinition{1});
- % tlsRYGDefinition = traci.trafficlights.getCompleteRedYellowGreenDefinition('0');
-
- %% VEHICLE GET COMMANDS
-
- % vehSpeed = traci.vehicle.getSpeed(testVehicle)
- % vehSpeedWOTraci = traci.vehicle.getSpeedWithoutTraCI(testVehicle)
- % vehPosition = traci.vehicle.getPosition(testVehicle)
- % vehAngle = traci.vehicle.getAngle(testVehicle)
- % vehRoadID = traci.vehicle.getRoadID(testVehicle)
- % vehLaneID = traci.vehicle.getLaneID(testVehicle)
- % vehLaneIndex = traci.vehicle.getLaneIndex(testVehicle)
- % vehTypeID = traci.vehicle.getTypeID(testVehicle)
- % vehRouteID = traci.vehicle.getRouteID(testVehicle)
- % vehRoute = traci.vehicle.getRoute(testVehicle)
- % vehLanePos = traci.vehicle.getLanePosition(testVehicle)
- % vehColor = traci.vehicle.getColor(testVehicle)
- % vehCO2Emission = traci.vehicle.getCO2Emission(testVehicle)
- % vehCOEmission = traci.vehicle.getCOEmission(testVehicle)
- % vehPmxEmission = traci.vehicle.getPMxEmission(testVehicle)
- % vehNOxEmission = traci.vehicle.getNOxEmission(testVehicle)
- % vehFuelConsumption = traci.vehicle.getFuelConsumption(testVehicle)
- % vehAdaptedTraveltime = traci.vehicle.getAdaptedTraveltime(testVehicle,10,'1i')
- % vehEffort = traci.vehicle.getEffort(testVehicle,10,'1i')
- % vehValidRoute = traci.vehicle.isRouteValid(testVehicle)
- % vehSignals = traci.vehicle.getSignals(testVehicle)
- % vehMaxSpeed = traci.vehicle.getMaxSpeed(testVehicle)
- % vehClass = traci.vehicle.getVehicleClass(testVehicle)
- % vehSpeedFactor = traci.vehicle.getSpeedFactor(testVehicle)
- % vehSpeedDeviation = traci.vehicle.getSpeedDeviation(testVehicle)
- % vehEmissionClass = traci.vehicle.getEmissionClass(testVehicle)
- % vehWidth = traci.vehicle.getWidth(testVehicle)
- % vehMinGap = traci.vehicle.getMinGap(testVehicle)
- % vehShapeClass = traci.vehicle.getShapeClass(testVehicle)
- % vehAccel = traci.vehicle.getAccel(testVehicle)
- % vehDecel = traci.vehicle.getDecel(testVehicle)
- % vehImperfection = traci.vehicle.getImperfection(testVehicle)
- % vehTau = traci.vehicle.getTau(testVehicle)
- if ismember(testVehicle,vehicles)
- vehLeader = traci.vehicle.getLeader(testVehicle, 1)
- end
- % vehBestLanes = traci.vehicle.getBestLanes(testVehicle)
- % vehDrivingDistance = traci.vehicle.getDrivingDistance(testVehicle,'2o',30)
- % vehDrivingDistance2D = traci.vehicle.getDrivingDistance2D(testVehicle,620,510)
-
-
- % Change the phase of the traffic light if a vehicle passed through the
- % induction loop
- if numPriorityVehicles > 0
- % traci.gui.screenshot('View #0','passedvehicle.bmp')
- % loop0VehicleData = traci.inductionloop.getVehicleData('0')
- if programPointer == length(PROGRAM)
- programPointer = 1;
- elseif ~strcmp(PROGRAM(programPointer), WEYELLOW)
- programPointer = 4;
- end
- end
- traci.trafficlights.setRedYellowGreenState('0', PROGRAM{programPointer});
-
- % AN ADDITIONAL EVIDENCE OF THE TRAFFIC LIGHTS SUBSCRIPTION, DON'T
- % FORGET TO SET THE SUBSCRIPTION BEFORE EXECUTING IT.
- % if no > 0
- % tlsCurrentPhaseHandle = traci.trafficlights.getSubscriptionResults('0');
- % tlsCurrentPhase = tlsCurrentPhaseHandle(constants.TL_RED_YELLOW_GREEN_STATE);
- % fprintf('The traffic lights'' phase changed to: %s\n', tlsCurrentPhase)
- % end
-
- % AN ADDITIONAL EVIDENCE OF THE LANE SUBSCRIPTIONS, ENABLE THE PLOTTING
- % FUNCTIONS BELOW TO VISUALIZE IT.
-% WElaneoccupancy(i) = traci.lane.getLastStepVehicleNumber('1i_0')+...
-% traci.lane.getLastStepVehicleNumber('2i_0');
-% NSlaneoccupancy(i) = traci.lane.getLastStepVehicleNumber('3i_0')+...
-% traci.lane.getLastStepVehicleNumber('4i_0');
-% %
-% steps(i) = i;
-% MinExpectedNumber = traci.simulation.getMinExpectedNumber();
- step = step + 1;
-end
-traci.close()
-% plot(steps, WElaneoccupancy)
-% hold;
-% plot(steps, NSlaneoccupancy, 'r')
-% legend('WE lane occupancy', 'NS lane occupancy')
-% title('Lane occupancy vs time')
-% xlabel('t (seconds)')
-% ylabel('number of vehicles')
\ No newline at end of file
diff --git a/tools/contributed/sumolib4matlab/+sumolib/+demand/BusStop.m b/tools/contributed/sumolib4matlab/+sumolib/+demand/BusStop.m
new file mode 100644
index 0000000..1d8ecef
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/+sumolib/+demand/BusStop.m
@@ -0,0 +1,43 @@
+classdef BusStop
+ properties %(GetAccess = private)
+ id
+ lane
+ startPos
+ endPos
+ friendlyPos
+ line
+ end
+ methods
+ function this = BusStop(varargin)
+ %sumolib.demand.BusStop constructs a BusStop object.
+ % myBusStop = sumolib.demand.BusStop(ID,LANE) creates an
+ % object myBusStop identified by the string ID and placed in
+ % the lane with ID LANE.
+ % Further properties can be defined as name-value pairs.
+ % These properties can be found at:
+ % http://sumo.dlr.de/wiki/Simulation/Public_Transport
+
+ % Copyright 2015 Universidad Nacional de Colombia,
+ % Politecnico Jaime Isaza Cadavid.
+ % $Id$
+
+ p = inputParser;
+ p.FunctionName = 'sumolib.demand.busStop';
+ p.addRequired('id', @ischar);
+ p.addRequired('lane', @ischar);
+ p.addOptional('startPos', [], @isnumeric);
+ p.addOptional('endPos', [], @isnumeric);
+ p.addOptional('friendlyPos', [], @isbool);
+ p.addOptional('line', '', @ischar);
+ p.parse(varargin{:})
+
+ this.id = p.Results.id;
+ this.lane = p.Results.lane;
+ this.startPos = p.Results.startPos;
+ this.endPos = p.Results.endPos;
+ this.friendlyPos = p.Results.friendlyPos;
+ this.line = p.Results.line;
+
+ end
+ end
+end
\ No newline at end of file
diff --git a/tools/contributed/sumolib4matlab/+sumolib/+demand/Flow.m b/tools/contributed/sumolib4matlab/+sumolib/+demand/Flow.m
new file mode 100644
index 0000000..3ee6f47
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/+sumolib/+demand/Flow.m
@@ -0,0 +1,109 @@
+classdef Flow
+ properties %(GetAccess = private)
+% beginTime
+% endTime
+ type
+ from
+ to
+ via
+ demandType
+ demand
+ number
+ color
+ departLane
+ departPos
+ departSpeed
+ arrivalLane
+ arrivalPos
+ arrivalSpeed
+ line
+ personNumber
+ containerNumber
+ stop
+ end
+ methods
+ function this = Flow(varargin)
+ %sumolib.demand.Flow constructs a Flow object.
+ % myFlow = sumolib.demand.Flow(FROM) creates an object
+ % myFlow representing a flow of vehicles with an origin given
+ % by the FROM string, which is the ID of the origin edge. The
+ % related number of vehicles is generated when the
+ % generateDemand function is executed specifying this flow,
+ % using the SUMO defaults.
+ % myFlow = sumolib.demand.Flow(...,DEMANTYPE,DEMAND)
+ % Specifies the type of demand as a string and the demand as
+ % a numeric array. The available demand types are
+ % vehsPerHour, period and probability with corresponding
+ % demands given in vehicles per hour, seconds and a
+ % probability between 0 and 1. Note that you must define both
+ % DEMANDTYPE and DEMAND.
+ % Further properties can be defined as name-value pairs.
+ % These properties can be found at:
+ % http://sumo.dlr.de/wiki/Demand/Shortest_or_Optimal_Path_Routing#Flow_Definitions
+
+ % Copyright 2015 Universidad Nacional de Colombia,
+ % Politecnico Jaime Isaza Cadavid.
+ % $Id$
+
+ demandTypes = {'vehsPerHour', 'period', 'probability'};
+ departLaneTypes = {'random','free','departLane'};
+ departPosTypes = {'random','free','random_free','base'};
+ departSpeedTypes = {'random','max'};
+ arrivalLaneTypes = {'current'};
+ arrivalPosTypes = {'random','max'};
+ arrivalSpeedTypes = {'current'};
+
+ p = inputParser;
+ p.FunctionName = 'sumolib.demand.Flow';
+ p.addRequired('from', @ischar);
+ % p.addRequired('beginTime', @isnumeric);
+ % p.addOptional('endTime', [], @isnumeric)
+ p.addOptional('demandType', [], @(x) any(validatestring(x,demandTypes)))
+ p.addOptional('demand', [], @isnumeric)
+ p.addOptional('type', [], @(x) isa(x,'sumolib.demand.VehicleType'))
+ p.addOptional('to', '', @ischar)
+ p.addOptional('via', [], @ischar)
+ p.addOptional('number', [], @isnumeric)
+ p.addOptional('color', [], @(x) length(x)<=4 && all(x)>=0 && all(x)<=255)
+ p.addOptional('departLane', [], @(x) isnumeric(x) || any(validatestring(x,departLaneTypes)))
+ p.addOptional('departPos', [], @(x) isnumeric(x) && x>=0 || any(validatestring(x,departPosTypes)))
+ p.addOptional('departSpeed', [], @(x) isnumeric(x) && x>=0 || any(validatestring(x,departSpeedTypes)))
+ p.addOptional('arrivalLane', [], @(x) isnumeric(x) || any(validatestring(x,arrivalLaneTypes)))
+ p.addOptional('arrivalPos', [], @(x) isnumeric(x) && x>=0 || any(validatestring(x,arrivalPosTypes)))
+ p.addOptional('arrivalSpeed', [], @(x) isnumeric(x) && x>=0 || any(validatestring(x,arrivalSpeedTypes)))
+ p.addOptional('stop', {}, @iscell)
+ p.parse(varargin{:})
+
+ if xor(isempty(p.Results.demandType),isempty(p.Results.demand))
+ throw(MException('Flow:demandError',...
+ 'Demand type or demand is not specified'));
+ end
+
+ if isempty(p.Results.demand) && isempty(p.Results.number)
+ throw(MException('Flow:demandError',...
+ 'You have to provide demand type or vehicle number'));
+ end
+
+ this.from = p.Results.from;
+% this.beginTime = p.Results.beginTime;
+% this.endTime = p.Results.endTime;
+ this.type = p.Results.type;
+ this.from = p.Results.from;
+ this.to = p.Results.to;
+ this.via = p.Results.via;
+ this.demandType = p.Results.demandType;
+ this.demand = p.Results.demand;
+ this.number = p.Results.number;
+ this.color = num2str(p.Results.color);
+ this.color = strrep(this.color, ' ', ',');
+ this.departLane = p.Results.departLane;
+ this.departPos = p.Results.departPos;
+ this.departSpeed = p.Results.departSpeed;
+ this.arrivalLane = p.Results.arrivalLane;
+ this.arrivalPos = p.Results.arrivalPos;
+ this.arrivalSpeed = p.Results.arrivalSpeed;
+ this.stop = p.Results.stop;
+
+ end
+ end
+end
\ No newline at end of file
diff --git a/tools/contributed/sumolib4matlab/+sumolib/+demand/Stop.m b/tools/contributed/sumolib4matlab/+sumolib/+demand/Stop.m
new file mode 100644
index 0000000..9f01fdf
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/+sumolib/+demand/Stop.m
@@ -0,0 +1,69 @@
+classdef Stop
+ properties %(GetAccess = private)
+ busStop
+ lane
+ endPos
+ startPos
+ friendlyPos
+ duration
+ until
+ index
+ triggered
+ containerTriggered
+ parking
+ actType
+ end
+ methods
+ function this = Stop(varargin)
+ %sumolib.demand.Stop constructs a Stop object.
+ % myStop = sumolib.demand.Stop(BUSSTOP) creates an
+ % object myStop in the bus stops defined by BUSSTOP. BUSSTOP
+ % is a cell array containing objects of the class
+ % sumolib.demand.BusStop. The duration of the stop is given
+ % by the SUMO default values.
+ % myStop = sumolib.demand.Stop(LANE) creates an
+ % object myStop in the lane with id LANE.
+ % Further properties can be defined as name-value pairs.
+ % These properties can be found at:
+ % http://sumo.dlr.de/wiki/Specification#Stops
+
+ % Copyright 2015 Universidad Nacional de Colombia,
+ % Politecnico Jaime Isaza Cadavid.
+ % $Id$
+
+ p = inputParser;
+ p.FunctionName = 'sumolib.demand.Stop';
+ p.addRequired('busStopOrLane', @(x) iscell(x) || ischar(x));
+ p.addOptional('endPos', [], @isnumeric);
+ p.addOptional('startPos', [], @isnumeric);
+ p.addOptional('friendlyPos', [], @isbool);
+ p.addOptional('duration', [], @isnumeric);
+ p.addOptional('until', [], @isnumeric);
+ p.addOptional('index', [], @isnumeric);
+ p.addOptional('triggered', [], @isbool);
+ p.addOptional('containerTriggered', [], @isbool);
+ p.addOptional('parking', [], @isbool);
+ p.addOptional('actType', [], @ischar);
+ p.parse(varargin{:})
+
+ if iscell(p.Results.busStopOrLane)
+ this.busStop = p.Results.busStopOrLane;
+ this.lane = '';
+ else
+ this.lane = p.Results.busStopOrLane;
+ this.busStop = {};
+ end
+
+ this.endPos = p.Results.endPos;
+ this.startPos = p.Results.startPos;
+ this.friendlyPos = p.Results.friendlyPos;
+ this.duration = p.Results.duration;
+ this.until = p.Results.until;
+ this.index = p.Results.index;
+ this.triggered = p.Results.triggered;
+ this.containerTriggered = p.Results.containerTriggered;
+ this.parking = p.Results.parking;
+ this.actType = p.Results.actType;
+ end
+ end
+end
\ No newline at end of file
diff --git a/tools/contributed/sumolib4matlab/+sumolib/+demand/TurnProbability.m b/tools/contributed/sumolib4matlab/+sumolib/+demand/TurnProbability.m
new file mode 100644
index 0000000..a96072e
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/+sumolib/+demand/TurnProbability.m
@@ -0,0 +1,44 @@
+classdef TurnProbability
+ properties %(GetAccess = private)
+% beginTime
+% endTime
+ fromEdge
+ toEdges
+ probabilities
+ end
+ methods
+ function this = TurnProbability(varargin)
+ %sumolib.demand.TurnProbability constructs a TurnProbability
+ %object.
+ % myTurnProbability = sumolib.demand.TurnProbability(FROMEDGE,...
+ % TOEDGES,PROBABILITIES) creates an object myTurnProbability
+ % where FROMEDGE is the ID of the SUMO edge of interest,
+ % TOEDGES is a cell array containing the IDs of edges
+ % connected to FROMEDGE and PROBABILITIES is an array of the
+ % same length than TOEDGES that specifies the turning
+ % probabilities with an origin given by FROMEDGE and
+ % destinations given by FROMEDGES.
+
+ % Copyright 2015 Universidad Nacional de Colombia,
+ % Politecnico Jaime Isaza Cadavid.
+ % $Id$
+
+ p = inputParser;
+ p.FunctionName = 'sumolib.demand.TurnProbability';
+% p.addRequired('beginTime', @isnumeric);
+% p.addRequired('endTime', @isnumeric);
+ p.addRequired('fromEdge', @ischar);
+ p.addRequired('toEdges', @iscell);
+ p.addRequired('probabilities', @iscell);
+
+ p.parse(varargin{:})
+
+% this.beginTime = p.Results.beginTime;
+% this.endTime = p.Results.endTime;
+ this.fromEdge = p.Results.fromEdge;
+ this.toEdges = p.Results.toEdges;
+ this.probabilities = p.Results.probabilities;
+
+ end
+ end
+end
\ No newline at end of file
diff --git a/tools/contributed/sumolib4matlab/+sumolib/+demand/VehicleType.m b/tools/contributed/sumolib4matlab/+sumolib/+demand/VehicleType.m
new file mode 100644
index 0000000..9c1ff73
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/+sumolib/+demand/VehicleType.m
@@ -0,0 +1,104 @@
+classdef VehicleType
+ properties %(GetAccess = private)
+ id
+ accel
+ decel
+ sigma
+ tau
+ vehTypelength
+ minGap
+ maxSpeed
+ speedFactor
+ speedDev
+ color
+ vClass
+ emissionClass
+ guiShape
+ width
+ imgFile
+ impatience
+ laneChangeModel
+ personCapacity
+ containerCapacity
+ boardingDuration
+ loadingDuration
+ end
+ methods
+ function this = VehicleType(varargin)
+ %sumolib.demand.VehicleType constructs a VehicleType object.
+ % myType = sumolib.demand.VehicleType(ID) creates an object
+ % myType identified by the string ID, that is an instance of
+ % the sumolib.demand.VehicleType class.
+ % Further properties can be defined as name-value pairs.
+ % These properties can be found at:
+ % http://sumo.dlr.de/wiki/Specification#Types
+
+ % Copyright 2015 Universidad Nacional de Colombia,
+ % Politecnico Jaime Isaza Cadavid.
+ % $Id$
+
+ vClasses = {'ignoring','private','emergency','authority',...
+ 'army','vip','passenger','hov','taxi','bus','coach',...
+ 'delivery','truck','trailer','tram','rail_urban',...
+ 'rail','rail_electric','motorcycle','moped','bycicle',...
+ 'pedestrian','evehicle','ship','custom1','custom2'};
+
+ guiShapes = {'pedestrian','bycicle','motorcycle','passenger',...
+ 'passenger/sedan','passenger/hatchback','passenger/wagon',...
+ 'passenger/van','delivery','truck','truck/semitrailer',...
+ 'truck/trailer','bus','bus/city','bus/flexible',...
+ 'bus/overland','rail','rail/light','rail/city','rail/slow',...
+ 'rail/fast','rail/cargo','evehicle','ship'};
+
+ p = inputParser;
+ p.FunctionName = 'sumolib.demand.VehicleType';
+ p.addRequired('id', @ischar);
+ p.addOptional('accel', [], @isnumeric);
+ p.addOptional('decel', [], @isnumeric);
+ p.addOptional('sigma', [], @isnumeric);
+ p.addOptional('tau', [], @isnumeric);
+ p.addOptional('length', [], @isnumeric);
+ p.addOptional('minGap', [], @isnumeric);
+ p.addOptional('maxSpeed', [], @isnumeric);
+ p.addOptional('speedFactor', [], @isnumeric);
+ p.addOptional('speedDev', [], @isnumeric);
+ p.addOptional('color', [], @(x) length(x)<=3 && all(x)>=0 && all(x)<=1);
+ p.addOptional('vClass', [], @(x) any(validatestring(x,vClasses)));
+ p.addOptional('emissionClass', [], @ischar);
+ p.addOptional('guiShape', [], @(x) any(validatestring(x,guiShapes)));
+ p.addOptional('width', [], @isnumeric);
+ p.addOptional('imgFile', [], @ischar);
+ p.addOptional('impatience', [], @(x) isnumeric(x) || strcmp(x,'off') == 1);
+ p.addOptional('laneChangeModel', [], @ischar);
+ p.addOptional('personCapacity', [], @isnumeric);
+ p.addOptional('containerCapacity', [], @isnumeric);
+ p.addOptional('boardingDuration', [], @isnumeric);
+ p.addOptional('loadingDuration', [], @isnumeric);
+ p.parse(varargin{:})
+
+ this.id = p.Results.id;
+ this.accel = p.Results.accel;
+ this.decel = p.Results.decel;
+ this.sigma = p.Results.sigma;
+ this.tau = p.Results.tau;
+ this.vehTypelength = p.Results.length;
+ this.minGap = p.Results.minGap;
+ this.maxSpeed = p.Results.maxSpeed;
+ this.speedFactor = p.Results.speedFactor;
+ this.speedDev = p.Results.speedDev;
+ this.color = num2str(p.Results.color);
+ this.color = strrep(this.color, ' ', ',');
+ this.vClass = p.Results.vClass;
+ this.emissionClass = p.Results.emissionClass;
+ this.guiShape = p.Results.guiShape;
+ this.width = p.Results.width;
+ this.imgFile = p.Results.imgFile;
+ this.impatience = p.Results.impatience;
+ this.laneChangeModel = p.Results.laneChangeModel;
+ this.personCapacity = p.Results.personCapacity;
+ this.containerCapacity = p.Results.containerCapacity;
+ this.boardingDuration = p.Results.boardingDuration;
+ this.loadingDuration = p.Results.loadingDuration;
+ end
+ end
+end
\ No newline at end of file
diff --git a/tools/contributed/sumolib4matlab/+sumolib/+demand/generateDemand.m b/tools/contributed/sumolib4matlab/+sumolib/+demand/generateDemand.m
new file mode 100644
index 0000000..746a929
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/+sumolib/+demand/generateDemand.m
@@ -0,0 +1,259 @@
+%% generateDemand Generates vehicle demand in a SUMO-readable format.
+% generateDemand(netFile, flows, beginTime, endTime) Generates vehicle
+% demand for a SUMO network through origin-destination specification.
+% netFile is a string specifying the path where the network file is
+% located. flows is a cell array containing objects of the
+% sumolib.demand.Flow class. In this case, the Flow instances must define
+% a destination edge i.e their 'to' property must be non null. The demand
+% is generated by uniformly distributing the elements of the demand
+% property of the flowProfiles objects along the interval defined by
+% beginTime and endTime. The output files have the same name as the
+% network file and are created in the same directory.
+% generateDemand(..., turns) Generates demand through turning
+% probabilities at junctions. The turns parameter is an instance of
+% the sumolib.demand.TurnProbability that assigns a turn probability to
+% the links connected to the given edge. Note that the flows should not
+% define a destination edge, otherwise it is ignored.
+% generateDemand(..., prefix). The output files are generated in the
+% directory defined by the string prefix, which also specifies the prefix
+% with which files are saved. It is recommended that the netFile and the
+% outputs reside in the same folder.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+function generateDemand(netFile, flows, beginTime, endTime,...
+ varargin)
+
+p = inputParser;
+
+addRequired(p,'netFile', at ischar);
+addRequired(p,'flows', at iscell);
+addRequired(p,'beginTime', at isnumeric);
+addRequired(p,'endTime', at isnumeric);
+addOptional(p,'turns',{}, at iscell);
+addOptional(p,'prefix','', at ischar);
+
+parse(p,netFile, flows, beginTime, endTime ,varargin{:});
+
+% Disable warnings related to objett-to-struct conversion
+warning('off', 'MATLAB:structOnObject');
+
+netFile = p.Results.netFile;
+flows = p.Results.flows;
+beginTime = p.Results.beginTime;
+endTime = p.Results.endTime;
+turns = p.Results.turns;
+prefix = p.Results.prefix;
+hasTurns = 0;
+
+if isempty(prefix)
+ [~,netName,~] = fileparts(which(netFile));
+ prefix = strrep([netName '_demand'], '.net', '');
+end
+
+% Validate if all flows have defined a destination edge if no turns are
+% specified
+if isempty(turns)
+ for i = 1:length(flows)
+ if isempty(flows{i}.to)
+ departLaneStr = ['_' num2str(flows{i}.departLane)];
+ if strcmp(departLaneStr, '_')
+ departLaneStr = '';
+ end
+ throw(MException('sumolib:DefinirionError',...
+ 'No destination edge defined for flow %s.',...
+ [flows{i}.from num2str(i-1) departLaneStr]));
+ end
+ end
+else
+ turnsFile = [prefix '.turns.xml'];
+ hasTurns = 1;
+end
+
+numIntervals = length(flows{1}.demand);
+time = linspace(beginTime,endTime, numIntervals + 1);
+
+% timeStep = range(time)/numIntervals;
+flowsFile = [prefix '.trips.xml'];
+routesFile = [prefix '.rou.xml'];
+vTypes = {};
+busStops = {};
+
+definedAddFile = 0;
+
+%% Generate the additional file containing bus stops, if available
+for i = 1:length(flows)
+ if ~isempty(flows{i}.stop)
+ stops = flows{i}.stop;
+ for j = 1:length(stops)
+ hasStopInLane = ~isempty(stops{j}.lane);
+ if ~hasStopInLane
+ if ~definedAddFile
+ addFile = [prefix '_bus_stops' '.add.xml'];
+ fileID = fopen(addFile,'w');
+ fprintf(fileID,'<add>\n');
+ definedAddFile = 1;
+ end
+ for k = 1:length(stops{j}.busStop)
+ currentBusStop = stops{j}.busStop{k};
+ if ~ismember(currentBusStop.id, busStops)
+ fprintf(fileID,'\t<busStop');
+ busStopStruct = struct(currentBusStop);
+ busStopStructFields = fieldnames(busStopStruct);
+ for l = 1:numel(busStopStructFields)
+ if ~isempty(busStopStruct.(char(busStopStructFields(l))))
+ fprintf(fileID,' %s="%s"', char(busStopStructFields(l)),...
+ num2str(busStopStruct.(char(busStopStructFields(l)))));
+ end
+ end
+ busStops = [busStops currentBusStop.id];
+ end
+ fprintf(fileID,'/>\n');
+ end
+ end
+ end
+ end
+end
+
+if definedAddFile
+ fprintf(fileID,'</add>');
+ fclose(fileID);
+end
+
+
+
+%% Generate the trips file
+fileID = fopen(flowsFile,'w');
+fprintf(fileID,'<flows>\n');
+
+% Generate vehicle types
+for i = 1:length(flows)
+ if ~isempty(flows{i}.type)
+ if ~ismember(flows{i}.type.id, vTypes)
+ vTypes = [vTypes {flows{i}.type.id}];
+ typeStruct = struct(flows{i}.type);
+ typeStructFields = fieldnames(typeStruct);
+ fprintf(fileID,'\t<vType');
+ for j = 1:numel(typeStructFields)
+ if ~isempty(typeStruct.(char(typeStructFields(j))))
+ fprintf(fileID,' %s="%s"', char(typeStructFields(j)),...
+ typeStruct.(char(typeStructFields(j))));
+ end
+ end
+ fprintf(fileID,'/>\n');
+ vTypes = [vTypes flows{i}.type.id];
+ end
+ end
+end
+
+% Generate flows
+for i=2:length(time)
+ for j=1:length(flows)
+
+ departLaneStr = ['_' num2str(flows{j}.departLane)];
+ if strcmp(departLaneStr, '_')
+ departLaneStr = '';
+ end
+
+ typeStr = ['_' flows{j}.type.id];
+ if strcmp(typeStr, '_')
+ typeStr = '';
+ end
+
+ flowID = [flows{j}.from num2str(i-1) departLaneStr typeStr];
+
+ stops = {};
+ flowStruct = struct(flows{j});
+ flowStructFields = fieldnames(flowStruct);
+ fprintf(fileID,'\t<flow id="%s" begin="%d" end="%d"',flowID,...
+ time(i-1), time(i));
+ for k = 1:numel(flowStructFields)
+ if ~isempty(flowStruct.(char(flowStructFields(k))))
+ if strcmp(flowStructFields(k), 'demandType')
+ fprintf(fileID,' %s=',...
+ flowStruct.(char(flowStructFields(k))));
+ elseif strcmp(flowStructFields(k), 'demand')
+ demandArray = flowStruct.(char(flowStructFields(k)));
+ fprintf(fileID,'"%d"', demandArray(i-1));
+ elseif strcmp(flowStructFields(k), 'number')
+ NumberArray = flowStruct.(char(flowStructFields(k)));
+ fprintf(fileID,' %s="%d"', char(flowStructFields(k)),...
+ NumberArray(i-1));
+ elseif strcmp(flowStructFields(k), 'type')
+ flowVehType = flowStruct.(char(flowStructFields(k)));
+ fprintf(fileID,' %s="%s"', char(flowStructFields(k)),...
+ flowVehType.id);
+ elseif strcmp(flowStructFields(k), 'stop')
+ stops = flowStruct.(char(flowStructFields(k)));
+ else
+ fprintf(fileID,' %s="%s"', char(flowStructFields(k)),...
+ num2str(flowStruct.(char(flowStructFields(k)))));
+ end
+ end
+ end
+
+ % Generate stops, if available
+ if ~isempty(stops)
+ fprintf(fileID,'>\n');
+ for k = 1:length(stops)
+ stopStruct = struct(stops{k});
+ stopStructFields = fieldnames(stopStruct);
+ fprintf(fileID,'\t\t<stop');
+ for l = 1:numel(stopStructFields)
+ if ~isempty(stopStruct.(char(stopStructFields(l))))
+ if strcmp(stopStructFields(l), 'busStop')
+ fprintf(fileID,' %s="', char(stopStructFields(l)));
+ for m = 1:length(stops{k}.busStop)
+ fprintf(fileID,'%s', stops{k}.busStop{m}.id);
+ if m~=length(stops{k}.busStop)
+ fprintf(fileID,' ', stops{k}.busStop{m}.id);
+ end
+ end
+ fprintf(fileID,'"');
+ else
+ fprintf(fileID,' %s="%s"', char(stopStructFields(l)),...
+ num2str(stopStruct.(char(stopStructFields(l)))));
+ end
+ end
+ end
+ fprintf(fileID,'/>\n');
+ fprintf(fileID,'\t</flow>\n');
+ end
+ else
+ fprintf(fileID,'/>\n');
+ end
+
+
+ end
+end
+fprintf(fileID,'</flows>');
+fclose(fileID);
+
+%% Generate the turns file and traffic demand
+if hasTurns
+ fileID = fopen(turnsFile,'w');
+ fprintf(fileID,'<turns>\n\t<interval begin="%d" end="%d">\n',beginTime,...
+ endTime);
+
+ for i=1:length(turns)
+ fprintf(fileID,'\t\t<fromEdge id="%s">\n', turns{i}.fromEdge);
+ for j=1:length(turns{i}.toEdges)
+ fprintf(fileID,'\t\t\t<toEdge id="%s" probability="%d"/>\n',...
+ turns{i}.toEdges{j},turns{i}.probabilities{j});
+ end
+ fprintf(fileID,'\t\t</fromEdge>\n');
+ end
+
+ fprintf(fileID,'\t</interval>\n</turns>');
+ fclose(fileID);
+ system(['jtrrouter --net-file ' netFile ' --flow-files ' flowsFile ' --turn-ratio-files ' turnsFile ' --output-file ' routesFile ' --ignore-errors' ' -v']);
+else
+ if ~definedAddFile
+ system(['duarouter --net-file ' netFile ' --flow-files ' flowsFile ' --output-file ' routesFile ' --ignore-errors' ' -v']);
+ else
+ system(['duarouter --net-file ' netFile ' --flow-files ' flowsFile ' --additional-files ' addFile ' --output-file ' routesFile ' --ignore-errors' ' -v']);
+ end
+end
\ No newline at end of file
diff --git a/tools/contributed/sumolib4matlab/examples/inter_palmas/generateDemand_inter_palmas.m b/tools/contributed/sumolib4matlab/examples/inter_palmas/generateDemand_inter_palmas.m
new file mode 100644
index 0000000..07a36cb
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/examples/inter_palmas/generateDemand_inter_palmas.m
@@ -0,0 +1,67 @@
+clear all
+close all
+clc
+
+% Define the vehicle types
+type_taxi = sumolib.demand.VehicleType('taxi','vClass', 'taxi');
+type_carro = sumolib.demand.VehicleType('carro', 'color', [1 0 0],...
+ 'vClass', 'passenger', 'guiShape', 'passenger');
+type_bus = sumolib.demand.VehicleType('bus', 'color', [0 1 0],...
+ 'vClass', 'bus', 'guiShape', 'bus');
+
+busStopE = sumolib.demand.BusStop('sanDiegoE', '-465_1', 'line', '--');
+busStopW = sumolib.demand.BusStop('sanDiegoW', '-447_1', 'line', '--');
+
+stopE = sumolib.demand.Stop({busStopE},'duration',120);
+stopW = sumolib.demand.Stop({busStopW},'duration',120);
+
+
+% Generate demands for some edges
+flow1 = sumolib.demand.Flow('33463249#0', 'type', type_taxi, 'demandType',...
+ 'vehsPerHour', 'demand', 800);
+flow2 = sumolib.demand.Flow('-380', 'type', type_taxi, 'demandType',...
+ 'vehsPerHour', 'demand', 800);
+flow3 = sumolib.demand.Flow('30659373#0', 'type', type_carro, 'demandType',...
+ 'vehsPerHour', 'demand', 500);
+flow4 = sumolib.demand.Flow('33463249#0', 'type', type_carro, 'demandType',...
+ 'vehsPerHour', 'demand', 1500);
+flow5 = sumolib.demand.Flow('-380', 'type', type_carro, 'demandType',...
+ 'vehsPerHour', 'demand', 1500);
+flow6 = sumolib.demand.Flow('33463249#0', 'to', '-461#1', 'type', type_bus,...
+ 'demandType', 'period', 'demand', 450, 'stop', {stopW});
+flow7 = sumolib.demand.Flow('-380', 'to', '-436#1', 'type', type_bus,...
+ 'demandType', 'period', 'demand', 450, 'stop', {stopE});
+
+
+% Define turning probabilities
+turns_flow1 = sumolib.demand.TurnProbability('33463249#0', {'30659403' '33463249#1'},...
+ {0.2 0.8});
+turns_flow2 = sumolib.demand.TurnProbability('-380', {'-465'},{1});
+turns_flow3 = sumolib.demand.TurnProbability('30659373#0', {'30659375' '30659373#1'},...
+ {0.6 0.4});
+
+
+% flow1_1 = sumolib.demand.Flow('O1a',0,...
+% round(120*rand(1,30)),containers.Map({'aO4'},{1}));
+%
+% flow1_2 = sumolib.demand.Flow('O1a',0,...
+% round(120*rand(1,30)),containers.Map({'aO3'},{1}));
+
+% Create an array of demands
+flows = {flow1 flow2 flow3 flow4 flow5};
+turns = {turns_flow1 turns_flow2 turns_flow1 turns_flow2 turns_flow3};
+
+% Get the filename of the example scenario
+[scenarioPath,~,~] = fileparts(which(mfilename));
+% scenarioPath = [scenarioPath '\inter_palmas'];
+cd(scenarioPath);
+
+% Generate demand for vehicles, using turns
+sumolib.demand.generateDemand('inter_palmas_notls.net.xml',...
+ flows, 50400, 54000, turns);
+
+% Generate demand for public transport, using origin and destination edges
+busFlows = {flow6 flow7};
+sumolib.demand.generateDemand('inter_palmas_notls.net.xml',...
+ busFlows, 50400, 54000, 'prefix', 'inter_palmas_buses');
+
diff --git a/tools/contributed/sumolib4matlab/examples/inter_palmas/inter_palmas_notls.net.xml b/tools/contributed/sumolib4matlab/examples/inter_palmas/inter_palmas_notls.net.xml
new file mode 100644
index 0000000..c820c27
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/examples/inter_palmas/inter_palmas_notls.net.xml
@@ -0,0 +1,326 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- generated on 06/19/15 10:10:07 by SUMO netconvert Version dev-SVN-r18493
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netconvertConfiguration.xsd">
+
+ <input>
+ <sumo-net-file value="inter_palmas_notls_shaped_conns_joined.net.xml"/>
+ <connection-files value="inter_palmas_notls.con.xml"/>
+ </input>
+
+ <output>
+ <output-file value="inter_palmas_notls_shaped_conns_joined_crossings.net.xml"/>
+ <output.street-names value="true"/>
+ </output>
+
+ <processing>
+ <no-turnarounds value="true"/>
+ <offset.disable-normalization value="true"/>
+ </processing>
+
+</configuration>
+-->
+
+<net version="0.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/net_file.xsd">
+
+ <location netOffset="-436926.13,-689249.98" convBoundary="0.00,0.00,227.10,369.18" origBoundary="-75.570172,6.235311,-75.568126,6.238647" projParameter="+proj=utm +zone=18 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"/>
+
+ <edge id=":339060251_0" function="internal">
+ <lane id=":339060251_0_0" index="0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="15.29" length="11.74" shape="183.56,68.28 186.18,66.47 188.61,65.46 190.77,64.10 192.60,61.27"/>
+ </edge>
+ <edge id=":339060251_1" function="internal">
+ <lane id=":339060251_1_0" index="0" allow="pedestrian" speed="16.67" length="10.69" width="2.00" shape="186.11,70.16 187.29,67.21 188.09,65.19 188.90,63.17 190.11,60.23"/>
+ <lane id=":339060251_1_1" index="1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="10.69" shape="188.61,71.18 189.79,68.24 190.59,66.22 191.39,64.20 192.60,61.27"/>
+ <lane id=":339060251_1_2" index="2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="10.69" shape="191.66,72.43 192.85,69.49 193.64,67.48 194.44,65.46 195.65,62.54"/>
+ </edge>
+ <edge id=":339060265_0" function="internal">
+ <lane id=":339060265_0_0" index="0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90" length="0.10" shape="77.51,254.19 77.51,254.19"/>
+ </edge>
+ <edge id=":339061351_0" function="internal">
+ <lane id=":339061351_0_0" index="0" allow="pedestrian" speed="16.67" length="10.79" width="2.00" shape="82.21,164.90 85.00,163.35 86.90,162.27 88.79,161.18 91.56,159.58"/>
+ </edge>
+ <edge id=":339061351_1" function="internal">
+ <lane id=":339061351_1_0" index="0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="15.29" length="2.52" shape="83.52,167.26 83.96,166.47 84.28,164.89"/>
+ </edge>
+ <edge id=":339061351_2" function="internal">
+ <lane id=":339061351_2_0" index="0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="10.79" shape="83.52,167.26 86.31,165.70 88.22,164.62 90.12,163.52 92.90,161.93"/>
+ <lane id=":339061351_2_1" index="1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="10.79" shape="85.11,170.15 87.93,168.58 89.84,167.50 91.75,166.40 94.54,164.79"/>
+ </edge>
+ <edge id=":339061351_4" function="internal">
+ <lane id=":339061351_4_0" index="0" speed="15.29" length="7.23" shape="84.28,164.89 84.34,164.61 84.67,161.69 84.95,157.70"/>
+ </edge>
+ <edge id=":339061351_c0" function="crossing" crossingEdges="30659403">
+ <lane id=":339061351_c0_0" index="0" allow="pedestrian" speed="1.00" length="6.50" width="4.00" shape="83.24,159.61 89.73,159.96"/>
+ </edge>
+ <edge id=":339061351_w0" function="walkingarea">
+ <lane id=":339061351_w0_0" index="0" allow="pedestrian" speed="1.00" length="1.86" width="4.00" shape="92.05,160.45 91.06,158.72 89.84,157.96 89.62,161.96"/>
+ </edge>
+ <edge id=":339061351_w1" function="walkingarea">
+ <lane id=":339061351_w1_0" index="0" allow="pedestrian" speed="1.00" length="5.40" width="4.00" shape="83.13,161.60 83.35,157.61 81.72,164.03 82.70,165.78"/>
+ </edge>
+ <edge id=":339061421_0" function="internal">
+ <lane id=":339061421_0_0" index="0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="2.48" shape="123.75,143.97 126.07,142.74"/>
+ <lane id=":339061421_0_1" index="1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="2.48" shape="125.41,146.82 127.48,145.72"/>
+ </edge>
+ <edge id=":339061421_w0" function="walkingarea">
+ <lane id=":339061421_w0_0" index="0" allow="pedestrian" speed="1.00" length="4.44" width="2.00" shape="125.34,141.20 124.48,139.40 120.23,137.92 121.24,139.65"/>
+ </edge>
+ <edge id=":339061695_0" function="internal">
+ <lane id=":339061695_0_0" index="0" allow="pedestrian" speed="16.67" length="5.31" width="2.00" shape="175.94,130.32 173.91,136.96"/>
+ <lane id=":339061695_0_1" index="1" allow="taxi bus" speed="16.67" length="5.31" shape="173.73,128.77 172.35,134.76"/>
+ <lane id=":339061695_0_2" index="2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="5.31" shape="173.73,128.77 170.45,132.06"/>
+ <lane id=":339061695_0_3" index="3" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="5.31" shape="171.03,126.88 168.55,129.36"/>
+ </edge>
+ <edge id=":339061699_0" function="internal">
+ <lane id=":339061699_0_0" index="0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="15.29" length="9.16" shape="80.92,189.93 80.31,187.19 79.10,185.73 77.30,185.53 74.89,186.62"/>
+ </edge>
+ <edge id=":339061699_1" function="internal">
+ <lane id=":339061699_1_0" index="0" allow="pedestrian" speed="16.67" length="7.87" width="2.00" shape="83.02,185.00 76.35,188.89"/>
+ <lane id=":339061699_1_1" index="1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="7.87" shape="81.68,182.65 74.89,186.62"/>
+ <lane id=":339061699_1_2" index="2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="7.87" shape="80.04,179.79 73.12,183.83"/>
+ </edge>
+ <edge id=":339062566_0" function="internal">
+ <lane id=":339062566_0_0" index="0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90" length="11.06" shape="83.76,269.74 82.33,267.00 80.76,265.24 78.88,263.67 76.52,261.56"/>
+ </edge>
+ <edge id=":339062566_1" function="internal">
+ <lane id=":339062566_1_0" index="0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90" length="11.04" shape="83.76,269.74 82.58,266.84 81.69,264.62 80.80,262.40 79.64,259.49"/>
+ </edge>
+ <edge id=":339062833_0" function="internal">
+ <lane id=":339062833_0_0" index="0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90" length="3.48" shape="86.92,85.35 86.87,84.91 86.71,84.53 86.46,84.21 86.09,83.95"/>
+ <lane id=":339062833_0_1" index="1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90" length="3.48" shape="90.22,85.35 90.06,83.99 89.59,82.83 88.79,81.85 87.69,81.06"/>
+ </edge>
+ <edge id=":cluster_-427_339061698_0" function="internal">
+ <lane id=":cluster_-427_339061698_0_0" index="0" allow="pedestrian" speed="16.67" length="2.89" width="2.00" shape="104.48,176.57 100.78,174.83"/>
+ <lane id=":cluster_-427_339061698_0_1" index="1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="2.89" shape="101.45,171.38 99.43,172.49"/>
+ <lane id=":cluster_-427_339061698_0_2" index="2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="2.89" shape="99.79,168.52 97.79,169.62"/>
+ </edge>
+ <edge id=":cluster_-427_339061698_3" function="internal">
+ <lane id=":cluster_-427_339061698_3_0" index="0" allow="pedestrian" speed="16.67" length="3.09" width="2.00" shape="91.92,159.37 92.16,155.43"/>
+ <lane id=":cluster_-427_339061698_3_1" index="1" allow="taxi bus" speed="16.67" length="3.09" shape="93.27,161.72 93.52,157.77"/>
+ <lane id=":cluster_-427_339061698_3_2" index="2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="3.09" shape="93.27,161.72 95.18,160.62"/>
+ <lane id=":cluster_-427_339061698_3_3" index="3" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="3.09" shape="94.91,164.58 96.85,163.47"/>
+ </edge>
+ <edge id=":cluster_-427_339061698_c0" function="crossing" crossingEdges="-465">
+ <lane id=":cluster_-427_339061698_c0_0" index="0" allow="pedestrian" speed="1.00" length="9.81" width="4.00" shape="97.28,168.01 102.07,176.57"/>
+ </edge>
+ <edge id=":cluster_-427_339061698_c1" function="crossing" crossingEdges="-447">
+ <lane id=":cluster_-427_339061698_c1_0" index="0" allow="pedestrian" speed="1.00" length="9.80" width="4.00" shape="90.99,157.39 95.92,165.86"/>
+ </edge>
+ <edge id=":cluster_-427_339061698_w0" function="walkingarea">
+ <lane id=":cluster_-427_339061698_w0_0" index="0" allow="pedestrian" speed="1.00" length="2.89" width="4.00" shape="100.28,173.96 101.27,175.70 104.93,177.46 104.02,175.68 103.81,175.59 100.32,177.54"/>
+ </edge>
+ <edge id=":cluster_-427_339061698_w1" function="walkingarea">
+ <lane id=":cluster_-427_339061698_w1_0" index="0" allow="pedestrian" speed="1.00" length="2.81" width="4.00" shape="89.26,158.40 92.67,156.30 91.66,154.57 91.43,158.51 92.42,160.24"/>
+ </edge>
+ <edge id=":cluster_-427_339061698_w2" function="walkingarea">
+ <lane id=":cluster_-427_339061698_w2_0" index="0" allow="pedestrian" speed="1.00" length="2.54" width="4.00" shape="94.19,166.87 97.65,164.85 99.02,167.03 95.53,168.99"/>
+ </edge>
+
+ <edge id="-380" from="339061690" to="339061695" name="Vía Las Palmas" priority="-1" type="highway.trunk" spreadType="center" shape="227.10,0.59 214.81,38.33 204.37,69.52 193.00,95.04 187.28,108.34 172.04,130.14">
+ <lane id="-380_0" index="0" allow="pedestrian" speed="16.67" length="139.62" width="2.00" shape="230.24,1.61 217.95,39.35 207.50,70.57 196.01,96.38 190.18,109.95 175.94,130.32"/>
+ <lane id="-380_1" index="1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="139.62" shape="227.67,0.78 215.38,38.52 204.94,69.71 193.55,95.28 187.81,108.63 173.73,128.77"/>
+ <lane id="-380_2" index="2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="139.62" shape="224.53,-0.25 212.24,37.49 201.81,68.66 190.53,93.94 184.91,107.02 171.03,126.88"/>
+ </edge>
+ <edge id="-436#0" from="cluster_-427_339061698" to="339061699" name="Vía Las Palmas" priority="-1" type="highway.trunk" spreadType="center" shape="100.42,171.23 75.82,185.32">
+ <lane id="-436#0_0" index="0" allow="pedestrian" speed="16.67" length="20.46" width="2.00" shape="100.78,174.83 83.02,185.00"/>
+ <lane id="-436#0_1" index="1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="20.46" shape="99.43,172.49 81.68,182.65"/>
+ <lane id="-436#0_2" index="2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="20.46" shape="97.79,169.62 80.04,179.79"/>
+ </edge>
+ <edge id="-436#1" from="339061699" to="339059944" name="Vía Las Palmas" priority="-1" type="highway.trunk" spreadType="center" shape="75.86,185.29 64.11,192.78 51.48,204.67 39.15,219.02">
+ <lane id="-436#1_0" index="0" allow="pedestrian" speed="16.67" length="48.56" width="2.00" shape="76.35,188.89 66.15,195.40 53.74,207.07 41.65,221.17"/>
+ <lane id="-436#1_1" index="1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="48.56" shape="74.89,186.62 64.48,193.26 51.89,205.11 39.60,219.41"/>
+ <lane id="-436#1_2" index="2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="48.56" shape="73.12,183.83 62.44,190.64 49.63,202.70 37.10,217.26"/>
+ </edge>
+ <edge id="-447" from="cluster_-427_339061698" to="339061421" name="Vía Las Palmas" priority="-1" type="highway.trunk" spreadType="center" shape="93.97,160.11 124.33,142.42">
+ <lane id="-447_0" index="0" allow="pedestrian" speed="16.67" length="33.07" width="2.00" shape="92.16,155.43 120.73,138.79"/>
+ <lane id="-447_1" index="1" allow="taxi bus" speed="16.67" length="33.07" shape="93.52,157.77 122.09,141.12"/>
+ <lane id="-447_2" index="2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="33.07" shape="95.18,160.62 123.75,143.97"/>
+ <lane id="-447_3" index="3" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="33.07" shape="96.85,163.47 125.41,146.82"/>
+ </edge>
+ <edge id="-461#0" from="339061421" to="339060251" name="Vía Las Palmas" priority="-1" type="highway.trunk" spreadType="center" shape="125.23,143.80 145.09,134.38 154.44,127.86 163.80,118.54 171.31,108.27 181.67,89.50 186.53,77.86 195.69,55.40">
+ <lane id="-461#0_0" index="0" allow="pedestrian" speed="16.67" length="98.83" width="2.00" shape="124.91,140.30 143.68,131.40 152.55,125.15 161.47,116.20 168.65,106.32 178.78,87.91 183.48,76.59 186.11,70.16"/>
+ <lane id="-461#0_1" index="1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="98.83" shape="126.07,142.74 144.83,133.84 154.10,127.37 163.38,118.11 170.83,107.92 181.14,89.21 185.98,77.63 188.61,71.18"/>
+ <lane id="-461#0_2" index="2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="98.83" shape="127.48,145.72 146.25,136.82 155.98,130.07 165.71,120.45 173.49,109.86 184.03,90.80 189.02,78.90 191.66,72.43"/>
+ </edge>
+ <edge id="-461#1" from="339060251" to="339061412" name="Vía Las Palmas" priority="-1" type="highway.trunk" spreadType="center" shape="195.70,55.39 199.20,46.99 213.80,0.00">
+ <lane id="-461#1_0" index="0" allow="pedestrian" speed="16.67" length="64.89" width="2.00" shape="190.11,60.23 196.15,45.72 210.65,-0.98"/>
+ <lane id="-461#1_1" index="1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="64.89" shape="192.60,61.27 198.65,46.76 213.23,-0.18"/>
+ <lane id="-461#1_2" index="2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="64.89" shape="195.65,62.54 201.69,48.03 216.38,0.80"/>
+ </edge>
+ <edge id="-465" from="339061695" to="cluster_-427_339061698" name="Vía Las Palmas" priority="-1" type="highway.trunk" spreadType="center" shape="172.63,131.81 149.80,147.91 136.45,154.57 101.21,172.68">
+ <lane id="-465_0" index="0" allow="pedestrian" speed="16.67" length="79.72" width="2.00" shape="173.91,136.96 152.65,151.96 138.66,159.00 104.48,176.57"/>
+ <lane id="-465_1" index="1" allow="taxi bus" speed="16.67" length="79.72" shape="172.35,134.76 151.10,149.75 137.45,156.58 103.12,174.23"/>
+ <lane id="-465_2" index="2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="79.72" shape="170.45,132.06 149.19,147.05 135.98,153.63 101.45,171.38"/>
+ <lane id="-465_3" index="3" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="79.72" shape="168.55,129.36 147.29,144.36 134.51,150.68 99.79,168.52"/>
+ </edge>
+ <edge id="30659170" from="339060265" to="339060251" name="Carrera 44" priority="-1" type="highway.secondary" spreadType="center" shape="77.51,254.19 71.71,239.62 70.49,226.21 73.07,216.27 83.20,207.18 111.31,197.65 122.88,188.21 125.54,182.01 124.62,152.24 128.46,138.69 134.09,133.08 156.92,109.47 169.65,91.18 181.20,70.53 196.62,55.78">
+ <lane id="30659170_0" index="0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90" length="238.25" shape="77.51,254.19 71.71,239.62 70.49,226.21 73.07,216.27 83.20,207.18 111.31,197.65 122.88,188.21 125.54,182.01 124.62,152.24 128.46,138.69 134.09,133.08 156.92,109.47 169.65,91.18 181.20,70.53 183.56,68.28"/>
+ </edge>
+ <edge id="30659373#0" from="365768381" to="339062566" name="Carrera 44" priority="-1" type="highway.secondary" spreadType="center" shape="130.85,369.18 89.86,284.63 83.07,268.05">
+ <lane id="30659373#0_0" index="0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90" length="110.05" shape="130.85,369.18 89.86,284.63 83.76,269.74"/>
+ </edge>
+ <edge id="30659373#1" from="339062566" to="339060265" name="Carrera 44" priority="-1" type="highway.secondary" spreadType="center">
+ <lane id="30659373#1_0" index="0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90" length="5.72" shape="79.64,259.49 77.51,254.19"/>
+ </edge>
+ <edge id="30659375" from="339062566" to="339061699" name="Carrera 44" priority="-1" type="highway.secondary" spreadType="center" shape="83.07,268.05 74.88,259.94 63.72,241.15 60.17,232.66 60.33,222.15 70.02,207.90 77.28,199.49 81.33,194.28 80.69,187.43 75.32,184.45">
+ <lane id="30659375_0" index="0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90" length="83.18" shape="76.52,261.56 74.88,259.94 63.72,241.15 60.17,232.66 60.33,222.15 70.02,207.90 77.28,199.49 81.33,194.28 80.92,189.93"/>
+ </edge>
+ <edge id="30659403" from="339061351" to="339062833" name="Carrera 43 A" priority="-1" type="highway.unclassified" spreadType="center" shape="86.05,167.69 86.74,155.13 87.67,130.59 88.58,96.63 88.57,83.43">
+ <lane id="30659403_0" index="0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90" length="72.47" shape="84.95,157.70 85.09,155.04 86.02,130.53 86.93,96.59 86.92,85.35"/>
+ <lane id="30659403_1" index="1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90" length="72.47" shape="88.24,157.88 88.39,155.22 89.32,130.65 90.23,96.67 90.22,85.35"/>
+ </edge>
+ <edge id="30659405" from="339062833" to="339061974" name="Calle 36" priority="-1" type="highway.unclassified" spreadType="center" shape="88.57,83.43 80.02,78.72 69.57,77.79 52.48,83.47 27.81,92.93 16.43,100.49 0.00,113.17">
+ <lane id="30659405_0" index="0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90" length="97.18" shape="86.09,83.95 79.53,80.33 69.77,79.46 53.00,85.04 28.57,94.41 17.34,101.86 1.01,114.48"/>
+ <lane id="30659405_1" index="1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90" length="97.18" shape="87.69,81.06 80.51,77.11 69.37,76.12 51.96,81.90 27.05,91.45 15.52,99.12 -1.01,111.86"/>
+ </edge>
+ <edge id="33463249#0" from="339059941" to="339061351" name="Vía Las Palmas" priority="-1" type="highway.trunk" spreadType="center" shape="28.26,184.70 42.01,184.36 57.21,180.36 73.27,173.62 85.57,166.81">
+ <lane id="33463249#0_0" index="0" allow="pedestrian" speed="16.67" length="58.74" width="2.00" shape="28.18,181.40 41.54,181.07 56.37,177.17 71.99,170.58 82.21,164.90"/>
+ <lane id="33463249#0_1" index="1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="58.74" shape="28.25,184.10 41.93,183.76 57.06,179.78 73.04,173.07 83.52,167.26"/>
+ <lane id="33463249#0_2" index="2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="58.74" shape="28.33,187.40 42.39,187.05 57.90,182.97 74.31,176.11 85.11,170.15"/>
+ </edge>
+ <edge id="33463249#1" from="339061351" to="cluster_-427_339061698" name="Vía Las Palmas" priority="-1" type="highway.trunk" spreadType="center" shape="85.56,166.82 94.80,161.53">
+ <lane id="33463249#1_0" index="0" allow="pedestrian" speed="16.67" length="0.43" width="2.00" shape="91.56,159.58 91.92,159.37"/>
+ <lane id="33463249#1_1" index="1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="0.43" shape="92.90,161.93 93.27,161.72"/>
+ <lane id="33463249#1_2" index="2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67" length="0.43" shape="94.54,164.79 94.91,164.58"/>
+ </edge>
+
+ <junction id="339059941" type="unregulated" x="28.29" y="185.70" incLanes="" intLanes="" shape="28.37,189.00 28.16,180.40"/>
+ <junction id="339059944" type="unregulated" x="38.39" y="218.37" incLanes="-436#1_0 -436#1_1 -436#1_2" intLanes="" shape="42.41,221.82 35.88,216.22"/>
+ <junction id="339060251" type="priority" x="196.62" y="55.78" incLanes="30659170_0 -461#0_0 -461#0_1 -461#0_2" intLanes=":339060251_0_0 :339060251_1_0 :339060251_1_1 :339060251_1_2" shape="197.12,63.15 189.19,59.84 182.45,67.12 184.66,69.43 185.18,69.78 193.14,73.03">
+ <request index="0" response="1110" foes="1110" cont="0"/>
+ <request index="1" response="0000" foes="0001" cont="0"/>
+ <request index="2" response="0000" foes="0001" cont="0"/>
+ <request index="3" response="0000" foes="0001" cont="0"/>
+ </junction>
+ <junction id="339060265" type="priority" x="77.51" y="254.19" incLanes="30659373#1_0" intLanes=":339060265_0_0" shape="76.02,254.79 78.99,253.59 76.02,254.78">
+ <request index="0" response="0" foes="0" cont="0"/>
+ </junction>
+ <junction id="339061351" type="priority" x="86.05" y="167.69" incLanes="33463249#0_0 33463249#0_1 33463249#0_2 :339061351_w1_0" intLanes=":339061351_0_0 :339061351_4_0 :339061351_2_0 :339061351_2_1 :339061351_c0_0" shape="95.33,166.18 91.06,158.72 89.84,157.96 83.35,157.61 81.73,164.03 85.89,171.55">
+ <request index="0" response="00000" foes="00000" cont="0"/>
+ <request index="1" response="10001" foes="10001" cont="1"/>
+ <request index="2" response="00000" foes="00000" cont="0"/>
+ <request index="3" response="00000" foes="00000" cont="0"/>
+ <request index="4" response="00000" foes="00010" cont="0"/>
+ </junction>
+ <junction id="339061412" type="unregulated" x="214.76" y="0.30" incLanes="-461#1_0 -461#1_1 -461#1_2" intLanes="" shape="209.69,-1.27 217.91,1.28"/>
+ <junction id="339061421" type="priority" x="125.66" y="144.70" incLanes="-447_0 -447_1 -447_2 -447_3" intLanes=":339061421_0_0 :339061421_0_1" shape="128.17,147.17 124.48,139.40 120.23,137.92 126.22,148.21">
+ <request index="0" response="00" foes="00" cont="0"/>
+ <request index="1" response="00" foes="00" cont="0"/>
+ </junction>
+ <junction id="339061690" type="unregulated" x="226.15" y="0.28" incLanes="" intLanes="" shape="223.01,-0.74 231.19,1.92"/>
+ <junction id="339061695" type="priority" x="171.22" y="129.56" incLanes="-380_0 -380_1 -380_2" intLanes=":339061695_0_0 :339061695_0_1 :339061695_0_2 :339061695_0_3" shape="176.76,130.89 169.71,125.96 167.63,128.06 174.49,137.78">
+ <request index="0" response="0000" foes="0000" cont="0"/>
+ <request index="1" response="0000" foes="0000" cont="0"/>
+ <request index="2" response="0000" foes="0000" cont="0"/>
+ <request index="3" response="0000" foes="0000" cont="0"/>
+ </junction>
+ <junction id="339061699" type="priority" x="75.32" y="184.45" incLanes="30659375_0 -436#0_0 -436#0_1 -436#0_2" intLanes=":339061699_0_0 :339061699_1_0 :339061699_1_1 :339061699_1_2" shape="79.49,191.76 82.36,188.10 83.52,185.86 79.25,178.40 72.26,182.49 76.88,189.74">
+ <request index="0" response="1110" foes="1110" cont="0"/>
+ <request index="1" response="0000" foes="0001" cont="0"/>
+ <request index="2" response="0000" foes="0001" cont="0"/>
+ <request index="3" response="0000" foes="0001" cont="0"/>
+ </junction>
+ <junction id="339061974" type="unregulated" x="0.00" y="113.17" incLanes="30659405_0 30659405_1" intLanes="" shape="1.99,115.74 -1.99,110.60"/>
+ <junction id="339062566" type="priority" x="83.07" y="268.05" incLanes="30659373#0_0" intLanes=":339062566_0_0 :339062566_1_0" shape="82.28,270.35 85.24,269.13 81.12,258.90 78.15,260.09 77.65,260.43 75.39,262.70">
+ <request index="0" response="00" foes="00" cont="0"/>
+ <request index="1" response="00" foes="00" cont="0"/>
+ </junction>
+ <junction id="339062833" type="priority" x="88.57" y="83.43" incLanes="30659403_0 30659403_1" intLanes=":339062833_0_0 :339062833_0_1" shape="85.32,85.35 91.82,85.35 88.46,79.66 85.32,85.35">
+ <request index="0" response="00" foes="00" cont="0"/>
+ <request index="1" response="00" foes="00" cont="0"/>
+ </junction>
+ <junction id="365768381" type="unregulated" x="130.85" y="369.18" incLanes="" intLanes="" shape="132.29,368.48 129.41,369.88"/>
+ <junction id="cluster_-427_339061698" type="priority" x="97.61" y="166.38" incLanes="-465_0 -465_1 -465_2 -465_3 33463249#1_0 33463249#1_1 33463249#1_2 :cluster_-427_339061698_w2_0 :cluster_-427_339061698_w1_0" intLanes=":cluster_-427_339061698_0_0 :cluster_-427_339061698_0_1 :cluster_-427_339061698_0_2 :cluster_-427_339061698_3_0 :cluster_-427_339061698_3_1 :cluster_-427_339061698_3_2 :cluster_-427_339061698_3_3 :cluster_-427_339061698_c0_0 :cluster_-427_339061698_c1_0" shape="104.9 [...]
+ <request index="0" response="010000000" foes="010000000" cont="0"/>
+ <request index="1" response="010000000" foes="010000000" cont="0"/>
+ <request index="2" response="010000000" foes="010000000" cont="0"/>
+ <request index="3" response="100000000" foes="100000000" cont="0"/>
+ <request index="4" response="100000000" foes="100000000" cont="0"/>
+ <request index="5" response="100000000" foes="100000000" cont="0"/>
+ <request index="6" response="100000000" foes="100000000" cont="0"/>
+ <request index="7" response="000000000" foes="000000111" cont="0"/>
+ <request index="8" response="000000000" foes="001111000" cont="0"/>
+ </junction>
+
+ <junction id=":339061351_4_0" type="internal" x="84.28" y="164.89" incLanes=":339061351_1_0 33463249#0_0" intLanes=":339061351_0_0 :339061351_c0_0"/>
+
+ <connection from="-380" to="-465" fromLane="0" toLane="0" via=":339061695_0_0" dir="s" state="M"/>
+ <connection from="-380" to="-465" fromLane="1" toLane="1" via=":339061695_0_1" dir="s" state="M"/>
+ <connection from="-380" to="-465" fromLane="1" toLane="2" via=":339061695_0_2" dir="s" state="M"/>
+ <connection from="-380" to="-465" fromLane="2" toLane="3" via=":339061695_0_3" dir="s" state="M"/>
+ <connection from="-436#0" to="-436#1" fromLane="0" toLane="0" via=":339061699_1_0" dir="s" state="M"/>
+ <connection from="-436#0" to="-436#1" fromLane="1" toLane="1" via=":339061699_1_1" dir="s" state="M"/>
+ <connection from="-436#0" to="-436#1" fromLane="2" toLane="2" via=":339061699_1_2" dir="s" state="M"/>
+ <connection from="-447" to="-461#0" fromLane="2" toLane="1" via=":339061421_0_0" dir="s" state="M"/>
+ <connection from="-447" to="-461#0" fromLane="3" toLane="2" via=":339061421_0_1" dir="s" state="M"/>
+ <connection from="-461#0" to="-461#1" fromLane="0" toLane="0" via=":339060251_1_0" dir="s" state="M"/>
+ <connection from="-461#0" to="-461#1" fromLane="1" toLane="1" via=":339060251_1_1" dir="s" state="M"/>
+ <connection from="-461#0" to="-461#1" fromLane="2" toLane="2" via=":339060251_1_2" dir="s" state="M"/>
+ <connection from="-465" to="-436#0" fromLane="0" toLane="0" via=":cluster_-427_339061698_0_0" dir="s" state="m"/>
+ <connection from="-465" to="-436#0" fromLane="2" toLane="1" via=":cluster_-427_339061698_0_1" dir="s" state="m"/>
+ <connection from="-465" to="-436#0" fromLane="3" toLane="2" via=":cluster_-427_339061698_0_2" dir="s" state="m"/>
+ <connection from="30659170" to="-461#1" fromLane="0" toLane="1" via=":339060251_0_0" dir="s" state="m"/>
+ <connection from="30659373#0" to="30659375" fromLane="0" toLane="0" via=":339062566_0_0" dir="s" state="M"/>
+ <connection from="30659373#0" to="30659373#1" fromLane="0" toLane="0" via=":339062566_1_0" dir="s" state="M"/>
+ <connection from="30659373#1" to="30659170" fromLane="0" toLane="0" via=":339060265_0_0" dir="s" state="M"/>
+ <connection from="30659375" to="-436#1" fromLane="0" toLane="1" via=":339061699_0_0" dir="r" state="m"/>
+ <connection from="30659403" to="30659405" fromLane="0" toLane="0" via=":339062833_0_0" dir="r" state="M"/>
+ <connection from="30659403" to="30659405" fromLane="1" toLane="1" via=":339062833_0_1" dir="r" state="M"/>
+ <connection from="33463249#0" to="33463249#1" fromLane="0" toLane="0" via=":339061351_0_0" dir="s" state="M"/>
+ <connection from="33463249#0" to="30659403" fromLane="1" toLane="0" via=":339061351_1_0" dir="r" state="m"/>
+ <connection from="33463249#0" to="33463249#1" fromLane="1" toLane="1" via=":339061351_2_0" dir="s" state="M"/>
+ <connection from="33463249#0" to="33463249#1" fromLane="2" toLane="2" via=":339061351_2_1" dir="s" state="M"/>
+ <connection from="33463249#1" to="-447" fromLane="0" toLane="0" via=":cluster_-427_339061698_3_0" dir="s" state="m"/>
+ <connection from="33463249#1" to="-447" fromLane="1" toLane="1" via=":cluster_-427_339061698_3_1" dir="s" state="m"/>
+ <connection from="33463249#1" to="-447" fromLane="1" toLane="2" via=":cluster_-427_339061698_3_2" dir="s" state="m"/>
+ <connection from="33463249#1" to="-447" fromLane="2" toLane="3" via=":cluster_-427_339061698_3_3" dir="s" state="m"/>
+
+ <connection from=":339060251_0" to="-461#1" fromLane="0" toLane="1" dir="s" state="M"/>
+ <connection from=":339060251_1" to="-461#1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":339060251_1" to="-461#1" fromLane="1" toLane="1" dir="s" state="M"/>
+ <connection from=":339060251_1" to="-461#1" fromLane="2" toLane="2" dir="s" state="M"/>
+ <connection from=":339060265_0" to="30659170" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":339061351_0" to="33463249#1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":339061351_1" to="30659403" fromLane="0" toLane="0" via=":339061351_4_0" dir="s" state="m"/>
+ <connection from=":339061351_4" to="30659403" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":339061351_2" to="33463249#1" fromLane="0" toLane="1" dir="s" state="M"/>
+ <connection from=":339061351_2" to="33463249#1" fromLane="1" toLane="2" dir="s" state="M"/>
+ <connection from=":339061421_0" to="-461#0" fromLane="0" toLane="1" dir="s" state="M"/>
+ <connection from=":339061421_0" to="-461#0" fromLane="1" toLane="2" dir="s" state="M"/>
+ <connection from=":339061695_0" to="-465" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":339061695_0" to="-465" fromLane="1" toLane="1" dir="s" state="M"/>
+ <connection from=":339061695_0" to="-465" fromLane="2" toLane="2" dir="s" state="M"/>
+ <connection from=":339061695_0" to="-465" fromLane="3" toLane="3" dir="s" state="M"/>
+ <connection from=":339061699_0" to="-436#1" fromLane="0" toLane="1" dir="s" state="M"/>
+ <connection from=":339061699_1" to="-436#1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":339061699_1" to="-436#1" fromLane="1" toLane="1" dir="s" state="M"/>
+ <connection from=":339061699_1" to="-436#1" fromLane="2" toLane="2" dir="s" state="M"/>
+ <connection from=":339062566_0" to="30659375" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":339062566_1" to="30659373#1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":339062833_0" to="30659405" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":339062833_0" to="30659405" fromLane="1" toLane="1" dir="s" state="M"/>
+ <connection from=":cluster_-427_339061698_0" to="-436#0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":cluster_-427_339061698_0" to="-436#0" fromLane="1" toLane="1" dir="s" state="M"/>
+ <connection from=":cluster_-427_339061698_0" to="-436#0" fromLane="2" toLane="2" dir="s" state="M"/>
+ <connection from=":cluster_-427_339061698_3" to="-447" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":cluster_-427_339061698_3" to="-447" fromLane="1" toLane="1" dir="s" state="M"/>
+ <connection from=":cluster_-427_339061698_3" to="-447" fromLane="2" toLane="2" dir="s" state="M"/>
+ <connection from=":cluster_-427_339061698_3" to="-447" fromLane="3" toLane="3" dir="s" state="M"/>
+
+ <connection from=":339061351_c0" to=":339061351_w0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":339061351_w0" to="33463249#1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":339061351_w1" to=":339061351_c0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from="33463249#0" to=":339061351_w1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":339061421_w0" to="-461#0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from="-447" to=":339061421_w0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":cluster_-427_339061698_c0" to=":cluster_-427_339061698_w0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":cluster_-427_339061698_c1" to=":cluster_-427_339061698_w2" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":cluster_-427_339061698_w0" to="-436#0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from="-465" to=":cluster_-427_339061698_w0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":cluster_-427_339061698_w1" to=":cluster_-427_339061698_c1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":cluster_-427_339061698_w1" to="-447" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from="33463249#1" to=":cluster_-427_339061698_w1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":cluster_-427_339061698_w2" to=":cluster_-427_339061698_c0" fromLane="0" toLane="0" dir="s" state="M"/>
+</net>
diff --git a/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Connection.java b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Connection.java
new file mode 100644
index 0000000..cf3d91d
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Connection.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2015 Universidad Nacional de Colombia,
+ * Politecnico Jaime Isaza Cadavid.
+ * Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+ * $Id$
+ */
+
+package co.edu.unalmed.gaunal.sumolib.net;
+
+/**
+ *
+ * @author GaunalJD
+ */
+public class Connection {
+ private Edge from;
+ private Edge to;
+ private Lane fromLane;
+ private Lane toLane;
+ private String tls;
+ private int tllink;
+
+ public Connection(Edge fromEdge, Edge toEdge, Lane fromLane, Lane toLane,
+ String direction, String tls, int tllink) {
+ this.from = fromEdge;
+ this.to = toEdge;
+ this.fromLane = fromLane;
+ this.toLane = toLane;
+ this.tls = tls;
+ this.tllink = tllink;
+ }
+
+ public Edge getFrom() {
+ return from;
+ }
+
+ public Edge getTo() {
+ return to;
+ }
+
+}
diff --git a/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Edge.java b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Edge.java
new file mode 100644
index 0000000..2045629
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Edge.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2015 Universidad Nacional de Colombia,
+ * Politecnico Jaime Isaza Cadavid.
+ * Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+ * $Id$
+ */
+
+package co.edu.unalmed.gaunal.sumolib.net;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+
+/**
+ *
+ * @author GaunalJD
+ */
+class Edge{
+
+ private String id;
+ private Node from;
+ private Node to;
+ private Integer prio;
+ private ArrayList lanes;
+ private Double speed;
+ private Object length;
+ private HashMap<Edge,ArrayList> incoming;
+ private HashMap<Edge,ArrayList> outgoing;
+ private Object shape;
+ private Object cachedShapeWithJunctions;
+ private String function;
+ private TLS tls;
+ private String name;
+
+ public Edge(String id, Node fromN, Node toN, Integer prio,
+ String function, String name) {
+ this.id = id;
+ this.from = fromN;
+ this.to = toN;
+ this.prio = prio;
+ fromN.addOutgoing(this);
+ toN.addIncoming(this);
+ this.lanes = new ArrayList();
+ this.speed = null;
+ this.length = null;
+ this.incoming = new HashMap();
+ this.outgoing = new HashMap();
+ this.shape = null;
+ this.cachedShapeWithJunctions = null;
+ this.function = function;
+ this.tls = null;
+ this.name = name;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public ArrayList getLanes() {
+ return lanes;
+ }
+
+ public String getName(){
+ return this.name;
+ }
+
+ public Object getTLS(){
+ return this.tls;
+ }
+
+ public void addLane(Lane lane){
+ this.lanes.add(lane);
+ this.speed = lane.getSpeed();
+ this.length = lane.getLength();
+ }
+
+ public void addOutgoing(Connection conn){
+ if (!this.outgoing.containsKey(conn.getTo())){
+ this.outgoing.put(conn.getTo(), new ArrayList());
+ }
+ this.outgoing.get(conn.getTo()).add(conn);
+ }
+
+ public void addIncoming(Connection conn){
+ if (!this.incoming.containsKey(conn.getFrom())){
+ this.incoming.put(conn.getFrom(), new ArrayList());
+ }
+ this.incoming.get(conn.getFrom()).add(conn);
+ }
+
+ public void setShape(ArrayList shape){
+ this.shape = shape;
+ this.cachedShapeWithJunctions = null;
+ }
+
+ public Lane getLane(int idx){
+ return (Lane) this.lanes.get(idx);
+ }
+
+ public void rebuildShape(){
+ int noShapes = this.lanes.size();
+ if (noShapes%2 == 1){
+ Lane theLane = (Lane) this.lanes.get((int) noShapes/2);
+ this.setShape(theLane.getShape());
+ } else{
+ ArrayList shape = new ArrayList();
+ int minLen = -1;
+ for (Iterator it = this.lanes.iterator(); it.hasNext();) {
+ Lane l = (Lane) it.next();
+ if (minLen==-1 || minLen > l.getShape().size()){
+ minLen = l.getShape().size();
+ }
+ }
+ for (int i=0; i<minLen; i++){
+ Double x = 0.0;
+ Double y = 0.0;
+ for (int j=0; j<this.lanes.size(); j++){
+ Lane theLane = (Lane) this.lanes.get(j);
+ Double[] theNode = (Double[]) theLane.getShape().get(i);
+ x = x + theNode[0];
+ y = y + theNode[1];
+ }
+ x = x / this.lanes.size();
+ y = y / this.lanes.size();
+ shape.add(new Double[] {x, y});
+ }
+ this.setShape(shape);
+ }
+ }
+
+ public void setTls(TLS tls) {
+ this.tls = tls;
+ }
+
+ public Object getShape() {
+ return shape;
+ }
+
+}
diff --git a/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Lane.java b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Lane.java
new file mode 100644
index 0000000..db8d569
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Lane.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2015 Universidad Nacional de Colombia,
+ * Politecnico Jaime Isaza Cadavid.
+ * Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+ * $Id$
+ */
+
+package co.edu.unalmed.gaunal.sumolib.net;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+/**
+ *
+ * @author GaunalJD
+ */
+class Lane extends Object{
+ private Edge edge;
+ private Double speed;
+ private Double length;
+ private ArrayList shape;
+ private ArrayList outgoing;
+ private HashMap params;
+
+ public Lane(Edge edge, Double speed, Double length) {
+ this.edge = edge;
+ this.speed = speed;
+ this.length = length;
+ this.shape = new ArrayList();
+ this.outgoing = new ArrayList();
+ this.params = new HashMap();
+ edge.addLane(this);
+ }
+
+ public Double getSpeed() {
+ return speed;
+ }
+
+ public Double getLength() {
+ return length;
+ }
+
+ public ArrayList getShape() {
+ return shape;
+ }
+
+ public void setShape(ArrayList shape) {
+ this.shape = shape;
+ }
+
+ public String getID(){
+ String id = this.edge.getId() + "_" +
+ String.valueOf(this.edge.getLanes().indexOf(this));
+ return id;
+ }
+
+ public HashMap getParams() {
+ return params;
+ }
+
+}
diff --git a/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Net.java b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Net.java
new file mode 100644
index 0000000..2f71d9f
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Net.java
@@ -0,0 +1,225 @@
+/*
+ * Copyright 2015 Universidad Nacional de Colombia,
+ * Politecnico Jaime Isaza Cadavid.
+ * Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+ * $Id$
+ */
+
+package co.edu.unalmed.gaunal.sumolib.net;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import com.infomatiq.jsi.rtree.RTree;
+
+/**
+ *
+ * @author GaunalJD
+ */
+public class Net {
+
+ private HashMap location;
+ private HashMap id2node;
+ private HashMap id2edge;
+ private HashMap id2tls;
+ private ArrayList nodes;
+ private ArrayList edges;
+ private ArrayList tlss;
+ private Double[][] ranges = {{10000.0, -10000.0},{10000.0, -10000.0}};
+ private ArrayList roundabouts;
+ private RTree rtree;
+
+ public Net() {
+ this.location = new HashMap();
+ this.id2node = new HashMap();
+ this.id2edge = new HashMap();
+ this.id2tls = new HashMap();
+ this.nodes = new ArrayList();
+ this.edges = new ArrayList();
+ this.tlss = new ArrayList();
+ this.roundabouts = new ArrayList();
+ this.rtree = new RTree();
+ }
+
+ public void setLocation(String netOffset,
+ String convBoundary,
+ String origBoundary,
+ String projParameter) {
+ this.location.put("netOffset", netOffset);
+ this.location.put("convBoundary", convBoundary);
+ this.location.put("origBoundary", origBoundary);
+ this.location.put("projParameter", projParameter);
+ }
+
+ public Node addNode(String id){
+ String type = null;
+ Double[] coord = null;
+ String[] incLanes = null;
+ if (!this.id2node.containsKey(id)){
+ Node n = new Node(id, type, coord, incLanes);
+ this.nodes.add(n);
+ this.id2node.put(id, n);
+ }
+ this.setAdditionalNodeInfo((Node)this.id2node.get(id),
+ type, coord, incLanes);
+ return (Node)this.id2node.get(id);
+ }
+
+ public Node addNode(String id, String type){
+ Double[] coord = null;
+ String[] incLanes = null;
+ if (!this.id2node.containsKey(id)){
+ Node n = new Node(id, type, coord, incLanes);
+ this.nodes.add(n);
+ this.id2node.put(id, n);
+ }
+ this.setAdditionalNodeInfo((Node)this.id2node.get(id),
+ type, coord, incLanes);
+ return (Node)this.id2node.get(id);
+ }
+
+ public Node addNode(String id, String type, Double[] coord){
+ String[] incLanes = null;
+ if (!this.id2node.containsKey(id)){
+ Node n = new Node(id, type, coord, incLanes);
+ this.nodes.add(n);
+ this.id2node.put(id, n);
+ }
+ this.setAdditionalNodeInfo((Node)this.id2node.get(id),
+ type, coord, incLanes);
+ return (Node)this.id2node.get(id);
+ }
+
+ public Node addNode(String id, String type, Double[] coord,
+ String[] incLanes){
+ if (!this.id2node.containsKey(id)){
+ Node n = new Node(id, type, coord, incLanes);
+ this.nodes.add(n);
+ this.id2node.put(id, n);
+ }
+ this.setAdditionalNodeInfo((Node)this.id2node.get(id),
+ type, coord, incLanes);
+ return (Node)this.id2node.get(id);
+ }
+
+ public void setAdditionalNodeInfo(Node node,
+ String type,
+ Double[] coord,
+ String[] incLanes){
+ if (coord!=null && node.getCoord() == null){
+ node.setCoord(coord);
+ this.ranges[0][0] = Math.min(this.ranges[0][0], coord[0]);
+ this.ranges[0][1] = Math.max(this.ranges[0][1], coord[0]);
+ this.ranges[1][0] = Math.min(this.ranges[1][0], coord[1]);
+ this.ranges[1][1] = Math.min(this.ranges[1][1], coord[1]);
+ }
+ if (incLanes!=null && node.getIncLanes() == null){
+ node.setIncLanes(incLanes);
+ }
+ if (type != null && node.getType()== null){
+ node.setType(type);
+ }
+ }
+
+ /**
+ *
+ * @param id
+ * @param fromID
+ * @param toID
+ * @param prio
+ * @param function
+ * @param name
+ * @return
+ */
+ public Edge addEdge(String id, String fromID, String toID, Integer prio,
+ String function, String name){
+ if (!this.id2edge.containsKey(id)){
+ Node fromN = this.addNode(fromID);
+ Node toN = this.addNode(toID);
+ Edge e = new Edge(id, fromN, toN, prio, function, name);
+ this.edges.add(e);
+ this.id2edge.put(id, e);
+ }
+ return (Edge)this.id2edge.get(id);
+ }
+
+ public Lane addLane(Edge edge, Double speed, Double length){
+ Lane lane = new Lane(edge, speed, length);
+ return lane;
+ }
+
+ public Roundabout addRoundabout(String[] nodes){
+ Roundabout r = new Roundabout(nodes);
+ this.roundabouts.add(r);
+ return r;
+ }
+
+ public void addConnection(Edge fromEdge, Edge toEdge, Lane fromlane,
+ Lane tolane, String direction, String tls, int tllink){
+ Connection conn = new Connection(fromEdge, toEdge, fromlane, tolane,
+ direction, tls, tllink);
+ fromEdge.addOutgoing(conn);
+ toEdge.addIncoming(conn);
+ }
+
+ public ArrayList getEdges(){
+ return this.edges;
+ }
+
+ public ArrayList getRoundabouts(){
+ return this.roundabouts;
+ }
+
+ public Boolean hasEdge(String id){
+ return this.id2edge.containsKey(id);
+ }
+
+ public Edge getEdge(String id){
+ return (Edge)this.id2edge.get(id);
+ }
+
+ /* initRtree missing */
+
+ /* public ArrayList getNeighboringEdges(x, y){
+ Double r = 0.1;
+ ArrayList edges = new ArrayList();
+
+ } */
+
+ public Boolean hasNode(String id){
+ return this.id2node.containsKey(id);
+ }
+
+ public Node getNode(String id){
+ return (Node)this.id2node.get(id);
+ }
+
+ public ArrayList getNodes() {
+ return nodes;
+ }
+
+ public TLS getTLSSecure(String tlid){
+ TLS tls;
+ if (this.id2tls.containsKey(tlid)){
+ tls = (TLS)this.id2tls.get(tlid);
+ return tls;
+ }else{
+ tls = new TLS(tlid);
+ this.id2tls.put(tlid, tls);
+ this.tlss.add(tls);
+
+ }
+ return tls;
+ }
+
+ public TLS addTLS(String tlid, Lane inLane, Lane outLane, Integer linkNo){
+ TLS tls = this.getTLSSecure(tlid);
+ tls.addConnection(inLane, outLane, linkNo);
+ return tls;
+ }
+
+ /* public TLSProgram addTLSProgram(String tlid, String programID,
+ Double offset, Double Time){
+
+ } */
+
+}
diff --git a/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/NetReader.java b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/NetReader.java
new file mode 100644
index 0000000..221f617
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/NetReader.java
@@ -0,0 +1,248 @@
+/*
+ * Copyright 2015 Universidad Nacional de Colombia,
+ * Politecnico Jaime Isaza Cadavid.
+ * Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+ * $Id$
+ */
+
+package co.edu.unalmed.gaunal.sumolib.net;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+/**
+ *
+ * @author GaunalJD
+ */
+public class NetReader extends DefaultHandler{
+
+ /**
+ *
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ */
+
+ private Net net;
+ private Edge currentEdge;
+ private Node currentNode;
+ private Lane currentLane;
+ private String currentShape;
+ private TLSProgram currentProgram;
+ private Boolean withPhases;
+ private Boolean withConnections;
+ private Boolean withFoes;
+
+ public NetReader() throws ParserConfigurationException, SAXException {
+ this.net = new Net();
+ this.currentEdge = null;
+ this.currentNode = null;
+ this.currentLane = null;
+ this.currentShape = "";
+ this.currentProgram = null;
+ this.withPhases = false;
+ this.withConnections = true;
+ this.withFoes = true;
+ }
+
+ @Override
+ public void startElement(String namespaceURI,
+ String localName,
+ String qName,
+ Attributes atts){
+
+ if (localName.equals("location")){
+ this.net.setLocation(atts.getValue("netOffset"),
+ atts.getValue("convBoundary"),
+ atts.getValue("origBoundary"),
+ atts.getValue("projParameter"));
+ }
+
+ if (localName.equals("edge")){
+
+ // Process non-internal edges
+ if (atts.getValue("function")==null ||
+ !atts.getValue("function").equals("internal")){
+ int prio;
+ prio = -1;
+ if (atts.getValue("priority")!=null){
+ prio = Integer.valueOf(atts.getValue("priority"));
+ }
+ String function;
+ function = "";
+ if (atts.getValue("function")!=null){
+ function = atts.getValue("function");
+ }
+ String name;
+ name = "";
+ if (atts.getValue("name")!=null){
+ name = atts.getValue("name");
+ }
+ this.currentEdge = this.net.addEdge(atts.getValue("id"),
+ atts.getValue("from"),atts.getValue("to"),
+ prio, function, name);
+ if (atts.getValue("shape")!=null){
+ try {
+ this.processShape(this.currentEdge,atts.getValue("shape"));
+ } catch (Exception ex) {
+ Logger.getLogger(NetReader.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ } else{
+ this.currentEdge = null;
+ }
+ }
+
+ if (localName.equals("lane") && this.currentEdge != null){
+ Double speed = Double.valueOf(atts.getValue("speed"));
+ Double length = Double.valueOf(atts.getValue("length"));
+ this.currentLane = this.net.addLane(this.currentEdge,speed,length);
+ if (atts.getValue("shape")!=null){
+ this.currentShape = atts.getValue("shape");
+ } else{
+ this.currentShape = "";
+ }
+ }
+
+ if (localName.equals("junction")){
+ if (!String.valueOf(atts.getValue("id").charAt(0)).equals(":")){
+ Double x = Double.valueOf(atts.getValue("x"));
+ Double y = Double.valueOf(atts.getValue("y"));
+ Double[] coord = new Double[]{x, y};
+ String[] incLanes = atts.getValue("incLanes").split(" ");
+ this.currentNode = this.net.addNode(atts.getValue("id"),
+ atts.getValue("type"), coord, incLanes);
+ }
+ }
+
+ if (localName.equals("connection") && this.withConnections &&
+ !String.valueOf(atts.getValue("from").charAt(0)).equals(":")){
+ Edge fromEdge = this.net.getEdge(atts.getValue("from"));
+ Edge toEdge = this.net.getEdge(atts.getValue("to"));
+ Lane fromLane = fromEdge.getLane(Integer.valueOf(atts.getValue("fromLane")));
+ Lane toLane = toEdge.getLane(Integer.valueOf(atts.getValue("toLane")));
+ String tl;
+ int tllink;
+ if (atts.getValue("tl")!=null && !atts.getValue("tl").equals("")){
+ tl = atts.getValue("tl");
+ tllink = Integer.valueOf(atts.getValue("linkIndex"));
+ TLS tls = this.net.addTLS(tl, fromLane, toLane, tllink);
+ fromEdge.setTls(tls);
+ } else{
+ tl = "";
+ tllink = -1;
+ }
+ this.net.addConnection(fromEdge, toEdge, fromLane, toLane,
+ atts.getValue("dir"), tl, tllink);
+ }
+
+ if (localName.equals("request") && this.withFoes){
+ this.currentNode.setFoes(Integer.valueOf(atts.getValue("index")),
+ atts.getValue("foes"), atts.getValue("response"));
+ }
+
+ if (localName.equals("phases") && this.withPhases){
+ this.currentProgram.addPhase(atts.getValue("state"),
+ Integer.valueOf(atts.getValue("duration")));
+ }
+
+ if (localName.equals("roundabout")){
+ this.net.addRoundabout(atts.getValue("nodes").split(" "));
+ }
+
+ if (localName.equals("param")){
+ if (this.currentLane!=null){
+ this.currentLane.getParams().put(atts.getValue("key"),
+ atts.getValue("value"));
+ }
+ }
+ }
+
+ @Override
+ public void characters(char[] ch, int start, int length){
+ if (this.currentLane != null){
+ this.currentShape = this.currentShape + ch;
+ }
+ }
+
+
+ @Override
+ public void endElement(String uri, String localName, String qName){
+ if (localName.equals("lane")){
+ if (this.currentLane!=null){
+ try {
+ this.processShape(this.currentLane, this.currentShape);
+ } catch (Exception ex) {
+ Logger.getLogger(NetReader.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ this.currentShape = "";
+ }
+ this.currentLane = null;
+ }
+ if (localName.equals("edge")){
+ if (this.currentEdge!=null && this.currentEdge.getShape()==null){
+ this.currentEdge.rebuildShape();
+ }
+ this.currentEdge = null;
+ }
+ }
+
+ public void processShape(Object object,
+ String shapeString) throws Exception{
+ ArrayList cshape = new ArrayList();
+ String[] es = shapeString.trim().split(" ");
+ for (String e : es) {
+ String[] p = e.split(",");
+ cshape.add(new Double[]{Double.valueOf(p[0]),Double.valueOf(p[1])});
+ object.getClass().getMethod("setShape",
+ new Class<?>[]{ArrayList.class}).invoke(object, cshape);
+ }
+ }
+
+ public Net getNet() {
+ return net;
+ }
+
+ /*public Double[] parseGeoData(String data){
+ String[] splitData = data.split(",");
+ Double[] parsedGeoData = new Double[4];
+ for (int i=1; i<parsedGeoData.length; i++){
+ parsedGeoData[i] = Double.parseDouble(splitData[i]);
+ }
+ return parsedGeoData;
+ }*/
+
+ public static Net readNet(String filename) throws ParserConfigurationException, SAXException{
+ NetReader netReader = new NetReader();
+ try{
+ File f = new File(filename);
+ if (!f.exists() || f.isDirectory()){
+ System.out.format("Network file '%s' not found",filename);
+ System.exit(1);
+ }
+ SAXParserFactory spf = SAXParserFactory.newInstance();
+ spf.setNamespaceAware(true);
+ SAXParser saxParser = spf.newSAXParser();
+
+ XMLReader xmlReader = saxParser.getXMLReader();
+ xmlReader.setContentHandler(netReader);
+ xmlReader.parse(filename);
+ } catch (ParserConfigurationException /*| SAXException | IOException*/ e){
+ System.out.println("Please mind that the network format has changed "
+ + "in 0.13.0, you may need to update your network!");
+ System.exit(1);
+ } catch (IOException ex) {
+ Logger.getLogger(NetReader.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ return netReader.getNet();
+ }
+
+}
\ No newline at end of file
diff --git a/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Node.java b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Node.java
new file mode 100644
index 0000000..5186d27
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Node.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2015 Universidad Nacional de Colombia,
+ * Politecnico Jaime Isaza Cadavid.
+ * Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+ * $Id$
+ */
+
+package co.edu.unalmed.gaunal.sumolib.net;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+/**
+ *
+ * @author GaunalJD
+ */
+public class Node {
+
+ private String id;
+ private String type;
+ private Double[] coord;
+ private ArrayList incoming;
+ private ArrayList outgoing;
+ private HashMap foes;
+ private HashMap prohibits;
+ private String[] incLanes;
+
+ public Node(String id, String type, Double[] coord, String[] incLanes) {
+ this.id = id;
+ this.type = type;
+ this.coord = coord;
+ this.incoming = new ArrayList();
+ this.outgoing = new ArrayList();
+ this.foes = new HashMap();
+ this.prohibits = new HashMap();
+ this.incLanes = incLanes;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void addOutgoing(Edge edge){
+ this.outgoing.add(edge);
+ }
+
+ public ArrayList getOutgoing(){
+ return this.outgoing;
+ }
+
+ public void addIncoming(Edge edge){
+ this.incoming.add(edge);
+ }
+
+ public void setFoes(int index, String foes, String prohibits){
+ this.foes.put(index, foes);
+ this.prohibits.put(index, prohibits);
+ }
+
+ public Double[] getCoord() {
+ return coord;
+ }
+
+ public void setCoord(Double[] coord) {
+ this.coord = coord;
+ }
+
+ public String[] getIncLanes() {
+ return incLanes;
+ }
+
+ public void setIncLanes(String[] incLanes) {
+ this.incLanes = incLanes;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+}
diff --git a/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Roundabout.java b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Roundabout.java
new file mode 100644
index 0000000..e78ad84
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/Roundabout.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2015 Universidad Nacional de Colombia,
+ * Politecnico Jaime Isaza Cadavid.
+ * Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+ * $Id$
+ */
+
+package co.edu.unalmed.gaunal.sumolib.net;
+
+/**
+ *
+ * @author GaunalJD
+ */
+public class Roundabout {
+ private String[] nodes;
+
+ public Roundabout(String[] nodes) {
+ this.nodes = nodes;
+ }
+
+ public String[] getNodes() {
+ return nodes;
+ }
+
+}
diff --git a/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/TLS.java b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/TLS.java
new file mode 100644
index 0000000..8a5cd2e
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/TLS.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 Universidad Nacional de Colombia,
+ * Politecnico Jaime Isaza Cadavid.
+ * Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+ * $Id$
+ */
+
+package co.edu.unalmed.gaunal.sumolib.net;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+/**
+ *
+ * @author GaunalJD
+ */
+public class TLS {
+ private String id;
+ private ArrayList<ArrayList> connections;
+ private Integer maxConnectionNumber;
+ private HashMap programs;
+
+ public TLS(String id) {
+ this.id = id;
+ this.connections = new ArrayList();
+ this.maxConnectionNumber = new Integer(-1);
+ this.programs = new HashMap();
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public ArrayList<ArrayList> getConnections() {
+ return connections;
+ }
+
+ public Integer getMaxConnectionNumber() {
+ return maxConnectionNumber;
+ }
+
+ public HashMap getPrograms() {
+ return programs;
+ }
+
+ public void addConnection(Lane inLane, Lane outLane, Integer linkNo){
+ ArrayList connection = new ArrayList();
+ connection.add(inLane);
+ connection.add(outLane);
+ connection.add(linkNo);
+ this.connections.add(connection);
+ }
+
+}
diff --git a/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/TLSProgram.java b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/TLSProgram.java
new file mode 100644
index 0000000..ea1e67b
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/src/co/edu/unalmed/gaunal/sumolib/net/TLSProgram.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2015 Universidad Nacional de Colombia,
+ * Politecnico Jaime Isaza Cadavid.
+ * Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+ * $Id$
+ */
+
+package co.edu.unalmed.gaunal.sumolib.net;
+
+import java.util.ArrayList;
+
+/**
+ *
+ * @author GaunalJD
+ */
+public class TLSProgram {
+ private String id;
+ private Double offset;
+ private String type;
+ private ArrayList<ArrayList> phases;
+
+ public TLSProgram(String id, Double offset, String type) {
+ this.id = id;
+ this.offset = offset;
+ this.type = type;
+ this.phases = new ArrayList();
+ }
+
+ public void addPhase(String state, int duration){
+ ArrayList phase = new ArrayList();
+ phase.add(state);
+ phase.add(duration);
+ this.phases.add(phase);
+ }
+
+ /* public String toXML(tlsID){
+ String ret = "\t ";
+ } */
+
+}
diff --git a/tools/contributed/sumolib4matlab/test/co/edu/unalmed/gaunal/sumolib/net/NetReaderTest.java b/tools/contributed/sumolib4matlab/test/co/edu/unalmed/gaunal/sumolib/net/NetReaderTest.java
new file mode 100644
index 0000000..fb995b2
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/test/co/edu/unalmed/gaunal/sumolib/net/NetReaderTest.java
@@ -0,0 +1,300 @@
+/*
+ * Copyright 2015 Universidad Nacional de Colombia,
+ * Politecnico Jaime Isaza Cadavid.
+ * Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+ * $Id$
+ */
+
+package co.edu.unalmed.gaunal.sumolib.net;
+
+import com.sun.org.apache.xml.internal.utils.AttList;
+import java.util.ArrayList;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.xml.parsers.ParserConfigurationException;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.ext.Attributes2;
+import org.xml.sax.helpers.AttributesImpl;
+
+/**
+ *
+ * @author GaunalJD
+ */
+public class NetReaderTest {
+
+ public NetReaderTest() {
+ }
+
+ @BeforeClass
+ public static void setUpClass() {
+ }
+
+ @AfterClass
+ public static void tearDownClass() {
+ }
+
+ /**
+ * Test of startElement method, of class NetReader.
+ */
+ @Test
+ public void testStartElement() {
+ System.out.println("startElement");
+ String namespaceURI = "";
+ String localNameLocation = "location";
+ String localNameEdge = "edge";
+ String localNameLane = "lane";
+ String localNameJunction = "junction";
+ String localNameConnection = "connection";
+ String localNameRequest = "request";
+ String localNamePhase = "phase";
+ String localNameRoundabout = "roundabout";
+
+ String qName = "";
+
+ AttributesImpl attsLocation = new AttributesImpl();
+ attsLocation.addAttribute(null, null, "netOffset", null,
+ "452.00,452.00");
+ attsLocation.addAttribute(null, null, "convBoundary", null,
+ "0.00,0.00,904.00,904.00");
+ attsLocation.addAttribute(null, null, "origBoundary", null,
+ "-452.00,-452.00,452.00,452.00");
+ attsLocation.addAttribute(null, null, "projParameter", null,
+ "!");
+
+ AttributesImpl attsEdgeInternal = new AttributesImpl();
+ attsEdgeInternal.addAttribute(null, null, "id", null,
+ ":a_0");
+ attsEdgeInternal.addAttribute(null, null, "function", null,
+ "internal");
+
+ AttributesImpl attsLaneInternal = new AttributesImpl();
+ attsLaneInternal.addAttribute(null, null, "id", null,
+ ":a_0_0");
+ attsLaneInternal.addAttribute(null, null, "index", null,
+ "0");
+ attsLaneInternal.addAttribute(null, null, "speed", null,
+ "50.00");
+ attsLaneInternal.addAttribute(null, null, "length", null,
+ "5.00");
+ attsLaneInternal.addAttribute(null, null, "shape", null,
+ "443.75,463.35 443.56,461.99 442.98,461.02 442.01,460.44 440.65,460.25");
+
+ AttributesImpl attsEdgeFrom = new AttributesImpl();
+ attsEdgeFrom.addAttribute(null, null, "id", null,
+ "O1a");
+ attsEdgeFrom.addAttribute(null, null, "from", null,
+ "O1");
+ attsEdgeFrom.addAttribute(null, null, "to", null,
+ "a");
+ attsEdgeFrom.addAttribute(null, null, "priority", null,
+ "1");
+ attsEdgeFrom.addAttribute(null, null, "type", null,
+ "calleTipo1");
+
+ AttributesImpl attsLaneFrom = new AttributesImpl();
+ attsLaneFrom.addAttribute(null, null, "id", null,
+ "O1a_0");
+ attsLaneFrom.addAttribute(null, null, "index", null,
+ "0");
+ attsLaneFrom.addAttribute(null, null, "speed", null,
+ "50.00");
+ attsLaneFrom.addAttribute(null, null, "length", null,
+ "440.65");
+ attsLaneFrom.addAttribute(null, null, "shape", null,
+ "443.75,904.00 443.75,463.35");
+
+ AttributesImpl attsEdgeTo = new AttributesImpl();
+ attsEdgeTo.addAttribute(null, null, "id", null,
+ "aO2");
+ attsEdgeTo.addAttribute(null, null, "from", null,
+ "a");
+ attsEdgeTo.addAttribute(null, null, "to", null,
+ "O2");
+ attsEdgeTo.addAttribute(null, null, "priority", null,
+ "1");
+ attsEdgeTo.addAttribute(null, null, "type", null,
+ "calleTipo1");
+
+ AttributesImpl attsLaneTo = new AttributesImpl();
+ attsLaneTo.addAttribute(null, null, "id", null,
+ "aO2_0");
+ attsLaneTo.addAttribute(null, null, "index", null,
+ "0");
+ attsLaneTo.addAttribute(null, null, "speed", null,
+ "50.00");
+ attsLaneTo.addAttribute(null, null, "length", null,
+ "440.65");
+ attsLaneTo.addAttribute(null, null, "shape", null,
+ "440.65,460.25 0.00,460.25");
+
+ AttributesImpl attsJunction = new AttributesImpl();
+ attsJunction.addAttribute(null, null, "id", null,
+ "O1");
+ attsJunction.addAttribute(null, null, "type", null,
+ "dead_end");
+ attsJunction.addAttribute(null, null, "x", null,
+ "452.00");
+ attsJunction.addAttribute(null, null, "y", null,
+ "904.00");
+ attsJunction.addAttribute(null, null, "incLanes", null,
+ "aO1_0 aO1_1 aO1_2");
+ attsJunction.addAttribute(null, null, "intLanes", null,
+ "");
+ attsJunction.addAttribute(null, null, "shape", null,
+ "451.95,904.00 442.15,904.00 461.85,904.00 452.05,904.00");
+
+ AttributesImpl attsRequest = new AttributesImpl();
+ attsRequest.addAttribute(null, null, "index", null,
+ "0");
+ attsRequest.addAttribute(null, null, "response", null,
+ "000000000000");
+ attsRequest.addAttribute(null, null, "foes", null,
+ "000000000000");
+ attsRequest.addAttribute(null, null, "cont", null,
+ "0");
+
+ AttributesImpl attsConnection = new AttributesImpl();
+ attsConnection.addAttribute(null, null, "from", null,
+ "O1a");
+ attsConnection.addAttribute(null, null, "to", null,
+ "aO2");
+ attsConnection.addAttribute(null, null, "fromLane", null,
+ "0");
+ attsConnection.addAttribute(null, null, "toLane", null,
+ "0");
+ attsConnection.addAttribute(null, null, "via", null,
+ ":a_0_0");
+ attsConnection.addAttribute(null, null, "tl", null,
+ "a");
+ attsConnection.addAttribute(null, null, "linkIndex", null,
+ "0");
+ attsConnection.addAttribute(null, null, "dir", null,
+ "r");
+ attsConnection.addAttribute(null, null, "state", null,
+ "o");
+
+ AttributesImpl attsPhase = new AttributesImpl();
+ attsPhase.addAttribute(null, null, "duration", null,
+ "31");
+ attsPhase.addAttribute(null, null, "state", null,
+ "GGgGrrGGgGrr");
+
+ AttributesImpl attsRoundabout = new AttributesImpl();
+ attsRoundabout.addAttribute(null, null, "nodes", null,
+ "322001698 1305076200 322002002 322001698");
+
+ try {
+ NetReader instance = new NetReader();
+ instance.startElement(null, localNameLocation, null, attsLocation);
+ instance.startElement(null, localNameEdge, null, attsEdgeInternal);
+ instance.startElement(null,localNameLane, null, attsLaneInternal);
+ instance.startElement(null, localNameEdge, null, attsEdgeFrom);
+ instance.startElement(null,localNameLane, null, attsLaneFrom);
+ instance.startElement(null, localNameEdge, null, attsEdgeTo);
+ instance.startElement(null,localNameLane, null, attsLaneTo);
+ instance.startElement(null,localNameJunction, null, attsJunction);
+ instance.startElement(null,localNameConnection, null, attsConnection);
+ instance.startElement(null,localNamePhase, null, attsPhase);
+ instance.startElement(null,localNameRoundabout, null, attsRoundabout);
+ } catch (ParserConfigurationException /*| SAXException*/ ex) {
+ System.exit(1);
+ } catch (SAXException ex) {
+ Logger.getLogger(NetReaderTest.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+
+ // TODO review the generated test code and remove the default call to fail.
+
+
+ /**
+ * Test of endElement method, of class NetReader.
+ */
+ /* @Test
+ public void testEndElement() {
+ System.out.println("endElement");
+ String uri = "";
+ String localName = "";
+ String qName = "";
+ NetReader instance = new NetReader();
+ instance.endElement(uri, localName, qName);
+ // TODO review the generated test code and remove the default call to fail.
+ fail("The test case is a prototype.");
+ }*/
+
+ /**
+ * Test of processShape method, of class NetReader.
+ */
+ /* @Test
+ public void testProcessShape() throws Exception {
+ System.out.println("processShape");
+ Object object = null;
+ String shapeString = "";
+ NetReader instance = new NetReader();
+ instance.processShape(object, shapeString);
+ // TODO review the generated test code and remove the default call to fail.
+ fail("The test case is a prototype.");
+ }*/
+
+ /**
+ * Test of getNet method, of class NetReader.
+ */
+ /* @Test
+ public void testGetNet() {
+ System.out.println("getNet");
+ NetReader instance = new NetReader();
+ Net expResult = null;
+ Net result = instance.getNet();
+ assertEquals(expResult, result);
+ // TODO review the generated test code and remove the default call to fail.
+ fail("The test case is a prototype.");
+ }*/
+
+ /**
+ * Test of parseGeoData method, of class NetReader.
+ */
+ /* @Test
+ public void testParseGeoData() {
+ System.out.println("parseGeoData");
+ String data = "";
+ NetReader instance = new NetReader();
+ Double[] expResult = null;
+ Double[] result = instance.parseGeoData(data);
+ assertArrayEquals(expResult, result);
+ // TODO review the generated test code and remove the default call to fail.
+ fail("The test case is a prototype.");
+ }*/
+
+ /**
+ * Test of readNet method, of class NetReader.
+ * @throws java.lang.Exception
+ */
+ @Test
+ public void testReadNet() throws Exception {
+ // System.out.println("readNet");
+ String filename = "C:\\sumo-0.20.0\\docs\\tutorial\\traci_tls\\data\\cross.net.xml";
+ /*Net expResult = null;*/
+ Net result = NetReader.readNet(filename);
+ ArrayList nodes;
+ ArrayList edges;
+ /*assertEquals(expResult, result);*/
+ // TODO review the generated test code and remove the default call to fail.
+ nodes = result.getNodes();
+ edges = result.getEdges();
+ System.out.println("The IDs of the edges in the SUMO network:");
+ for(int i=0;i<edges.size();i++){
+ Edge currentEdge = (Edge) edges.get(i);
+ System.out.print(currentEdge.getId() + ", ");
+ }
+ System.out.println("\nThe IDs of the nodes in the SUMO network:");
+ for(int i=0;i<nodes.size();i++){
+ Node currentNode = (Node) nodes.get(i);
+ System.out.print(currentNode.getId() + ", ");
+ }
+ }
+
+}
diff --git a/tools/contributed/sumolib4matlab/test/co/edu/unalmed/gaunal/sumolib/net/NetTest.java b/tools/contributed/sumolib4matlab/test/co/edu/unalmed/gaunal/sumolib/net/NetTest.java
new file mode 100644
index 0000000..52553fe
--- /dev/null
+++ b/tools/contributed/sumolib4matlab/test/co/edu/unalmed/gaunal/sumolib/net/NetTest.java
@@ -0,0 +1,503 @@
+/*
+ * Copyright 2015 Universidad Nacional de Colombia,
+ * Politecnico Jaime Isaza Cadavid.
+ * Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+ * $Id$
+ */
+
+package co.edu.unalmed.gaunal.sumolib.net;
+
+import java.util.ArrayList;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+/**
+ *
+ * @author GaunalJD
+ */
+public class NetTest {
+
+ public NetTest() {
+ }
+
+ @BeforeClass
+ public static void setUpClass() {
+ }
+
+ @AfterClass
+ public static void tearDownClass() {
+ }
+
+ /**
+ * Test of setLocation method, of class Net.
+ */
+ /* @Test
+ public void testSetLocation() {
+ System.out.println("setLocation");
+ Double[] netOffset = null;
+ Double[] convBoundary = null;
+ Double[] origBoundary = null;
+ char projParameter = ' ';
+ Net instance = new Net();
+ instance.setLocation(netOffset, convBoundary, origBoundary, projParameter);
+
+ }*/
+
+ /**
+ * Test of addNode method, of class Net.
+ */
+ @Test
+ public void testAddNode_String() {
+ System.out.println("addNode");
+ String id = "myNode";
+ Net instance = new Net();
+ Node expResult = new Node(id, null, null, null);
+ Node result = instance.addNode(id);
+ assertEquals(expResult.getId(), result.getId());
+ Assert.assertArrayEquals(expResult.getCoord(), result.getCoord());
+ Assert.assertArrayEquals(expResult.getIncLanes(), result.getIncLanes());
+ assertEquals(expResult.getType(), result.getType());
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+ /**
+ * Test of addNode method, of class Net.
+ */
+ @Test
+ public void testAddNode_String_String() {
+ System.out.println("addNode");
+ String id = "myNode";
+ String type = "priority";
+ Net instance = new Net();
+ Node expResult = new Node(id, type, null, null);
+ Node result = instance.addNode(id, type);
+ assertEquals(expResult.getId(), result.getId());
+ Assert.assertArrayEquals(expResult.getCoord(), result.getCoord());
+ Assert.assertArrayEquals(expResult.getIncLanes(), result.getIncLanes());
+ assertEquals(expResult.getType(), result.getType());
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+ /**
+ * Test of addNode method, of class Net.
+ */
+ @Test
+ public void testAddNode_3args() {
+ System.out.println("addNode");
+ String id = "myNode";
+ String type = "priority";
+ Double[] coord = new Double[] {1.9,2.0};
+ Net instance = new Net();
+ Node expResult = new Node(id, type, coord, null);
+ Node result = instance.addNode(id, type, coord);
+ assertEquals(expResult.getId(), result.getId());
+ Assert.assertArrayEquals(expResult.getCoord(), result.getCoord());
+ Assert.assertArrayEquals(expResult.getIncLanes(), result.getIncLanes());
+ assertEquals(expResult.getType(), result.getType());
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+ /**
+ * Test of addNode method, of class Net.
+ */
+ @Test
+ public void testAddNode_4args() {
+ System.out.println("addNode");
+ String id = "myNode";
+ String type = "priority";
+ Double[] coord = new Double[] {1.9,2.0};
+ String[] incLanes = new String[] {"2","3"};
+ Net instance = new Net();
+ Node expResult = new Node(id, type, coord, incLanes);
+ Node result = instance.addNode(id, type, coord, incLanes);
+ assertEquals(expResult.getId(), result.getId());
+ Assert.assertArrayEquals(expResult.getCoord(), result.getCoord());
+ Assert.assertArrayEquals(expResult.getIncLanes(), result.getIncLanes());
+ assertEquals(expResult.getType(), result.getType());
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+ /**
+ * Test of setAdditionalNodeInfo method, of class Net.
+ */
+ @Test
+ public void testSetAdditionalNodeInfo() {
+ System.out.println("setAdditionalNodeInfo");
+ String id = "myNode";
+ String type = "priority";
+ Double[] coord = new Double[] {1.9,2.0};
+ String[] incLanes = new String[] {"2","3"};
+ Node node = new Node(id, type, coord, incLanes);
+ Net instance = new Net();
+ instance.setAdditionalNodeInfo(node, type, coord, incLanes);
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+ /**
+ * Test of addEdge method, of class Net.
+ */
+ @Test
+ public void testAddEdge() {
+ System.out.println("addEdge");
+ String id = "myEdge";
+ String fromID = "1";
+ String toID = "2";
+ Integer prio = 1;
+ String function = "internal";
+ String name = "";
+ Net instance = new Net();
+ Edge expResult = new Edge(id, instance.addNode(fromID),
+ instance.addNode(toID), prio, function, name);
+ Edge result = instance.addEdge(id, fromID, toID, prio, function, name);
+ assertEquals(expResult.getId(), result.getId());
+ assertEquals(expResult.getLanes(), result.getLanes());
+ assertEquals(expResult.getName(), result.getName());
+ assertEquals(expResult.getShape(), result.getShape());
+ assertEquals(expResult.getTLS(), result.getTLS());
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+ /**
+ * Test of addLane method, of class Net.
+ */
+ @Test
+ public void testAddLane() {
+ System.out.println("addLane");
+ String id = "myEdge";
+ String fromID = "1";
+ String toID = "2";
+ Integer prio = 1;
+ String function = "internal";
+ String name = "";
+ Double speed = 60.0;
+ Double length = 120.0;
+ Net instance = new Net();
+ Edge edge1 = new Edge(id, instance.addNode(fromID),
+ instance.addNode(toID), prio, function, name);
+ Edge edge2 = new Edge(id, instance.addNode(fromID),
+ instance.addNode(toID), prio, function, name);
+ Lane expResult = new Lane(edge1, speed, length);
+ Lane result = instance.addLane(edge2, speed, length);
+ String expResultID = expResult.getID();
+ String resultID = result.getID();
+ assertEquals(expResultID, resultID);
+ assertEquals(expResult.getLength(), result.getLength());
+ assertEquals(expResult.getParams(), result.getParams());
+ assertEquals(expResult.getShape(), result.getShape());
+ assertEquals(expResult.getSpeed(), result.getSpeed());
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+ /**
+ * Test of addRoundabout method, of class Net.
+ */
+ @Test
+ public void testAddRoundabout() {
+ System.out.println("addRoundabout");
+ String[] nodes = new String[] {"1","2","3","4"};
+ Net instance = new Net();
+ Roundabout expResult = new Roundabout(nodes);
+ Roundabout result = instance.addRoundabout(nodes);
+ Assert.assertArrayEquals(expResult.getNodes(), result.getNodes());
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+ /**
+ * Test of addConnection method, of class Net.
+ */
+ @Test
+ public void testAddConnection() {
+ System.out.println("addConnection");
+ String id1 = "myEdge1";
+ String fromID1 = "1";
+ String toID1 = "2";
+ Integer prio1 = 1;
+ String function1 = "internal";
+ String name1 = "";
+
+ String id2 = "myEdge2";
+ String fromID2 = "3";
+ String toID2 = "4";
+ Integer prio2 = 5;
+ String function2 = "internal";
+ String name2 = "";
+
+ Double speed = 60.0;
+ Double length = 120.0;
+
+ String direction = "";
+ String tls = "";
+ int tllink = 0;
+
+ Net instance = new Net();
+ Edge fromEdge = new Edge(id1, instance.addNode(fromID1),
+ instance.addNode(toID1), prio1, function1, name1);
+ Edge toEdge = new Edge(id2, instance.addNode(fromID2),
+ instance.addNode(toID2), prio2, function2, name2);
+
+ Lane fromlane = new Lane(fromEdge, speed, length);
+ Lane tolane = new Lane(toEdge, speed, length);
+
+ instance.addConnection(fromEdge, toEdge, fromlane, tolane, direction, tls, tllink);
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+ /**
+ * Test of getRoundabouts method, of class Net.
+ */
+ @Test
+ public void testGetRoundabouts() {
+ System.out.println("getRoundabouts");
+ Net instance = new Net();
+ String[] myNodes1 = new String[] {"1","2"};
+ String[] myNodes2 = new String[] {"3","4"};
+ Roundabout roundabout1 = new Roundabout(myNodes1);
+ Roundabout roundabout2 = new Roundabout(myNodes2);
+ ArrayList expResult = new ArrayList();
+ expResult.add(roundabout1);
+ expResult.add(roundabout2);
+ instance.addRoundabout(myNodes1);
+ instance.addRoundabout(myNodes2);
+ ArrayList result = instance.getRoundabouts();
+ Assert.assertArrayEquals(((Roundabout)expResult.get(0)).getNodes(),
+ ((Roundabout)result.get(0)).getNodes());
+ Assert.assertArrayEquals(((Roundabout)expResult.get(1)).getNodes(),
+ ((Roundabout)result.get(1)).getNodes());
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+ /**
+ * Test of hasEdge method, of class Net.
+ */
+ @Test
+ public void testHasEdge() {
+ System.out.println("hasEdge");
+ String id = "myEdge";
+ String fromID = "1";
+ String toID = "2";
+ Integer prio = 1;
+ String function = "internal";
+ String name = "";
+ Net instance = new Net();
+ instance.addEdge(id, fromID, toID, prio, function, name);
+ Boolean expResult = true;
+ Boolean result = instance.hasEdge(id);
+ assertEquals(expResult, result);
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+ /**
+ * Test of getEdge method, of class Net.
+ */
+ @Test
+ public void testGetEdge() {
+ System.out.println("getEdge");
+ String id = "myEdge";
+ String fromID = "1";
+ String toID = "2";
+ Integer prio = 1;
+ String function = "internal";
+ String name = "";
+ Net instance = new Net();
+ instance.addEdge(id, fromID, toID, prio, function, name);
+ Edge expResult = new Edge(id, instance.addNode(fromID),
+ instance.addNode(toID), prio, function, name);
+ Edge result = instance.getEdge(id);
+ assertEquals(expResult.getId(), result.getId());
+ assertEquals(expResult.getLanes(), result.getLanes());
+ assertEquals(expResult.getShape(), result.getShape());
+ assertEquals(expResult.getTLS(), result.getTLS());
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+ /**
+ * Test of hasNode method, of class Net.
+ */
+ @Test
+ public void testHasNode() {
+ System.out.println("hasNode");
+ String id = "myNode";
+ String type = "priority";
+ Double[] coord = new Double[] {1.9,2.0};
+ String[] incLanes = new String[] {"2","3"};
+ Net instance = new Net();
+ instance.addNode(id, type, coord, incLanes);
+ Boolean expResult = true;
+ Boolean result = instance.hasNode(id);
+ assertEquals(expResult, result);
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+ /**
+ * Test of getNode method, of class Net.
+ */
+ @Test
+ public void testGetNode() {
+ System.out.println("getNode");
+ String id = "myNode";
+ String type = "priority";
+ Double[] coord = new Double[] {1.9,2.0};
+ String[] incLanes = new String[] {"2","3"};
+ Net instance = new Net();
+ instance.addNode(id, type, coord, incLanes);
+ Node expResult = new Node(id, type, coord, incLanes);
+ Node result = instance.getNode(id);
+ Assert.assertArrayEquals(expResult.getCoord(), result.getCoord());
+ assertEquals(expResult.getId(), result.getId());
+ Assert.assertArrayEquals(expResult.getIncLanes(), result.getIncLanes());
+ assertEquals(expResult.getOutgoing(), result.getOutgoing());
+ Assert.assertArrayEquals(expResult.getIncLanes(), result.getIncLanes());
+ assertEquals(expResult.getType(), result.getType());
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+ /**
+ * Test of getNodes method, of class Net.
+ */
+ @Test
+ public void testGetNodes() {
+ System.out.println("getNodes");
+ String id1 = "myNode1";
+ String type1 = "priority";
+ Double[] coord1 = new Double[] {1.9,2.0};
+ String[] incLanes1 = new String[] {"2","3"};
+
+ String id2 = "myNode2";
+ String type2 = "priority";
+ Double[] coord2 = new Double[] {5.5,-3.0};
+ String[] incLanes2 = new String[] {"0","2"};
+
+ Node myNode1 = new Node(id1, type1, coord1, incLanes1);
+ Node myNode2 = new Node(id2, type2, coord2, incLanes2);
+
+ Net instance = new Net();
+ instance.addNode(id1, type1, coord1, incLanes1);
+ instance.addNode(id2, type2, coord2, incLanes2);
+
+ ArrayList expResult = new ArrayList();
+ expResult.add(myNode1);
+ expResult.add(myNode2);
+
+ ArrayList result = instance.getNodes();
+ Node result1 = (Node)expResult.get(0);
+ Node result2 = (Node)expResult.get(1);
+
+ Assert.assertArrayEquals(result1.getCoord(), myNode1.getCoord());
+ assertEquals(result1.getId(), myNode1.getId());
+ Assert.assertArrayEquals(result1.getIncLanes(), myNode1.getIncLanes());
+ assertEquals(result1.getOutgoing(), myNode1.getOutgoing());
+ Assert.assertArrayEquals(result1.getIncLanes(), myNode1.getIncLanes());
+ assertEquals(result1.getType(), myNode1.getType());
+
+ Assert.assertArrayEquals(result2.getCoord(), myNode2.getCoord());
+ assertEquals(result2.getId(), myNode2.getId());
+ Assert.assertArrayEquals(result2.getIncLanes(), myNode2.getIncLanes());
+ assertEquals(result2.getOutgoing(), myNode2.getOutgoing());
+ Assert.assertArrayEquals(result2.getIncLanes(), myNode2.getIncLanes());
+ assertEquals(result2.getType(), myNode2.getType());
+
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+ /**
+ * Test of getTLSSecure method, of class Net.
+ */
+ @Test
+ public void testGetTLSSecure() {
+ System.out.println("getTLSSecure");
+
+ String id1 = "myEdge1";
+ String fromID1 = "1";
+ String toID1 = "2";
+ Integer prio1 = 1;
+ String function1 = "internal";
+ String name1 = "";
+
+ String id2 = "myEdge2";
+ String fromID2 = "3";
+ String toID2 = "4";
+ Integer prio2 = 5;
+ String function2 = "internal";
+ String name2 = "";
+
+ Double speed = 11.0;
+ Double length = 50.0;
+
+ String tlid = "myTLS";
+
+ Net instance = new Net();
+ Edge myEdge1 = new Edge(id1, instance.addNode(fromID1), instance.addNode(toID1),
+ prio1, function1, name1);
+
+ Edge myEdge2 = new Edge(id2, instance.addNode(fromID2), instance.addNode(toID2),
+ prio2, function2, name2);
+
+ Lane inLane = new Lane(myEdge1, speed, length);
+ Lane outLane = new Lane(myEdge2, speed, length);
+
+ instance.addTLS(tlid, inLane, outLane, 1);
+
+ TLS expResult = new TLS(tlid);
+ expResult.addConnection(inLane, outLane, 1);
+
+ TLS result = instance.getTLSSecure(tlid);
+ assertEquals(expResult.getConnections(), result.getConnections());
+ assertEquals(expResult.getId(), result.getId());
+ assertEquals(expResult.getMaxConnectionNumber(),
+ result.getMaxConnectionNumber());
+ assertEquals(expResult.getPrograms(), result.getPrograms());
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+ /**
+ * Test of addTLS method, of class Net.
+ */
+ @Test
+ public void testAddTLS() {
+ System.out.println("addTLS");
+ String id1 = "myEdge1";
+ String fromID1 = "1";
+ String toID1 = "2";
+ Integer prio1 = 1;
+ String function1 = "internal";
+ String name1 = "";
+
+ String id2 = "myEdge2";
+ String fromID2 = "3";
+ String toID2 = "4";
+ Integer prio2 = 5;
+ String function2 = "internal";
+ String name2 = "";
+
+ Double speed = 11.0;
+ Double length = 50.0;
+
+ String tlid = "myTLS";
+
+ Net instance = new Net();
+
+ Edge myEdge1 = new Edge(id1, instance.addNode(fromID1), instance.addNode(toID1),
+ prio1, function1, name1);
+
+ Edge myEdge2 = new Edge(id2, instance.addNode(fromID2), instance.addNode(toID2),
+ prio2, function2, name2);
+
+ Lane inLane = new Lane(myEdge1, speed, length);
+ Lane outLane = new Lane(myEdge2, speed, length);
+
+ TLS expResult = new TLS(tlid);
+ expResult.addConnection(inLane, outLane, 1);
+
+ TLS result = instance.addTLS(tlid, inLane, outLane, 1);
+ assertEquals(expResult.getConnections(), result.getConnections());
+ assertEquals(expResult.getId(), result.getId());
+ assertEquals(expResult.getMaxConnectionNumber(),
+ result.getMaxConnectionNumber());
+ assertEquals(expResult.getPrograms(), result.getPrograms());
+ // TODO review the generated test code and remove the default call to fail.
+ }
+
+}
diff --git a/tools/contributed/sumoplayer/AUTHOR b/tools/contributed/sumoplayer/AUTHOR
deleted file mode 100644
index 73a54b5..0000000
--- a/tools/contributed/sumoplayer/AUTHOR
+++ /dev/null
@@ -1,2 +0,0 @@
-Michael Willigens <michael at willigens.de>
-MOdifications to adapt to all versions of SUMO was added by Sandesh upper <suppoor at gmail.com>
diff --git a/tools/contributed/sumoplayer/LICENSE b/tools/contributed/sumoplayer/LICENSE
deleted file mode 100644
index b7db6eb..0000000
--- a/tools/contributed/sumoplayer/LICENSE
+++ /dev/null
@@ -1,280 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
diff --git a/tools/contributed/sumoplayer/README b/tools/contributed/sumoplayer/README
deleted file mode 100644
index 7923438..0000000
--- a/tools/contributed/sumoplayer/README
+++ /dev/null
@@ -1,54 +0,0 @@
-# This is file gives a brief overview on SUMPlayer usage.
-# SUMOPlayer can be used to play SUMO network-dump files
-# in realtime (if possible) to latitude/longitude coordinates.
-# It can be customized in any way by implemting
-# de.psi.telco.sumoplayer.SUMOLocationListener
-# SEE:
-# public interface SUMOLocationListener {
-# public void LocationUpdated(String vehicleId, int timestep, double lon, double lat, double speed);
-# }
-# You can call SUMOPlayer with your own implementation by using the
-# -l "<classname>" parameter.
-# If not used, SUMOPlayer uses STDOUT CVS style like:
-# <vehicle_id>|<timestep>|<lon>|<lat>|<speed>
-
-# Eclipse integration is easily possible by:
-# new-project -> from existing ant buildfile (build.xml)
-
-# see possible ant tasks:
-$> ant -projecthelp
-
-# compile
-$> ant sumoplayer.jar
-
-# run sumoPlayer with:
-$> ant sumplayer.run
-# ... or even better integrated in your project by jarfile:
-$> java -jar sumoplayer.jar
-# possible parameters:
-# ANT param # desctiption
-# JAR param
-
- -Dnetfile=<sumo_network_xml_file> # the used sumo network file
- -n # needed for geo coordinate lookups
-
- -Dndump=<sumo_ndump_xml_file> # sumo network-dump simulation file
- -d
-
- -Dequipped=<propability> # a floating value between 0 and 1
- -e # defining the number of tracked
- # vehicles. 0.01 is 1%
-
- -Djitter=<value_in_meters> # a random GPS jitter in meters
- -j
-
- -Dlistener=<full_java_classname> # the used java implementation of
- -l # SUMOLocationListener
- # default:
- # de.psi.telco.sumoplayer.SUMOPipedLocationListener
- # (stdout CSV style data)
-
-
-
-# JAVA DOC
-$> ant javadoc # creates JAVA DOCS in /build/javadoc
diff --git a/tools/contributed/sumoplayer/build.xml b/tools/contributed/sumoplayer/build.xml
deleted file mode 100644
index 2fbaea7..0000000
--- a/tools/contributed/sumoplayer/build.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-
-<project name="sumoplayer">
- <!-- PROPERTIES -->
- <property environment="env"/>
-
- <!-- RUN DEFAULTS -->
- <property name="net" value="sumo.net.xml"/>
- <property name="ndump" value="sumo.ndump.xml"/>
- <property name="equipped" value="0.1"/>
- <property name="jitter" value="50" />
- <property name="listener" value="de.psi.telco.sumoplayer.SUMOPipedLocationListener" />
-
- <!-- PATHS -->
- <property name="src.java" value="./src/java"/>
- <property name="lib" value="./lib"/>
- <property name="build" value="./build"/>
- <property name="dist" value="${build}/dist"/>
- <property name="build.classes" value="${build}/classes"/>
- <property name="build.javadoc" value="${build}/javadoc"/>
- <property name="javadoc.packages" value="de.psi.telco.*"/>
-
- <!-- CLASSPATH -->
- <path id="classpath_jars">
- <fileset dir="${lib}">
- <include name="*.jar"/>
- </fileset>
- </path>
- <path id="classpath_compiled">
- <path refid="classpath_jars"/>
- <pathelement path="${build.classes}"/>
- </path>
-
- <!-- PREPERATIONS -->
- <target name="prepare" depends="clean" >
- <mkdir dir="${build}"/>
- <mkdir dir="${dist}"/>
- <mkdir dir="${build.classes}"/>
- <mkdir dir="${build.javadoc}"/>
- </target>
-
- <target name="clean" description="cleans the project">
- <delete dir="${build}"/>
- <delete dir="${dist}"/>
- </target>
-
- <!-- BUILDING -->
- <target name="compile" depends="clean,prepare" description="compile the java code">
- <javac destdir="${build.classes}" debug="on" target="1.5" source="1.5">
- <src path="${src.java}"/>
-
- <classpath refid="classpath_jars"/>
- </javac>
- </target>
-
- <!-- RUN TARGETS -->
- <target name="sumoplayer.run" depends="compile" description="runs a simulation">
- <java classname="de.psi.telco.sumoplayer.SUMOPlayer"
- classpathref="classpath_compiled"
- dir="${resources}">
- <arg line="-n ${net}"/>
- <arg line="-d ${ndump}"/>
- <arg line="-e ${equipped}"/>
- <arg line="-j ${jitter}" />
- <arg line="-l ${listener}" />
- </java>
- </target>
-
- <target name="sumoplayer.jar" depends="compile,javadoc" description="builds the sumoplayer jar-file to build/dist including javadocs">
- <jar destfile="${dist}/sumoplayer.jar" basedir="${build.classes}">
- <!-- include javadoc -->
- <fileset dir="${build.javadoc}"/>
-
- <!-- main class attribute for manifest -->
- <manifest>
- <attribute name="Main-class" value="de.psi.telco.sumoplayer/SUMOPlayer"/>
- </manifest>
-
- <!-- some external jars -->
- <zipfileset src="${lib}/javaproj-1.0.4.jar" />
- <zipfileset src="${lib}/xerces_2_5_0.jar" />
- </jar>
- </target>
-
- <!-- MISC TARGETS -->
- <target name="javadoc"
- description="Generate javadoc for all sources.">
- <javadoc packagenames="${javadoc.packages}"
- destdir="${build.javadoc}"
- author="true"
- version="true">
- <packageset dir="${src.java}" defaultexcludes="yes"/>
- <classpath refid="classpath_jars"/>
- </javadoc>
- </target>
-</project>
diff --git a/tools/contributed/sumoplayer/convert_sumoplayer_op_2_lonlat.py b/tools/contributed/sumoplayer/convert_sumoplayer_op_2_lonlat.py
deleted file mode 100755
index 81fe966..0000000
--- a/tools/contributed/sumoplayer/convert_sumoplayer_op_2_lonlat.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env python
-"""
- at file convert_sumoplayer_op_2_lonlat.py
- at author Sandesh Uppoor
- at author Laura Bieker
- at author Michael Behrisch
- at date 2011-05-30
- at version $Id: convert_sumoplayer_op_2_lonlat.py 18096 2015-03-17 09:50:59Z behrisch $
-
-This code takes the sumoplayer output as input file . The sumoplayer output has the syntax : time, vehicle_id , x, y , speed(meters). if anyone want to check the real location on the openstreetmap, he need to convert x,y back to lon lat format , This code does that for you .
-
-O/P syntax : time , vehicle_id , lon ,lat ,speed(meters)
-
-IMP-->Makesure you have installed python and pyproj package to run this code
-command : python convert_sumoplayer_op_2_lonlat.py sumoplayer_output.txt
-
-SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
-Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors
-
-This file is part of SUMO.
-SUMO is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3 of the License, or
-(at your option) any later version.
-"""
-
-import sys
-from pyproj import Proj
-from string import split
-if __name__ == "__main__":
-
- f = open(sys.argv[1], 'r')
- while True:
-
- x = f.readline()
- if x is None:
- break
- else:
- r = split(x, ' ')
- player_x = r[2]
- player_y = r[3]
- time_ = r[0]
- vid = r[1]
- speed = r[4]
- offset_x = -342498.94
- offset_y = -5630725.14
- actual_x = float(player_x) - offset_x
- actual_y = float(player_y) - offset_y
-
- p = Proj(proj='utm', zone=32, ellps='WGS84')
- lat, lon = p(actual_x, actual_y, inverse=True)
- print time_, vid, lon, lat, speed
- exit
diff --git a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOGeoCoordinatesResolver.java b/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOGeoCoordinatesResolver.java
deleted file mode 100644
index 6aa248e..0000000
--- a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOGeoCoordinatesResolver.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package de.psi.telco.sumoplayer;
-
-import java.io.File;
-import java.io.IOException;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.xml.sax.SAXException;
-
-import de.psi.telco.sumoplayer.util.PROJTransformer;
-import de.psi.telco.sumoplayer.util.Point;
-import de.psi.telco.sumoplayer.util.PointImpl;
-
-public class SUMOGeoCoordinatesResolver {
-
- private File networkFile;
- private SUMONetwork network = new SUMONetwork();
- private PROJTransformer proj;
-
- public SUMOGeoCoordinatesResolver(String netfile){
- this.networkFile = new File(netfile);
- this.readNetwork();
-
- this.proj = new PROJTransformer(network.projString, network.offset);
- }
-
- private void readNetwork() {
- SAXParserFactory saxFactory = SAXParserFactory.newInstance();
- SAXParser saxParser = null;
- try {
- saxParser = saxFactory.newSAXParser();
- } catch (ParserConfigurationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (SAXException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- SUMOSAXNeworkfileHandler saxHandler = new SUMOSAXNeworkfileHandler();
- //System.out.println("Reading SUMO Networkfile...");
- try {
- saxParser.parse(networkFile, saxHandler);
- } catch (SAXException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- //System.out.println("done.");
-
- this.network = saxHandler.network;
- }
-
- public Point resolv(String edgeId, String laneId, double pos){
- //System.out.println("Resolver call - edge:"+edgeId+" - lane:"+laneId+" - pod:"+pos);
- if (this.network != null){ // network loaded. do look up
- Point out = network.lanes.get(laneId).getPositionWithin(pos);
-
- out = proj.transformInvers(out);
- return out;
- }else{
- return new PointImpl(0,0);
- }
- }
-}
diff --git a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOLane.java b/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOLane.java
deleted file mode 100644
index 3e8550b..0000000
--- a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOLane.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package de.psi.telco.sumoplayer;
-
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import de.psi.telco.sumoplayer.util.GeoCalc;
-import de.psi.telco.sumoplayer.util.Point;
-import de.psi.telco.sumoplayer.util.PointImpl;
-import de.psi.telco.sumoplayer.util.Vector;
-
-public class SUMOLane {
-
- public String id;
- public List<Point> points = new LinkedList<Point>();
-
- private double length = -1; // not known
-
- public SUMOLane(String id){
- this.id=id;
- }
-
- public double getLength(){
- if (length == -1){
- length = 0;
- Iterator i = points.iterator();
- Point a = null;
- Point b = null;
- while (i.hasNext()){
- if (a == null){
- a = (Point)i.next();
- continue;
- }
- b = (Point)i.next();
-
- length += GeoCalc.distance(a, b);
-
- a = b;
- }
- return length;
- }else{
- return length;
- }
- }
-
- public Point getPositionWithin(double pos){
- //System.out.println("GetPosWithin: laneId:"+this.id+" - req pos: "+pos+" - cal len:"+this.getLength()+"***"+points);
- if (this.getLength()<=pos){ // near end. returning last point
- return points.get(points.size()-1); // just return last point
- }
- try{
- int idx = 0;
- double len = 0;
- Iterator i = points.iterator();
- Point a = null;
- Point b = null;
- boolean foundWithin = false;
- while (i.hasNext()){
- if (a == null){
- a = (Point)i.next();
- continue;
- }
-
- b = (Point)i.next();
- if (len+GeoCalc.distance(a,b)<pos){
- len += GeoCalc.distance(a,b);
- idx++;
- }else{
- foundWithin = true;
- break;
- }
-
- a = b;
- }
-
- // sometimes requested positions lies a bit outside the lane. dont know why.
- if (foundWithin){ // TODO: check if this is just a sumo mistake
- PointImpl startPos = new PointImpl(points.get(idx).getX(),points.get(idx).getY());
- PointImpl endPos = new PointImpl(points.get(idx+1).getX(),points.get(idx+1).getY());
- double partialLen = startPos.distance(endPos);
- double rest = pos-len;
- double fact = rest/partialLen;
-
- Vector out = startPos.add((endPos.sub(startPos).scale(fact)));
- return new PointImpl(out.getX(),out.getY());
- }else{
- return points.get(points.size()-1); // just return last point
- }
-
- }catch(Exception e){
- e.printStackTrace();
- return new PointImpl(0,0);
- }
- }
-}
diff --git a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOLocationListener.java b/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOLocationListener.java
deleted file mode 100644
index b1213a0..0000000
--- a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOLocationListener.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package de.psi.telco.sumoplayer;
-
-/**
- * This interface can be used to customize SUMOPlayer's output in a simple and powerful way.
- * SUMOPlayer will call this interface whenever it gets to know about a new vehilce position.
- *
- * E.g. It can be used to implement HTTP requests for SUMO position updates (if needed).
- *
- * @author michael willigens <michael at willigens.de>
- *
- */
-public interface SUMOLocationListener {
- public void LocationUpdated(String vehicleId, int timestep, double lon, double lat, double speed);
-}
diff --git a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMONetwork.java b/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMONetwork.java
deleted file mode 100644
index 985856c..0000000
--- a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMONetwork.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package de.psi.telco.sumoplayer;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import de.psi.telco.sumoplayer.util.Point;
-import de.psi.telco.sumoplayer.util.PointImpl;
-import de.psi.telco.sumoplayer.util.Vector;
-
-/**
- * This file represents a SUMO network and is read by SUMOSAXNetworkfileHandler
- *
- * @author will
- *
- */
-public class SUMONetwork {
-
- public Map<String, SUMOLane> lanes = new HashMap<String,SUMOLane>();
- public String projString = null;
- public Vector offset = new PointImpl(0,0);
- private Map<String,Point> junctions = new HashMap<String,Point>();
-
- public void addJunction(String id, double x, double y){
- junctions.put(id, new PointImpl(x,y));
- }
-
- public Point getJunction(String id){
- return this.junctions.get(id);
- }
-
-}
diff --git a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOPipedLocationListener.java b/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOPipedLocationListener.java
deleted file mode 100644
index 4037ae3..0000000
--- a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOPipedLocationListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package de.psi.telco.sumoplayer;
-/**
- * This location listener implementation is SUMOPlayers default.
- * It pipes ouput in CVS style to STDOUT
- * @author will
- *
- */
-public class SUMOPipedLocationListener implements SUMOLocationListener {
-
- public static char separator = ' ';/* a space is the seperator*/
-
- /*speed is in meters , lon lat are just names actual value is
- in cartesian coordinates , with offsets mentioned in the
- SUMOnetwork file. To convert the number back to lon lat use
- pyproj (look for code convert_sumoplayer_op_2_lonlat.py )*/
-
- public void LocationUpdated(String vehicleId, int timestep, double lon,
- double lat, double speed) {
-
- System.out.println(timestep+(separator+vehicleId)+separator+lon+separator+lat+separator+(speed/3.6));
-
- }
-
-}
diff --git a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOPlayer.java b/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOPlayer.java
deleted file mode 100644
index 5e787e5..0000000
--- a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOPlayer.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/**
- * This software is under the
- *
- * GNU GENERAL PUBLIC LICENSE
- * Version 2, June 1991
- *
- * see attached file LICENSE
- */
-package de.psi.telco.sumoplayer;
-
-import java.io.File;
-import java.io.IOException;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.xml.sax.SAXException;
-
-/**
- * This class runs a SUMO simulated netword dumpfile.
- * It needs to know of the used xumo.net.xml network file
- * in order to look up the coordinates correctly.
- *
- * @author Michael Willigens <michael at willigens.de>
- *
- */
-public class SUMOPlayer extends Thread{
-
- private String ndumpFile = "sumo.ndump.xml";
- private String networkFile = "sumo.net.xml";
- private double trackingPropability = 0.01;
- private int jitter = 0; // in meters
- private String listenerClassname = "de.psi.telco.sumoplayer.SUMOPipedLocationListener";
-
- private SAXParser saxParser;
- private SUMOSAXHandler saxHandler;
-
- /**
- * the main function to call it from command line
- * @param args
- */
- public static void main(String[] args) {
- String nDumpFilename = "sumo.ndump.xml";
- String netFilename = "sumo.net.xml";
- String listenerClassname = "de.psi.telco.sumoplayer.SUMOPipedLocationListener";
- double propability = 0.01;
- int jitter = 0;
-
- for (int i = 0; i<args.length;i++){
- if (args[i].equals("-n") && args.length > i+1){
- netFilename = args[i+1];
- i++;
- }
- if (args[i].equals("-d") && args.length > i+1){
- nDumpFilename = args[i+1];
- i++;
- }
- if (args[i].equals("-l") && args.length > i+1){
- listenerClassname = args[i+1];
- i++;
- }
- if (args[i].equals("-e") && args.length > i+1){
- propability = Double.parseDouble(args[i+1]);
- i++;
- }
- if (args[i].equals("-j") && args.length > i+1){
- jitter = Integer.parseInt(args[i+1]);
- i++;
- }
- }
-
- File net = new File(netFilename);
- if (!net.exists()){
- System.out.println("SUMO Network file does not exist! set this with \"-n sumo.net.xml\". aborting");
- System.exit(1);
- }
- File ndump = new File(nDumpFilename);
- if (!ndump.exists()){
- System.out.println("SUMO ndump file does not exist! set this with \"-d sumo.ndump.xml\". aborting");
- System.exit(1);
- }
-
- SUMOPlayer player = new SUMOPlayer(nDumpFilename,netFilename,propability, jitter, listenerClassname);
-
- player.run();
- }
-
- /**
- * This function initializes a SUMO player.
- * It mainly reads the network file which it
- * will need to perform a simualtion.
- *
- */
- private void init() {
- SAXParserFactory saxFactory = SAXParserFactory.newInstance();
- try {
- saxParser = saxFactory.newSAXParser();
- } catch (ParserConfigurationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (SAXException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- saxHandler = new SUMOSAXHandler(networkFile);
- saxHandler.setCar4carEquippedPropability(this.trackingPropability);
- saxHandler.setJitter(jitter);
-
- SUMOLocationListener listener = null;
- try {
- listener = (SUMOLocationListener) Class.forName(listenerClassname).newInstance();
- } catch (Exception e){
- e.printStackTrace();
- System.exit(1);
- }
- saxHandler.setListener(listener);
- }
-
- /**
- * This function Runs the simulation.
- *
- */
- public void run() {
- this.init(); // read network first
-
- //System.out.println("Performing Simulation...");
- try {
- saxParser.parse(new File(ndumpFile), saxHandler);
- } catch (SAXException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- //System.out.println("done.");
- }
-
- /**
- * This constructor creates a SUMO player using a ndump file.
- * @param ndumpFile
- * @param networkFile
- * @param trackingPropability
- */
- public SUMOPlayer(String ndumpFile, String networkFile, double trackingPropability, int jitter, String listenerClassname){
-
- this.ndumpFile = ndumpFile;
- this.networkFile = networkFile;
- if (trackingPropability > 0) this.trackingPropability = trackingPropability;
- this.jitter = jitter;
-
- if (listenerClassname != null && listenerClassname.length() > 0){
- this.listenerClassname = listenerClassname;
- }
- }
-
-}
diff --git a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOSAXHandler.java b/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOSAXHandler.java
deleted file mode 100644
index db8f527..0000000
--- a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOSAXHandler.java
+++ /dev/null
@@ -1,148 +0,0 @@
-package de.psi.telco.sumoplayer;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import de.psi.telco.sumoplayer.util.GeoCalc;
-import de.psi.telco.sumoplayer.util.Point;
-import de.psi.telco.sumoplayer.util.PointImpl;
-
-/**
- * This SAX Handler parses SUMO "--network-dump" output files.
- * It guesses which vehicles are tracked by a given propability.
- *
- * @author will
- *
- */
-public class SUMOSAXHandler extends DefaultHandler{
-
- /**
- * The given propability which decides which cars are beeing tracked
- * 0 means no vehicles 1 means all vehicles. anything else between.
- */
- private double car4carEquippedPropbaility = 0.01;
- private int jitter = 0;
-
- private Set<String> trackedVehicles = new HashSet<String>(); // The set of vehicles which are tracked
- private Set<String> knownVehicles = new HashSet<String>();
-
- private int timestep;
- private long startTime;
-
- private String edgeId;
- private String laneId;
-
- private String vehicleId;
- private double pos;
- private double speed;
-
- private SUMOLocationListener listener;
- private SUMOGeoCoordinatesResolver resolver;
-
- public SUMOSAXHandler(String netfilename){
- this.resolver = new SUMOGeoCoordinatesResolver(netfilename);
- }
-
- public void startDocument(){
- startTime = System.currentTimeMillis();
- }
-
- public void startElement (String uri, String localName, String qName, Attributes attributes) throws SAXException{
- if (qName.equals("timestep")){
- String full= attributes.getValue("time");
- //String req = full.substring(0, 4);
- String req = "";
-
- for (int i=0;i<full.length();i++){
- char ctr=full.charAt(i);
- if (ctr != '.') {
- req +=ctr;
- }else if(ctr == '.') {
- break;
- }
-
- }
-
- timestep = Integer.parseInt(req);
-
- long timeToBe = startTime + timestep*1000; // dirty realtime trick
- long now = System.currentTimeMillis();
- try {
- if (timeToBe-now>0){
- Thread.sleep(timeToBe-now);
- }
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }else if(qName.equals("edge")){
- edgeId = attributes.getValue("id");
- }else if(qName.equals("lane")){
- laneId = attributes.getValue("id");
- }else if(qName.equals("vehicle")){
- vehicleId = attributes.getValue("id");
- pos = Double.parseDouble(attributes.getValue("pos"));
- speed = Double.parseDouble(attributes.getValue("speed"));
-
- handleVehicle();
- }
- }
-
- private void handleVehicle(){
- if (trackedVehicles.size() == 0){ // add first vehicle anyway for simulations whith only one vehicle
- knownVehicles.add(vehicleId);
- trackedVehicles.add(vehicleId);
- }else{ // add vehicles probabilistic
- if (!knownVehicles.contains(vehicleId)){ // check if vehicle is already known
-
- knownVehicles.add(vehicleId); // then add it as known
- if (car4carEquippedPropbaility > Math.random()){ // and calculate propability
- trackedVehicles.add(vehicleId); // ... to add it
- }
- }
- }
-
- if (trackedVehicles.contains(vehicleId)){ // handle a tracked vehicle only
- // calculate geo position
- Point p = resolver.resolv(edgeId, laneId, pos);
-
- // calculate jitter if required
- if (jitter > 0){
- double jitterLon = GeoCalc.getLonOffset(p.getX(), p.getY(), jitter)*((Math.random()*2)-1);
- double jitterLat = GeoCalc.getLatOffset(p.getX(), p.getY(), jitter)*((Math.random()*2)-1);
- p = new PointImpl(p.getX()+jitterLon,p.getY()+jitterLat);
- }
-
- // call the listener
- this.listener.LocationUpdated(vehicleId, timestep, p.getX(), p.getY(), speed*3.6);
- }
- }
-
- public double getCar4carEquippedPropbaility() {
- return car4carEquippedPropbaility;
- }
-
- public void setCar4carEquippedPropability(double car4carEquippedPropbaility) {
- this.car4carEquippedPropbaility = car4carEquippedPropbaility;
- }
-
- public void setListener(SUMOLocationListener listener) {
- this.listener = listener;
- }
-
- public void setResolver(SUMOGeoCoordinatesResolver resolver) {
- this.resolver = resolver;
- }
-
- /**
- * This function sets the GPS jitter in meters
- * @param jitter
- */
- public void setJitter(int jitter){
- this.jitter = jitter;
- }
-}
diff --git a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOSAXNeworkfileHandler.java b/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOSAXNeworkfileHandler.java
deleted file mode 100644
index ffd385a..0000000
--- a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/SUMOSAXNeworkfileHandler.java
+++ /dev/null
@@ -1,136 +0,0 @@
-package de.psi.telco.sumoplayer;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import de.psi.telco.sumoplayer.util.PointImpl;
-
-/**
- * This SAX parser can be used to read SUMO networkfiles.
- * It builds a SUMONetwork object containing the networks topology
- * @author will
- *
- */
-public class SUMOSAXNeworkfileHandler extends DefaultHandler{
-
- // build data
- public SUMONetwork network = new SUMONetwork();;
-
- // element state
- private static int UNKNOWN = 0;
- private static int EDGE = 1;
- private static int LANE = 2;
- private static int CEDGE = 3;
- private static int JUNCTION = 4;
- private static int OFFSET = 5;
- private static int PROJ = 6;
- private int currentElementType;
-
- // store
- private String sumoEdgeId;
- private String sumoLaneId;
- private String cEdgeId;
- private String junctionId;
-
- public void startElement (String uri, String localName, String qName, Attributes attributes) throws SAXException{
- if (qName.equals("edge")){
- this.currentElementType = EDGE;
- sumoEdgeId = attributes.getValue("id");
-
- }else if (qName.equals("lane")){
- this.currentElementType = LANE;
- sumoLaneId = attributes.getValue("id");
-
- network.lanes.put(sumoLaneId, new SUMOLane(sumoLaneId));
-
- String data = new String(attributes.getValue("shape"));
-
- String[] coordPairs = data.split(" "); // split by pairs ( COORD1X,COORD1Y COORD2X,COORD2Y ...)
- for (int i = 0 ; i < coordPairs.length; i++){
- String[] coordElements = coordPairs[i].split(",");
- if (coordElements != null && coordElements.length == 2){ // split by comma ( COORD1X,COORD1Y )
- try{
- double x = Double.parseDouble(coordElements[0]);
- double y = Double.parseDouble(coordElements[1]);
-
- network.lanes.get(sumoLaneId).points.add(new PointImpl(x,y));
- }catch(NumberFormatException e){
- }
- }
- }
-
-
- }else if (qName.equals("cedge")){ // cedges seem to be mappings from sumo.edg.xml IDs to sumoIDs
- this.currentElementType = CEDGE;
- cEdgeId = attributes.getValue("id");
- }
-
- /* // note junctions not interesting. all coordinates are stored within lanes
- else if (qName.equals("junction")){ // junction found. add it
- this.currentEementType = JUNCTION;
-
- // i.e. <junction id="124667945" type="priority" x="3186.50" y="17778.50">...</junction>
- junctionId = attributes.getValue("id");
- double x = Double.parseDouble(attributes.getValue("x"));
- double y = Double.parseDouble(attributes.getValue("y"));
- network.addJunction(junctionId, x, y);
- }*/
-
- // some network cfg
- else if (qName.equals("net-offset")){
- this.currentElementType = OFFSET;
- }else if (qName.equals("orig-proj")){
- this.currentElementType = PROJ;
- }
-
- }
-
- public void endElement (String uri, String localName, String qName) throws SAXException{
- this.currentElementType = UNKNOWN;
- }
-
- // this can be used to read coordinates from edges for example: <edge id="bla"...>COORD1X,COORD1Y COORD2X,COORD2Y</edge>
- public void characters (char ch[], int start, int length){
-
- if (currentElementType == LANE){ // read coords from lane
-
- char[] chars = new char[length]; // copy stuff from sax buffer
- for (int i = 0; i<length; i++){
- chars[i] = ch[start+i];
- }
- String data = new String(chars);
-
- String[] coordPairs = data.split(" "); // split by pairs ( COORD1X,COORD1Y COORD2X,COORD2Y ...)
- for (int i = 0 ; i < coordPairs.length; i++){
- String[] coordElements = coordPairs[i].split(",");
- if (coordElements != null && coordElements.length == 2){ // split by comma ( COORD1X,COORD1Y )
- try{
- double x = Double.parseDouble(coordElements[0]);
- double y = Double.parseDouble(coordElements[1]);
-
- network.lanes.get(sumoLaneId).points.add(new PointImpl(x,y));
- }catch(NumberFormatException e){
- }
- }
- }
-
- }else if (currentElementType == OFFSET){ // read offset. i.e: <net-offset>-755969.000000,-5660071.000000</net-offset>
- char[] chars = new char[length]; // copy stuff from sax buffer
- for (int i = 0; i<length; i++){
- chars[i] = ch[start+i];
- }
- String data = new String(chars);
- String[] vectorElements = data.split(",");
- if (vectorElements.length==2){
- network.offset = new PointImpl(Double.parseDouble(vectorElements[0]),Double.parseDouble(vectorElements[1]));
- }
- }else if (currentElementType == PROJ){ // read projection string. i.e: <orig-proj>+proj=utm +ellps=bessel +units=m</orig-proj>
- char[] chars = new char[length]; // copy stuff from sax buffer
- for (int i = 0; i<length; i++){
- chars[i] = ch[start+i];
- }
- network.projString = new String(chars);
- }
- }
-}
diff --git a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/GeoCalc.java b/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/GeoCalc.java
deleted file mode 100644
index 9cfe155..0000000
--- a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/GeoCalc.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package de.psi.telco.sumoplayer.util;
-
-
-public class GeoCalc {
-
- public static double KM_PER_LAT = 111.12;
- public static final double LATITUDE_PER_KM = 1.0/111.12;
- public static final int EARTH_RADIUS_KM = 6371;
-
- public static double distance(Point a, Point b){
- return Math.sqrt( Math.pow(Math.abs(a.getX()-b.getX()),2) + Math.pow(Math.abs(a.getY()-b.getY()),2) );
- }
- public static double geoDistanceKm(Point a, Point b){
- return Math.acos(Math.sin(Math.toRadians(a.getY()))*Math.sin(Math.toRadians(b.getY())) +
- Math.cos(Math.toRadians(a.getY()))*Math.cos(Math.toRadians(b.getY())) *
- Math.cos(Math.toRadians(b.getX())-Math.toRadians(a.getX()))) * (double)EARTH_RADIUS_KM;
- }
- public static double geoDistanceM(Point a, Point b){
- return (geoDistanceKm(a, b)*1000);
- }
-
- /**
- * This function returns the minimum distance from Poit p to Line l.
- * It uses SUNs implementation which uses a scalarproduct projection length
- * to determin the minimal distance.
- * @param p
- * @param l
- * @return
- */
- public static double distance(Point p, Line l) {
- double x1 = l.getA().getX();
- double x2 = l.getB().getX();
- double y1 = l.getA().getY();
- double y2 = l.getB().getY();
- double px = p.getX();
- double py = p.getX();
-
- // Adjust vectors relative to x1,y1
- // x2,y2 becomes relative vector from x1,y1 to end of segment
- x2 -= x1;
- y2 -= y1;
- // px,py becomes relative vector from x1,y1 to test point
- px -= x1;
- py -= y1;
- double dotprod = px * x2 + py * y2;
- // dotprod is the length of the px,py vector
- // projected on the x1,y1=>x2,y2 vector times the
- // length of the x1,y1=>x2,y2 vector
- double projlenSq = dotprod * dotprod / (x2 * x2 + y2 * y2);
- // Distance to line is now the length of the relative point
- // vector minus the length of its projection onto the line
- double lenSq = px * px + py * py - projlenSq;
- if (lenSq < 0) {
- lenSq = 0;
- }
- return Math.sqrt(lenSq);
- }
-
- public static double getLonOffset(double lon, double lat, int meters){
- double latDelta = (1.0/(KM_PER_LAT*1000))*meters;
- double lonFact = Math.cos(Math.toRadians(lat));
- return latDelta*lonFact;
- }
-
- public static double getLatOffset(double lon, double lat, int meters){
- return (1.0/(KM_PER_LAT*1000))*meters;
- }
-}
diff --git a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/Line.java b/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/Line.java
deleted file mode 100644
index 847bf52..0000000
--- a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/Line.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package de.psi.telco.sumoplayer.util;
-
-/**
- * Interfacing a generic Line containing 2 Points
- *
- * @author will
- *
- */
-public interface Line {
-
- /**
- * Returns the starting Point of this Line
- * @return
- */
- public abstract Point getA();
-
- /**
- * Returns the ending Point of this Line
- * @return
- */
- public abstract Point getB();
-
-}
\ No newline at end of file
diff --git a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/LineImpl.java b/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/LineImpl.java
deleted file mode 100644
index 7309d34..0000000
--- a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/LineImpl.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package de.psi.telco.sumoplayer.util;
-
-public class LineImpl implements Line {
- private Point a;
- private Point b;
-
- public LineImpl(double ax, double ay, double bx, double by){
- this.a = new PointImpl(ax,ay);
- this.b = new PointImpl(bx,by);
- }
- public LineImpl(Point a, Point b){
- this.a = a;
- this.b = b;
- }
-
- /* (non-Javadoc)
- * @see de.psi.telco.car4car.dto.geo.Line#getA()
- */
- public Point getA(){
- return a;
- }
- /* (non-Javadoc)
- * @see de.psi.telco.car4car.dto.geo.Line#getB()
- */
- public Point getB(){
- return b;
- }
-}
diff --git a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/PROJTransformer.java b/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/PROJTransformer.java
deleted file mode 100644
index 04f8187..0000000
--- a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/PROJTransformer.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package de.psi.telco.sumoplayer.util;
-
-import java.awt.geom.Point2D.Double;
-
-import com.jhlabs.map.proj.Projection;
-import com.jhlabs.map.proj.ProjectionFactory;
-
-public class PROJTransformer {
- private String projString = null;
- private Vector offset = null;
- private Projection proj = null;
-
- public PROJTransformer(String projString, Vector offset){
- this.projString = projString;
- this.offset = offset;
- if (this.projString != null){
- this.proj = ProjectionFactory.fromPROJ4Specification(this.projString.split(" "));
- }
- }
-
- public PROJTransformer(String projString){
- this.projString = projString;
- this.offset = null;
- if (this.projString != null){
- this.proj = ProjectionFactory.fromPROJ4Specification(this.projString.split(" "));
- }
- }
-
- public Point transformInvers(Point input){
- PointImpl output = new PointImpl(input.getX(),input.getY());
- if (offset != null){ // correct offset it required
- output = new PointImpl(output.getX()-offset.getX(),output.getY()-offset.getY());
- }
- if (proj != null){
- // magic
- Double projout = new Double();
- proj.inverseTransform(new Double(output.getX(),output.getY()), projout);
- output = new PointImpl(projout.x,projout.y);
- }
- return output;
- }
-
- public Point transform(Point input){
- PointImpl output = new PointImpl(input.getX(),input.getY());
- if (proj != null){
- // magic
- Double projout = new Double();
- proj.transform(new Double(output.getX(),output.getY()), projout);
- output = new PointImpl(projout.x,projout.y);
- }
- if (offset != null){ // correct offset it required
- output = new PointImpl(output.getX()+offset.getX(),output.getY()+offset.getY());
- }
- return output;
- }
-
- public Point transform(double lon, double lat){
- PointImpl output = new PointImpl(lon, lat);
- if (proj != null){
- // magic
- Double projout = new Double();
- proj.transform(new Double(lon,lat), projout);
- output = new PointImpl(projout.x,projout.y);
- }
- if (offset != null){ // correct offset it required
- output = new PointImpl(output.getX()+offset.getX(),output.getY()+offset.getY());
- }
- return output;
- }
-}
diff --git a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/Point.java b/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/Point.java
deleted file mode 100644
index bc79ff2..0000000
--- a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/Point.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package de.psi.telco.sumoplayer.util;
-
-public interface Point {
- public double getX();
- public double getY();
-}
diff --git a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/PointImpl.java b/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/PointImpl.java
deleted file mode 100644
index d6f02bf..0000000
--- a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/PointImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package de.psi.telco.sumoplayer.util;
-
-public class PointImpl implements Point, Vector{
-
- double x;
- double y;
-
- public PointImpl(double x, double y) {
- this.x = x;
- this.y = y;
- }
-
- public double distance(Point b) {
- return GeoCalc.distance(this,b);
- }
- public double distance(Line l) {
- return GeoCalc.distance(this,l);
- }
-
- public double getX() {
- return x;
- }
-
- public double getY() {
- return y;
- }
-
- public String toString(){
- return "<Point x=\""+x+"\" y="+y+"\"/>";
- }
-
- public Vector add(Vector b) {
- return new PointImpl(x+b.getX(),y+b.getY());
- }
-
- public Vector sub(Vector b) {
- return new PointImpl(x-b.getX(),y-b.getY());
- }
-
- public Vector scale(double scalar) {
- return new PointImpl(x*scalar,y*scalar);
- }
-}
diff --git a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/Vector.java b/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/Vector.java
deleted file mode 100644
index 42a8319..0000000
--- a/tools/contributed/sumoplayer/src/java/de/psi/telco/sumoplayer/util/Vector.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package de.psi.telco.sumoplayer.util;
-
-public interface Vector {
- public double getX();
- public double getY();
- public Vector add(Vector b);
- public Vector sub(Vector b);
- public Vector scale(double scalar);
-}
diff --git a/tools/contributed/traas/src/de/tudresden/sumo/cmd/Vehicle.java b/tools/contributed/traas/src/de/tudresden/sumo/cmd/Vehicle.java
index 2562674..615747d 100644
--- a/tools/contributed/traas/src/de/tudresden/sumo/cmd/Vehicle.java
+++ b/tools/contributed/traas/src/de/tudresden/sumo/cmd/Vehicle.java
@@ -863,7 +863,7 @@ public class Vehicle {
* @param sm speed mode
* @return SumoCommand
*/
- public static SumoCommand setspeedMode(String vehID, int sm){
+ public static SumoCommand setSpeedMode(String vehID, int sm){
return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_SPEEDSETMODE, vehID, sm);
}
@@ -889,7 +889,7 @@ public class Vehicle {
* @param vehID vehicle id
* @return SumoCommand
*/
- public static SumoCommand Resume(String vehID){
+ public static SumoCommand resume(String vehID){
Object[] array = new Object[]{vehID};
return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.CMD_RESUME, vehID, array);
}
diff --git a/tools/contributed/traas/src/de/tudresden/sumo/config/Constants.java b/tools/contributed/traas/src/de/tudresden/sumo/config/Constants.java
index 22b7a75..686bfe7 100644
--- a/tools/contributed/traas/src/de/tudresden/sumo/config/Constants.java
+++ b/tools/contributed/traas/src/de/tudresden/sumo/config/Constants.java
@@ -172,6 +172,9 @@ public class Constants {
/**name of the current program (get: traffic lights)*/
public static final int TL_CURRENT_PROGRAM = 0x29;
+
+ /**current state, using external signal names (get: traffic lights)*/
+ public static final int TL_EXTERNAL_STATE = 0x2e;
/**set simulation variable*/
public static final int CMD_SET_SIM_VARIABLE = 0xcb;
diff --git a/tools/contributed/traas/src/de/tudresden/ws/Traci.java b/tools/contributed/traas/src/de/tudresden/ws/Traci.java
index 58050ed..38accaf 100644
--- a/tools/contributed/traas/src/de/tudresden/ws/Traci.java
+++ b/tools/contributed/traas/src/de/tudresden/ws/Traci.java
@@ -211,8 +211,8 @@ public class Traci{
}
@WebMethod(action="Vehicle: setResume")
- public void Vehicle_Resume(@WebParam(name = "vehID") String vehID){
- this.sumo.set_cmd(Vehicle.Resume(vehID));
+ public void Vehicle_resume(@WebParam(name = "vehID") String vehID){
+ this.sumo.set_cmd(Vehicle.resume(vehID));
}
@WebMethod(action="Vehicle: setTau")
diff --git a/tools/contributed/traas/src/it/polito/appeal/traci/SumoTraciConnection.java b/tools/contributed/traas/src/it/polito/appeal/traci/SumoTraciConnection.java
index d984095..62423f8 100644
--- a/tools/contributed/traas/src/it/polito/appeal/traci/SumoTraciConnection.java
+++ b/tools/contributed/traas/src/it/polito/appeal/traci/SumoTraciConnection.java
@@ -125,6 +125,7 @@ public class SumoTraciConnection {
this.remote=true;
socket = new Socket();
+ socket.setTcpNoDelay(true);
int waitTime = 500; // milliseconds
for (int i = 0; i < CONNECT_RETRIES; i++) {
@@ -185,6 +186,7 @@ public class SumoTraciConnection {
socket = new Socket();
+ socket.setTcpNoDelay(true);
try {
socket.connect(new InetSocketAddress("127.0.0.1", remotePort));
diff --git a/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeStateQuery.java b/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeStateQuery.java
index 5c810e7..a48ee02 100755
--- a/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeStateQuery.java
+++ b/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeStateQuery.java
@@ -93,5 +93,4 @@ public abstract class ChangeStateQuery extends Query {
multi.add(this);
multi.run();
}
-
}
diff --git a/tools/contributed/traci4j/src/java/it/polito/appeal/traci/MultiQuery.java b/tools/contributed/traci4j/src/java/it/polito/appeal/traci/MultiQuery.java
index e9e0782..b1c3af5 100755
--- a/tools/contributed/traci4j/src/java/it/polito/appeal/traci/MultiQuery.java
+++ b/tools/contributed/traci4j/src/java/it/polito/appeal/traci/MultiQuery.java
@@ -100,6 +100,7 @@ public class MultiQuery {
}
reqMsg.writeTo(dos);
+ dos.flush();
ResponseMessage respMsg = new ResponseMessage(dis);
Iterator<ResponseContainer> responseIterator = respMsg.responses().iterator();
for (Query q : queries) {
diff --git a/tools/contributed/traci4j/src/java/it/polito/appeal/traci/SumoTraciConnection.java b/tools/contributed/traci4j/src/java/it/polito/appeal/traci/SumoTraciConnection.java
index 15fcbe1..4458d73 100755
--- a/tools/contributed/traci4j/src/java/it/polito/appeal/traci/SumoTraciConnection.java
+++ b/tools/contributed/traci4j/src/java/it/polito/appeal/traci/SumoTraciConnection.java
@@ -26,6 +26,8 @@ import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.io.DataInputStream;
import java.io.DataOutputStream;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
import java.io.IOException;
import java.net.ConnectException;
import java.net.InetAddress;
@@ -335,8 +337,8 @@ public class SumoTraciConnection {
}
private void postConnect() throws IOException {
- dis = new DataInputStream(socket.getInputStream());
- dos = new DataOutputStream(socket.getOutputStream());
+ dis = new DataInputStream(new BufferedInputStream(socket.getInputStream()));
+ dos = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream()));
closeQuery = new CloseQuery(dis, dos);
simData = new SimulationData(dis, dos);
diff --git a/tools/contributed/traci4j/src/xml/traciObjects/TrafficLight.xml b/tools/contributed/traci4j/src/xml/traciObjects/TrafficLight.xml
index 5f0976e..5b2b8c7 100755
--- a/tools/contributed/traci4j/src/xml/traciObjects/TrafficLight.xml
+++ b/tools/contributed/traci4j/src/xml/traciObjects/TrafficLight.xml
@@ -92,7 +92,7 @@
<readQuery>
<name>ReadAssumedNextSwitchTime</name>
<enum>ASSUMED_NEXT_SWITCH_TIME</enum>
- <const>it.polito.appeal.traci.protocol.Constants.TL_RED_YELLOW_GREEN_STATE</const>
+ <const>it.polito.appeal.traci.protocol.Constants.TL_NEXT_SWITCH</const>
<query>ReadObjectVarQuery.IntegerQ</query>
<returnType></returnType>
<dynamic>true</dynamic>
@@ -113,7 +113,7 @@
<changeStateQuery>
<name>ChangePhaseIndex</name>
<query>ChangeObjectVarQuery.ChangeIntegerQ</query>
- <const>it.polito.appeal.traci.protocol.Constants.TL_CURRENT_PHASE</const>
+ <const>it.polito.appeal.traci.protocol.Constants.TL_PHASE_INDEX</const>
</changeStateQuery>
<changeStateQuery>
diff --git a/tools/contributed/traci4matlab/+traci/+areal/getContextSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+areal/getContextSubscriptionResults.m
new file mode 100644
index 0000000..daa0709
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+areal/getContextSubscriptionResults.m
@@ -0,0 +1,26 @@
+function contextSubscriptionResults = getContextSubscriptionResults(detID)
+%getContextSubscriptionResults Get the context subscription results for the
+% last time step.
+% contextSubscriptionResults = getContextSubscriptionResults(DETID)
+% Returns the context subscription results for the last time step and the
+% given areal detector. If no areal detector id is given, all subscription results are
+% returned in a containers.Map data struccure. If the areal detector id is unknown
+% or the subscription did for any reason return no data, 'None' is
+% returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global arealSubscriptionResults
+if isempty(arealSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ detID=None;
+end
+contextSubscriptionResults = arealSubscriptionResults.getContext(detID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+areal/getIDCount.m b/tools/contributed/traci4matlab/+traci/+areal/getIDCount.m
new file mode 100644
index 0000000..894c296
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+areal/getIDCount.m
@@ -0,0 +1,10 @@
+function IDCount = getIDCount()
+%getIDCount Get the number of aeral detectors in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDCount = traci.areal.getUniversal(constants.ID_COUNT, '');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+areal/getIDList.m b/tools/contributed/traci4matlab/+traci/+areal/getIDList.m
new file mode 100644
index 0000000..ad94952
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+areal/getIDList.m
@@ -0,0 +1,12 @@
+function IDList = getIDList()
+%getIDList Get the IDs of the areal detectors in the network.
+% IDList = getIDList() Returns a cell array of strings containing the IDs
+% of the areal detectors in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDList = traci.areal.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+areal/getJamLengthMeters.m b/tools/contributed/traci4matlab/+traci/+areal/getJamLengthMeters.m
new file mode 100644
index 0000000..6f333cc
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+areal/getJamLengthMeters.m
@@ -0,0 +1,13 @@
+function JamLengthMeters = getJamLengthMeters(detID)
+%getJamLengthMeters Return the jam length in vehicles.
+% JamLengthVehicle = getJamLengthVehicle(DETID) Returns the
+% jam length in meters within the last simulation step on
+% the given areal detector.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+JamLengthMeters = traci.areal.getUniversal(constants.JAM_LENGTH_METERS, detID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+areal/getJamLengthVehicle.m b/tools/contributed/traci4matlab/+traci/+areal/getJamLengthVehicle.m
new file mode 100644
index 0000000..71e0af7
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+areal/getJamLengthVehicle.m
@@ -0,0 +1,13 @@
+function JamLengthVehicle = getJamLengthVehicle(detID)
+%getJamLengthVehicle Return the jam length in vehicles.
+% JamLengthVehicle = getJamLengthVehicle(DETID) Returns the
+% jam length in vehicles within the last simulation step on
+% the given areal detector.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+JamLengthVehicle = traci.areal.getUniversal(constants.JAM_LENGTH_VEHICLE, detID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+areal/getLastStepMeanSpeed.m b/tools/contributed/traci4matlab/+traci/+areal/getLastStepMeanSpeed.m
new file mode 100644
index 0000000..6245997
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+areal/getLastStepMeanSpeed.m
@@ -0,0 +1,12 @@
+function lastStepMeanSpeed = getLastStepMeanSpeed(detID)
+%getLastStepMeanSpeed Get the average speed on the areal detector.
+% lastStepMeanSpeed = getLastStepMeanSpeed(DETID) Returns the average
+% speed in m/s for the last time step on the given areal detector.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepMeanSpeed = traci.areal.getUniversal(constants.LAST_STEP_MEAN_SPEED, detID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+areal/getLastStepOccupancy.m b/tools/contributed/traci4matlab/+traci/+areal/getLastStepOccupancy.m
new file mode 100644
index 0000000..9f3789f
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+areal/getLastStepOccupancy.m
@@ -0,0 +1,12 @@
+function lastStepOccupancy = getLastStepOccupancy(detID)
+%getLastStepOccupancy Get the percentage of occupation on the areal detector.
+% lastStepOccupancy = getLastStepOccupancy(DETID) Returns the occupancy
+% in percentage for the last time step on the given areal detector.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepOccupancy = traci.areal.getUniversal(constants.LAST_STEP_OCCUPANCY, detID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+areal/getSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+areal/getSubscriptionResults.m
new file mode 100644
index 0000000..3617167
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+areal/getSubscriptionResults.m
@@ -0,0 +1,26 @@
+function subscriptionResults = getSubscriptionResults(detID)
+%getSubscriptionResults Get the subscription results for the last time step.
+% subscriptionResults = getSubscriptionResults(DETID) Returns the
+% subscription results for the last time step and the given areal detector. If no
+% areal detector id is given, all subscription results are returned in a
+% containers.Map data structure.
+% If the areal detector id is unknown or the subscription did for any reason return
+% no data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global arealSubscriptionResults
+if isempty(arealSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ detID = 'None';
+end
+
+subscriptionResults = arealSubscriptionResults.get(detID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+areal/getUniversal.m b/tools/contributed/traci4matlab/+traci/+areal/getUniversal.m
new file mode 100644
index 0000000..6cfaac9
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+areal/getUniversal.m
@@ -0,0 +1,25 @@
+function returnedValue = getUniversal(varID, detID)
+%getUniversal An internal function to send the get command and read the
+%variable value.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global arealSubscriptionResults
+
+if isempty(arealSubscriptionResults)
+ ReturnValueFunc = traci.RETURN_VALUE_FUNC.areal;
+else
+ ReturnValueFunc = aeralSubscriptionResults.valueFunc;
+end
+
+% Prepare the outgoing message and read the response. The result variable
+% is a traci.Storage object
+result = traci.sendReadOneStringCmd(constants.CMD_GET_AREAL_DETECTOR_VARIABLE,varID,detID);
+handleReturValueFunc = str2func(ReturnValueFunc(varID));
+
+% Use the proper method to read the variable of interest from the result
+returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+areal/subscribe.m b/tools/contributed/traci4matlab/+traci/+areal/subscribe.m
new file mode 100644
index 0000000..1d5ea14
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+areal/subscribe.m
@@ -0,0 +1,43 @@
+function subscribe(detID, varargin)
+%subscribe Subscribe to areal detector variable.
+% subscribe(DETID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for
+% the maximum allowed interval.
+% subscribe(DETID,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS for the maximum allowed interval.
+% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
+% allowed end time.
+% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
+% END.
+% A call to this function clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global arealSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'areal.subscribe';
+p.addRequired('detID', at ischar)
+p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(detID, varargin{:})
+detID = p.Results.detID;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+% Construct the subscription results object
+if isempty(arealSubscriptionResults)
+ arealSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.areal);
+else
+ arealSubscriptionResults.reset();
+end
+
+% Call the traci subscribe function
+traci.subscribe(constants.CMD_SUBSCRIBE_AREAL_DETECTOR_VARIABLE,...
+ subscriptionBegin, subscriptionEnd, detID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+areal/subscribeContext.m b/tools/contributed/traci4matlab/+traci/+areal/subscribeContext.m
new file mode 100644
index 0000000..a1fd880
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+areal/subscribeContext.m
@@ -0,0 +1,51 @@
+function subscribeContext(detID, domain, dist, varargin)
+%subscribeContext Subscribe to an areal detector's context variable.
+% subscribeContext(DETID,DOMAIN,DIST) Subscribe to the
+% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the
+% areal detector specified by DETID at a distance given by DIST, for the maximum
+% allowed interval. The type of objets that surround the areal detector are defined
+% in the DOMAIN parameter. Note that not all the SUMO object types
+% support the variable LAST_STEP_VEHICLE_NUMBER.
+% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS.
+% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
+% maximum allowed end time.
+% subscribeContext(...,END) Subscribe for the time interval defined by
+% BEGIN and END.
+% A call to this method clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global arealSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'areal.subscribeContext';
+p.addRequired('detID', at ischar)
+p.addRequired('domain', at ischar)
+p.addRequired('dist', at isnumeric)
+p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(detID, domain, dist, varargin{:})
+detID = p.Results.detID;
+domain = p.Results.domain;
+dist = p.Results.dist;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+% Construct the subscription results object
+if isempty(arealSubscriptionResults)
+ arealSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.areal);
+else
+ arealSubscriptionResults.reset();
+end
+
+% Call the traci subscribeContext function
+traci.subscribeContext(constants.CMD_SUBSCRIBE_AREAL_DETECTOR_CONTEXT,...
+ subscriptionBegin, subscriptionEnd, detID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/adaptTraveltime.m b/tools/contributed/traci4matlab/+traci/+edge/adaptTraveltime.m
new file mode 100644
index 0000000..2767fb0
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/adaptTraveltime.m
@@ -0,0 +1,17 @@
+function adaptTraveltime(edgeID, time)
+%adaptTraveltime Adapt the travel time value for the given edge.
+% adaptTraveltime(EDGEID,TIME) Adapt the travel time value used for
+% (re-) routing for the given edge in the SUMO server.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_EDGE_VARIABLE, constants.VAR_EDGE_TRAVELTIME, edgeID, 1+4+1+8);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x'))...
+ traci.packInt32(1) uint8(sscanf(constants.TYPE_DOUBLE,'%x'))...
+ traci.packInt64(time)];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getAdaptedTraveltime.m b/tools/contributed/traci4matlab/+traci/+edge/getAdaptedTraveltime.m
new file mode 100644
index 0000000..c6fc480
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getAdaptedTraveltime.m
@@ -0,0 +1,19 @@
+function adaptedTraveltime = getAdaptedTraveltime(edgeID, time)
+%getAdaptedTraveltime Return the travel time value.
+% adaptedTraveltime = getAdaptedTraveltime(EDGEID,TIME) Return the travel
+% time value (in s) used for (re-)routing which is valid on the specified
+% edge at the given time.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% $Id$
+
+global message
+import traci.constants
+traci.beginMessage(constants.CMD_GET_EDGE_VARIABLE,...
+ constants.VAR_EDGE_TRAVELTIME,edgeID, 1+4);
+message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x'))...
+ traci.packInt32(traci.time2steps(time))];
+result = traci.checkResult(constants.CMD_GET_EDGE_VARIABLE,...
+ constants.VAR_EDGE_TRAVELTIME, edgeID);
+adaptedTraveltime = result.readDouble();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getCO2Emission.m b/tools/contributed/traci4matlab/+traci/+edge/getCO2Emission.m
new file mode 100644
index 0000000..7a93879
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getCO2Emission.m
@@ -0,0 +1,12 @@
+function CO2Emission = getCO2Emission(edgeID)
+%getCO2Emission Returns the CO2 emission on the given edge.
+% CO2Emission = getCO2Emission(EDGEID) Returns the CO2 emission in mg for
+% the last time step on the given edge.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+CO2Emission = traci.edge.getUniversal(constants.VAR_CO2EMISSION, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getCOEmission.m b/tools/contributed/traci4matlab/+traci/+edge/getCOEmission.m
new file mode 100644
index 0000000..b9c2ba3
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getCOEmission.m
@@ -0,0 +1,12 @@
+function COEmission = getCOEmission(edgeID)
+%getCOEmission Returns the CO emission on the given edge.
+% COEmission = getCOEmission(EDGEID) Returns the CO emission in mg for
+% the last time step on the given edge.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+COEmission = traci.edge.getUniversal(constants.VAR_COEMISSION, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getContextSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+edge/getContextSubscriptionResults.m
new file mode 100644
index 0000000..eb3b46c
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getContextSubscriptionResults.m
@@ -0,0 +1,26 @@
+function contextSubscriptionResults = getContextSubscriptionResults(edgeID)
+%getContextSubscriptionResults Get the context subscription results for the
+% last time step.
+% contextSubscriptionResults = getContextSubscriptionResults(EDGEID)
+% Returns the context subscription results for the last time step and the
+% given edge. If no edge id is given, all subscription results are
+% returned in a containers.Map data struccure. If the edge id is unknown
+% or the subscription did for any reason return no data, 'None' is
+% returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global edgeSubscriptionResults
+if isempty(edgeSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ edgeID=None;
+end
+contextSubscriptionResults = edgeSubscriptionResults.getContext(edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getEffort.m b/tools/contributed/traci4matlab/+traci/+edge/getEffort.m
new file mode 100644
index 0000000..07a30ed
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getEffort.m
@@ -0,0 +1,19 @@
+function effort = getEffort(edgeID, time)
+%getEffort Get the effort used for (re-)routing.
+% effort = getEffort(EDGEID,TIME) Returns the effort value used for
+% (re-)routing which is valid on the edge at the given time.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global message
+import traci.constants
+traci.beginMessage(constants.CMD_GET_EDGE_VARIABLE, constants.VAR_EDGE_EFFORT,...
+ edgeID, 1+4);
+message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x'))...
+ traci.packInt32(traci.time2steps(time))];
+result = traci.checkResult(constants.CMD_GET_EDGE_VARIABLE,...
+ constants.VAR_EDGE_EFFORT, edgeID);
+effort = result.readDouble();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getFuelConsumption.m b/tools/contributed/traci4matlab/+traci/+edge/getFuelConsumption.m
new file mode 100644
index 0000000..828020a
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getFuelConsumption.m
@@ -0,0 +1,12 @@
+function fuelConsumption = getFuelConsumption(edgeID)
+%getFuelConsumption Get the fuel consumption on the edge.
+% fuelConsumption = getFuelConsumption(EDGEID) Returns the fuel
+% consumption in ml for the last time step on the given edge.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+fuelConsumption = traci.edge.getUniversal(constants.VAR_FUELCONSUMPTION, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getHCEmission.m b/tools/contributed/traci4matlab/+traci/+edge/getHCEmission.m
new file mode 100644
index 0000000..c4f1394
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getHCEmission.m
@@ -0,0 +1,12 @@
+function HCEmission = getHCEmission(edgeID)
+%getHCEmission Returns the HC emission on the given edge.
+% HCEmission = getCOEmission(EDGEID) Returns the HC emission in mg for
+% the last time step on the given edge.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+HCEmission = traci.edge.getUniversal(constants.VAR_HCEMISSION, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getIDCount.m b/tools/contributed/traci4matlab/+traci/+edge/getIDCount.m
new file mode 100644
index 0000000..d325e5f
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getIDCount.m
@@ -0,0 +1,10 @@
+function IDCount = getIDCount()
+%getIDCount Get the number of edges in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDCount = traci.edge.getUniversal(constants.ID_COUNT, '');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getIDList.m b/tools/contributed/traci4matlab/+traci/+edge/getIDList.m
new file mode 100644
index 0000000..9b04b00
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getIDList.m
@@ -0,0 +1,12 @@
+function IDList = getIDList()
+%getIDList Get the IDs of the edges in the network.
+% IDList = getIDList() Returns a cell array of strings containing the IDs
+% of the edges in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDList = traci.edge.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getLastStepHaltingNumber.m b/tools/contributed/traci4matlab/+traci/+edge/getLastStepHaltingNumber.m
new file mode 100644
index 0000000..fe8af74
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getLastStepHaltingNumber.m
@@ -0,0 +1,13 @@
+function lastStepHaltingNumber = getLastStepHaltingNumber(edgeID)
+%getLastStepHaltingNumber Get the number of halting vehicles.
+% lastStepHaltingNumber = getLastStepHaltingNumber(EDGEID) Returns the
+% total number of halting vehicles for the last time step on the given
+% edge. A speed of less than 0.1 m/s is considered a halt.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepHaltingNumber = traci.edge.getUniversal(constants.LAST_STEP_VEHICLE_HALTING_NUMBER, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getLastStepLength.m b/tools/contributed/traci4matlab/+traci/+edge/getLastStepLength.m
new file mode 100644
index 0000000..a62aec6
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getLastStepLength.m
@@ -0,0 +1,12 @@
+function lastStepLength = getLastStepLength(edgeID)
+%getLastStepLength Get the mean vehicle length on the edge.
+% lastStepLength = getLastStepLength(EDGEID) Returns the mean vehicle
+% length in m for the last time step on the given edge.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepLength = traci.edge.getUniversal(constants.LAST_STEP_LENGTH, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getLastStepMeanSpeed.m b/tools/contributed/traci4matlab/+traci/+edge/getLastStepMeanSpeed.m
new file mode 100644
index 0000000..7943ffd
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getLastStepMeanSpeed.m
@@ -0,0 +1,12 @@
+function lastStepMeanSpeed = getLastStepMeanSpeed(edgeID)
+%getLastStepMeanSpeed Get the average speed on the edge.
+% lastStepMeanSpeed = getLastStepMeanSpeed(EDGEID) Returns the average
+% speed in m/s for the last time step on the given edge.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepMeanSpeed = traci.edge.getUniversal(constants.LAST_STEP_MEAN_SPEED, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getLastStepOccupancy.m b/tools/contributed/traci4matlab/+traci/+edge/getLastStepOccupancy.m
new file mode 100644
index 0000000..9a3f30a
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getLastStepOccupancy.m
@@ -0,0 +1,12 @@
+function lastStepOccupancy = getLastStepOccupancy(edgeID)
+%getLastStepOccupancy Get the percentage of occupation on the edge.
+% lastStepOccupancy = getLastStepOccupancy(EDGEID) Returns the occupancy
+% in percentage for the last time step on the given edge.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepOccupancy = traci.edge.getUniversal(constants.LAST_STEP_OCCUPANCY, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getLastStepPersonIDs.m b/tools/contributed/traci4matlab/+traci/+edge/getLastStepPersonIDs.m
new file mode 100644
index 0000000..a82ae08
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getLastStepPersonIDs.m
@@ -0,0 +1,12 @@
+function personIDs = getLastStepPersonIDs(edgeID)
+%getLastStepPersonIDs Returns the ids of the persons in the last time step.
+% personIDs = getLastStepPersonIDs(EDGEID) Returns the ids of the persons
+% on the given edge during the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+personIDs = traci.edge.getUniversal(constants.LAST_STEP_PERSON_ID_LIST, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getLastStepVehicleIDs.m b/tools/contributed/traci4matlab/+traci/+edge/getLastStepVehicleIDs.m
new file mode 100644
index 0000000..32e4bfc
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getLastStepVehicleIDs.m
@@ -0,0 +1,13 @@
+function lastStepVehicleIDs = getLastStepVehicleIDs(edgeID)
+%getLastStepVehicleIDs Get the IDs of the vehicles in the edge.
+% lastStepVehicleIDs = getLastStepVehicleIDs(EDGEID) Returns cell array
+% of strings containing the IDs of the vehicles for the last time step
+% on the given edge.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepVehicleIDs = traci.edge.getUniversal(constants.LAST_STEP_VEHICLE_ID_LIST, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getLastStepVehicleNumber.m b/tools/contributed/traci4matlab/+traci/+edge/getLastStepVehicleNumber.m
new file mode 100644
index 0000000..fd3673f
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getLastStepVehicleNumber.m
@@ -0,0 +1,13 @@
+function lastStepVehicleNumber = getLastStepVehicleNumber(edgeID)
+%getLastStepVehicleNumber Get the number vehicles in the edge.
+% lastStepVehicleNumber = getLastStepVehicleNumber(EDGEID) Returns the
+% total number of vehicles for the last time step on the given edge.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepVehicleNumber = traci.edge.getUniversal(...
+ constants.LAST_STEP_VEHICLE_NUMBER, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getNOxEmission.m b/tools/contributed/traci4matlab/+traci/+edge/getNOxEmission.m
new file mode 100644
index 0000000..488b611
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getNOxEmission.m
@@ -0,0 +1,12 @@
+function NOxEmission = getNOxEmission(edgeID)
+import traci.constants
+%getNOxEmission Get the NOx emission in the edge.
+% NOxEmission = getNOxEmission(EDGEID) Returns the NOx emission in mg for
+% the last time step on the given edge.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+NOxEmission = traci.edge.getUniversal(constants.VAR_NOXEMISSION, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getNoiseEmission.m b/tools/contributed/traci4matlab/+traci/+edge/getNoiseEmission.m
new file mode 100644
index 0000000..ee3a5e0
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getNoiseEmission.m
@@ -0,0 +1,12 @@
+function noiseEmission = getNoiseEmission(edgeID)
+%getNoiseEmission Get the noise emission in the edge.
+% noiseEmission = getNoiseEmission(EDGEID) Returns the noise emission in
+% db for the last time step on the given edge.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+noiseEmission = traci.edge.getUniversal(constants.VAR_NOISEEMISSION, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getPmxEmission.m b/tools/contributed/traci4matlab/+traci/+edge/getPmxEmission.m
new file mode 100644
index 0000000..0e452c7
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getPmxEmission.m
@@ -0,0 +1,12 @@
+function pmxEmission = getPmxEmission(edgeID)
+%getPmxEmission Get the particular matter emission in the edge.
+% pmxEmission = getPmxEmission(EDGEID) Returns the particular matter
+% emission in mg for the last time step on the given edge.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+pmxEmission = traci.edge.getUniversal(constants.VAR_PMXEMISSION, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+edge/getSubscriptionResults.m
new file mode 100644
index 0000000..c28382b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getSubscriptionResults.m
@@ -0,0 +1,26 @@
+function subscriptionResults = getSubscriptionResults(edgeID)
+%getSubscriptionResults Get the subscription results for the last time step.
+% subscriptionResults = getSubscriptionResults(EDGEID) Returns the
+% subscription results for the last time step and the given edge. If no
+% edge id is given, all subscription results are returned in a
+% containers.Map data structure.
+% If the edge id is unknown or the subscription did for any reason return
+% no data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global edgeSubscriptionResults
+if isempty(edgeSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ edgeID = 'None';
+end
+
+subscriptionResults = edgeSubscriptionResults.get(edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getTraveltime.m b/tools/contributed/traci4matlab/+traci/+edge/getTraveltime.m
new file mode 100644
index 0000000..993a891
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getTraveltime.m
@@ -0,0 +1,12 @@
+function traveltime = getTraveltime(edgeID)
+%getTraveltime Get estimated travel time in the edge.
+% traveltime = getTraveltime(EDGEID) Returns the estimated travel time in
+% seconds for the last time step on the given edge.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traveltime = traci.edge.getUniversal(constants.VAR_CURRENT_TRAVELTIME, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/getUniversal.m b/tools/contributed/traci4matlab/+traci/+edge/getUniversal.m
new file mode 100644
index 0000000..d91f2e0
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/getUniversal.m
@@ -0,0 +1,25 @@
+function returnedValue = getUniversal(varID, edgeID)
+%getUniversal An internal function to send the get command and read the
+%variable value.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global edgeSubscriptionResults
+
+if isempty(edgeSubscriptionResults)
+ ReturnValueFunc = traci.RETURN_VALUE_FUNC.edge;
+else
+ ReturnValueFunc = edgeSubscriptionResults.valueFunc;
+end
+
+% Prepare the outgoing message and read the response. The result variable
+% is a traci.Storage object
+result = traci.sendReadOneStringCmd(constants.CMD_GET_EDGE_VARIABLE,varID,edgeID);
+handleReturValueFunc = str2func(ReturnValueFunc(varID));
+
+% Use the proper method to read the variable of interest from the result
+returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/setEffort.m b/tools/contributed/traci4matlab/+traci/+edge/setEffort.m
new file mode 100644
index 0000000..c651b4b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/setEffort.m
@@ -0,0 +1,17 @@
+function setEffort(edgeID, effort)
+%setEffort Adapt the effort for (-re) routing.
+% setEffort(EDGEID,EFFORT) Adapt the effort value used for (re-)routing
+% for the given edge.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_EDGE_VARIABLE, constants.VAR_EDGE_EFFORT, edgeID, 1+4+1+8);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x'))...
+ traci.packInt32(1) uint8(sscanf(constants.TYPE_DOUBLE,'%x'))...
+ traci.packInt64(effort)];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/setMaxSpeed.m b/tools/contributed/traci4matlab/+traci/+edge/setMaxSpeed.m
new file mode 100644
index 0000000..d8c5593
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/setMaxSpeed.m
@@ -0,0 +1,12 @@
+function setMaxSpeed(edgeID, speed)
+%setMaxSpeed Set the maximum speed in the edge.
+% setMaxSpeed(EDGEID,SPEED) Set a new maximum speed (in m/s) for all
+% lanes of the edge.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_EDGE_VARIABLE, constants.VAR_MAXSPEED, edgeID, speed)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/subscribe.m b/tools/contributed/traci4matlab/+traci/+edge/subscribe.m
new file mode 100644
index 0000000..b03f37e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/subscribe.m
@@ -0,0 +1,43 @@
+function subscribe(edgeID, varargin)
+%subscribe Subscribe to edge variable.
+% subscribe(EDGEID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for
+% the maximum allowed interval.
+% subscribe(EDGEID,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS for the maximum allowed interval.
+% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
+% allowed end time.
+% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
+% END.
+% A call to this function clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global edgeSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'edge.subscribe';
+p.addRequired('edgeID', at ischar)
+p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(edgeID, varargin{:})
+edgeID = p.Results.edgeID;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+% Construct the subscription results object
+if isempty(edgeSubscriptionResults)
+ edgeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.edge);
+else
+ edgeSubscriptionResults.reset();
+end
+
+% Call the traci subscribe function
+traci.subscribe(constants.CMD_SUBSCRIBE_EDGE_VARIABLE,...
+ subscriptionBegin, subscriptionEnd, edgeID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+edge/subscribeContext.m b/tools/contributed/traci4matlab/+traci/+edge/subscribeContext.m
new file mode 100644
index 0000000..c5a8e58
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+edge/subscribeContext.m
@@ -0,0 +1,51 @@
+function subscribeContext(edgeID, domain, dist, varargin)
+%subscribeContext Subscribe to an edge's context variable.
+% subscribeContext(EDGEID,DOMAIN,DIST) Subscribe to the
+% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the
+% edge specified by EDGEID at a distance given by DIST, for the maximum
+% allowed interval. The type of objets that surround the edge are defined
+% in the DOMAIN parameter. Note that not all the SUMO object types
+% support the variable LAST_STEP_VEHICLE_NUMBER.
+% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS.
+% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
+% maximum allowed end time.
+% subscribeContext(...,END) Subscribe for the time interval defined by
+% BEGIN and END.
+% A call to this method clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global edgeSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'edge.subscribeContext';
+p.addRequired('edgeID', at ischar)
+p.addRequired('domain', at ischar)
+p.addRequired('dist', at isnumeric)
+p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(edgeID, domain, dist, varargin{:})
+edgeID = p.Results.edgeID;
+domain = p.Results.domain;
+dist = p.Results.dist;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+% Construct the subscription results object
+if isempty(edgeSubscriptionResults)
+ edgeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.edge);
+else
+ edgeSubscriptionResults.reset();
+end
+
+% Call the traci subscribeContext function
+traci.subscribeContext(constants.CMD_SUBSCRIBE_EDGE_CONTEXT,...
+ subscriptionBegin, subscriptionEnd, edgeID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+gui/getBoundary.m b/tools/contributed/traci4matlab/+traci/+gui/getBoundary.m
new file mode 100644
index 0000000..a9faed0
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+gui/getBoundary.m
@@ -0,0 +1,16 @@
+function boundary = getBoundary(viewID)
+%getBoundary Get the coordinates of the view.
+% boundary = getBoundary(VIEWID) Returns the coordinates of the lower
+% left and the upper right corner of the currently visible view. If no
+% view ID is given, the function return the results for the default view.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+if nargin < 1
+ viewID = 'View #0';
+end
+boundary = traci.gui.getUniversal(constants.VAR_VIEW_BOUNDARY, viewID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+gui/getContextSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+gui/getContextSubscriptionResults.m
new file mode 100644
index 0000000..ca91f9b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+gui/getContextSubscriptionResults.m
@@ -0,0 +1,26 @@
+function ContextSubscriptionResults = getContextSubscriptionResults(viewID)
+%getContextSubscriptionResults Get the context subscription results for the
+% last time step.
+% contextSubscriptionResults = getContextSubscriptionResults(VIEWID)
+% Returns the context subscription results for the last time step and the
+% given view. If no view id is given, all subscription results are
+% returned in a containers.Map data struccure. If the view id is unknown
+% or the subscription did for any reason return no data, 'None' is
+% returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global guiSubscriptionResults
+if isempty(guiSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ viewID=None;
+end
+ContextSubscriptionResults = guiSubscriptionResults.getContext(viewID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+gui/getIDList.m b/tools/contributed/traci4matlab/+traci/+gui/getIDList.m
new file mode 100644
index 0000000..e4ecd17
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+gui/getIDList.m
@@ -0,0 +1,12 @@
+function IDList = getIDList()
+%getIDList Get the IDs of the views in the network.
+% IDList = getIDList() Returns a cell array of strings containing the IDs
+% of the views in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDList = traci.gui.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+gui/getOffset.m b/tools/contributed/traci4matlab/+traci/+gui/getOffset.m
new file mode 100644
index 0000000..f35eb59
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+gui/getOffset.m
@@ -0,0 +1,16 @@
+function offset = getOffset(viewID)
+%getOffset Get the offset of the view.
+% offset = getOffset(VIEWID) Returns the x and y offset of the center of
+% the current view. If no view ID is given, the function return the
+% results for the default view.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+if nargin < 1
+ viewID = 'View #0';
+end
+offset = traci.gui.getUniversal(constants.VAR_VIEW_OFFSET, viewID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+gui/getSchema.m b/tools/contributed/traci4matlab/+traci/+gui/getSchema.m
new file mode 100644
index 0000000..425f199
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+gui/getSchema.m
@@ -0,0 +1,16 @@
+function schema = getSchema(viewID)
+%getSchema Get the color schema of the view.
+% schema = getSchema(VIEWID) Returns the name of the current coloring
+% scheme. If no view ID is given, the function return the results for the
+% default view.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+if nargin < 1
+ viewID = 'View #0';
+end
+schema = traci.gui.getUniversal(constants.VAR_VIEW_SCHEMA, viewID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+gui/getSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+gui/getSubscriptionResults.m
new file mode 100644
index 0000000..bab785b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+gui/getSubscriptionResults.m
@@ -0,0 +1,26 @@
+function subscriptionResults = getSubscriptionResults(viewID)
+%getSubscriptionResults Get the subscription results for the last time step.
+% subscriptionResults = getSubscriptionResults(VIEWID) Returns the
+% subscription results for the last time step and the given view. If no
+% view id is given, all subscription results are returned in a
+% containers.Map data structure.
+% If the view id is unknown or the subscription did for any reason return
+% no data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global guiSubscriptionResults
+if isempty(guiSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ viewID = 'None';
+end
+
+subscriptionResults = guiSubscriptionResults.get(viewID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+gui/getUniversal.m b/tools/contributed/traci4matlab/+traci/+gui/getUniversal.m
new file mode 100644
index 0000000..f74432e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+gui/getUniversal.m
@@ -0,0 +1,25 @@
+function returnedValue = getUniversal(varID, viewID)
+%getUniversal An internal function to send the get command and read the
+%variable value.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global guiSubscriptionResults
+
+if isempty(guiSubscriptionResults)
+ returnValueFunc = traci.RETURN_VALUE_FUNC.gui;
+else
+ returnValueFunc = guiSubscriptionResults.valueFunc;
+end
+
+% Prepare the outgoing message and read the response. The result variable
+% is a traci.Storage object
+result = traci.sendReadOneStringCmd(constants.CMD_GET_GUI_VARIABLE,varID,viewID);
+handleReturValueFunc = str2func(returnValueFunc(varID));
+
+% Use the proper method to read the variable of interest from the result
+returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+gui/getZoom.m b/tools/contributed/traci4matlab/+traci/+gui/getZoom.m
new file mode 100644
index 0000000..53c03bc
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+gui/getZoom.m
@@ -0,0 +1,16 @@
+function zoom = getZoom(viewID)
+%getZoom Get the zoom of the view.
+% zoom = getZoom(viewID) Returns the current zoom factor of the view. If
+% no view ID is given, the function return the results for the default
+% view.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+if nargin < 1
+ viewID = 'View #0';
+end
+zoom = traci.gui.getUniversal(constants.VAR_VIEW_ZOOM, viewID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+gui/screenshot.m b/tools/contributed/traci4matlab/+traci/+gui/screenshot.m
new file mode 100644
index 0000000..0a7aa80
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+gui/screenshot.m
@@ -0,0 +1,14 @@
+function screenshot(viewID, filename)
+%screenshot Save a screenshot of the SUMO gui.
+% screenshot(VIEWID, FILENAME) Save a screenshot for the given view to
+% the given filename. The fileformat is guessed from the extension, the
+% available formats differ from platform to platform but should at least
+% include ps, svg and pdf, on linux probably gif, png and jpg as well.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendStringCmd(constants.CMD_SET_GUI_VARIABLE, constants.VAR_SCREENSHOT, viewID, filename);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+gui/setBoundary.m b/tools/contributed/traci4matlab/+traci/+gui/setBoundary.m
new file mode 100644
index 0000000..daf2bd2
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+gui/setBoundary.m
@@ -0,0 +1,16 @@
+function setBoundary(viewID, xmin, ymin, xmax, ymax)
+%setBoundary Set the coordinates of the view.
+% setBoundary(VIEWID, XMIN, YMIN, XMAX, YMAX) Set the current boundary
+% for the given view (see getBoundary).
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_GUI_VARIABLE, constants.VAR_VIEW_BOUNDARY, viewID, 1+8+8+8+8);
+message.string = [message.string uint8(sscanf(constants.TYPE_BOUNDINGBOX,'%x'))...
+ traci.packInt64([ymax xmax ymin xmin])];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+gui/setOffset.m b/tools/contributed/traci4matlab/+traci/+gui/setOffset.m
new file mode 100644
index 0000000..89ea99f
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+gui/setOffset.m
@@ -0,0 +1,15 @@
+function setOffset(viewID, x, y)
+%setOffset Set the offset of the view.
+% setOffset(VIEWID, X, Y) Set the current offset for the given view.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_GUI_VARIABLE, constants.VAR_VIEW_OFFSET, viewID, 1+8+8);
+message.string = [message.string uint8(sscanf(constants.POSITION_2D,'%x'))...
+ traci.packInt64([y x])];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+gui/setSchema.m b/tools/contributed/traci4matlab/+traci/+gui/setSchema.m
new file mode 100644
index 0000000..a1607d7
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+gui/setSchema.m
@@ -0,0 +1,12 @@
+function setSchema(viewID, schemeName)
+%setSchema Set the coloring scheme of the view.
+% setSchema(VIEWID, SCHEMENAME) Set the current coloring scheme for the
+% given view.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendStringCmd(constants.CMD_SET_GUI_VARIABLE, constants.VAR_VIEW_SCHEMA, viewID, schemeName);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+gui/setZoom.m b/tools/contributed/traci4matlab/+traci/+gui/setZoom.m
new file mode 100644
index 0000000..0800d73
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+gui/setZoom.m
@@ -0,0 +1,11 @@
+function setZoom(viewID, zoom)
+%setZoom Set the zoom of the view.
+% setZoom(VIEWID, ZOOM) Set the current zoom factor for the given view.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_GUI_VARIABLE, constants.VAR_VIEW_ZOOM, viewID, zoom);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+gui/subscribe.m b/tools/contributed/traci4matlab/+traci/+gui/subscribe.m
new file mode 100644
index 0000000..8c124b8
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+gui/subscribe.m
@@ -0,0 +1,37 @@
+function subscribe(viewID, varargin)
+%subscribe Subscribe to view variable.
+% subscribe(VIEWID) Subscribe to the VAR_VIEW_OFFSET value for the
+% maximum allowed interval.
+% subscribe(VIEWID,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS for the maximum allowed interval.
+% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
+% allowed end time.
+% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
+% END.
+% A call to this function clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global guiSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'gui.subscribe';
+p.addRequired('viewID', at ischar)
+p.addOptional('varIDs', {constants.VAR_VIEW_OFFSET}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(viewID, varargin{:})
+viewID = p.Results.viewID;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+guiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.gui);
+guiSubscriptionResults.reset()
+traci.subscribe(constants.CMD_SUBSCRIBE_GUI_VARIABLE,...
+ subscriptionBegin, subscriptionEnd, viewID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+gui/subscribeContext.m b/tools/contributed/traci4matlab/+traci/+gui/subscribeContext.m
new file mode 100644
index 0000000..21ace10
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+gui/subscribeContext.m
@@ -0,0 +1,46 @@
+function subscribeContext(viewID, domain, dist, varargin)
+%subscribeContext Subscribe to a view's context variable.
+% subscribeContext(VIEWID,DOMAIN,DIST) Subscribe to the VAR_VIEW_OFFSET
+% value of the SUMO objects that surround the view specified by VIEWID at
+% a distance given by DIST, for the maximum allowed interval. The type of
+% objets that surround the view are defined in the DOMAIN parameter. Note
+% that not all the SUMO object types support the variable
+% VAR_VIEW.
+% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS.
+% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
+% maximum allowed end time.
+% subscribeContext(...,END) Subscribe for the time interval defined by
+% BEGIN and END.
+% A call to this method clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global guiSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'gui.subscribeContext';
+p.addRequired('viewID', at ischar)
+p.addRequired('domain', at ischar)
+p.addRequired('dist', at isnumeric)
+p.addOptional('varIDs', {constants.VAR_VIEW_OFFSET}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(viewID, domain, dist, varargin{:})
+viewID = p.Results.viewID;
+domain = p.Results.domain;
+dist = p.Results.dist;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+guiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.gui);
+
+guiSubscriptionResults.reset()
+traci.subscribeContext(constants.CMD_SUBSCRIBE_GUI_CONTEXT,...
+ subscriptionBegin, subscriptionEnd, viewID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+gui/trackVehicle.m b/tools/contributed/traci4matlab/+traci/+gui/trackVehicle.m
new file mode 100644
index 0000000..f7f5ebe
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+gui/trackVehicle.m
@@ -0,0 +1,12 @@
+function trackVehicle(viewID, vehID)
+%trackVehicle Track vehicle in SUMO gui.
+% trackVehicle(viewID, vehID) Start visually tracking the given vehicle
+% on the given view.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendStringCmd(constants.CMD_SET_GUI_VARIABLE, constants.VAR_TRACK_VEHICLE, viewID, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+inductionloop/getContextSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+inductionloop/getContextSubscriptionResults.m
new file mode 100644
index 0000000..4e5920e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+inductionloop/getContextSubscriptionResults.m
@@ -0,0 +1,26 @@
+function ContextSubscriptionResults = getContextSubscriptionResults(loopID)
+%getContextSubscriptionResults Get the context subscription results for the
+% last time step.
+% contextSubscriptionResults = getContextSubscriptionResults(LOOPID)
+% Returns the context subscription results for the last time step and the
+% given induction loop. If no induction loop id is given, all
+% subscription results are returned in a containers.Map data struccure.
+% If the induction loop id is unknown or the subscription did for any
+% reason return no data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global loopSubscriptionResults
+if isempty(loopSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ loopID=None;
+end
+ContextSubscriptionResults = loopSubscriptionResults.getContext(loopID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+inductionloop/getIDList.m b/tools/contributed/traci4matlab/+traci/+inductionloop/getIDList.m
new file mode 100644
index 0000000..1963f62
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+inductionloop/getIDList.m
@@ -0,0 +1,13 @@
+function IDList = getIDList()
+%getIDList Get the IDs of the induction loops in the network.
+% IDList = getIDList() Returns a cell array of strings containing the IDs
+% of the induction loops in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDList = traci.inductionloop.getUniversal(constants.ID_LIST, '');
+
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+inductionloop/getLaneID.m b/tools/contributed/traci4matlab/+traci/+inductionloop/getLaneID.m
new file mode 100644
index 0000000..478d467
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+inductionloop/getLaneID.m
@@ -0,0 +1,11 @@
+function laneID = getLaneID(loopID)
+%getLaneID Get the id of the lane the loop is on.
+% laneID = getLaneID(LOOPID) Returns the id of the lane the loop is on.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+laneID = traci.inductionloop.getUniversal(constants.VAR_LANE_ID, loopID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+inductionloop/getLastStepMeanLength.m b/tools/contributed/traci4matlab/+traci/+inductionloop/getLastStepMeanLength.m
new file mode 100644
index 0000000..139b06c
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+inductionloop/getLastStepMeanLength.m
@@ -0,0 +1,12 @@
+function lastStepMeanLength = getLastStepMeanLength(loopID)
+%getLastStepMeanLength Get the mean length of the vehicles in the lane.
+% lastStepMeanLength = getLastStepMeanLength(LOOPID) Returns the mean
+% length in m of vehicles which were on the detector in the last step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepMeanLength = traci.inductionloop.getUniversal(constants.LAST_STEP_LENGTH, loopID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+inductionloop/getLastStepMeanSpeed.m b/tools/contributed/traci4matlab/+traci/+inductionloop/getLastStepMeanSpeed.m
new file mode 100644
index 0000000..e85082b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+inductionloop/getLastStepMeanSpeed.m
@@ -0,0 +1,13 @@
+function lastStepMeanSpeed = getLastStepMeanSpeed(loopID)
+%getLastStepMeanSpeed Get the mean speed of the vehicles in the lane.
+% lastStepMeanSpeed = getLastStepMeanSpeed(LOOPID) Returns the mean
+% speed in m/s of vehicles that were on the named induction loop within
+% the last simulation step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepMeanSpeed = traci.inductionloop.getUniversal(constants.LAST_STEP_MEAN_SPEED, loopID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+inductionloop/getLastStepOccupancy.m b/tools/contributed/traci4matlab/+traci/+inductionloop/getLastStepOccupancy.m
new file mode 100644
index 0000000..17c2dd6
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+inductionloop/getLastStepOccupancy.m
@@ -0,0 +1,12 @@
+function lastStepOccupancy = getLastStepOccupancy(loopID)
+%getLastStepOccupancy Get the percentage of time the loop was occupied.
+% lastStepOccupancy = getLastStepOccupancy(LOOPID) Returns the percentage
+% of time the detector was occupied by a vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepOccupancy = traci.inductionloop.getUniversal(constants.LAST_STEP_OCCUPANCY, loopID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+inductionloop/getLastStepVehicleIDs.m b/tools/contributed/traci4matlab/+traci/+inductionloop/getLastStepVehicleIDs.m
new file mode 100644
index 0000000..f3701ca
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+inductionloop/getLastStepVehicleIDs.m
@@ -0,0 +1,13 @@
+function lastStepVehicleIDs = getLastStepVehicleIDs(loopID)
+%getLastStepVehicleIDs Get the IDs of the vehicles that were in the loop.
+% lastStepVehicleIDs = getLastStepVehicleIDs(LOOPID) Returns the list of
+% ids of vehicles that were on the named induction loop in the last
+% simulation step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepVehicleIDs = traci.inductionloop.getUniversal(constants.LAST_STEP_VEHICLE_ID_LIST, loopID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+inductionloop/getLastStepVehicleNumber.m b/tools/contributed/traci4matlab/+traci/+inductionloop/getLastStepVehicleNumber.m
new file mode 100644
index 0000000..4df8715
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+inductionloop/getLastStepVehicleNumber.m
@@ -0,0 +1,13 @@
+function lastStepVehicleNumber = getLastStepVehicleNumber(loopID)
+%getLastStepVehicleNumber Get number of vehicles in the loop.
+% lastStepVehicleNumber = getLastStepVehicleNumber(LOOPID) Returns the
+% number of vehicles that were on the named induction loop within the last simulation step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepVehicleNumber = traci.inductionloop.getUniversal(...
+ constants.LAST_STEP_VEHICLE_NUMBER, loopID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+inductionloop/getPosition.m b/tools/contributed/traci4matlab/+traci/+inductionloop/getPosition.m
new file mode 100644
index 0000000..4fddabc
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+inductionloop/getPosition.m
@@ -0,0 +1,12 @@
+function position = getPosition(loopID)
+%getPosition Get the position of the loop.
+% position = getPosition(LOOPID) Returns the position measured from the
+% beginning of the lane in meters.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+position = traci.inductionloop.getUniversal(constants.VAR_POSITION, loopID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+inductionloop/getSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+inductionloop/getSubscriptionResults.m
new file mode 100644
index 0000000..312a7bd
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+inductionloop/getSubscriptionResults.m
@@ -0,0 +1,26 @@
+function subscriptionResults = getSubscriptionResults(loopID)
+%getSubscriptionResults Get the subscription results for the last time step.
+% subscriptionResults = getSubscriptionResults(LOOPID) Returns the
+% subscription results for the last time step and the given induction loop. If no
+% induction loop id is given, all subscription results are returned in a
+% containers.Map data structure.
+% If the induction loop id is unknown or the subscription did for any reason return
+% no data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global loopSubscriptionResults
+if isempty(loopSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ loopID = 'None';
+end
+
+subscriptionResults = loopSubscriptionResults.get(loopID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+inductionloop/getTimeSinceDetection.m b/tools/contributed/traci4matlab/+traci/+inductionloop/getTimeSinceDetection.m
new file mode 100644
index 0000000..cadcafd
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+inductionloop/getTimeSinceDetection.m
@@ -0,0 +1,12 @@
+function timeSinceDetection = getTimeSinceDetection(loopID)
+%getTimeSinceDetection Get the time since the last detection.
+% timeSinceDetection = getTimeSinceDetection(LOOPID) Returns the time in
+% seconds since last detection.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+timeSinceDetection = traci.inductionloop.getUniversal(constants.LAST_STEP_TIME_SINCE_DETECTION, loopID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+inductionloop/getUniversal.m b/tools/contributed/traci4matlab/+traci/+inductionloop/getUniversal.m
new file mode 100644
index 0000000..ec10a0d
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+inductionloop/getUniversal.m
@@ -0,0 +1,25 @@
+function returnedValue = getUniversal(varID, loopID)
+%getUniversal An internal function to send the get command and read the
+%variable value.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global inductionloopSubscriptionResults
+
+if isempty(inductionloopSubscriptionResults)
+ returnValueFunc = traci.RETURN_VALUE_FUNC.inductionloop;
+else
+ returnValueFunc = inductionloopSubscriptionResults.valueFunc;
+end
+
+% Prepare the outgoing message and read the response. The result variable
+% is a traci.Storage object
+result = traci.sendReadOneStringCmd(constants.CMD_GET_INDUCTIONLOOP_VARIABLE,varID,loopID);
+handleReturValueFunc = str2func(returnValueFunc(varID));
+
+% Use the proper method to read the variable of interest from the result
+returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+inductionloop/getVehicleData.m b/tools/contributed/traci4matlab/+traci/+inductionloop/getVehicleData.m
new file mode 100644
index 0000000..6fe97b6
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+inductionloop/getVehicleData.m
@@ -0,0 +1,12 @@
+function vehicleData = getVehicleData(loopID)
+%getVehicleData Get several data about passed vehicles.
+% vehicleData = getVehicleData(LOOPID) Returns a cell structure
+% containing several information about vehicles which passed the detector.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+vehicleData = traci.inductionloop.getUniversal(constants.LAST_STEP_VEHICLE_DATA, loopID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+inductionloop/readVehicleData.m b/tools/contributed/traci4matlab/+traci/+inductionloop/readVehicleData.m
new file mode 100644
index 0000000..19bea2a
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+inductionloop/readVehicleData.m
@@ -0,0 +1,24 @@
+function data = readVehicleData(result)
+%readVehicleData Internal function to read several vehicle information.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+result.readLength();
+nbData = result.readInt();
+data = {};
+for i=1:nbData
+ result.read(1);
+ vehID = result.readString();
+ result.read(1);
+ len = result.readDouble();
+ result.read(1);
+ entryTime = result.readDouble();
+ result.read(1);
+ leaveTime = result.readDouble();
+ result.read(1);
+ typeID = result.readString();
+ data = [data, vehID, len, entryTime, leaveTime, typeID];
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+inductionloop/subscribe.m b/tools/contributed/traci4matlab/+traci/+inductionloop/subscribe.m
new file mode 100644
index 0000000..6abc064
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+inductionloop/subscribe.m
@@ -0,0 +1,38 @@
+function subscribe(loopID, varargin)
+%subscribe Subscribe to induction loop variable.
+% subscribe(LOOPID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for
+% the maximum allowed interval.
+% subscribe(LOOPID,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS for the maximum allowed interval.
+% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
+% allowed end time.
+% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
+% END.
+% A call to this function clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global loopSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'inductionloop.subscribe';
+p.addRequired('loopID', at ischar)
+p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(loopID, varargin{:})
+loopID = p.Results.loopID;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+loopSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.inductionloop);
+
+loopSubscriptionResults.reset()
+traci.subscribe(constants.CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE,...
+ subscriptionBegin, subscriptionEnd, loopID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+inductionloop/subscribeContext.m b/tools/contributed/traci4matlab/+traci/+inductionloop/subscribeContext.m
new file mode 100644
index 0000000..5b6f576
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+inductionloop/subscribeContext.m
@@ -0,0 +1,46 @@
+function subscribeContext(loopID, domain, dist, varargin)
+%subscribeContext Subscribe to an induction loop's context variable.
+% subscribeContext(LOOPID,DOMAIN,DIST) Subscribe to the
+% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the
+% induction loop specified by LOOPID at a distance given by DIST, for the
+% maximum allowed interval. The type of objets that surround the
+% induction loop are defined in the DOMAIN parameter. Note that not all
+% the SUMO object types support the variable LAST_STEP_VEHICLE_NUMBER.
+% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS.
+% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
+% maximum allowed end time.
+% subscribeContext(...,END) Subscribe for the time interval defined by
+% BEGIN and END.
+% A call to this method clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global loopSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'inductionloop.subscribeContext';
+p.addRequired('loopID', at ischar)
+p.addRequired('domain', at ischar)
+p.addRequired('dist', at isnumeric)
+p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(loopID, domain, dist, varargin{:})
+loopID = p.Results.loopID;
+domain = p.Results.domain;
+dist = p.Results.dist;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+loopSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.inductionloop);
+
+loopSubscriptionResults.reset()
+traci.subscribeContext(constants.CMD_SUBSCRIBE_INDUCTIONLOOP_CONTEXT,...
+ subscriptionBegin, subscriptionEnd, loopID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+junction/getContextSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+junction/getContextSubscriptionResults.m
new file mode 100644
index 0000000..23bb470
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+junction/getContextSubscriptionResults.m
@@ -0,0 +1,26 @@
+function ContextSubscriptionResults = getContextSubscriptionResults(junctionID)
+%getContextSubscriptionResults Get the context subscription results for the
+% last time step.
+% contextSubscriptionResults = getContextSubscriptionResults(JUNCTIONID)
+% Returns the context subscription results for the last time step and the
+% given junction. If no junction id is given, all subscription results are
+% returned in a containers.Map data struccure. If the junction id is unknown
+% or the subscription did for any reason return no data, 'None' is
+% returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global junctionSubscriptionResults
+if isempty(junctionSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ junctionID=None;
+end
+ContextSubscriptionResults = junctionSubscriptionResults.getContext(junctionID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+junction/getIDList.m b/tools/contributed/traci4matlab/+traci/+junction/getIDList.m
new file mode 100644
index 0000000..820a1e6
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+junction/getIDList.m
@@ -0,0 +1,12 @@
+function IDList = getIDList()
+%getIDList Get the IDs of the junctions in the network.
+% IDList = getIDList() Returns a cell array of strings containing the IDs
+% of the junctions in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDList = traci.junction.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+junction/getPosition.m b/tools/contributed/traci4matlab/+traci/+junction/getPosition.m
new file mode 100644
index 0000000..e72931d
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+junction/getPosition.m
@@ -0,0 +1,12 @@
+function position = getPosition(junctionID)
+%getPosition Get the position of the junction.
+% position = getPosition(JUNCTIONID) Returns the coordinates of the
+% center of the junction.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+position = traci.junction.getUniversal(constants.VAR_POSITION, junctionID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+junction/getSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+junction/getSubscriptionResults.m
new file mode 100644
index 0000000..3596df4
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+junction/getSubscriptionResults.m
@@ -0,0 +1,26 @@
+function subscriptionResults = getSubscriptionResults(junctionID)
+%getSubscriptionResults Get the subscription results for the last time step.
+% subscriptionResults = getSubscriptionResults(JUNCTIONID) Returns the
+% subscription results for the last time step and the given junction. If no
+% junction id is given, all subscription results are returned in a
+% containers.Map data structure.
+% If the junction id is unknown or the subscription did for any reason return
+% no data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global junctionSubscriptionResults
+if isempty(junctionSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ junctionID = 'None';
+end
+
+subscriptionResults = junctionSubscriptionResults.get(junctionID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+junction/getUniversal.m b/tools/contributed/traci4matlab/+traci/+junction/getUniversal.m
new file mode 100644
index 0000000..c00c282
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+junction/getUniversal.m
@@ -0,0 +1,25 @@
+function returnedValue = getUniversal(varID, junctionID)
+%getUniversal An internal function to send the get command and read the
+%variable value.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global junctionSubscriptionResults
+
+if isempty(junctionSubscriptionResults)
+ returnValueFunc = traci.RETURN_VALUE_FUNC.junction;
+else
+ returnValueFunc = junctionSubscriptionResults.valueFunc;
+end
+
+% Prepare the outgoing message and read the response. The result variable
+% is a traci.Storage object
+result = traci.sendReadOneStringCmd(constants.CMD_GET_JUNCTION_VARIABLE,varID,junctionID);
+handleReturValueFunc = str2func(returnValueFunc(varID));
+
+% Use the proper method to read the variable of interest from the result
+returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+junction/subscribe.m b/tools/contributed/traci4matlab/+traci/+junction/subscribe.m
new file mode 100644
index 0000000..6cb2fd7
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+junction/subscribe.m
@@ -0,0 +1,38 @@
+function subscribe(junctionID, varargin)
+%subscribe Subscribe to junction variable.
+% subscribe(JUNCTIONID) Subscribe to the VAR_POSITION value for the
+% maximum allowed interval.
+% subscribe(JUNCTIONID,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS for the maximum allowed interval.
+% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
+% allowed end time.
+% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
+% END.
+% A call to this function clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global junctionSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'junction.subscribe';
+p.addRequired('junctionID', at ischar)
+p.addOptional('varIDs', {constants.VAR_POSITION}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(junctionID, varargin{:})
+junctionID = p.Results.junctionID;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+junctionSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.junction);
+
+junctionSubscriptionResults.reset()
+traci.subscribe(constants.CMD_SUBSCRIBE_JUNCTION_VARIABLE,...
+ subscriptionBegin, subscriptionEnd, junctionID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+junction/subscribeContext.m b/tools/contributed/traci4matlab/+traci/+junction/subscribeContext.m
new file mode 100644
index 0000000..8ec0fd3
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+junction/subscribeContext.m
@@ -0,0 +1,46 @@
+function subscribeContext(junctionID, domain, dist, varargin)
+%subscribeContext Subscribe to a junction's context variable.
+% subscribeContext(JUNCTIONID,DOMAIN,DIST) Subscribe to the
+% VAR_POSITION value of the SUMO objects that surround the junction
+% specified by JUNCTIONID at a distance given by DIST, for the maximum
+% allowed interval. The type of objets that surround the junction are
+% defined in the DOMAIN parameter. Note that not all the SUMO object
+% types support the variable VAR_POSITION.
+% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS.
+% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
+% maximum allowed end time.
+% subscribeContext(...,END) Subscribe for the time interval defined by
+% BEGIN and END.
+% A call to this method clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global junctionSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'junction.subscribeContext';
+p.addRequired('junctionID', at ischar)
+p.addRequired('domain', at ischar)
+p.addRequired('dist', at isnumeric)
+p.addOptional('varIDs', {constants.VAR_POSITION}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(junctionID, domain, dist, varargin{:})
+junctionID = p.Results.junctionID;
+domain = p.Results.domain;
+dist = p.Results.dist;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+junctionSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.junction);
+
+junctionSubscriptionResults.reset()
+traci.subscribeContext(constants.CMD_SUBSCRIBE_JUNCTION_CONTEXT,...
+ subscriptionBegin, subscriptionEnd, junctionID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getAllowed.m b/tools/contributed/traci4matlab/+traci/+lane/getAllowed.m
new file mode 100644
index 0000000..0a8dfb3
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getAllowed.m
@@ -0,0 +1,13 @@
+function allowed = getAllowed(laneID)
+%getAllowed Get the allowed vehicle classes in the lane.
+% allowed = getAllowed(LANEID) Returns a cell array of strings containing
+% the allowed vehicle classes. An empty cell array means all vehicles are
+% allowed.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+allowed = traci.lane.getUniversal(constants.LANE_ALLOWED, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getCO2Emission.m b/tools/contributed/traci4matlab/+traci/+lane/getCO2Emission.m
new file mode 100644
index 0000000..6e65413
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getCO2Emission.m
@@ -0,0 +1,12 @@
+function CO2Emission = getCO2Emission(laneID)
+%getCO2Emission Returns the CO2 emission on the given lane.
+% CO2Emission = getCO2Emission(LANEID) Returns the CO2 emission in mg for
+% the last time step on the given lane.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+CO2Emission = traci.lane.getUniversal(constants.VAR_CO2EMISSION, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getCOEmission.m b/tools/contributed/traci4matlab/+traci/+lane/getCOEmission.m
new file mode 100644
index 0000000..1d9270b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getCOEmission.m
@@ -0,0 +1,12 @@
+function COEmission = getCOEmission(laneID)
+%getCOEmission Returns the CO emission on the given lane.
+% COEmission = getCOEmission(LANEID) Returns the CO emission in mg for
+% the last time step on the given lane.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+COEmission = traci.lane.getUniversal(constants.VAR_COEMISSION, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getContextSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+lane/getContextSubscriptionResults.m
new file mode 100644
index 0000000..e23f6eb
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getContextSubscriptionResults.m
@@ -0,0 +1,26 @@
+function ContextSubscriptionResults = getContextSubscriptionResults(laneID)
+%getContextSubscriptionResults Get the context subscription results for the
+% last time step.
+% contextSubscriptionResults = getContextSubscriptionResults(LANEID)
+% Returns the context subscription results for the last time step and the
+% given lane. If no lane id is given, all subscription results are
+% returned in a containers.Map data struccure. If the lane id is unknown
+% or the subscription did for any reason return no data, 'None' is
+% returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global laneSubscriptionResults
+if isempty(laneSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ laneID=None;
+end
+ContextSubscriptionResults = laneSubscriptionResults.getContext(laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getDisallowed.m b/tools/contributed/traci4matlab/+traci/+lane/getDisallowed.m
new file mode 100644
index 0000000..9e5e1c6
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getDisallowed.m
@@ -0,0 +1,12 @@
+function disallowed = getDisallowed(laneID)
+%getDisallowed Get the disallowed vehicle classes in the lane.
+% disallowed = getDisallowed(LANEID) Returns a cell array of strings containing
+% the disallowed vehicle classes.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+disallowed = traci.lane.getUniversal(constants.LANE_DISALLOWED, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getEdgeID.m b/tools/contributed/traci4matlab/+traci/+lane/getEdgeID.m
new file mode 100644
index 0000000..2648233
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getEdgeID.m
@@ -0,0 +1,12 @@
+function edgeID = getEdgeID(laneID)
+%getEdgeID Returns the id of the edge the lane belongs to.
+% edgeID = getEdgeID(LANEID) Returns the id of the edge the lane belongs
+% to.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+edgeID = traci.lane.getUniversal(constants.LANE_EDGE_ID, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getFuelConsumption.m b/tools/contributed/traci4matlab/+traci/+lane/getFuelConsumption.m
new file mode 100644
index 0000000..c42af67
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getFuelConsumption.m
@@ -0,0 +1,12 @@
+function FuelConsumption = getFuelConsumption(laneID)
+%getFuelConsumption Get the fuel consumption on the lane.
+% fuelConsumption = getFuelConsumption(LANEID) Returns the fuel
+% consumption in ml for the last time step on the given lane.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+FuelConsumption = traci.lane.getUniversal(constants.VAR_FUELCONSUMPTION, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getHCEmission.m b/tools/contributed/traci4matlab/+traci/+lane/getHCEmission.m
new file mode 100644
index 0000000..3577122
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getHCEmission.m
@@ -0,0 +1,12 @@
+function HCEmission = getHCEmission(laneID)
+%getHCEmission Returns the HC emission on the given lane.
+% HCEmission = getCOEmission(LANEID) Returns the HC emission in mg for
+% the last time step on the given lane.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+HCEmission = traci.lane.getUniversal(constants.VAR_HCEMISSION, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getIDList.m b/tools/contributed/traci4matlab/+traci/+lane/getIDList.m
new file mode 100644
index 0000000..c0850c9
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getIDList.m
@@ -0,0 +1,12 @@
+function IDList = getIDList()
+%getIDList Get the IDs of the lanes in the network.
+% IDList = getIDList() Returns a cell array of strings containing the IDs
+% of the lanes in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDList = traci.lane.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getLastStepHaltingNumber.m b/tools/contributed/traci4matlab/+traci/+lane/getLastStepHaltingNumber.m
new file mode 100644
index 0000000..ee6df0e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getLastStepHaltingNumber.m
@@ -0,0 +1,13 @@
+function lastStepHaltingNumber = getLastStepHaltingNumber(laneID)
+%getLastStepHaltingNumber Get the number of halting vehicles.
+% lastStepHaltingNumber = getLastStepHaltingNumber(LANEID) Returns the
+% total number of halting vehicles for the last time step on the given
+% lane. A speed of less than 0.1 m/s is considered a halt.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepHaltingNumber = traci.lane.getUniversal(constants.LAST_STEP_VEHICLE_HALTING_NUMBER, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getLastStepLength.m b/tools/contributed/traci4matlab/+traci/+lane/getLastStepLength.m
new file mode 100644
index 0000000..0b3170e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getLastStepLength.m
@@ -0,0 +1,12 @@
+function lastStepLength = getLastStepLength(laneID)
+%getLastStepLength Get the mean vehicle length on the lane.
+% lastStepLength = getLastStepLength(LANEID) Returns the mean vehicle
+% length in m for the last time step on the given lane.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepLength = traci.lane.getUniversal(constants.LAST_STEP_LENGTH, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getLastStepMeanSpeed.m b/tools/contributed/traci4matlab/+traci/+lane/getLastStepMeanSpeed.m
new file mode 100644
index 0000000..43f4b11
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getLastStepMeanSpeed.m
@@ -0,0 +1,12 @@
+function lastStepMeanSpeed = getLastStepMeanSpeed(laneID)
+%getLastStepMeanSpeed Get the average speed on the lane.
+% lastStepMeanSpeed = getLastStepMeanSpeed(LANEID) Returns the average
+% speed in m/s for the last time step on the given lane.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepMeanSpeed = traci.lane.getUniversal(constants.LAST_STEP_MEAN_SPEED, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getLastStepOccupancy.m b/tools/contributed/traci4matlab/+traci/+lane/getLastStepOccupancy.m
new file mode 100644
index 0000000..ad7bf03
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getLastStepOccupancy.m
@@ -0,0 +1,12 @@
+function lastStepOccupancy = getLastStepOccupancy(laneID)
+%getLastStepOccupancy Get the percentage of occupation on the lane.
+% lastStepOccupancy = getLastStepOccupancy(LANEID) Returns the occupancy
+% in percentage for the last time step on the given lane.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepOccupancy = traci.lane.getUniversal(constants.LAST_STEP_OCCUPANCY, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getLastStepVehicleIDs.m b/tools/contributed/traci4matlab/+traci/+lane/getLastStepVehicleIDs.m
new file mode 100644
index 0000000..0674fa6
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getLastStepVehicleIDs.m
@@ -0,0 +1,13 @@
+function lastStepVehicleIDs = getLastStepVehicleIDs(laneID)
+%getLastStepVehicleIDs Get the IDs of the vehicles in the lane.
+% lastStepVehicleIDs = getLastStepVehicleIDs(LANEID) Returns cell array
+% of strings containing the IDs of the vehicles for the last time step
+% on the given lane.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepVehicleIDs = traci.lane.getUniversal(constants.LAST_STEP_VEHICLE_ID_LIST, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getLastStepVehicleNumber.m b/tools/contributed/traci4matlab/+traci/+lane/getLastStepVehicleNumber.m
new file mode 100644
index 0000000..831fbff
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getLastStepVehicleNumber.m
@@ -0,0 +1,13 @@
+function lastStepVehicleNumber = getLastStepVehicleNumber(laneID)
+%getLastStepVehicleNumber Get the number vehicles in the lane.
+% lastStepVehicleNumber = getLastStepVehicleNumber(LANEID) Returns the
+% total number of vehicles for the last time step on the given lane.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepVehicleNumber = traci.lane.getUniversal(...
+ constants.LAST_STEP_VEHICLE_NUMBER, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getLength.m b/tools/contributed/traci4matlab/+traci/+lane/getLength.m
new file mode 100644
index 0000000..df17d19
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getLength.m
@@ -0,0 +1,11 @@
+function length = getLength(laneID)
+%getLength Returns the length of the lane in m.
+% length = getLength(LANEID) Returns the length of the lane in m.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+length = traci.lane.getUniversal(constants.VAR_LENGTH, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getLinkNumber.m b/tools/contributed/traci4matlab/+traci/+lane/getLinkNumber.m
new file mode 100644
index 0000000..aba2026
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getLinkNumber.m
@@ -0,0 +1,12 @@
+function linkNumber = getLinkNumber(laneID)
+%getLinkNumber Returns the number of connections to successive lanes.
+% linkNumber = getLinkNumber(LANEID) Returns the number of connections to
+% successive lanes.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+linkNumber = traci.lane.getUniversal(constants.LANE_LINK_NUMBER, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getLinks.m b/tools/contributed/traci4matlab/+traci/+lane/getLinks.m
new file mode 100644
index 0000000..5f4d61a
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getLinks.m
@@ -0,0 +1,13 @@
+function links = getLinks(laneID)
+%getLinks Returns a cell containing ids of successor lanes together with
+%priority, open and foe.
+% links = getLinks(LANEID) Returns a cell containing ids of successor
+% lanes together with priority, open and foe.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+links = traci.lane.getUniversal(constants.LANE_LINKS, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getMaxSpeed.m b/tools/contributed/traci4matlab/+traci/+lane/getMaxSpeed.m
new file mode 100644
index 0000000..a467a67
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getMaxSpeed.m
@@ -0,0 +1,12 @@
+function maxSpeed = getMaxSpeed(laneID)
+% getMaxSpeed Maximum allowed speed in the lane.
+% maxSpeed = getMaxSpeed(LANEID) Returns the maximum allowed speed on the
+% lane in m/s.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+maxSpeed = traci.lane.getUniversal(constants.VAR_MAXSPEED, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getNOxEmission.m b/tools/contributed/traci4matlab/+traci/+lane/getNOxEmission.m
new file mode 100644
index 0000000..df4f91c
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getNOxEmission.m
@@ -0,0 +1,12 @@
+function NOxEmission = getNOxEmission(laneID)
+%getNOxEmission Get the NOx emission in the lane.
+% NOxEmission = getNOxEmission(LANEID) Returns the NOx emission in mg for
+% the last time step on the given lane.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+NOxEmission = traci.lane.getUniversal(constants.VAR_NOXEMISSION, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getNoiseEmission.m b/tools/contributed/traci4matlab/+traci/+lane/getNoiseEmission.m
new file mode 100644
index 0000000..2bb6510
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getNoiseEmission.m
@@ -0,0 +1,12 @@
+function noiseEmission = getNoiseEmission(laneID)
+%getNoiseEmission Get the noise emission in the lane.
+% noiseEmission = getNoiseEmission(LANEID) Returns the noise emission in
+% db for the last time step on the given lane.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+noiseEmission = traci.lane.getUniversal(constants.VAR_NOISEEMISSION, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getPMxEmission.m b/tools/contributed/traci4matlab/+traci/+lane/getPMxEmission.m
new file mode 100644
index 0000000..7005229
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getPMxEmission.m
@@ -0,0 +1,12 @@
+function PMxEmission = getPMxEmission(laneID)
+%getPmxEmission Get the particular matter emission in the lane.
+% pmxEmission = getPmxEmission(LANEID) Returns the particular matter
+% emission in mg for the last time step on the given lane.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+PMxEmission = traci.lane.getUniversal(constants.VAR_PMXEMISSION, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getShape.m b/tools/contributed/traci4matlab/+traci/+lane/getShape.m
new file mode 100644
index 0000000..2b55e48
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getShape.m
@@ -0,0 +1,12 @@
+function shape = getShape(laneID)
+%getShape Get the shape of the lane.
+% shape = getShape(LANEID) Returns a list of 2D positions (cartesian)
+% describing the geometry of the given lane.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+shape = traci.lane.getUniversal(constants.VAR_SHAPE, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+lane/getSubscriptionResults.m
new file mode 100644
index 0000000..5899d2e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getSubscriptionResults.m
@@ -0,0 +1,26 @@
+function subscriptionResults = getSubscriptionResults(laneID)
+%getSubscriptionResults Get the subscription results for the last time step.
+% subscriptionResults = getSubscriptionResults(LANEID) Returns the
+% subscription results for the last time step and the given lane. If no
+% lane id is given, all subscription results are returned in a
+% containers.Map data structure.
+% If the lane id is unknown or the subscription did for any reason return
+% no data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global laneSubscriptionResults
+if isempty(laneSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ laneID = 'None';
+end
+
+subscriptionResults = laneSubscriptionResults.get(laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getTraveltime.m b/tools/contributed/traci4matlab/+traci/+lane/getTraveltime.m
new file mode 100644
index 0000000..7e9b3c9
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getTraveltime.m
@@ -0,0 +1,12 @@
+function traveltime = getTraveltime(laneID)
+%getTraveltime Get estimated travel time in the lane.
+% traveltime = getTraveltime(LANEID) Returns the estimated travel time in
+% seconds for the last time step on the given lane.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traveltime = traci.lane.getUniversal(constants.VAR_CURRENT_TRAVELTIME, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getUniversal.m b/tools/contributed/traci4matlab/+traci/+lane/getUniversal.m
new file mode 100644
index 0000000..055e36e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getUniversal.m
@@ -0,0 +1,25 @@
+function returnedValue = getUniversal(varID, laneID)
+%getUniversal An internal function to send the get command and read the
+%variable value.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global laneSubscriptionResults
+
+if isempty(laneSubscriptionResults)
+ returnValueFunc = traci.RETURN_VALUE_FUNC.lane;
+else
+ returnValueFunc = laneSubscriptionResults.valueFunc;
+end
+
+% Prepare the outgoing message and read the response. The result variable
+% is a traci.Storage object
+result = traci.sendReadOneStringCmd(constants.CMD_GET_LANE_VARIABLE,varID,laneID);
+handleReturValueFunc = str2func(returnValueFunc(varID));
+
+% Use the proper method to read the variable of interest from the result
+returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/getWidth.m b/tools/contributed/traci4matlab/+traci/+lane/getWidth.m
new file mode 100644
index 0000000..35d654a
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/getWidth.m
@@ -0,0 +1,11 @@
+function width = getWidth(laneID)
+%getWidth Returns the width of the lane in m.
+% width = getWidth(LANEID) Returns the width of the lane in m.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+width = traci.lane.getUniversal(constants.VAR_WIDTH, laneID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/readLinks.m b/tools/contributed/traci4matlab/+traci/+lane/readLinks.m
new file mode 100644
index 0000000..c98ea38
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/readLinks.m
@@ -0,0 +1,30 @@
+function links = readLinks(result)
+%readLinks Internal function to read information about the links.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+result.read(5) % Type Compound, Length
+nbLinks = result.readInt();
+links = {};
+for i=1:nbLinks
+ result.read(1); % Type String
+ approachedLane = result.readString();
+ result.read(1); % Type String
+ approachedInternal = result.readString();
+ result.read(1); % Type Byte
+ hasPrio = result.read(1);
+ result.read(1); % Type Byte
+ isOpen = result.read(1);
+ result.read(1); % Type Byte
+ hasFoe = result.read(1);
+ result.read(1); % Type String
+ state = result.readString();
+ result.read(1); % Type String
+ direction = result.readString();
+ result.read(1); % Type Float
+ len = result.readDouble();
+ links = [links approachedLane, hasPrio, isOpen, hasFoe];
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/setAllowed.m b/tools/contributed/traci4matlab/+traci/+lane/setAllowed.m
new file mode 100644
index 0000000..a6c52b5
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/setAllowed.m
@@ -0,0 +1,22 @@
+function setAllowed(laneID, allowedClasses)
+import traci.constants
+%setAllowed Set the allowed vehicle classes in the lane.
+% setAllowed(LANEID,ALLOWEDCLASSES) Sets a list of allowed vehicle
+% classes contained in a cell array of strings. Setting an empty list
+% means all vehicles are allowed.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global message
+traci.beginMessage(constants.CMD_SET_LANE_VARIABLE, constants.LANE_ALLOWED,...
+laneID, 1+4+sum(cellfun('length', allowedClasses))+4*length(allowedClasses));
+message.string = [message.string uint8(sscanf(constants.TYPE_STRINGLIST,'%x')) ...
+ traci.packInt32(length(allowedClasses))];
+for i=1:length(allowedClasses)
+ message.string = [message.string traci.packInt32(length(...
+ allowedClasses{i})) uint8(allowedClasses{i})];
+end
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/setDisallowed.m b/tools/contributed/traci4matlab/+traci/+lane/setDisallowed.m
new file mode 100644
index 0000000..032983b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/setDisallowed.m
@@ -0,0 +1,21 @@
+function setDisallowed(laneID, disallowedClasses)
+%setDisallowed Set the disallowed vehicle classes in the lane.
+% setDisallowed(LANEID,DISALLOWEDCLASSES) Sets a list of disallowed
+% vehicle classes contained in a cell array of strings.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_LANE_VARIABLE, constants.LANE_DISALLOWED,...
+laneID, 1+4+sum(cellfun('length', disallowedClasses))+4*length(disallowedClasses));
+message.string = [message.string uint8(sscanf(constants.TYPE_STRINGLIST,'%x')) ...
+ traci.packInt32(length(disallowedClasses))];
+for i=1:length(disallowedClasses)
+ message.string = [message.string traci.packInt32(length(...
+ disallowedClasses{i})) uint8(disallowedClasses{i})];
+end
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/setLength.m b/tools/contributed/traci4matlab/+traci/+lane/setLength.m
new file mode 100644
index 0000000..65a5916
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/setLength.m
@@ -0,0 +1,11 @@
+function setLength(laneID, len)
+%setLength Sets the length of the lane in m.
+% setLength(LANEID,LENGTH) Sets the length of the lane in m.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_LANE_VARIABLE, constants.VAR_LENGTH, laneID, len)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/setMaxSpeed.m b/tools/contributed/traci4matlab/+traci/+lane/setMaxSpeed.m
new file mode 100644
index 0000000..f008dea
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/setMaxSpeed.m
@@ -0,0 +1,12 @@
+function setMaxSpeed(laneID, speed)
+%setMaxSpeed Sets a new maximum allowed speed on the lane in m/s.
+% setMaxSpeed(LANEID,SPEED) Sets a new maximum allowed speed on the lane
+% in m/s.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_LANE_VARIABLE, constants.VAR_MAXSPEED, laneID, speed)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/subscribe.m b/tools/contributed/traci4matlab/+traci/+lane/subscribe.m
new file mode 100644
index 0000000..0e00ec1
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/subscribe.m
@@ -0,0 +1,38 @@
+function subscribe(laneID, varargin)
+%subscribe Subscribe to lane variable.
+% subscribe(LANEID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for
+% the maximum allowed interval.
+% subscribe(LANEID,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS for the maximum allowed interval.
+% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
+% allowed end time.
+% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
+% END.
+% A call to this function clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global laneSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'lane.subscribe';
+p.addRequired('laneID', at ischar)
+p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(laneID, varargin{:})
+laneID = p.Results.laneID;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+laneSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.lane);
+
+laneSubscriptionResults.reset()
+traci.subscribe(constants.CMD_SUBSCRIBE_LANE_VARIABLE,...
+ subscriptionBegin, subscriptionEnd, laneID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+lane/subscribeContext.m b/tools/contributed/traci4matlab/+traci/+lane/subscribeContext.m
new file mode 100644
index 0000000..83b2511
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+lane/subscribeContext.m
@@ -0,0 +1,47 @@
+function subscribeContext(laneID, domain, dist, varargin)
+%subscribeContext Subscribe to a lane's context variable.
+% subscribeContext(LANEID,DOMAIN,DIST) Subscribe to the
+% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the
+% lane specified by LANEID at a distance given by DIST, for the maximum
+% allowed interval. The type of objets that surround the lane are defined
+% in the DOMAIN parameter. Note that not all the SUMO object types
+% support the variable LAST_STEP_VEHICLE_NUMBER.
+% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS.
+% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
+% maximum allowed end time.
+% subscribeContext(...,END) Subscribe for the time interval defined by
+% BEGIN and END.
+% A call to this method clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global laneSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'lane.subscribeContext';
+p.addRequired('laneID', at ischar)
+p.addRequired('domain', at ischar)
+p.addRequired('dist', at isnumeric)
+p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(laneID, domain, dist, varargin{:})
+laneID = p.Results.laneID;
+domain = p.Results.domain;
+dist = p.Results.dist;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+laneSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.lane);
+
+
+laneSubscriptionResults.reset()
+traci.subscribeContext(constants.CMD_SUBSCRIBE_LANE_CONTEXT,...
+ subscriptionBegin, subscriptionEnd, laneID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+multientryexit/getContextSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+multientryexit/getContextSubscriptionResults.m
new file mode 100644
index 0000000..c565799
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+multientryexit/getContextSubscriptionResults.m
@@ -0,0 +1,27 @@
+function ContextSubscriptionResults = getContextSubscriptionResults(detID)
+%getContextSubscriptionResults Get the context subscription results for the
+% last time step.
+% contextSubscriptionResults = getContextSubscriptionResults(DETID)
+% Returns the context subscription results for the last time step and the
+% given multi-entry/multi-exit detector. If no multi-entry/multi-exit
+% detector id is given, all subscription results are returned in a
+% containers.Map data struccure. If the multi-entry/multi-exit detector
+% id is unknown or the subscription did for any reason return no data,
+% 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global detSubscriptionResults
+if isempty(detSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the context variable'));
+end
+if nargin < 1
+ detID=None;
+end
+ContextSubscriptionResults = detSubscriptionResults.getContext(detID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+multientryexit/getIDList.m b/tools/contributed/traci4matlab/+traci/+multientryexit/getIDList.m
new file mode 100644
index 0000000..cdd3afe
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+multientryexit/getIDList.m
@@ -0,0 +1,12 @@
+function IDList = getIDList()
+%getIDList Get the IDs of the multi-entry/multi-exit detectors in the network.
+% IDList = getIDList() Returns a cell array of strings containing the IDs
+% of the multi-entry/multi-exit detectors in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDList = traci.multientryexit.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+multientryexit/getLastStepHaltingNumber.m b/tools/contributed/traci4matlab/+traci/+multientryexit/getLastStepHaltingNumber.m
new file mode 100644
index 0000000..d03da24
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+multientryexit/getLastStepHaltingNumber.m
@@ -0,0 +1,14 @@
+function lastStepHaltingNumber = getLastStepHaltingNumber(detID)
+%getLastStepHaltingNumber Get the number of halting vehicles.
+% lastStepHaltingNumber = getLastStepHaltingNumber(DETID) Returns the
+% total number of halting vehicles for the last time step on the given
+% multi-entry/multi-exit detector. A speed of less than 0.1 m/s is
+% considered a halt.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepHaltingNumber = traci.multientryexit.getUniversal(constants.LAST_STEP_VEHICLE_HALTING_NUMBER, detID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+multientryexit/getLastStepMeanSpeed.m b/tools/contributed/traci4matlab/+traci/+multientryexit/getLastStepMeanSpeed.m
new file mode 100644
index 0000000..17a12b4
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+multientryexit/getLastStepMeanSpeed.m
@@ -0,0 +1,13 @@
+function lastStepMeanSpeed = getLastStepMeanSpeed(detID)
+%getLastStepMeanSpeed Get the average speed.
+% lastStepMeanSpeed = getLastStepMeanSpeed(DETID) Returns the average
+% speed in m/s for the last time step on the given multi-entry/multi-exit
+% detector.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepMeanSpeed = traci.multientryexit.getUniversal(constants.LAST_STEP_MEAN_SPEED, detID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+multientryexit/getLastStepVehicleIDs.m b/tools/contributed/traci4matlab/+traci/+multientryexit/getLastStepVehicleIDs.m
new file mode 100644
index 0000000..d17cd1c
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+multientryexit/getLastStepVehicleIDs.m
@@ -0,0 +1,13 @@
+function lastStepVehicleIDs = getLastStepVehicleIDs(detID)
+%getLastStepVehicleIDs Get the IDs of the vehicles.
+% lastStepVehicleIDs = getLastStepVehicleIDs(DETID) Returns cell array
+% of strings containing the IDs of the vehicles for the last time step
+% on the given multi-entry/multi-exit detector.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepVehicleIDs = traci.multientryexit.getUniversal(constants.LAST_STEP_VEHICLE_ID_LIST, detID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+multientryexit/getLastStepVehicleNumber.m b/tools/contributed/traci4matlab/+traci/+multientryexit/getLastStepVehicleNumber.m
new file mode 100644
index 0000000..259ceac
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+multientryexit/getLastStepVehicleNumber.m
@@ -0,0 +1,13 @@
+function lastStepVehicleNumber = getLastStepVehicleNumber(detID)
+%getLastStepVehicleNumber Get the number vehicles.
+% lastStepVehicleNumber = getLastStepVehicleNumber(DETID) Returns the
+% total number of vehicles for the last time step on the given
+% multi-entry/multi-exit detector.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lastStepVehicleNumber = traci.multientryexit.getUniversal(constants.LAST_STEP_VEHICLE_NUMBER, detID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+multientryexit/getSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+multientryexit/getSubscriptionResults.m
new file mode 100644
index 0000000..340700b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+multientryexit/getSubscriptionResults.m
@@ -0,0 +1,27 @@
+function subscriptionResults = getSubscriptionResults(detID)
+%getSubscriptionResults Get the subscription results for the last time step.
+% subscriptionResults = getSubscriptionResults(DETID) Returns the
+% subscription results for the last time step and the given
+% multi-entry/multi-exit detector. If no multi-entry/multi-exit detector
+% id is given, all subscription results are returned in a containers.Map
+% data structure.
+% If the multi-entry/multi-exit detector id is unknown or the subscription did for any reason return
+% no data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global detSubscriptionResults
+if isempty(detSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ detID = 'None';
+end
+
+subscriptionResults = detSubscriptionResults.get(detID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+multientryexit/getUniversal.m b/tools/contributed/traci4matlab/+traci/+multientryexit/getUniversal.m
new file mode 100644
index 0000000..4d544f5
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+multientryexit/getUniversal.m
@@ -0,0 +1,25 @@
+function returnedValue = getUniversal(varID, detID)
+%getUniversal An internal function to send the get command and read the
+%variable value.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global detSubscriptionResults
+
+if isempty(detSubscriptionResults)
+ returnValueFunc = traci.RETURN_VALUE_FUNC.multientryexit;
+else
+ returnValueFunc = detSubscriptionResults.valueFunc;
+end
+
+% Prepare the outgoing message and read the response. The result variable
+% is a traci.Storage object
+result = traci.sendReadOneStringCmd(constants.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE,varID,detID);
+handleReturValueFunc = str2func(returnValueFunc(varID));
+
+% Use the proper method to read the variable of interest from the result
+returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+multientryexit/subscribe.m b/tools/contributed/traci4matlab/+traci/+multientryexit/subscribe.m
new file mode 100644
index 0000000..1750337
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+multientryexit/subscribe.m
@@ -0,0 +1,39 @@
+function subscribe(detID, varargin)
+%subscribe Subscribe to multi-entry/multi-exit detector variable.
+% subscribe(DETID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for
+% the maximum allowed interval.
+% subscribe(DETID,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS for the maximum allowed interval.
+% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
+% allowed end time.
+% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
+% END.
+% A call to this function clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global detSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'det.subscribe';
+p.addRequired('detID', at ischar)
+p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(detID, varargin{:})
+detID = p.Results.detID;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+detSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.multientryexit);
+
+
+detSubscriptionResults.reset()
+traci.subscribe(constants.CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE,...
+ subscriptionBegin, subscriptionEnd, detID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+multientryexit/subscribeContext.m b/tools/contributed/traci4matlab/+traci/+multientryexit/subscribeContext.m
new file mode 100644
index 0000000..bbc2a5a
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+multientryexit/subscribeContext.m
@@ -0,0 +1,48 @@
+function subscribeContext(detID, domain, dist, varargin)
+%subscribeContext Subscribe to a multi-entry/multi-exit detector's context
+% variable.
+% subscribeContext(EDGEID,DOMAIN,DIST) Subscribe to the
+% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the
+% multi-entry/multi-exit detector specified by EDGEID at a distance given
+% by DIST, for the maximum allowed interval. The type of objets that
+% surround the multi-entry/multi-exit detector are defined in the DOMAIN
+% parameter. Note that not all the SUMO object types support the variable
+% LAST_STEP_VEHICLE_NUMBER.
+% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS.
+% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
+% maximum allowed end time.
+% subscribeContext(...,END) Subscribe for the time interval defined by
+% BEGIN and END.
+% A call to this method clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global detSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'multientryexit.subscribeContext';
+p.addRequired('detID', at ischar)
+p.addRequired('domain', at ischar)
+p.addRequired('dist', at isnumeric)
+p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(detID, domain, dist, varargin{:})
+detID = p.Results.detID;
+domain = p.Results.domain;
+dist = p.Results.dist;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+detSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.multientryexit);
+
+detSubscriptionResults.reset()
+traci.subscribeContext(constants.CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT,...
+ subscriptionBegin, subscriptionEnd, detID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getAngle.m b/tools/contributed/traci4matlab/+traci/+person/getAngle.m
new file mode 100644
index 0000000..95779b1
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getAngle.m
@@ -0,0 +1,12 @@
+function angle = getAngle(personID)
+%getAngle Get the angle of the person.
+% angle = getAngle(PERSONID) Returns the angle in degrees of the named
+% person within the last step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+angle = traci.person.getUniversal(constants.VAR_ANGLE, personID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getColor.m b/tools/contributed/traci4matlab/+traci/+person/getColor.m
new file mode 100644
index 0000000..3f25d54
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getColor.m
@@ -0,0 +1,11 @@
+function color = getColor(personID)
+%getColor Get the color of the person.
+% color = getColor(PERSONID) Returns the person's rgba color.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+color = traci.person.getUniversal(constants.VAR_COLOR, personID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getContextSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+person/getContextSubscriptionResults.m
new file mode 100644
index 0000000..6b7b86c
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getContextSubscriptionResults.m
@@ -0,0 +1,26 @@
+function ContextSubscriptionResults = getContextSubscriptionResults(personID)
+%getContextSubscriptionResults Get the context subscription results for the
+% last time step.
+% contextSubscriptionResults = getContextSubscriptionResults(PERSONID)
+% Returns the context subscription results for the last time step and the
+% given person. If no person id is given, all subscription results are
+% returned in a containers.Map data struccure. If the person id is unknown
+% or the subscription did for any reason return no data, 'None' is
+% returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global personSubscriptionResults
+if isempty(personSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ personID=None;
+end
+ContextSubscriptionResults = personSubscriptionResults.getContext(personID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getIDCount.m b/tools/contributed/traci4matlab/+traci/+person/getIDCount.m
new file mode 100644
index 0000000..c8cf5dc
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getIDCount.m
@@ -0,0 +1,10 @@
+function IDCount = getIDCount()
+%getIDCount Get the number of persons in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDCount = traci.person.getUniversal(constants.ID_COUNT, '');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getIDList.m b/tools/contributed/traci4matlab/+traci/+person/getIDList.m
new file mode 100644
index 0000000..92ad63b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getIDList.m
@@ -0,0 +1,12 @@
+function IDList = getIDList()
+%getIDList Get the IDs of the persons in the network.
+% IDList = getIDList() Returns a cell array of strings containing the IDs
+% of the persons in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDList = traci.person.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getLanePosition.m b/tools/contributed/traci4matlab/+traci/+person/getLanePosition.m
new file mode 100644
index 0000000..d3ddb2b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getLanePosition.m
@@ -0,0 +1,12 @@
+function lanePosition = getLanePosition(personID)
+%getLanePosition Get the position of the person along the lane.
+% lanePosition = getLanePosition(PERSONID) Returns the position of the
+% person along the lane measured in m.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lanePosition = traci.person.getUniversal(constants.VAR_LANEPOSITION, personID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getLength.m b/tools/contributed/traci4matlab/+traci/+person/getLength.m
new file mode 100644
index 0000000..6efeffc
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getLength.m
@@ -0,0 +1,11 @@
+function length = getLength(personID)
+%getLength Returns the length in m of the given person.
+% length = getLength(PERSONID) Returns the length in m of the given person.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+length = traci.person.getUniversal(constants.VAR_LENGTH, personID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getMinGap.m b/tools/contributed/traci4matlab/+traci/+person/getMinGap.m
new file mode 100644
index 0000000..07ac97d
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getMinGap.m
@@ -0,0 +1,12 @@
+function minGap = getMinGap(personID)
+%getMinGap Returns the gap to front person.
+% minGap = getMinGap(PERSONID) Returns the offset (gap to front person if
+% halting) of this person.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+minGap = traci.person.getUniversal(constants.VAR_MINGAP, personID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getNextEdge.m b/tools/contributed/traci4matlab/+traci/+person/getNextEdge.m
new file mode 100644
index 0000000..c692fff
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getNextEdge.m
@@ -0,0 +1,13 @@
+function nextEdge = getNextEdge(personID)
+%getNextEdge Returns next edge on the persons route.
+% nextEdge = getNextEdge(PERSONID) returns the next edge on the persons
+% route (including crossing and walkingareas). If there is no further
+% edge or the person is in another stage, returns the empty string.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+nextEdge = traci.person.getUniversal(constants.VAR_NEXT_EDGE, personID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getPosition.m b/tools/contributed/traci4matlab/+traci/+person/getPosition.m
new file mode 100644
index 0000000..b4dde44
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getPosition.m
@@ -0,0 +1,12 @@
+function position = getPosition(personID)
+%getPosition Returns the position of the named person within the last step.
+% position = getPosition(PERSONID) Returns the x,y position of the named
+% person within the last step [m,m].
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+position = traci.person.getUniversal(constants.VAR_POSITION, personID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getPosition3D.m b/tools/contributed/traci4matlab/+traci/+person/getPosition3D.m
new file mode 100644
index 0000000..a4bb772
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getPosition3D.m
@@ -0,0 +1,12 @@
+function position = getPosition3D(personID)
+%getPosition3D Returns the position of the named person within the last step.
+% position = getPosition3D(PERSONID) Returns the position of the named
+% person within the last step [m,m,m].
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+position = traci.person.getUniversal(constants.VAR_POSITION3D, personID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getRoadID.m b/tools/contributed/traci4matlab/+traci/+person/getRoadID.m
new file mode 100644
index 0000000..7dd7a33
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getRoadID.m
@@ -0,0 +1,12 @@
+function roadID = getRoadID(personID)
+%getRoadID Returns the edge the person was at in last step.
+% roadID = getRoadID(PERSONID) Returns the id of the edge the named person
+% was at within the last step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+roadID = traci.person.getUniversal(constants.VAR_ROAD_ID, personID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getSpeed.m b/tools/contributed/traci4matlab/+traci/+person/getSpeed.m
new file mode 100644
index 0000000..72426d5
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getSpeed.m
@@ -0,0 +1,12 @@
+function speed = getSpeed(personID)
+%getSpeed Get the person speed.
+% speed = getSpeed(PERSONID) Returns the speed in m/s of the named person
+% within the last step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+speed = traci.person.getUniversal(constants.VAR_SPEED, personID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+person/getSubscriptionResults.m
new file mode 100644
index 0000000..30f411a
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getSubscriptionResults.m
@@ -0,0 +1,26 @@
+function subscriptionResults = getSubscriptionResults(personID)
+%getSubscriptionResults Get the subscription results for the last time step.
+% subscriptionResults = getSubscriptionResults(PERSONID) Returns the
+% subscription results for the last time step and the given person. If no
+% person id is given, all subscription results are returned in a
+% containers.Map data structure.
+% If the person id is unknown or the subscription did for any reason return
+% no data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global personSubscriptionResults
+if isempty(personSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ personID = 'None';
+end
+
+subscriptionResults = personSubscriptionResults.get(personID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getTypeID.m b/tools/contributed/traci4matlab/+traci/+person/getTypeID.m
new file mode 100644
index 0000000..ced91ed
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getTypeID.m
@@ -0,0 +1,12 @@
+function typeID = getTypeID(personID)
+%getTypeID Returns the id of the type of the named person.
+% typeID = getTypeID(PERSONID) Returns the id of the type of the named
+% person.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+typeID = traci.person.getUniversal(constants.VAR_TYPE, personID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getUniversal.m b/tools/contributed/traci4matlab/+traci/+person/getUniversal.m
new file mode 100644
index 0000000..a9ddfc5
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getUniversal.m
@@ -0,0 +1,25 @@
+function returnedValue = getUniversal(varID, personID)
+%getUniversal An internal function to send the get command and read the
+%variable value.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global personSubscriptionResults
+
+if isempty(personSubscriptionResults)
+ returnValueFunc = traci.RETURN_VALUE_FUNC.person;
+else
+ returnValueFunc = personSubscriptionResults.valueFunc;
+end
+
+% Prepare the outgoing message and read the response. The result variable
+% is a traci.Storage object
+result = traci.sendReadOneStringCmd(constants.CMD_GET_PERSON_VARIABLE,varID,personID);
+handleReturValueFunc = str2func(returnValueFunc(varID));
+
+% Use the proper method to read the variable of interest from the result
+returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getWaitingTime.m b/tools/contributed/traci4matlab/+traci/+person/getWaitingTime.m
new file mode 100644
index 0000000..108c9c0
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getWaitingTime.m
@@ -0,0 +1,14 @@
+function waitingTime = getWaitingTime(personID)
+%getWaitingTime Returns the waiting time of the given person.
+% waitingTime = getWaitingTime(PERSONID) The waiting time of a person is
+% defined as the time (in seconds) spent with a speed below 0.1m/s since
+% the last time it was faster than 0.1m/s. (basically, the waiting time
+% of a person is reset to 0 every time it moves).
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+waitingTime = traci.person.getUniversal(constants.VAR_WAITING_TIME, personID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/getWidth.m b/tools/contributed/traci4matlab/+traci/+person/getWidth.m
new file mode 100644
index 0000000..8bfc0e7
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/getWidth.m
@@ -0,0 +1,11 @@
+function width = getWidth(personID)
+%getWidth Returns the width in m of this person.
+% width = getWidth(PERSONID) Returns the width in m of this person.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+width = traci.person.getUniversal(constants.VAR_WIDTH, personID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/subscribe.m b/tools/contributed/traci4matlab/+traci/+person/subscribe.m
new file mode 100644
index 0000000..ee9095e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/subscribe.m
@@ -0,0 +1,38 @@
+function subscribe(personID, varargin)
+%subscribe Subscribe to person variable.
+% subscribe(PERSONID) Subscribe to the VAR_ROAD_ID and VAR_LANEPOSITION
+% values for the maximum allowed interval.
+% subscribe(PERSONID,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS for the maximum allowed interval.
+% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
+% allowed end time.
+% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
+% END.
+% A call to this function clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global personSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'person.subscribe';
+p.addRequired('personID', at ischar)
+p.addOptional('varIDs', {constants.VAR_ROAD_ID, constants.VAR_LANEPOSITION}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(personID, varargin{:})
+personID = p.Results.personID;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+personSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.person);
+
+personSubscriptionResults.reset()
+traci.subscribe(constants.CMD_SUBSCRIBE_PERSON_VARIABLE,...
+ subscriptionBegin, subscriptionEnd, personID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+person/subscribeContext.m b/tools/contributed/traci4matlab/+traci/+person/subscribeContext.m
new file mode 100644
index 0000000..78326ff
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+person/subscribeContext.m
@@ -0,0 +1,46 @@
+function subscribeContext(personID, domain, dist, varargin)
+%subscribeContext Subscribe to a person's context variable.
+% subscribeContext(PERSONID,DOMAIN,DIST) Subscribe to the VAR_ROAD_ID and
+% VAR_LANEPOSITION value of the SUMO objects that surround the person
+% specified by PERSONID at a distance given by DIST, for the maximum allowed
+% interval. The type of objets that surround the person are defined in
+% the DOMAIN parameter. Note that not all the SUMO object types support
+% the variables VAR_ROAD_ID and VAR_LANEPOSITION.
+% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS.
+% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
+% maximum allowed end time.
+% subscribeContext(...,END) Subscribe for the time interval defined by
+% BEGIN and END.
+% A call to this method clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global personSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'person.subscribeContext';
+p.addRequired('personID', at ischar)
+p.addRequired('domain', at ischar)
+p.addRequired('dist', at isnumeric)
+p.addOptional('varIDs', {constants.VAR_ROAD_ID, constants.VAR_LANEPOSITION}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(personID, domain, dist, varargin{:})
+personID = p.Results.personID;
+domain = p.Results.domain;
+dist = p.Results.dist;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+personSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.person);
+
+personSubscriptionResults.reset()
+traci.subscribeContext(constants.CMD_SUBSCRIBE_PERSON_CONTEXT,...
+ subscriptionBegin, subscriptionEnd, personID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+poi/add.m b/tools/contributed/traci4matlab/+traci/+poi/add.m
new file mode 100644
index 0000000..2bcb6f3
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+poi/add.m
@@ -0,0 +1,36 @@
+function add(poiID, x, y, color, poiType, layer)
+%add Add a point of interest (poi) to the SUMO network.
+% add(POIID,X,Y,COLOR) Adds a poi with the id POIID to the coordinates
+% X and Y, with the specified color. COLOR is a four-element vector whose
+% elements range from 0 to 255, they represent the R, G, B and Alpha
+% (unused) components of the color.
+% add(...,POITYPE) Assigns a type POITYPE to the added poi.
+% add(...,LAYER) Adds the poi to the given layer.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+
+if nargin < 6
+ layer = 0;
+ if nargin < 5
+ poiType = '';
+ end
+end
+typeCompound = sscanf(constants.TYPE_COMPOUND,'%x');
+typeString = sscanf(constants.TYPE_STRING,'%x');
+typeColor = sscanf(constants.TYPE_COLOR,'%x');
+typeInteger = sscanf(constants.TYPE_INTEGER,'%x');
+position2D = sscanf(constants.POSITION_2D,'%x');
+traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.ADD, poiID,...
+ 1+4 + 1+4+length(poiType) + 1+1+1+1+1 + 1+4 + 1+8+8);
+message.string = [message.string uint8(typeCompound) traci.packInt32(4)];
+message.string = [message.string uint8(typeString) traci.packInt32(length(poiType)) uint8(poiType)];
+message.string = [message.string uint8([typeColor color])];
+message.string = [message.string uint8(typeInteger) traci.packInt32(layer)];
+message.string = [message.string uint8(position2D) traci.packInt64([x y])];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+poi/getColor.m b/tools/contributed/traci4matlab/+traci/+poi/getColor.m
new file mode 100644
index 0000000..5207464
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+poi/getColor.m
@@ -0,0 +1,11 @@
+function color = getColor(poiID)
+%getColor Get the color of the poi.
+% color = getColor(POIID) Returns the rgba color of the given poi.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+color = traci.poi.getUniversal(constants.VAR_COLOR, poiID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+poi/getContextSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+poi/getContextSubscriptionResults.m
new file mode 100644
index 0000000..00052c6
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+poi/getContextSubscriptionResults.m
@@ -0,0 +1,26 @@
+function ContextSubscriptionResults = getContextSubscriptionResults(poiID)
+%getContextSubscriptionResults Get the context subscription results for the
+% last time step.
+% contextSubscriptionResults = getContextSubscriptionResults(POIID)
+% Returns the context subscription results for the last time step and the
+% given poi. If no poi id is given, all subscription results are
+% returned in a containers.Map data struccure. If the poi id is unknown
+% or the subscription did for any reason return no data, 'None' is
+% returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global poiSubscriptionResults
+if isempty(poiSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ poiID=None;
+end
+ContextSubscriptionResults = poiSubscriptionResults.getContext(poiID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+poi/getIDList.m b/tools/contributed/traci4matlab/+traci/+poi/getIDList.m
new file mode 100644
index 0000000..49d66a5
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+poi/getIDList.m
@@ -0,0 +1,12 @@
+function IDList = getIDList()
+%getIDList Get the IDs of the pois in the network.
+% IDList = getIDList() Returns a cell array of strings containing the IDs
+% of the pois in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDList = traci.poi.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+poi/getPosition.m b/tools/contributed/traci4matlab/+traci/+poi/getPosition.m
new file mode 100644
index 0000000..c485dc4
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+poi/getPosition.m
@@ -0,0 +1,12 @@
+function position = getPosition(poiID)
+%getPosition Get the position of the poi.
+% position = getPosition(POIID) Returns the position coordinates of
+% the given poi.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+position = traci.poi.getUniversal(constants.VAR_POSITION, poiID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+poi/getSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+poi/getSubscriptionResults.m
new file mode 100644
index 0000000..5ba0b69
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+poi/getSubscriptionResults.m
@@ -0,0 +1,26 @@
+function subscriptionResults = getSubscriptionResults(poiID)
+%getSubscriptionResults Get the subscription results for the last time step.
+% subscriptionResults = getSubscriptionResults(POIID) Returns the
+% subscription results for the last time step and the given poi. If no
+% poi id is given, all subscription results are returned in a
+% containers.Map data structure.
+% If the poi id is unknown or the subscription did for any reason return
+% no data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global poiSubscriptionResults
+if isempty(poiSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ poiID = 'None';
+end
+
+subscriptionResults = poiSubscriptionResults.get(poiID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+poi/getType.m b/tools/contributed/traci4matlab/+traci/+poi/getType.m
new file mode 100644
index 0000000..e3f14b3
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+poi/getType.m
@@ -0,0 +1,11 @@
+function type = getType(poiID)
+%getType Returns the (abstract) type of the poi.
+% type = getType(POIID) Returns the (abstract) type of the poi.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+type = traci.poi.getUniversal(constants.VAR_TYPE, poiID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+poi/getUniversal.m b/tools/contributed/traci4matlab/+traci/+poi/getUniversal.m
new file mode 100644
index 0000000..07d5056
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+poi/getUniversal.m
@@ -0,0 +1,25 @@
+function returnedValue = getUniversal(varID, poiID)
+%getUniversal An internal function to send the get command and read the
+%variable value.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global poiSubscriptionResults
+
+if isempty(poiSubscriptionResults)
+ returnValueFunc = traci.RETURN_VALUE_FUNC.poi;
+else
+ returnValueFunc = poiSubscriptionResults.valueFunc;
+end
+
+% Prepare the outgoing message and read the response. The result variable
+% is a traci.Storage object
+result = traci.sendReadOneStringCmd(constants.CMD_GET_POI_VARIABLE,varID,poiID);
+handleReturValueFunc = str2func(returnValueFunc(varID));
+
+% Use the proper method to read the variable of interest from the result
+returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+poi/remove.m b/tools/contributed/traci4matlab/+traci/+poi/remove.m
new file mode 100644
index 0000000..0cf2d30
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+poi/remove.m
@@ -0,0 +1,18 @@
+function remove(poiID, layer)
+%remove Remove the poi from the SUMO network.
+% remove(POIID,LAYER) Removes the poi identified with POIID and
+% associated to the given layer. If no layer is given, it defaults to 0.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+if nargin < 2
+ layer = 0;
+end
+traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.REMOVE, poiID, 1+4);
+message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(layer)];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+poi/setColor.m b/tools/contributed/traci4matlab/+traci/+poi/setColor.m
new file mode 100644
index 0000000..2a4039d
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+poi/setColor.m
@@ -0,0 +1,16 @@
+function setColor(poiID, color)
+%setColor Sets the rgba color of the poi.
+% setColor(POIID,COLOR) Sets the rgba color of the poi. COLOR is a
+% four-element vector whose elements range from 0 to 255, they represent
+% the R, G, B and Alpha (unused) components of the color.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.VAR_COLOR, poiID, 1+1+1+1+1);
+message.string = [message.string uint8([sscanf(constants.TYPE_COLOR,'%x') color])];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+poi/setPosition.m b/tools/contributed/traci4matlab/+traci/+poi/setPosition.m
new file mode 100644
index 0000000..d8636c7
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+poi/setPosition.m
@@ -0,0 +1,14 @@
+function setPosition(poiID, x, y)
+%setPosition Sets the position coordinates of the poi.
+% setPosition(POIID,X,Y) Sets the position coordinates of the poi.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.VAR_POSITION, poiID, 1+8+8);
+message.string = [message.string uint8(sscanf(constants.POSITION_2D,'%x')) traci.packInt64([y x])];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+poi/setType.m b/tools/contributed/traci4matlab/+traci/+poi/setType.m
new file mode 100644
index 0000000..938c98d
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+poi/setType.m
@@ -0,0 +1,15 @@
+function setType(poiID, poiType)
+%setType Sets the (abstract) type of the poi.
+% setType(POIID,POITYPE) Sets the (abstract) type of the poi.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.VAR_TYPE, poiID, 1+4+length(poiType));
+message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x'))...
+ traci.packInt32(length(poiType)) uint8(poiType)];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+poi/subscribe.m b/tools/contributed/traci4matlab/+traci/+poi/subscribe.m
new file mode 100644
index 0000000..a43bc1e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+poi/subscribe.m
@@ -0,0 +1,38 @@
+function subscribe(poiID, varargin)
+%subscribe Subscribe to poi variable.
+% subscribe(POIID) Subscribe to the VAR_POSITION value for the maximum
+% allowed interval.
+% subscribe(POIID,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS for the maximum allowed interval.
+% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
+% allowed end time.
+% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
+% END.
+% A call to this function clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global poiSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'poi.subscribe';
+p.addRequired('poiID', at ischar)
+p.addOptional('varIDs', {constants.VAR_POSITION}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(poiID, varargin{:})
+poiID = p.Results.poiID;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+poiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.poi);
+
+poiSubscriptionResults.reset()
+traci.subscribe(constants.CMD_SUBSCRIBE_POI_VARIABLE,...
+ subscriptionBegin, subscriptionEnd, poiID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+poi/subscribeContext.m b/tools/contributed/traci4matlab/+traci/+poi/subscribeContext.m
new file mode 100644
index 0000000..067cbf3
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+poi/subscribeContext.m
@@ -0,0 +1,46 @@
+function subscribeContext(poiID, domain, dist, varargin)
+%subscribeContext Subscribe to a poi's context variable.
+% subscribeContext(POIID,DOMAIN,DIST) Subscribe to the
+% VAR_POSITION value of the SUMO objects that surround the poi specified by
+% POIID at a distance given by DIST, for the maximum allowed interval.
+% The type of objets that surround the poi are defined in the DOMAIN
+% parameter. Note that not all the SUMO object types support the variable
+% VAR_POSITION.
+% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS.
+% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
+% maximum allowed end time.
+% subscribeContext(...,END) Subscribe for the time interval defined by
+% BEGIN and END.
+% A call to this method clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global poiSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'poi.subscribeContext';
+p.addRequired('poiID', at ischar)
+p.addRequired('domain', at ischar)
+p.addRequired('dist', at isnumeric)
+p.addOptional('varIDs', {constants.VAR_POSITION}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(poiID, domain, dist, varargin{:})
+poiID = p.Results.poiID;
+domain = p.Results.domain;
+dist = p.Results.dist;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+poiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.poi);
+
+poiSubscriptionResults.reset()
+traci.subscribeContext(constants.CMD_SUBSCRIBE_POI_CONTEXT,...
+ subscriptionBegin, subscriptionEnd, poiID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+polygon/add.m b/tools/contributed/traci4matlab/+traci/+polygon/add.m
new file mode 100644
index 0000000..fc8f3a2
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+polygon/add.m
@@ -0,0 +1,50 @@
+function add(polygonID, shape, color, fill, polygonType, layer)
+%add Add a polygon to the SUMO network.
+% add(POLYGONID,SHAPE,COLOR) Adds a polygon with the id POLYGONID to the
+% with the given shape and color. SHAPE is a cell array whose elements
+% are 2-dimensional vectors that represent the x and y coordinates of the
+% points that define the shape of the polygon. COLOR is a four-element
+% vector whose elements range from 0 to 255, they represent the R, G, B
+% and Alpha (unused) components of the color.
+% add(...,FILL) Is a boolean value which specifies if the polygon has to
+% be filled.
+% add(...,POLYGONTYPE) Assigns a type POLYGONTYPE to the added polygon.
+% add(...,LAYER) Adds the poi to the given layer.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+
+if nargin < 6
+ layer = 0;
+ if nargin < 5
+ polygonType = '';
+ if nargin < 4
+ fill = false;
+ end
+ end
+end
+
+typeCompound = sscanf(constants.TYPE_COMPOUND,'%x');
+typeString = sscanf(constants.TYPE_STRING,'%x');
+typeColor = sscanf(constants.TYPE_COLOR,'%x');
+typeInteger = sscanf(constants.TYPE_INTEGER,'%x');
+typeUbyte = sscanf(constants.TYPE_UBYTE,'%x');
+typePolygon = sscanf(constants.TYPE_POLYGON,'%x');
+
+traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.ADD, polygonID,...
+ 1+4 + 1+4+length(polygonType) + 1+1+1+1+1 + 1+1 + 1+4 + 1+1+length(shape)*(8+8));
+message.string = [message.string uint8(typeCompound) traci.packInt32(4)];
+message.string = [message.string uint8(typeString) traci.packInt32(length(polygonType)) uint8(polygonType)];
+message.string = [message.string uint8([typeColor color])];
+message.string = [message.string uint8([typeUbyte fill])];
+message.string = [message.string uint8(typeInteger) traci.packInt32(layer)];
+message.string = [message.string uint8([typePolygon length(shape)])];
+for i=1:length(shape)
+ message.string = [message.string traci.packInt64(fliplr(shape{i}))];
+end
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+polygon/getColor.m b/tools/contributed/traci4matlab/+traci/+polygon/getColor.m
new file mode 100644
index 0000000..6f6c104
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+polygon/getColor.m
@@ -0,0 +1,11 @@
+function color = getColor(polygonID)
+%getColor Get the color of the polygon.
+% color = getColor(POLYGONID) Returns the rgba color of the given polygon.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+color = traci.polygon.getUniversal(constants.VAR_COLOR, polygonID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+polygon/getContextSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+polygon/getContextSubscriptionResults.m
new file mode 100644
index 0000000..7250760
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+polygon/getContextSubscriptionResults.m
@@ -0,0 +1,26 @@
+function ContextSubscriptionResults = getContextSubscriptionResults(polygonID)
+%getContextSubscriptionResults Get the context subscription results for the
+% last time step.
+% contextSubscriptionResults = getContextSubscriptionResults(POLYGONID)
+% Returns the context subscription results for the last time step and the
+% given polygon. If no polygon id is given, all subscription results are
+% returned in a containers.Map data struccure. If the polygon id is unknown
+% or the subscription did for any reason return no data, 'None' is
+% returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global polygonSubscriptionResults
+if isempty(polygonSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ polygonID=None;
+end
+ContextSubscriptionResults = polygonSubscriptionResults.getContext(polygonID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+polygon/getIDList.m b/tools/contributed/traci4matlab/+traci/+polygon/getIDList.m
new file mode 100644
index 0000000..560c55f
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+polygon/getIDList.m
@@ -0,0 +1,12 @@
+function IDList = getIDList()
+%getIDList Get the IDs of the polygons in the network.
+% IDList = getIDList() Returns a cell array of strings containing the IDs
+% of the polygons in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDList = traci.polygon.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+polygon/getShape.m b/tools/contributed/traci4matlab/+traci/+polygon/getShape.m
new file mode 100644
index 0000000..1e702b1
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+polygon/getShape.m
@@ -0,0 +1,14 @@
+function shape = getShape(polygonID)
+%getShape Get the shape of the polygon.
+% shape = getShape(POLYGONID) Returns the shape of the given polygon,
+% which is a cell array containing 2-dimensional vectors that represent
+% the x and y coordinates of the points that define the shape of the
+% polygon.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+shape = traci.polygon.getUniversal(constants.VAR_SHAPE, polygonID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+polygon/getSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+polygon/getSubscriptionResults.m
new file mode 100644
index 0000000..d6dd8a7
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+polygon/getSubscriptionResults.m
@@ -0,0 +1,26 @@
+function subscriptionResults = getSubscriptionResults(polygonID)
+%getSubscriptionResults Get the subscription results for the last time step.
+% subscriptionResults = getSubscriptionResults(POLYGONID) Returns the
+% subscription results for the last time step and the given polygon. If no
+% polygon id is given, all subscription results are returned in a
+% containers.Map data structure.
+% If the polygon id is unknown or the subscription did for any reason return
+% no data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global polygonSubscriptionResults
+if isempty(polygonSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ polygonID = 'None';
+end
+
+subscriptionResults = polygonSubscriptionResults.get(polygonID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+polygon/getType.m b/tools/contributed/traci4matlab/+traci/+polygon/getType.m
new file mode 100644
index 0000000..2cd14ee
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+polygon/getType.m
@@ -0,0 +1,11 @@
+function type = getType(polygonID)
+%getType Returns the (abstract) type of the polygon.
+% type = getType(POLYGONID) Returns the (abstract) type of the polygon.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+type = traci.polygon.getUniversal(constants.VAR_TYPE, polygonID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+polygon/getUniversal.m b/tools/contributed/traci4matlab/+traci/+polygon/getUniversal.m
new file mode 100644
index 0000000..5d8ed06
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+polygon/getUniversal.m
@@ -0,0 +1,25 @@
+function returnedValue = getUniversal(varID, polygonID)
+%getUniversal An internal function to send the get command and read the
+%variable value.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global polygonSubscriptionResults
+
+if isempty(polygonSubscriptionResults)
+ returnValueFunc = traci.RETURN_VALUE_FUNC.polygon;
+else
+ returnValueFunc = polygonSubscriptionResults.valueFunc;
+end
+
+% Prepare the outgoing message and read the response. The result variable
+% is a traci.Storage object
+result = traci.sendReadOneStringCmd(constants.CMD_GET_POLYGON_VARIABLE,varID,polygonID);
+handleReturValueFunc = str2func(returnValueFunc(varID));
+
+% Use the proper method to read the variable of interest from the result
+returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+polygon/remove.m b/tools/contributed/traci4matlab/+traci/+polygon/remove.m
new file mode 100644
index 0000000..6b5e0df
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+polygon/remove.m
@@ -0,0 +1,18 @@
+function remove(polygonID, layer)
+%remove Remove the polygon from the SUMO network.
+% remove(POLYGONID,LAYER) Removes the polygon identified with POLYGONID
+% and associated to the given layer. If no layer is given, it defaults to 0.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+if nargin < 2
+ layer = 0;
+end
+traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.REMOVE, polygonID, 1+4);
+message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(layer)];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+polygon/setColor.m b/tools/contributed/traci4matlab/+traci/+polygon/setColor.m
new file mode 100644
index 0000000..9d93595
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+polygon/setColor.m
@@ -0,0 +1,16 @@
+function setColor(polygonID, color)
+%setColor Sets the rgba color of the polygon.
+% setColor(POLYGONID,COLOR) Sets the rgba color of the polygon. COLOR is
+% a four-element vector whose elements range from 0 to 255, they represent
+% the R, G, B and Alpha (unused) components of the color.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.VAR_COLOR, polygonID, 1+1+1+1+1);
+message.string = [message.string uint8([sscanf(constants.TYPE_COLOR,'%x') color])];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+polygon/setShape.m b/tools/contributed/traci4matlab/+traci/+polygon/setShape.m
new file mode 100644
index 0000000..8f50ea0
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+polygon/setShape.m
@@ -0,0 +1,20 @@
+function setShape(polygonID, shape)
+%setShape Sets the shape of the polygon.
+% setShape(POLYGONID,SHAPE) Sets the shape of the polygon to the given.
+% SHAPE is a cell array whose elements are 2-dimensional vectors that
+% represent the x and y coordinates of the points that define the shape
+% of the polygon.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.VAR_SHAPE, polygonID, 1+1+length(shape)*(8+8));
+message.string = [message.string uint8([sscanf(constants.TYPE_POLYGON,'%x') length(shape)])];
+for i=1:length(shape)
+ message.string = [message.string traci.packInt64(fliplr(shape{i}))];
+end
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+polygon/setType.m b/tools/contributed/traci4matlab/+traci/+polygon/setType.m
new file mode 100644
index 0000000..cec7cfb
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+polygon/setType.m
@@ -0,0 +1,15 @@
+function setType(polygonID, polygonType)
+%setType Sets the (abstract) type of the polygon.
+% setType(POLYGONID,POLYGONTTYPE) Sets the (abstract) type of the polygon.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.VAR_TYPE, polygonID, 1+4+length(polygonType));
+message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
+ traci.packInt32(length(polygonType)) uint8(polygonType)];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+polygon/subscribe.m b/tools/contributed/traci4matlab/+traci/+polygon/subscribe.m
new file mode 100644
index 0000000..764cc47
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+polygon/subscribe.m
@@ -0,0 +1,38 @@
+function subscribe(polygonID, varargin)
+%subscribe Subscribe to polygon variable.
+% subscribe(POLYGONID) Subscribe to the VAR_SHAPE value for the maximum
+% allowed interval.
+% subscribe(POLYGONID,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS for the maximum allowed interval.
+% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
+% allowed end time.
+% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
+% END.
+% A call to this function clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global polygonSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'polygon.subscribe';
+p.addRequired('polygonID', at ischar)
+p.addOptional('varIDs', {constants.VAR_SHAPE}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(polygonID, varargin{:})
+polygonID = p.Results.polygonID;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+polygonSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.polygon);
+
+polygonSubscriptionResults.reset()
+traci.subscribe(constants.CMD_SUBSCRIBE_POLYGON_VARIABLE,...
+ subscriptionBegin, subscriptionEnd, polygonID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+polygon/subscribeContext.m b/tools/contributed/traci4matlab/+traci/+polygon/subscribeContext.m
new file mode 100644
index 0000000..e63fe8a
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+polygon/subscribeContext.m
@@ -0,0 +1,46 @@
+function subscribeContext(polygonID, domain, dist, varargin)
+%subscribeContext Subscribe to a polygon's context variable.
+% subscribeContext(POLYGONID,DOMAIN,DIST) Subscribe to the
+% VAR_SHAPE value of the SUMO objects that surround the polygon specified
+% by POLYGONID at a distance given by DIST, for the maximum allowed
+% interval. The type of objets that surround the polygon are defined in
+% the DOMAIN parameter. Note that not all the SUMO object types support
+% the variable VAR_SHAPE.
+% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS.
+% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
+% maximum allowed end time.
+% subscribeContext(...,END) Subscribe for the time interval defined by
+% BEGIN and END.
+% A call to this method clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global polygonSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'polygon.subscribeContext';
+p.addRequired('polygonID', at ischar)
+p.addRequired('domain', at ischar)
+p.addRequired('dist', at isnumeric)
+p.addOptional('varIDs', {constants.VAR_SHAPE}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(polygonID, domain, dist, varargin{:})
+polygonID = p.Results.polygonID;
+domain = p.Results.domain;
+dist = p.Results.dist;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+polygonSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.polygon);
+
+polygonSubscriptionResults.reset()
+traci.subscribeContext(constants.CMD_SUBSCRIBE_POLYGON_CONTEXT,...
+ subscriptionBegin, subscriptionEnd, polygonID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+route/add.m b/tools/contributed/traci4matlab/+traci/+route/add.m
new file mode 100644
index 0000000..b269e72
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+route/add.m
@@ -0,0 +1,22 @@
+function add(routeID, edges)
+%add Add a route to the SUMO simulation.
+% add(ROUTEID,EDGES) Adds a route with the id ROUTEID comprised of the
+% given edges. EDGES is a cell array of strings containing the IDs of the
+% edges.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_ROUTE_VARIABLE, constants.ADD, routeID,...
+ 1+4+sum(cellfun('length', edges))+4*length(edges));
+message.string = [message.string uint8(sscanf(constants.TYPE_STRINGLIST,'%x')) ...
+ traci.packInt32(length(edges))];
+for i=1:length(edges)
+ message.string = [message.string traci.packInt32(length(edges{i})) ...
+ uint8(edges{i})];
+end
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+route/getContextSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+route/getContextSubscriptionResults.m
new file mode 100644
index 0000000..c5302e7
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+route/getContextSubscriptionResults.m
@@ -0,0 +1,26 @@
+function ContextSubscriptionResults = getContextSubscriptionResults(routeID)
+%getContextSubscriptionResults Get the context subscription results for the
+% last time step.
+% contextSubscriptionResults = getContextSubscriptionResults(ROUTEID)
+% Returns the context subscription results for the last time step and the
+% given route. If no route id is given, all subscription results are
+% returned in a containers.Map data struccure. If the route id is unknown
+% or the subscription did for any reason return no data, 'None' is
+% returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global routeSubscriptionResults
+if isempty(routeSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ routeID=None;
+end
+ContextSubscriptionResults = routeSubscriptionResults.getContext(routeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+route/getEdges.m b/tools/contributed/traci4matlab/+traci/+route/getEdges.m
new file mode 100644
index 0000000..ebc5e5f
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+route/getEdges.m
@@ -0,0 +1,13 @@
+function edges = getEdges(routeID)
+%getEdges Return the edges of the route.
+% edges = getEdges(ROUTEID) Returns a list of all edges in the route. The
+% list of edges is a cell array of strings whose elements are the IDs of
+% the edges.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+edges = traci.route.getUniversal(constants.VAR_EDGES, routeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+route/getIDList.m b/tools/contributed/traci4matlab/+traci/+route/getIDList.m
new file mode 100644
index 0000000..f40f11a
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+route/getIDList.m
@@ -0,0 +1,12 @@
+function IDList = getIDList()
+%getIDList Get the IDs of the routes in the network.
+% IDList = getIDList() Returns a cell array of strings containing the IDs
+% of the routes in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDList = traci.route.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+route/getSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+route/getSubscriptionResults.m
new file mode 100644
index 0000000..ae52ddd
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+route/getSubscriptionResults.m
@@ -0,0 +1,26 @@
+function subscriptionResults = getSubscriptionResults(routeID)
+%getSubscriptionResults Get the subscription results for the last time step.
+% subscriptionResults = getSubscriptionResults(ROUTEID) Returns the
+% subscription results for the last time step and the given route. If no
+% route id is given, all subscription results are returned in a
+% containers.Map data structure.
+% If the route id is unknown or the subscription did for any reason return
+% no data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global routeSubscriptionResults
+if isempty(routeSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ routeID = 'None';
+end
+
+subscriptionResults = routeSubscriptionResults.get(routeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+route/getUniversal.m b/tools/contributed/traci4matlab/+traci/+route/getUniversal.m
new file mode 100644
index 0000000..603b9e1
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+route/getUniversal.m
@@ -0,0 +1,25 @@
+function returnedValue = getUniversal(varID, routeID)
+%getUniversal An internal function to send the get command and read the
+%variable value.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global routeSubscriptionResults
+
+if isempty(routeSubscriptionResults)
+ returnValueFunc = traci.RETURN_VALUE_FUNC.route;
+else
+ returnValueFunc = routeSubscriptionResults.valueFunc;
+end
+
+% Prepare the outgoing message and read the response. The result variable
+% is a traci.Storage object
+result = traci.sendReadOneStringCmd(constants.CMD_GET_ROUTE_VARIABLE,varID,routeID);
+handleReturValueFunc = str2func(returnValueFunc(varID));
+
+% Use the proper method to read the variable of interest from the result
+returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+route/subscribe.m b/tools/contributed/traci4matlab/+traci/+route/subscribe.m
new file mode 100644
index 0000000..7c2fcc5
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+route/subscribe.m
@@ -0,0 +1,38 @@
+function subscribe(routeID, varargin)
+%subscribe Subscribe to route variable.
+% subscribe(ROUTEID) Subscribe to the ID_LIST value for the maximum
+% allowed interval.
+% subscribe(ROUTEID,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS for the maximum allowed interval.
+% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
+% allowed end time.
+% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
+% END.
+% A call to this function clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global routeSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'route.subscribe';
+p.addRequired('routeID', at ischar)
+p.addOptional('varIDs', {constants.ID_LIST}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(routeID, varargin{:})
+routeID = p.Results.routeID;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+routeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.route);
+
+routeSubscriptionResults.reset()
+traci.subscribe(constants.CMD_SUBSCRIBE_ROUTE_VARIABLE,...
+ subscriptionBegin, subscriptionEnd, routeID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+route/subscribeContext.m b/tools/contributed/traci4matlab/+traci/+route/subscribeContext.m
new file mode 100644
index 0000000..4969553
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+route/subscribeContext.m
@@ -0,0 +1,45 @@
+function subscribeContext(routeID, domain, dist, varargin)
+%subscribeContext Subscribe to a route's context variable.
+% subscribeContext(ROUTEID,DOMAIN,DIST) Subscribe to the ID_LIST value of
+% the SUMO objects that surround the route specified by ROUTEID at a
+% distance given by DIST, for the maximum allowed interval. The type of
+% objets that surround the route are defined in the DOMAIN parameter.
+% Note that not all the SUMO object types support the variable ID_LIST.
+% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS.
+% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
+% maximum allowed end time.
+% subscribeContext(...,END) Subscribe for the time interval defined by
+% BEGIN and END.
+% A call to this method clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global routeSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'route.subscribeContext';
+p.addRequired('routeID', at ischar)
+p.addRequired('domain', at ischar)
+p.addRequired('dist', at isnumeric)
+p.addOptional('varIDs', {constants.ID_LIST}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(routeID, domain, dist, varargin{:})
+routeID = p.Results.routeID;
+domain = p.Results.domain;
+dist = p.Results.dist;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+routeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.route);
+
+routeSubscriptionResults.reset()
+traci.subscribeContext(constants.CMD_SUBSCRIBE_ROUTE_CONTEXT,...
+ subscriptionBegin, subscriptionEnd, routeID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/convert2D.m b/tools/contributed/traci4matlab/+traci/+simulation/convert2D.m
new file mode 100644
index 0000000..1cda03b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/convert2D.m
@@ -0,0 +1,38 @@
+function [x y] = convert2D(edgeID, pos, laneIndex, toGeo)
+%convert2D Convert to absolute coordinates from those relative to an edge.
+% [X,Y] = convert2D(EDGEID,POS) Converts from the position POS relative
+% to the edge EDGEID to absolute coordinates.
+% [X,Y] = convert2D(...,LANEINDEX) Specify the index of the edge's lane.
+% [X,Y] = convert2D(...,TOGEO) Specify if the conversion is made to
+% geo-coordinates, in this case, X is the longitude and Y is the latitude.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+if nargin < 4
+ toGeo = false;
+ if nargin < 3
+ laneIndex = 0;
+ end
+end
+
+posType = sscanf(constants.POSITION_2D,'%x');
+
+if toGeo
+ posType = sscanf(constants.POSITION_LON_LAT,'%x');
+end
+traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION,...
+ '', 1+4 + 1+4+length(edgeID)+8+1 + 1+1);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(2)];
+message.string = [message.string uint8(sscanf(constants.POSITION_ROADMAP,'%x')) ...
+ traci.packInt32(length(edgeID)) uint8(edgeID)];
+message.string = [message.string traci.packInt64(pos) ...
+ uint8([laneIndex sscanf(constants.TYPE_UBYTE,'%x') posType])];
+result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION, '');
+x = result.readDouble;
+y = result.readDouble;
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/convertGeo.m b/tools/contributed/traci4matlab/+traci/+simulation/convertGeo.m
new file mode 100644
index 0000000..bbe4de9
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/convertGeo.m
@@ -0,0 +1,38 @@
+function [longitude latitude] = convertGeo(x, y, fromGeo)
+%convertGeo Convert to geo-coordinates.
+% [LONGITUDE,LATITUDE] = convertGeo(X,Y) Converts the position specified
+% by X and Y to geo-coordinates. Cartesian coordinates are assumed for
+% the input.
+% [X Y] = convert2D(...,FROMGEO) Specify if the conversion is to be
+% made from geo-coordinates, in this case, X is the longitude and Y is
+% the latitude.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+if nargin < 3
+ fromGeo = false;
+end
+
+fromType = sscanf(constants.POSITION_2D,'%x');
+toType = sscanf(constants.POSITION_LON_LAT,'%x');
+
+if fromGeo
+ fromType = sscanf(constants.POSITION_LON_LAT,'%x');
+ toType = sscanf(constants.POSITION_2D,'%x');
+end
+
+traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION,...
+ '', 1+4 + 1+8+8 + 1+1);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(2)];
+message.string = [message.string uint8(fromType) ...
+ traci.packInt64([y x])];
+message.string = [message.string uint8([sscanf(constants.TYPE_UBYTE,'%x') toType])];
+result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION, '');
+longitude = result.readDouble;
+latitude = result.readDouble;
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/convertRoad.m b/tools/contributed/traci4matlab/+traci/+simulation/convertRoad.m
new file mode 100644
index 0000000..4fd7af8
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/convertRoad.m
@@ -0,0 +1,38 @@
+function [roadID pos laneID] = convertRoad(x, y, isGeo)
+%convertRoad Convert to coordinates relative to a road from absolute coordinates.
+% [ROADID POS LANEID] = convertRoad(X,Y) Converts from the absolute
+% position defined by X and Y, to a position POS relative to the road
+% ROADID and the lane LANEID. Cartesian coordinates are assumed for the
+% input.
+% [ROADID POS LANEID] = convertRoad(...,ISGEO) Specify if the absolute
+% input position is in geo-coordinates.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+if nargin < 3
+ isGeo = false;
+end
+
+posType = sscanf(constants.POSITION_2D,'%x');
+
+if isGeo
+ posType = sscanf(constants.POSITION_LON_LAT,'%x');
+end
+
+traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION,...
+ '', 1+4 + 1+8+8 + 1+1);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(2)];
+message.string = [message.string uint8(posType) ...
+ traci.packInt64([y x])];
+message.string = [message.string uint8([sscanf(constants.TYPE_UBYTE,'%x') ...
+ sscanf(constants.POSITION_ROADMAP,'%x')])];
+result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION, '');
+roadID = result.readString();
+pos = result.readDouble();
+laneID = result.read(1);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getArrivedIDList.m b/tools/contributed/traci4matlab/+traci/+simulation/getArrivedIDList.m
new file mode 100644
index 0000000..41379e0
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getArrivedIDList.m
@@ -0,0 +1,13 @@
+function arrivedIDList = getArrivedIDList()
+%getArrivedIDList Get the list of arrived vehicles.
+% arrivedIDList = getArrivedIDList() Returns a cell array of strings that
+% contains the IDs of the vehicles which arrived (have reached their
+% destination and are removed from the road network) in this time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+arrivedIDList = traci.simulation.getUniversal(constants.VAR_ARRIVED_VEHICLES_IDS);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getArrivedNumber.m b/tools/contributed/traci4matlab/+traci/+simulation/getArrivedNumber.m
new file mode 100644
index 0000000..ae50743
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getArrivedNumber.m
@@ -0,0 +1,13 @@
+function arrivedNumber = getArrivedNumber()
+%getArrivedNumber Get the number of arrived vehicles.
+% arrivedNumber = getArrivedNumber() Returns the number of vehicles which
+% arrived (have reached their destination and are removed from the road
+% network) in this time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+arrivedNumber = traci.simulation.getUniversal(constants.VAR_ARRIVED_VEHICLES_NUMBER);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getCurrentTime.m b/tools/contributed/traci4matlab/+traci/+simulation/getCurrentTime.m
new file mode 100644
index 0000000..ae5c617
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getCurrentTime.m
@@ -0,0 +1,12 @@
+function currentTime = getCurrentTime()
+%getCurrentTime Returns the current simulation time in ms.
+% currentTime = getCurrentTime() Returns the current simulation time in
+% ms.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+currentTime = traci.simulation.getUniversal(constants.VAR_TIME_STEP);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getDeltaT.m b/tools/contributed/traci4matlab/+traci/+simulation/getDeltaT.m
new file mode 100644
index 0000000..677529a
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getDeltaT.m
@@ -0,0 +1,11 @@
+function deltaT = getDeltaT()
+%getDeltaT Returns the time-step of the simulation in ms.
+% deltaT = getDeltaT() Returns the time-step of the simulation in ms.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+deltaT = traci.simulation.getUniversal(constants.VAR_DELTA_T);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getDepartedIDList.m b/tools/contributed/traci4matlab/+traci/+simulation/getDepartedIDList.m
new file mode 100644
index 0000000..e2be064
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getDepartedIDList.m
@@ -0,0 +1,13 @@
+function departedIDList = getDepartedIDList()
+%getDepartedIDList Get the IDs of departed vehicles.
+% departedIDList = getDepartedIDList() Returns a cell array of strings
+% containing the ids of vehicles which departed (were inserted into the
+% road network) in this time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+departedIDList = traci.simulation.getUniversal(constants.VAR_DEPARTED_VEHICLES_IDS);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getDepartedNumber.m b/tools/contributed/traci4matlab/+traci/+simulation/getDepartedNumber.m
new file mode 100644
index 0000000..648ccdb
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getDepartedNumber.m
@@ -0,0 +1,12 @@
+function departedNumber = getDepartedNumber()
+%getDepartedNumber Get the number of departed vehicles.
+% departedNumber = getDepartedNumber() Returns the number of vehicles
+% which departed (were inserted into the road network) in this time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+departedNumber = traci.simulation.getUniversal(constants.VAR_DEPARTED_VEHICLES_NUMBER);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getDistance2D.m b/tools/contributed/traci4matlab/+traci/+simulation/getDistance2D.m
new file mode 100644
index 0000000..4b49260
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getDistance2D.m
@@ -0,0 +1,46 @@
+function distance2D = getDistance2D(x1, y1, x2, y2, isGeo, isDriving)
+%getDistance2D Get the distance between two coordinates.
+% distance2D = getDistance2D(X1,Y1,X2,Y2) Returns the distance between
+% the points defined by the 2D coordinates (X1,Y1) and (X2,Y2).
+% Cartesian coordinates are assumed.
+% distance2D = getDistance2D(...,ISGEO) Specify wether the inputs are
+% in geo-coordinates.
+% distance2D = getDistance2D(...,ISDRIVING) Specify wether the air or the
+% driving distance shall be computed.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+if nargin < 6
+ isDriving = false;
+ if nargin < 5
+ isGeo = false;
+ end
+end
+
+posType = sscanf(constants.POSITION_2D,'%x');
+
+if isGeo
+ posType = sscanf(constants.POSITION_LON_LAT,'%x');
+end
+
+distType = sscanf(constants.REQUEST_AIRDIST,'%x');
+
+if isDriving
+ distType = sscanf(constants.REQUEST_DRIVINGDIST,'%x');
+end
+
+traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.DISTANCE_REQUEST,...
+ '', 1+4 + 1+8+8 + 1+8+8 + 1);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(3)];
+message.string = [message.string uint8(posType) ...
+ traci.packInt64([y1 x1])];
+message.string = [message.string uint8(posType) ...
+ traci.packInt64([y2 x2]) uint8(distType)];
+result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.DISTANCE_REQUEST, '');
+distance2D = result.readDouble();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getDistanceRoad.m b/tools/contributed/traci4matlab/+traci/+simulation/getDistanceRoad.m
new file mode 100644
index 0000000..97fe264
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getDistanceRoad.m
@@ -0,0 +1,36 @@
+function distanceRoad = getDistanceRoad(edgeID1, pos1, edgeID2, pos2, isDriving)
+%getDistanceRoad Get the distance between two relative-to-edge positions.
+% distanceRoad = getDistanceRoad(EDGEID1,POS1,EDGEID2,POS2) Returns the
+% distance between the points defined by the relative-to-edge positions
+% (EDGEID1,POS1) and (EDGEID2,POS2).
+% distance2D = getDistance2D(...,ISDRIVING) Specify wether the air or the
+% driving distance shall be computed.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+if nargin < 5
+ isDriving = false;
+end
+
+distType = sscanf(constants.REQUEST_AIRDIST,'%x');
+
+if isDriving
+ distType = sscanf(constants.REQUEST_DRIVINGDIST,'%x');
+end
+
+traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.DISTANCE_REQUEST,...
+ '', 1+4 + 1+4+length(edgeID1)+8+1 + 1+4+length(edgeID2)+8+1 + 1);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(3)];
+message.string = [message.string uint8(sscanf(constants.POSITION_ROADMAP,'%x')) ...
+ traci.packInt32(length(edgeID1)) uint8(edgeID1)];
+message.string = [message.string traci.packInt64(pos1) uint8([0 sscanf(constants.POSITION_ROADMAP,'%x')]) ...
+ traci.packInt32(length(edgeID2)) uint8(edgeID2)];
+message.string = [message.string traci.packInt64(pos2) uint8([0 distType])];
+result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.DISTANCE_REQUEST, '');
+distanceRoad = result.readDouble;
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getEndingTeleportIDList.m b/tools/contributed/traci4matlab/+traci/+simulation/getEndingTeleportIDList.m
new file mode 100644
index 0000000..e4f7ecd
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getEndingTeleportIDList.m
@@ -0,0 +1,13 @@
+function endingTeleportIDList = getEndingTeleportIDList()
+%getEndingTeleportIDList Get the IDs of teleported vehicles.
+% endingTeleportIDList = getEndingTeleportIDList() Returns a cell array
+% of strings containing the IDs of the vehicles which ended to be
+% teleported in this time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+endingTeleportIDList = traci.simulation.getUniversal(constants.VAR_TELEPORT_ENDING_VEHICLES_IDS);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getEndingTeleportNumber.m b/tools/contributed/traci4matlab/+traci/+simulation/getEndingTeleportNumber.m
new file mode 100644
index 0000000..6b18d95
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getEndingTeleportNumber.m
@@ -0,0 +1,12 @@
+function endingTeleportNumber = getEndingTeleportNumber()
+%getEndingTeleportNumber Get the number teleported vehicles.
+% endingTeleportNumber = getEndingTeleportNumber() Returns the number of
+% vehicles which ended to be teleported in this time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+endingTeleportNumber = traci.simulation.getUniversal(constants.VAR_TELEPORT_ENDING_VEHICLES_NUMBER);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getLoadedIDList.m b/tools/contributed/traci4matlab/+traci/+simulation/getLoadedIDList.m
new file mode 100644
index 0000000..c01733b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getLoadedIDList.m
@@ -0,0 +1,12 @@
+function loadedIDList = getLoadedIDList()
+%getLoadedIDList Get the IDs of loaded vehicles.
+% loadedIDList = getLoadedIDList() Returns a cell array of strings
+% cotaining the ids of the vehicles which were loaded in this time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+loadedIDList = traci.simulation.getUniversal(constants.VAR_LOADED_VEHICLES_IDS);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getLoadedNumber.m b/tools/contributed/traci4matlab/+traci/+simulation/getLoadedNumber.m
new file mode 100644
index 0000000..5e866d4
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getLoadedNumber.m
@@ -0,0 +1,12 @@
+function loadedNumber = getLoadedNumber()
+%getLoadedNumber Get the number loaded vehicles.
+% loadedNumber = getLoadedNumber() Returns the number of vehicles which
+% were loaded in this time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+loadedNumber = traci.simulation.getUniversal(constants.VAR_LOADED_VEHICLES_NUMBER);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getMinExpectedNumber.m b/tools/contributed/traci4matlab/+traci/+simulation/getMinExpectedNumber.m
new file mode 100644
index 0000000..cdfd57b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getMinExpectedNumber.m
@@ -0,0 +1,17 @@
+function minExpectedNumber = getMinExpectedNumber()
+%getMinExpectedNumber Get the number of non-arrived vehicles.
+% minExpectedNumber = getMinExpectedNumber() Returns the number of
+% vehicles which are in the net plus the ones still waiting to start.
+% This number may be smaller than the actual number of vehicles still to
+% come because of delayed route file parsing. If the number is 0 however,
+% it is guaranteed that all route files have been parsed completely and
+% all vehicles have left the network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+minExpectedNumber = traci.simulation.getUniversal(...
+ constants.VAR_MIN_EXPECTED_VEHICLES);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getNetBoundary.m b/tools/contributed/traci4matlab/+traci/+simulation/getNetBoundary.m
new file mode 100644
index 0000000..0ae1a17
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getNetBoundary.m
@@ -0,0 +1,13 @@
+function netBoundary = getNetBoundary()
+%getNetBoundary Get the boundary box of the network.
+% netBoundary = getNetBoundary() Returns the coordinates of the
+% lower-left and the upper-right points that define the boundaries of the
+% network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+netBoundary = traci.simulation.getUniversal(constants.VAR_NET_BOUNDING_BOX);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getStartingTeleportIDList.m b/tools/contributed/traci4matlab/+traci/+simulation/getStartingTeleportIDList.m
new file mode 100644
index 0000000..4f28246
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getStartingTeleportIDList.m
@@ -0,0 +1,13 @@
+function startingTeleportIDList = getStartingTeleportIDList()
+%getStartingTeleportIDList Get the IDs of vehicles stsrting to teleport.
+% startingTeleportIDList = getStartingTeleportIDList() Returns a cell
+% array of strings containing the ids of vehicles which which started to
+% teleport in this time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+startingTeleportIDList = traci.simulation.getUniversal(constants.VAR_TELEPORT_STARTING_VEHICLES_IDS);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getStartingTeleportNumber.m b/tools/contributed/traci4matlab/+traci/+simulation/getStartingTeleportNumber.m
new file mode 100644
index 0000000..eb5662a
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getStartingTeleportNumber.m
@@ -0,0 +1,12 @@
+function startingTeleportNumber = getStartingTeleportNumber()
+%getStartingTeleportNumber Get the number of vehicles stsrting to teleport.
+% startingTeleportNumber = getStartingTeleportNumber() Returns the number
+% of vehicles which started to teleport in this time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+startingTeleportNumber = traci.simulation.getUniversal(constants.VAR_TELEPORT_STARTING_VEHICLES_NUMBER);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+simulation/getSubscriptionResults.m
new file mode 100644
index 0000000..533da7e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getSubscriptionResults.m
@@ -0,0 +1,19 @@
+function subscriptionResults = getSubscriptionResults()
+%getSubscriptionResults Get the subscription results for the last time step.
+% subscriptionResults = getSubscriptionResults() Returns the subscription
+% results for the last time step.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global simSubscriptionResults
+if isempty(simSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+
+subscriptionResults = simSubscriptionResults.get('x');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/getUniversal.m b/tools/contributed/traci4matlab/+traci/+simulation/getUniversal.m
new file mode 100644
index 0000000..b4ab566
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/getUniversal.m
@@ -0,0 +1,25 @@
+function returnedValue = getUniversal(varID)
+%getUniversal An internal function to send the get command and read the
+%variable value.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global simSubscriptionResults
+
+if isempty(simSubscriptionResults)
+ returnValueFunc = traci.RETURN_VALUE_FUNC.simulation;
+else
+ returnValueFunc = simSubscriptionResults.valueFunc;
+end
+
+% Prepare the outgoing message and read the response. The result variable
+% is a traci.Storage object
+result = traci.sendReadOneStringCmd(constants.CMD_GET_SIM_VARIABLE,varID,'');
+handleReturValueFunc = str2func(returnValueFunc(varID));
+
+% Use the proper method to read the variable of interest from the result
+returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+simulation/subscribe.m b/tools/contributed/traci4matlab/+traci/+simulation/subscribe.m
new file mode 100644
index 0000000..80689a6
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+simulation/subscribe.m
@@ -0,0 +1,36 @@
+function subscribe(varargin)
+%subscribe Subscribe to simulation variable.
+% subscribe() Subscribe to the VAR_DEPARTED_VEHICLES_IDS value for
+% the maximum allowed interval.
+% subscribe(VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS for the maximum allowed interval.
+% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
+% allowed end time.
+% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
+% END.
+% A call to this function clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global simSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'simulation.subscribe';
+p.addOptional('varIDs', {constants.VAR_DEPARTED_VEHICLES_IDS}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(varargin{:})
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+simSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.simulation);
+
+simSubscriptionResults.reset()
+traci.subscribe(constants.CMD_SUBSCRIBE_SIM_VARIABLE,...
+ subscriptionBegin, subscriptionEnd, 'x', varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/Logic.m b/tools/contributed/traci4matlab/+traci/+trafficlights/Logic.m
new file mode 100644
index 0000000..1cd132b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/Logic.m
@@ -0,0 +1,43 @@
+classdef Logic
+%Logic constructs a Logic object.
+% myLogic = Logic(SUBID,TYPE,SUBPARAMETER,CURRENTPHASEINDEX,PHASES)
+% constructs a Logic object myLogic containing an ID SUBID, astarting
+% phase index CURRENTPHASEINDEX, and a cell array of traci.Phase objects,
+% PHASES, which represent the phase definitions of trafic lights' program
+% myLogic. TYPE and SUBPARAMETER are not currently implemented in SUMO
+% server, therefore, the must be set to zero.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+ properties
+ subID
+ type
+ subParameter
+ currentPhaseIndex
+ phases
+ end
+ methods
+ function this = Logic(subID, type, subParameter, currentPhaseIndex, phases)
+ this.subID = subID;
+ this.type = type;
+ this.subParameter = subParameter;
+ this.currentPhaseIndex = currentPhaseIndex;
+ this.phases = phases;
+ end
+
+ function display(this)
+ disp('Logic:');
+ disp(['subID: ' num2str(this.subID)]);
+ disp(['type: ' num2str(this.type)]);
+ disp(['subParameter: ' num2str(this.subParameter)]);
+ disp(['currentPhaseIndex: ' num2str(this.currentPhaseIndex)]);
+ for i=1:length(this.phases)
+ display(this.phases{i});
+ end
+ end
+
+ end
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/Phase.m b/tools/contributed/traci4matlab/+traci/+trafficlights/Phase.m
new file mode 100644
index 0000000..b9f59a5
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/Phase.m
@@ -0,0 +1,38 @@
+classdef Phase
+%Phase Construct a Phase object for TraCI traffic lights.
+% myPhase = Phase(DURATION,DURATION1,DURATION2,PHASEDEF) Constructs a
+% Phase object with the properties DURATION, DURATION1, which is the min
+% duration in miliseconds; DURATION2, which is the max duration in
+% miliseconds and PHASEDEF, which is a string of light definitions from
+% rRgGyYoO for red, green, yellow, off, where lower case letters mean
+% that the stream has to decelerate.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+ properties
+ duration
+ duration1
+ duration2
+ phaseDef
+ end
+ methods
+ function this = Phase(duration, duration1, duration2, phaseDef)
+ this.duration = duration;
+ this.duration1 = duration1;
+ this.duration2 = duration2;
+ this.phaseDef = phaseDef;
+ end
+
+ function display(this)
+ disp('Phase:');
+ disp(['duration: ' num2str(this.duration)]);
+ disp(['duration1: ' num2str(this.duration1)]);
+ disp(['duration2: ' num2str(this.duration1)]);
+ disp(['phaseDef: ' num2str(this.phaseDef)]);
+ end
+
+ end
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/getCompleteRedYellowGreenDefinition.m b/tools/contributed/traci4matlab/+traci/+trafficlights/getCompleteRedYellowGreenDefinition.m
new file mode 100644
index 0000000..dd921b0
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/getCompleteRedYellowGreenDefinition.m
@@ -0,0 +1,14 @@
+function completeRedYellowGreenDefinition = getCompleteRedYellowGreenDefinition(tlsID)
+%getCompleteRedYellowGreenDefinition Get the complete traffic lights definition.
+% completeRedYellowGreenDefinition =
+% getCompleteRedYellowGreenDefinition(TLSID) Returns a
+% traci.trafficlights.Logic object that describes the atributes of the
+% traffic light definition including all the phase definitions.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+completeRedYellowGreenDefinition = traci.trafficlights.getUniversal(constants.TL_COMPLETE_DEFINITION_RYG, tlsID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/getContextSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+trafficlights/getContextSubscriptionResults.m
new file mode 100644
index 0000000..80e216e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/getContextSubscriptionResults.m
@@ -0,0 +1,26 @@
+function ContextSubscriptionResults = getContextSubscriptionResults(tlsID)
+%getContextSubscriptionResults Get the context subscription results for the
+% last time step.
+% contextSubscriptionResults = getContextSubscriptionResults(TLSID)
+% Returns the context subscription results for the last time step and the
+% given traffic light. If no traffic light id is given, all subscription
+% results are returned in a containers.Map data struccure. If the traffic
+% light id is unknown or the subscription did for any reason return no
+% data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global tlsSubscriptionResults
+if isempty(tlsSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ tlsID=None;
+end
+ContextSubscriptionResults = tlsSubscriptionResults.getContext(tlsID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/getControlledLanes.m b/tools/contributed/traci4matlab/+traci/+trafficlights/getControlledLanes.m
new file mode 100644
index 0000000..7705dc9
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/getControlledLanes.m
@@ -0,0 +1,13 @@
+function controlledLanes = getControlledLanes(tlsID)
+%getControlledLanes Get the controlled lanes.
+% controlledLanes = getControlledLanes(TLSID) Returns a cell array of
+% strings containing the ids of the lanes controlled by the given traffic
+% lights.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+controlledLanes = traci.trafficlights.getUniversal(constants.TL_CONTROLLED_LANES, tlsID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/getControlledLinks.m b/tools/contributed/traci4matlab/+traci/+trafficlights/getControlledLinks.m
new file mode 100644
index 0000000..34f9512
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/getControlledLinks.m
@@ -0,0 +1,14 @@
+function controlledLinks = getControlledLinks(tlsID)
+%getControlledLinks Get the links controlled by the traffic light.
+% controlledLinks = getControlledLinks(tlsID) Returns a cell array
+% containing the links controlled by the traffic light, sorted by the
+% signal index and described by giving the incoming, outgoing, and via
+% lane.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+controlledLinks = traci.trafficlights.getUniversal(constants.TL_CONTROLLED_LINKS, tlsID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/getIDList.m b/tools/contributed/traci4matlab/+traci/+trafficlights/getIDList.m
new file mode 100644
index 0000000..44afc8a
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/getIDList.m
@@ -0,0 +1,12 @@
+function IDList = getIDList()
+%getIDList Get the IDs of the traffic lights in the network.
+% IDList = getIDList() Returns a cell array of strings containing the IDs
+% of the traffic lights in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDList = traci.trafficlights.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/getNextSwitch.m b/tools/contributed/traci4matlab/+traci/+trafficlights/getNextSwitch.m
new file mode 100644
index 0000000..b5e9219
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/getNextSwitch.m
@@ -0,0 +1,13 @@
+function nextSwitch = getNextSwitch(tlsID)
+%getNextSwitch Returns the time in ms at which the next phase change will
+%be performed.
+% nextSwitch = getNextSwitch(TLSID) Returns the time in ms at which the
+% next phase change will be performed.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+nextSwitch = traci.trafficlights.getUniversal(constants.TL_NEXT_SWITCH, tlsID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/getPhase.m b/tools/contributed/traci4matlab/+traci/+trafficlights/getPhase.m
new file mode 100644
index 0000000..b789b5f
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/getPhase.m
@@ -0,0 +1,12 @@
+function phase = getPhase(tlsID)
+%getPhase Get the phase index.
+% phase = getPhase(TLSID) Returns the current phase index of
+% given trafficlights.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+phase = traci.trafficlights.getUniversal(constants.TL_CURRENT_PHASE, tlsID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/getProgram.m b/tools/contributed/traci4matlab/+traci/+trafficlights/getProgram.m
new file mode 100644
index 0000000..f75605d
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/getProgram.m
@@ -0,0 +1,11 @@
+function program = getProgram(tlsID)
+%getProgram Returns the id of the current program.
+% program = getProgram(TLSID) Returns the id of the current program.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+program = traci.trafficlights.getUniversal(constants.TL_CURRENT_PROGRAM, tlsID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/getRedYellowGreenState.m b/tools/contributed/traci4matlab/+traci/+trafficlights/getRedYellowGreenState.m
new file mode 100644
index 0000000..e0db6e5
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/getRedYellowGreenState.m
@@ -0,0 +1,14 @@
+function redYellowGreenState = getRedYellowGreenState(tlsID)
+%getRedYellowGreenState Get the traffic lights' state.
+% redYellowGreenState = getRedYellowGreenState(TLSID) Returns the named
+% tl's state as a string of light definitions from rRgGyYoO, for red,
+% green, yellow, off, where lower case letters mean that the stream has
+% to decelerate.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+redYellowGreenState = traci.trafficlights.getUniversal(constants.TL_RED_YELLOW_GREEN_STATE, tlsID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/getSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+trafficlights/getSubscriptionResults.m
new file mode 100644
index 0000000..e86b5fa
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/getSubscriptionResults.m
@@ -0,0 +1,27 @@
+function subscriptionResults = getSubscriptionResults(tlsID)
+%getSubscriptionResults Get the subscription results for the last time step.
+% subscriptionResults = getSubscriptionResults(TLSID) Returns the
+% subscription results for the last time step and the given traffic
+% lights. If no traffic lights id is given, all subscription results are
+% returned in a containers.Map data structure.
+% If the traffic lights id is unknown or the subscription did for any reason return
+% no data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global tlSubscriptionResults
+if isempty(tlSubscriptionResults)
+ traci.close();
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ tlsID = 'None';
+end
+
+subscriptionResults = tlSubscriptionResults.get(tlsID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/getUniversal.m b/tools/contributed/traci4matlab/+traci/+trafficlights/getUniversal.m
new file mode 100644
index 0000000..cc7646f
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/getUniversal.m
@@ -0,0 +1,25 @@
+function returnedValue = getUniversal(varID, tlsID)
+%getUniversal An internal function to send the get command and read the
+%variable value.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global tlsSubscriptionResults
+
+if isempty(tlsSubscriptionResults)
+ returnValueFunc = traci.RETURN_VALUE_FUNC.trafficlights;
+else
+ returnValueFunc = tlsSubscriptionResults.valueFunc;
+end
+
+% Prepare the outgoing message and read the response. The result variable
+% is a traci.Storage object
+result = traci.sendReadOneStringCmd(constants.CMD_GET_TL_VARIABLE,varID,tlsID);
+handleReturValueFunc = str2func(returnValueFunc(varID));
+
+% Use the proper method to read the variable of interest from the result
+returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/readLinks.m b/tools/contributed/traci4matlab/+traci/+trafficlights/readLinks.m
new file mode 100644
index 0000000..69fd462
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/readLinks.m
@@ -0,0 +1,22 @@
+function signals = readLinks(result)
+%readLinks Internal function to read the links controlled by the traffic lights.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+result.readLength();
+nbSignals = result.readInt(); % Length
+signals = cell(1,nbSignals);
+for i=1:nbSignals
+ result.read(1); % Type of Number of Controlled Links
+ nbControlledLinks = result.readInt(); % Number of Controlled Links
+ controlledLinks = cell(1,nbControlledLinks);
+ for j=1:nbControlledLinks
+ result.read(1); % Type of Link j
+ link = result.readStringList(); % Link j
+ controlledLinks{j} = link;
+ end
+ signals(i) = controlledLinks;
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/readLogics.m b/tools/contributed/traci4matlab/+traci/+trafficlights/readLogics.m
new file mode 100644
index 0000000..c86857c
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/readLogics.m
@@ -0,0 +1,38 @@
+function logics = readLogics(result)
+%readLogics Internal function to read the complete program of the traffic lights.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+result.readLength();
+nbLogics = result.readInt(); % Number of logics
+logics = cell(1,nbLogics);
+for i=1:nbLogics
+ result.read(1); % Type of SubID
+ subID = result.readString();
+ result.read(1); % Type of Type
+ type = result.readInt(); % Type
+ result.read(1); % Type of SubParameter
+ subParameter = result.readInt(); % SubParameter
+ result.read(1); % Type of Current phase index
+ currentPhaseIndex = result.readInt(); % Current phase index
+ result.read(1); % Type of Number of phases
+ nbPhases = result.readInt(); % Number of phases
+ phases = cell(1,nbPhases);
+ for j=1:nbPhases
+ result.read(1); % Type of Duration
+ duration = result.readInt(); % Duration
+ result.read(1); % Type of Duration1
+ duration1 = result.readInt(); % Duration1
+ result.read(1); % Type of Duration2
+ duration2 = result.readInt(); % Duration2
+ result.read(1); % Type of Phase Definition
+ phaseDef = result.readString(); % Phase Definition
+ phase = traci.trafficlights.Phase(duration, duration1, duration2, phaseDef);
+ phases{j} = phase;
+ end
+ logic = traci.trafficlights.Logic(subID, type, subParameter, currentPhaseIndex, phases);
+ logics{i} = logic;
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/setCompleteRedYellowGreenDefinition.m b/tools/contributed/traci4matlab/+traci/+trafficlights/setCompleteRedYellowGreenDefinition.m
new file mode 100644
index 0000000..cb92d84
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/setCompleteRedYellowGreenDefinition.m
@@ -0,0 +1,44 @@
+function setCompleteRedYellowGreenDefinition(tlsID, tls)
+%setCompleteRedYellowGreenDefinition Set the complete definition of the traffic light.
+% setCompleteRedYellowGreenDefinition(TLSID,TLS) Sets the attributes of
+% trafic lights' definition including all the phase definitions. Those
+% attributes are included in the TLS parameter, which is a
+% traci.trafficlights.Logic object.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+len = 1+4 + 1+4+length(tls.subID) + 1+4 + 1+4 + 1+4 + 1+4; % tls parameter
+itemNo = 1+1+1+1+1;
+for p=1:length(tls.phases)
+ len = len + 1+4 + 1+4 + 1+4 + 1+4+length(tls.phases{p}.phaseDef);
+ itemNo = itemNo + 4;
+end
+traci.beginMessage(constants.CMD_SET_TL_VARIABLE, constants.TL_COMPLETE_PROGRAM_RYG, tlsID, len);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(itemNo)];
+message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
+ traci.packInt32(length(tls.subID)) uint8(tls.subID)]; % Program ID
+message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
+ traci.packInt32(0)]; % Type
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(0)]; % subitems
+message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
+ traci.packInt32(tls.currentPhaseIndex)];
+message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
+ traci.packInt32(length(tls.phases))]; % phaseNo
+
+for i=1:length(tls.phases)
+ message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
+ traci.packInt32(tls.phases{i}.duration) ...
+ uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(tls.phases{i}.duration1) ...
+ uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(tls.phases{i}.duration2)];
+ message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
+ traci.packInt32(length(tls.phases{i}.phaseDef)) ...
+ uint8(tls.phases{i}.phaseDef)];
+end
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/setPhase.m b/tools/contributed/traci4matlab/+traci/+trafficlights/setPhase.m
new file mode 100644
index 0000000..98815a1
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/setPhase.m
@@ -0,0 +1,14 @@
+function setPhase(tlsID, index)
+%setPhase Set the phase index of the traffic light.
+% setPhase(TLSID,INDEX) Sets the index of the traffic lights with ID TLSID
+% to the given in the INDEX parameter. There are as many tls indexes as
+% phase definitions in the tls program. The tls index starts from zero.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendIntCmd(constants.CMD_SET_TL_VARIABLE,...
+ constants.TL_PHASE_INDEX, tlsID, index);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/setPhaseDuration.m b/tools/contributed/traci4matlab/+traci/+trafficlights/setPhaseDuration.m
new file mode 100644
index 0000000..cbe1410
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/setPhaseDuration.m
@@ -0,0 +1,14 @@
+function setPhaseDuration(tlsID, phaseDuration)
+%setPhaseDuration Set the phase duration traffic light.
+% setPhaseDuration(TLSID,PHASEDURATION) Sets the current phase's duration
+% in miliseconds of the traffic lights with ID TLSID to the given in the
+% PHASEDURATION parameter.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendIntCmd(constants.CMD_SET_TL_VARIABLE,...
+ constants.TL_PHASE_DURATION, tlsID, 1000*phaseDuration);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/setProgram.m b/tools/contributed/traci4matlab/+traci/+trafficlights/setProgram.m
new file mode 100644
index 0000000..a9f5a16
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/setProgram.m
@@ -0,0 +1,12 @@
+function setProgram(tlsID, programID)
+%setProgram Sets the id of the current program.
+% setProgram(TLSID,PROGRAMID)Sets the id of the current program.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendStringCmd(constants.CMD_SET_TL_VARIABLE,...
+ constants.TL_PROGRAM, tlsID, programID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/setRedYellowGreenState.m b/tools/contributed/traci4matlab/+traci/+trafficlights/setRedYellowGreenState.m
new file mode 100644
index 0000000..0b6ebf4
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/setRedYellowGreenState.m
@@ -0,0 +1,14 @@
+function setRedYellowGreenState(tlsID, state)
+%setRedYellowGreenState Set the state of the traffic lights.
+% setRedYellowGreenState(TLSID,STATE) Sets the named tl's state as a
+% string of light definitions from rRgGyYoO, for red, green, yellow, off,
+% where lower case letters mean that the stream has to decelerate.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendStringCmd(constants.CMD_SET_TL_VARIABLE,...
+ constants.TL_RED_YELLOW_GREEN_STATE, tlsID, state);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/subscribe.m b/tools/contributed/traci4matlab/+traci/+trafficlights/subscribe.m
new file mode 100644
index 0000000..5e041f6
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/subscribe.m
@@ -0,0 +1,38 @@
+function subscribe(tlsID, varargin)
+%subscribe Subscribe to traffic lights variable.
+% subscribe(TLSID) Subscribe to the TL_CURRENT_PHASE value for the
+% maximum allowed interval.
+% subscribe(TLSID,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS for the maximum allowed interval.
+% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
+% allowed end time.
+% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
+% END.
+% A call to this function clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global tlSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'trafficlights.subscribe';
+p.addRequired('tlsID', at ischar)
+p.addOptional('varIDs', {constants.TL_CURRENT_PHASE}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(tlsID, varargin{:})
+tlsID = p.Results.tlsID;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+tlSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.trafficlights);
+
+tlSubscriptionResults.reset()
+traci.subscribe(constants.CMD_SUBSCRIBE_TL_VARIABLE,...
+ subscriptionBegin, subscriptionEnd, tlsID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+trafficlights/subscribeContext.m b/tools/contributed/traci4matlab/+traci/+trafficlights/subscribeContext.m
new file mode 100644
index 0000000..57bb0cb
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+trafficlights/subscribeContext.m
@@ -0,0 +1,46 @@
+function subscribeContext(tlsID, domain, dist, varargin)
+%subscribeContext Subscribe to a traffic lights's context variable.
+% subscribeContext(TLSID,DOMAIN,DIST) Subscribe to the TL_CURRENT_PHASE
+% value of the SUMO objects that surround the traffic lights specified by
+% TLSID at a distance given by DIST, for the maximum allowed interval.
+% The type of objets that surround the traffic lights are defined in the
+% DOMAIN parameter. Note that not all the SUMO object types support the
+% variable TL_CURRENT_PHASE.
+% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS.
+% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
+% maximum allowed end time.
+% subscribeContext(...,END) Subscribe for the time interval defined by
+% BEGIN and END.
+% A call to this method clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global tlsSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'trafficlights.subscribeContext';
+p.addRequired('tlsID', at ischar)
+p.addRequired('domain', at ischar)
+p.addRequired('dist', at isnumeric)
+p.addOptional('varIDs', {constants.TL_CURRENT_PHASE}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(tlsID, domain, dist, varargin{:})
+tlsID = p.Results.tlsID;
+domain = p.Results.domain;
+dist = p.Results.dist;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+tlsSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.trafficlights);
+
+tlsSubscriptionResults.reset()
+traci.subscribeContext(constants.CMD_SUBSCRIBE_TL_CONTEXT,...
+ subscriptionBegin, subscriptionEnd, tlsID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/add.m b/tools/contributed/traci4matlab/+traci/+vehicle/add.m
new file mode 100644
index 0000000..727928e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/add.m
@@ -0,0 +1,57 @@
+function add(vehID, routeID, varargin)
+%add Add a vehicle to the SUMO network
+% add(VEHID,ROUTEID) Adds a vehicle in the current time-step with ID
+% VEHID and assigns the route with ID ROUTEID to it.
+% add(...,DEPART) Specify the departure time in seconds.
+% add(...,POS) Specify the position relative to the starting lane.
+% add(...,SPEED) Specify the starting speed of the vehicle.
+% add(...,LANE) Specify the lane number in which the vehicle will start.
+% add(...,TYPEID) Specify the type of the vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+
+p = inputParser;
+p.FunctionName = 'vehicle.add';
+p.addRequired('vehID', at ischar)
+p.addRequired('routeID', at ischar)
+p.addOptional('depart', -2, @isnumeric) % -2 = DEPART_NOW
+p.addOptional('pos', 0, @isnumeric)
+p.addOptional('speed', 0, @isnumeric)
+p.addOptional('lane', 0, @isnumeric)
+p.addOptional('typeID', 'DEFAULT_VEHTYPE', @ischar)
+p.parse(vehID, routeID, varargin{:})
+
+vehID = p.Results.vehID;
+routeID = p.Results.routeID;
+depart = p.Results.depart;
+pos = p.Results.pos;
+speed = p.Results.speed;
+lane = p.Results.lane;
+typeID = p.Results.typeID;
+
+
+traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.ADD, vehID,...
+ 1+4 + 1+4+length(typeID) + 1+4+length(routeID) + 1+4 + 1+8 + 1+8 + 1+1);
+if depart > 0
+ depart = depart*1000;
+end
+
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(6)];
+message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
+ traci.packInt32(length(typeID)) uint8(typeID)];
+message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
+ traci.packInt32(length(routeID)) uint8(routeID)];
+message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
+ traci.packInt32(depart)];
+message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
+ traci.packInt64(pos) uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
+ traci.packInt64(speed)];
+message.string = [message.string uint8([sscanf(constants.TYPE_BYTE,'%x') uint8(lane)])];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/changeLane.m b/tools/contributed/traci4matlab/+traci/+vehicle/changeLane.m
new file mode 100644
index 0000000..82c835c
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/changeLane.m
@@ -0,0 +1,20 @@
+function changeLane(vehID, laneIndex, duration)
+%add Make the vehicle to switch the lane.
+% changeLane(VEHID,LANEINDEX,DURATION) Makes the vehicle with ID VEHID to
+% change the lane to the specified in the index LANEINDEX for the given
+% time duration.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_CHANGELANE,...
+ vehID, 1+4+1+1+1+4);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(2) uint8([sscanf(constants.TYPE_BYTE,'%x') ...
+ laneIndex sscanf(constants.TYPE_INTEGER,'%x')]) ...
+ traci.packInt32(duration)];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/changeTarget.m b/tools/contributed/traci4matlab/+traci/+vehicle/changeTarget.m
new file mode 100644
index 0000000..ac4bec7
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/changeTarget.m
@@ -0,0 +1,12 @@
+function changeTarget(vehID, edgeID)
+%changeTarget Change the vehicle's destination.
+% changeTarget(VEHID,EDGEID) Changes the vehicle's destination edge to
+% the given. The route is rebuilt.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_CHANGETARGET, vehID, edgeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getAccel.m b/tools/contributed/traci4matlab/+traci/+vehicle/getAccel.m
new file mode 100644
index 0000000..81b07bf
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getAccel.m
@@ -0,0 +1,12 @@
+function accel = getAccel(vehID)
+%getAccel Get the acceleration of the vehicle.
+% accel = getAccel(VEHID) Returns the maximum acceleration possibility in
+% m/s^2 of this vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+accel = traci.vehicle.getUniversal(constants.VAR_ACCEL, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getAdaptedTraveltime.m b/tools/contributed/traci4matlab/+traci/+vehicle/getAdaptedTraveltime.m
new file mode 100644
index 0000000..3a1e77d
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getAdaptedTraveltime.m
@@ -0,0 +1,21 @@
+function adaptedTraveltime = getAdaptedTraveltime(vehID, time, edgeID)
+%getAdaptedTraveltime Returns the vehicle-dependent edge travel time.
+% adaptedTraveltime = getAdaptedTraveltime(VEHID,TIME,EDGEID) Returns the
+% edge travel time for the given time as stored in the vehicle's internal
+% container. If such a value does not exist, -1 is returned.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_EDGE_TRAVELTIME,...
+ vehID, 1+4+1+4+1+4+length(edgeID));
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) traci.packInt32(2) ...
+ uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(time) ...
+ uint8(sscanf(constants.TYPE_STRING,'%x')) traci.packInt32(length(edgeID)) ...
+ uint8(edgeID)];
+result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_EDGE_TRAVELTIME, vehID);
+adaptedTraveltime = result.readDouble();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getAngle.m b/tools/contributed/traci4matlab/+traci/+vehicle/getAngle.m
new file mode 100644
index 0000000..0a278bf
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getAngle.m
@@ -0,0 +1,12 @@
+function angle = getAngle(vehID)
+%getAngle Get the angle of the vehicle.
+% angle = getAngle(VEHID) Returns the angle in degrees of the named
+% vehicle within the last step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+angle = traci.vehicle.getUniversal(constants.VAR_ANGLE, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getBestLanes.m b/tools/contributed/traci4matlab/+traci/+vehicle/getBestLanes.m
new file mode 100644
index 0000000..6031d50
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getBestLanes.m
@@ -0,0 +1,14 @@
+function bestLanes = getBestLanes(vehID)
+%getBestLanes Returns information about the wish to use subsequent lanes
+% bestLanes = getBestLanes(VEHID) Returns information about the wish to
+% use subsequent edges' lanes, which is stored in a cell array. The
+% information includes laneID, length, occupation, offset,
+% allowsContinuation and nextLanes.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+bestLanes = traci.vehicle.getUniversal(constants.VAR_BEST_LANES, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getCO2Emission.m b/tools/contributed/traci4matlab/+traci/+vehicle/getCO2Emission.m
new file mode 100644
index 0000000..defc23d
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getCO2Emission.m
@@ -0,0 +1,12 @@
+function CO2Emission = getCO2Emission(vehID)
+%getCO2Emission Returns the CO2 emission of the vehicle.
+% CO2Emission = getCO2Emission(VEHID) Returns the CO2 emission in mg for
+% the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+CO2Emission = traci.vehicle.getUniversal(constants.VAR_CO2EMISSION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getCOEmission.m b/tools/contributed/traci4matlab/+traci/+vehicle/getCOEmission.m
new file mode 100644
index 0000000..42a6d13
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getCOEmission.m
@@ -0,0 +1,12 @@
+function COEmission = getCOEmission(vehID)
+%getCOEmission Returns the CO emission of the vehicle.
+% COEmission = getCO2Emission(VEHID) Returns the CO emission in mg for
+% the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+COEmission = traci.vehicle.getUniversal(constants.VAR_COEMISSION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getColor.m b/tools/contributed/traci4matlab/+traci/+vehicle/getColor.m
new file mode 100644
index 0000000..b251b3e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getColor.m
@@ -0,0 +1,11 @@
+function color = getColor(vehID)
+%getColor Get the color of the vehicle.
+% color = getColor(VEHID) Returns the vehicle's rgba color.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+color = traci.vehicle.getUniversal(constants.VAR_COLOR, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getContextSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+vehicle/getContextSubscriptionResults.m
new file mode 100644
index 0000000..d82d161
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getContextSubscriptionResults.m
@@ -0,0 +1,26 @@
+function ContextSubscriptionResults = getContextSubscriptionResults(vehID)
+%getContextSubscriptionResults Get the context subscription results for the
+% last time step.
+% contextSubscriptionResults = getContextSubscriptionResults(VEHICLEID)
+% Returns the context subscription results for the last time step and the
+% given vehicle. If no vehicle id is given, all subscription results are
+% returned in a containers.Map data struccure. If the vehicle id is unknown
+% or the subscription did for any reason return no data, 'None' is
+% returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global vehSubscriptionResults
+if isempty(vehSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ vehID=None;
+end
+ContextSubscriptionResults = vehSubscriptionResults.getContext(vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getDecel.m b/tools/contributed/traci4matlab/+traci/+vehicle/getDecel.m
new file mode 100644
index 0000000..d68efc2
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getDecel.m
@@ -0,0 +1,12 @@
+function decel = getDecel(vehID)
+%getDecel Returns the deceleration of the vehicle.
+% decel = getDecel(VEHID) Returns the maximum deceleration possibility
+% in m/s^2 of this vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+decel = traci.vehicle.getUniversal(constants.VAR_DECEL, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getDrivingDistance.m b/tools/contributed/traci4matlab/+traci/+vehicle/getDrivingDistance.m
new file mode 100644
index 0000000..5ccf526
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getDrivingDistance.m
@@ -0,0 +1,24 @@
+function drivingDistance = getDrivingDistance(vehID, edgeID, pos, laneID)
+%getDrivingDistance Returns the driving distance to relative coordinate.
+% drivingDistance = getDrivingDistance(VEHID,EDGEID,POS,LANEID) Returns
+% the driving distance from the current position to the given in POS. POS
+% is a position relative to the edge identified by EDGEID and the lane
+% index specified in LANEID. If no LANEID is given, it defaults to zero.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+if nargin < 4
+ laneID=0;
+end
+traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, constants.DISTANCE_REQUEST,...
+ vehID, 1+4+1+4+length(edgeID) + 8+1+1);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) traci.packInt32(2) ...
+ uint8(sscanf(constants.POSITION_ROADMAP,'%x')) traci.packInt32(length(edgeID)) uint8(edgeID)];
+message.string = [message.string traci.packInt64(pos) uint8([laneID sscanf(constants.REQUEST_DRIVINGDIST,'%x')])];
+result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, constants.DISTANCE_REQUEST, vehID);
+drivingDistance = result.readDouble();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getDrivingDistance2D.m b/tools/contributed/traci4matlab/+traci/+vehicle/getDrivingDistance2D.m
new file mode 100644
index 0000000..35920f7
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getDrivingDistance2D.m
@@ -0,0 +1,19 @@
+function drivingDistance2D = getDrivingDistance2D(vehID, x, y)
+%getDrivingDistance2D Returns the driving distance to an absolute coordinate.
+% drivingDistance2D = getDrivingDistance2D(VEHID,X,Y) Returns
+% the driving distance from the current position to that defined by the
+% coordinates X and Y.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, constants.DISTANCE_REQUEST,...
+ vehID, 1+4+1+8+8+1);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) traci.packInt32(2) ...
+ uint8(sscanf(constants.POSITION_2D,'%x')) traci.packInt64([y x]) uint8(sscanf(constants.REQUEST_DRIVINGDIST,'%x'))];
+result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, constants.DISTANCE_REQUEST, vehID);
+drivingDistance2D = result.readDouble();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getEffort.m b/tools/contributed/traci4matlab/+traci/+vehicle/getEffort.m
new file mode 100644
index 0000000..fda6bae
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getEffort.m
@@ -0,0 +1,21 @@
+function effort = getEffort(vehID, time, edgeID)
+%getEffort Return the vehicle-dependent edge effort.
+% effort = getEffort(VEHID,TIME,EDGEID) Returns the edge effort for the
+% given time as stored in the vehicle's internal container. If such a
+% value does not exist, -1 is returned.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_EDGE_EFFORT,...
+ vehID, 1+4+1+4+1+4+length(edgeID));
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) traci.packInt32(2) ...
+ uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(time) ...
+ uint8(sscanf(constants.TYPE_STRING,'%x')) traci.packInt32(length(edgeID)) ...
+ uint8(edgeID)];
+result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_EDGE_EFFORT, vehID);
+effort = result.readDouble();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getEmissionClass.m b/tools/contributed/traci4matlab/+traci/+vehicle/getEmissionClass.m
new file mode 100644
index 0000000..89a1218
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getEmissionClass.m
@@ -0,0 +1,12 @@
+function emissionClass = getEmissionClass(vehID)
+%getEmissionClass Returns the emission class of this vehicle.
+% emissionClass = getEmissionClass(VEHID) Returns the emission class of
+% this vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+emissionClass = traci.vehicle.getUniversal(constants.VAR_EMISSIONCLASS, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getFuelConsumption.m b/tools/contributed/traci4matlab/+traci/+vehicle/getFuelConsumption.m
new file mode 100644
index 0000000..60bb392
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getFuelConsumption.m
@@ -0,0 +1,12 @@
+function fuelConsumption = getFuelConsumption(vehID)
+%getFuelConsumption Get the fuel consumption of the vehicle.
+% fuelConsumption = getFuelConsumption(VEHID) Returns the fuel
+% consumption in ml for the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+fuelConsumption = traci.vehicle.getUniversal(constants.VAR_FUELCONSUMPTION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getHCEmission.m b/tools/contributed/traci4matlab/+traci/+vehicle/getHCEmission.m
new file mode 100644
index 0000000..4817159
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getHCEmission.m
@@ -0,0 +1,12 @@
+function HCEmission = getHCEmission(vehID)
+%getHCEmission Returns the HC emission of the vehicle.
+% HCEmission = getHCEmission(VEHID) Returns the HC emission in mg for
+% the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+HCEmission = traci.vehicle.getUniversal(constants.VAR_HCEMISSION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getIDList.m b/tools/contributed/traci4matlab/+traci/+vehicle/getIDList.m
new file mode 100644
index 0000000..90f65f8
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getIDList.m
@@ -0,0 +1,12 @@
+function IDList = getIDList()
+%getIDList Get the IDs of the vehicles in the network.
+% IDList = getIDList() Returns a cell array of strings containing the IDs
+% of the vehicles in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDList = traci.vehicle.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getImperfection.m b/tools/contributed/traci4matlab/+traci/+vehicle/getImperfection.m
new file mode 100644
index 0000000..4672fa6
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getImperfection.m
@@ -0,0 +1,12 @@
+function imperfection = getImperfection(vehID)
+%getImperfection Returns driver's imperfection.
+% imperfection = getImperfection(VEHID) Returns the driver's imperfection
+% (dawdling) [0,1]
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+imperfection = traci.vehicle.getUniversal(constants.VAR_IMPERFECTION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getLaneID.m b/tools/contributed/traci4matlab/+traci/+vehicle/getLaneID.m
new file mode 100644
index 0000000..92e0eba
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getLaneID.m
@@ -0,0 +1,15 @@
+function laneID = getLaneID(vehID)
+%getLaneID Returns the ID of the lane where the vehicle was in the last step.
+% laneID = getLaneID(VEHID) Returns the id of the lane the named vehicle
+% was at within the last step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+
+
+import traci.constants
+laneID = traci.vehicle.getUniversal(constants.VAR_LANE_ID, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getLaneIndex.m b/tools/contributed/traci4matlab/+traci/+vehicle/getLaneIndex.m
new file mode 100644
index 0000000..486f225
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getLaneIndex.m
@@ -0,0 +1,12 @@
+function laneIndex = getLaneIndex(vehID)
+%getLaneIndex Returns the index of the lane where the vehicle was in the last step.
+% laneIndex = getLaneIndex(VEHID) Returns the index of the lane the named
+% vehicle was at within the last step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+laneIndex = traci.vehicle.getUniversal(constants.VAR_LANE_INDEX, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getLanePosition.m b/tools/contributed/traci4matlab/+traci/+vehicle/getLanePosition.m
new file mode 100644
index 0000000..8a56983
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getLanePosition.m
@@ -0,0 +1,12 @@
+function lanePosition = getLanePosition(vehID)
+%getLanePosition Get the position of the vehicle along the lane.
+% lanePosition = getLanePosition(VEHID) Returns the position of the
+% vehicle along the lane measured in m.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+lanePosition = traci.vehicle.getUniversal(constants.VAR_LANEPOSITION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getLeader.m b/tools/contributed/traci4matlab/+traci/+vehicle/getLeader.m
new file mode 100644
index 0000000..7d53304
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getLeader.m
@@ -0,0 +1,31 @@
+function [vehicleID, dist] = getLeader(vehID,dist)
+%getLeader Return the leading vehicle id and distance to ir.
+% [vehicleID, dist] = getLeader(VEHID,DIST) Return the leading vehicle id
+% together with the distance.
+% The DIST parameter defines the maximum lookahead, 0 calculates a
+% lookahead from the brake gap.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+if nargin < 2
+ dist = 0;
+end
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, '0x68',...
+ vehID, 1+8);
+message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x'))...
+ traci.packInt64(dist)];
+
+result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, '0x68', vehID);
+
+result.readInt();
+result.read(1);
+vehicleID = result.readString();
+result.read(1);
+dist = result.readDouble();
+
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getLength.m b/tools/contributed/traci4matlab/+traci/+vehicle/getLength.m
new file mode 100644
index 0000000..bf93b0f
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getLength.m
@@ -0,0 +1,11 @@
+function length = getLength(vehID)
+%getLength Returns the length in m of the given vehicle.
+% length = getLength(VEHID) Returns the length in m of the given vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+length = traci.vehicle.getUniversal(constants.VAR_LENGTH, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getMaxSpeed.m b/tools/contributed/traci4matlab/+traci/+vehicle/getMaxSpeed.m
new file mode 100644
index 0000000..c0cdd9c
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getMaxSpeed.m
@@ -0,0 +1,12 @@
+function maxSpeed = getMaxSpeed(vehID)
+%getMaxSpeed Returns the maximum speed in m/s of this vehicle.
+% maxSpeed = getMaxSpeed(VEHID) Returns the maximum speed in m/s of this
+% vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+maxSpeed = traci.vehicle.getUniversal(constants.VAR_MAXSPEED, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getMinGap.m b/tools/contributed/traci4matlab/+traci/+vehicle/getMinGap.m
new file mode 100644
index 0000000..801e079
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getMinGap.m
@@ -0,0 +1,12 @@
+function minGap = getMinGap(vehID)
+%getMinGap Returns the gap to front vehicle.
+% minGap = getMinGap(VEHID) Returns the offset (gap to front vehicle if
+% halting) of this vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+minGap = traci.vehicle.getUniversal(constants.VAR_MINGAP, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getNOxEmission.m b/tools/contributed/traci4matlab/+traci/+vehicle/getNOxEmission.m
new file mode 100644
index 0000000..60bbe04
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getNOxEmission.m
@@ -0,0 +1,12 @@
+function NOxEmission = getNOxEmission(vehID)
+%getNOxEmission Get the NOx emission of the vehicle.
+% NOxEmission = getNOxEmission(VEHID) Returns the NOx emission in mg for
+% the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+NOxEmission = traci.vehicle.getUniversal(constants.VAR_NOXEMISSION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getNoiseEmission.m b/tools/contributed/traci4matlab/+traci/+vehicle/getNoiseEmission.m
new file mode 100644
index 0000000..40e0a56
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getNoiseEmission.m
@@ -0,0 +1,12 @@
+function noiseEmission = getNoiseEmission(vehID)
+%getNoiseEmission Get the noise emission of the vehicle.
+% noiseEmission = getNoiseEmission(VEHID) Returns the noise emission in
+% db for the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+noiseEmission = traci.vehicle.getUniversal(constants.VAR_NOISEEMISSION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getPMxEmission.m b/tools/contributed/traci4matlab/+traci/+vehicle/getPMxEmission.m
new file mode 100644
index 0000000..94c6290
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getPMxEmission.m
@@ -0,0 +1,12 @@
+function PMxEmission = getPMxEmission(vehID)
+%getPmxEmission Get the particular matter emission of the vehicle.
+% pmxEmission = getPmxEmission(VEHID) Returns the particular matter
+% emission in mg for the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+PMxEmission = traci.vehicle.getUniversal(constants.VAR_PMXEMISSION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getPosition.m b/tools/contributed/traci4matlab/+traci/+vehicle/getPosition.m
new file mode 100644
index 0000000..ee4d234
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getPosition.m
@@ -0,0 +1,12 @@
+function position = getPosition(vehID)
+%getPosition Returns the position of the named vehicle within the last step.
+% position = getPosition(VEHID) Returns the x,y position of the named
+% vehicle within the last step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+position = traci.vehicle.getUniversal(constants.VAR_POSITION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getRoadID.m b/tools/contributed/traci4matlab/+traci/+vehicle/getRoadID.m
new file mode 100644
index 0000000..135a8f6
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getRoadID.m
@@ -0,0 +1,12 @@
+function roadID = getRoadID(vehID)
+%getRoadID Returns the edge the vehicle was at in last step.
+% roadID = getRoadID(VEHID) Returns the id of the edge the named vehicle
+% was at within the last step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+roadID = traci.vehicle.getUniversal(constants.VAR_ROAD_ID, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getRoute.m b/tools/contributed/traci4matlab/+traci/+vehicle/getRoute.m
new file mode 100644
index 0000000..de6acaf
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getRoute.m
@@ -0,0 +1,12 @@
+function route = getRoute(vehID)
+%getRoute Get the vehicle route.
+% route = getRoute(VEHID) Returns a cell array of strings containing the
+% ids of the edges the vehicle's route is made of.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+route = traci.vehicle.getUniversal(constants.VAR_EDGES, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getRouteID.m b/tools/contributed/traci4matlab/+traci/+vehicle/getRouteID.m
new file mode 100644
index 0000000..cd6fbe4
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getRouteID.m
@@ -0,0 +1,12 @@
+function routeID = getRouteID(vehID)
+%getRouteID Returns the id of the route of the named vehicle.
+% routeID = getRouteID(VEHID) Returns the id of the route of the named
+% vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+routeID = traci.vehicle.getUniversal(constants.VAR_ROUTE_ID, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getShapeClass.m b/tools/contributed/traci4matlab/+traci/+vehicle/getShapeClass.m
new file mode 100644
index 0000000..562a1e0
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getShapeClass.m
@@ -0,0 +1,12 @@
+function shapeClass = getShapeClass(vehID)
+%getShapeClass Returns the shape class of this vehicle.
+% shapeClass = getShapeClass(VEHID) Returns the shape class of this
+% vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+shapeClass = traci.vehicle.getUniversal(constants.VAR_SHAPECLASS, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getSignals.m b/tools/contributed/traci4matlab/+traci/+vehicle/getSignals.m
new file mode 100644
index 0000000..396e5b0
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getSignals.m
@@ -0,0 +1,30 @@
+function signals = getSignals(vehID)
+%getSignals Get the vehicle route.
+% signals = getSignals(VEHID) Returns an integer encoding the state of a
+% vehicle's signals.
+% The following table shows the defined signals.
+%
+% Name Bit
+% VEH_SIGNAL_BLINKER_RIGHT 0
+% VEH_SIGNAL_BLINKER_LEFT 1
+% VEH_SIGNAL_BLINKER_EMERGENCY 2
+% VEH_SIGNAL_BRAKELIGHT 3
+% VEH_SIGNAL_FRONTLIGHT 4
+% VEH_SIGNAL_FOGLIGHT 5
+% VEH_SIGNAL_HIGHBEAM 6
+% VEH_SIGNAL_BACKDRIVE 7
+% VEH_SIGNAL_WIPER 8
+% VEH_SIGNAL_DOOR_OPEN_LEFT 9
+% VEH_SIGNAL_DOOR_OPEN_RIGHT 10
+% VEH_SIGNAL_EMERGENCY_BLUE 11
+% VEH_SIGNAL_EMERGENCY_RED 12
+% VEH_SIGNAL_EMERGENCY_YELLOW 13
+
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+signals = traci.vehicle.getUniversal(constants.VAR_SIGNALS, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getSpeed.m b/tools/contributed/traci4matlab/+traci/+vehicle/getSpeed.m
new file mode 100644
index 0000000..2017153
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getSpeed.m
@@ -0,0 +1,12 @@
+function speed = getSpeed(vehID)
+%getSpeed Get the vehicle speed.
+% speed = getSpeed(VEHID) Returns the speed in m/s of the named vehicle
+% within the last step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+speed = traci.vehicle.getUniversal(constants.VAR_SPEED, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getSpeedDeviation.m b/tools/contributed/traci4matlab/+traci/+vehicle/getSpeedDeviation.m
new file mode 100644
index 0000000..52fc086
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getSpeedDeviation.m
@@ -0,0 +1,12 @@
+function speedDeviation = getSpeedDeviation(vehID)
+%getSpeedDeviation Returns the maximum speed deviation of the vehicle type.
+% speedDeviation = getSpeedDeviation(VEHID) Returns the maximum speed
+% deviation of the vehicle type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+speedDeviation = traci.vehicle.getUniversal(constants.VAR_SPEED_DEVIATION, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getSpeedFactor.m b/tools/contributed/traci4matlab/+traci/+vehicle/getSpeedFactor.m
new file mode 100644
index 0000000..7f7424f
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getSpeedFactor.m
@@ -0,0 +1,12 @@
+function speedFactor = getSpeedFactor(vehID)
+%getSpeedFactor Returns the chosen speed factor for this vehicle.
+% speedFactor = getSpeedFactor(VEHID) Returns the chosen speed factor for
+% this vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+speedFactor = traci.vehicle.getUniversal(constants.VAR_SPEED_FACTOR, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getSpeedWithoutTraCI.m b/tools/contributed/traci4matlab/+traci/+vehicle/getSpeedWithoutTraCI.m
new file mode 100644
index 0000000..908567b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getSpeedWithoutTraCI.m
@@ -0,0 +1,8 @@
+function speedWithoutTraCI = getSpeedWithoutTraCI(vehID)
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+speedWithoutTraCI = traci.vehicle.getUniversal(constants.VAR_SPEED_WITHOUT_TRACI, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+vehicle/getSubscriptionResults.m
new file mode 100644
index 0000000..2490bec
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getSubscriptionResults.m
@@ -0,0 +1,26 @@
+function subscriptionResults = getSubscriptionResults(vehID)
+%getSubscriptionResults Get the subscription results for the last time step.
+% subscriptionResults = getSubscriptionResults(VEHICLEID) Returns the
+% subscription results for the last time step and the given vehicle. If no
+% vehicle id is given, all subscription results are returned in a
+% containers.Map data structure.
+% If the vehicle id is unknown or the subscription did for any reason return
+% no data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global vehSubscriptionResults
+if isempty(vehSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ vehID = 'None';
+end
+
+subscriptionResults = vehSubscriptionResults.get(vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getTau.m b/tools/contributed/traci4matlab/+traci/+vehicle/getTau.m
new file mode 100644
index 0000000..45aa16d
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getTau.m
@@ -0,0 +1,12 @@
+function tau = getTau(vehID)
+%getTau Returns the driver's reaction time in s for this vehicle.
+% tau = getTau(VEHID) Returns the driver's reaction time in s for this
+% vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+tau = traci.vehicle.getUniversal(constants.VAR_TAU, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getTypeID.m b/tools/contributed/traci4matlab/+traci/+vehicle/getTypeID.m
new file mode 100644
index 0000000..d341c32
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getTypeID.m
@@ -0,0 +1,12 @@
+function typeID = getTypeID(vehID)
+%getTypeID Returns the id of the type of the named vehicle.
+% typeID = getTypeID(VEHID) Returns the id of the type of the named
+% vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+typeID = traci.vehicle.getUniversal(constants.VAR_TYPE, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getUniversal.m b/tools/contributed/traci4matlab/+traci/+vehicle/getUniversal.m
new file mode 100644
index 0000000..dc176bb
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getUniversal.m
@@ -0,0 +1,25 @@
+function returnedValue = getUniversal(varID, vehID)
+%getUniversal An internal function to send the get command and read the
+%variable value.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global vehSubscriptionResults
+
+if isempty(vehSubscriptionResults)
+ returnValueFunc = traci.RETURN_VALUE_FUNC.vehicle;
+else
+ returnValueFunc = vehSubscriptionResults.valueFunc;
+end
+
+% Prepare the outgoing message and read the response. The result variable
+% is a traci.Storage object
+result = traci.sendReadOneStringCmd(constants.CMD_GET_VEHICLE_VARIABLE,varID,vehID);
+handleReturValueFunc = str2func(returnValueFunc(varID));
+
+% Use the proper method to read the variable of interest from the result
+returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getVehicleClass.m b/tools/contributed/traci4matlab/+traci/+vehicle/getVehicleClass.m
new file mode 100644
index 0000000..facd4a4
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getVehicleClass.m
@@ -0,0 +1,12 @@
+function vehicleClass = getVehicleClass(vehID)
+%getVehicleClass Returns the vehicle class of this vehicle.
+% vehicleClass = getVehicleClass(VEHID) Returns the vehicle class of this
+% vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+vehicleClass = traci.vehicle.getUniversal(constants.VAR_VEHICLECLASS, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/getWidth.m b/tools/contributed/traci4matlab/+traci/+vehicle/getWidth.m
new file mode 100644
index 0000000..939e4cc
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/getWidth.m
@@ -0,0 +1,11 @@
+function width = getWidth(vehID)
+%getWidth Returns the width in m of this vehicle.
+% width = getWidth(VEHID) Returns the width in m of this vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+width = traci.vehicle.getUniversal(constants.VAR_WIDTH, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/isRouteValid.m b/tools/contributed/traci4matlab/+traci/+vehicle/isRouteValid.m
new file mode 100644
index 0000000..6d29385
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/isRouteValid.m
@@ -0,0 +1,12 @@
+function isvalid = isRouteValid(vehID)
+%isRouteValid Determine whether the current route of the vehicle is valid.
+% isvalid = isRouteValid(VEHID) Determine whether the current route of the
+% vehicle is valid (i.e. all the edges along the route are connected).
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+isvalid = traci.vehicle.getUniversal(constants.VAR_ROUTE_VALID, vehID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/moveTo.m b/tools/contributed/traci4matlab/+traci/+vehicle/moveTo.m
new file mode 100644
index 0000000..483ff51
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/moveTo.m
@@ -0,0 +1,21 @@
+function moveTo(vehID, laneID, pos)
+%moveTo Commands the vehicle to move to the specified position.
+% moveTo(VEHID,LANEID,POS) Commands the vehicle to move to the specified
+% position on the given lane.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MOVE_TO, vehID,...
+ 1+4+1+4+length(laneID)+1+8);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(2)];
+message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
+ traci.packInt32(length(laneID)) uint8(laneID)];
+message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
+ traci.packInt32(pos)];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/moveToVTD.m b/tools/contributed/traci4matlab/+traci/+vehicle/moveToVTD.m
new file mode 100644
index 0000000..cafc1a0
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/moveToVTD.m
@@ -0,0 +1,24 @@
+function moveToVTD(vehID, edgeID, lane, x, y)
+%moveToVTD Commands the vehicle to move to the specified position.
+% moveToVTD(VEHID,EDGEID,LANE,X,Y)
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+
+traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MOVE_TO_VTD,...
+ vehID,1+4+1+4+length(edgeID)+1+4+1+8+1+8);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(4)];
+message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
+ traci.packInt32(length(edgeID)) uint8(edgeID)];
+message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
+ traci.packInt32(lane)];
+message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
+ traci.packInt64(x)];
+message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
+ traci.packInt64(y)];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/readBestLanes.m b/tools/contributed/traci4matlab/+traci/+vehicle/readBestLanes.m
new file mode 100644
index 0000000..3fa2c29
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/readBestLanes.m
@@ -0,0 +1,31 @@
+function lanes = readBestLanes(result)
+%readBestLanes Internal function to read information about the whish to use
+%subsequent edge's lanes.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+result.read(5);
+nbLanes = result.readInt(); % Length
+lanes = cell(1,nbLanes);
+for i=1:nbLanes
+ result.read(1);
+ laneID = result.readString();
+ result.read(1);
+ len = result.readDouble();
+ result.read(1);
+ occupation = result.readDouble();
+ result.read(1);
+ offset = result.read(1);
+ result.read(1);
+ allowsContinuation = result.read(1);
+ result.read(1);
+ nextLanesNo = result.readInt();
+ nextLanes = cell(1,nextLanesNo);
+ for j=1:nextLanesNo
+ nextLanes{j} = result.readString();
+ end
+ lanes{i} = {laneID, len, occupation, offset, allowsContinuation, nextLanes};
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/remove.m b/tools/contributed/traci4matlab/+traci/+vehicle/remove.m
new file mode 100644
index 0000000..8f9cfce
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/remove.m
@@ -0,0 +1,17 @@
+function remove(vehID, reason)
+%remove Remove vehicle.
+% remove(VEHID,REASON) Remove vehicle with the given ID for the given
+% reason. Reasons are defined in traci.constants and start with REMOVE_
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+
+if nargin < 2
+ reason = sscanf(constants.REMOVE_VAPORIZED,'%x');
+end
+
+traci.sendByteCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.REMOVE, vehID, reason);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/rerouteEffort.m b/tools/contributed/traci4matlab/+traci/+vehicle/rerouteEffort.m
new file mode 100644
index 0000000..3946c1b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/rerouteEffort.m
@@ -0,0 +1,19 @@
+function rerouteEffort(vehID)
+%rerouteEffort Compute new route based on the edges' assigned effort.
+% rerouteEffort(VEHID) Computes a new route using the vehicle's internal
+% and the global edge effort information. Replaces the current route by
+% the found.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+
+traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_REROUTE_EFFORT, vehID,...
+ 1+4);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(0)];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/rerouteTraveltime.m b/tools/contributed/traci4matlab/+traci/+vehicle/rerouteTraveltime.m
new file mode 100644
index 0000000..afc9e04
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/rerouteTraveltime.m
@@ -0,0 +1,19 @@
+function rerouteTraveltime(vehID)
+%rerouteTraveltime Compute new route based on the edges' assigned travel time.
+% rerouteTraveltime(VEHID) Computes a new route using the vehicle's
+% internal and the global edge travel time information. Replaces the
+% current route by the found.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+
+traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_REROUTE_TRAVELTIME, vehID,...
+ 1+4);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(0)];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setAccel.m b/tools/contributed/traci4matlab/+traci/+vehicle/setAccel.m
new file mode 100644
index 0000000..21cf943
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setAccel.m
@@ -0,0 +1,12 @@
+function setAccel(vehID, accel)
+%setAccel Set the acceleration of the vehicle.
+% setAccel(VEHID,ACCEL) Sets the maximum acceleration in m/s^2 for this
+% vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_ACCEL, vehID, accel);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setAdaptedTraveltime.m b/tools/contributed/traci4matlab/+traci/+vehicle/setAdaptedTraveltime.m
new file mode 100644
index 0000000..f20e3b4
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setAdaptedTraveltime.m
@@ -0,0 +1,24 @@
+function setAdaptedTraveltime(vehID, begTime, endTime, edgeID, time)
+%setAdaptedTraveltime Assign edge's travel time to vehicle's container.
+% setAdaptedTraveltime(VEHID,BEGTIME,ENDTIME,EDGEID,TIME) Inserts the
+% information about the travel time of edge EDGEID valid from BEGTIME
+% time to ENDTIME time into the vehicle's internal edge weights container.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+
+traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_EDGE_TRAVELTIME, vehID,...
+ 1+4+1+4+1+4+1+4+length(edgeID)+1+8);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(4) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
+ traci.packInt32(begTime) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
+ traci.packInt32(endTime) uint8(sscanf(constants.TYPE_STRING,'%x')) ...
+ traci.packInt32(length(edgeID)) uint8(edgeID)];
+message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
+ traci.packInt64(time)];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setColor.m b/tools/contributed/traci4matlab/+traci/+vehicle/setColor.m
new file mode 100644
index 0000000..b004f49
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setColor.m
@@ -0,0 +1,16 @@
+function setColor(vehID, color)
+%setColor Set the color of the vehicle.
+% setColor(VEHID,COLOR) Sets color for vehicle with the given ID, i.e.
+% (255,0,0,0) for the color red. The fourth integer (alpha) is currently
+% ignored
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_COLOR, vehID, 1+1+1+1+1);
+message.string = [message.string uint8([sscanf(constants.TYPE_COLOR,'%x') color])];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setDecel.m b/tools/contributed/traci4matlab/+traci/+vehicle/setDecel.m
new file mode 100644
index 0000000..deb2ed3
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setDecel.m
@@ -0,0 +1,12 @@
+function setDecel(vehID, decel)
+%setDecel ets the maximum deceleration for this vehicle.
+% setDecel(VEHID,DECEL) Sets the maximum deceleration in m/s^2 for this
+% vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_DECEL, vehID, decel);
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setEffort.m b/tools/contributed/traci4matlab/+traci/+vehicle/setEffort.m
new file mode 100644
index 0000000..836e763
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setEffort.m
@@ -0,0 +1,24 @@
+function setEffort(vehID, begTime, endTime, edgeID, effort)
+%setEffort Inserts the information about the effort of the given edge.
+% setEffort(VEHID,BEGTIME,ENDTIME,EDGEID,EFFORT) Inserts the information
+% about the effort of edge EDGEID valid from BEGTIME time to ENDTIME time
+% into the vehicle's internal edge weights container.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+
+traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_EDGE_EFFORT, vehID,...
+ 1+4+1+4+1+4+1+4+length(edgeID)+1+4);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(int32(4)) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
+ traci.packInt32(int32(begTime)) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
+ traci.packInt32(int32(endTime)) uint8(sscanf(constants.TYPE_STRING,'%x')) ...
+ traci.packInt32(int32(length(uint8(edgeID)))) uint8(edgeID)];
+message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
+ traci.packInt64(effort)];
+traci.sendExact()
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setEmissionClass.m b/tools/contributed/traci4matlab/+traci/+vehicle/setEmissionClass.m
new file mode 100644
index 0000000..4746b5a
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setEmissionClass.m
@@ -0,0 +1,11 @@
+function setEmissionClass(vehID, clazz)
+%setEmissionClass Sets the emission class for this vehicle.
+% setEmissionClass(VEHID,CLASS) Sets the emission class for this vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_EMISSIONCLASS, vehID, clazz);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setImperfection.m b/tools/contributed/traci4matlab/+traci/+vehicle/setImperfection.m
new file mode 100644
index 0000000..045e876
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setImperfection.m
@@ -0,0 +1,13 @@
+function setImperfection(vehID, imperfection)
+%setImperfection Sets the driver's imperfection (dawdling).
+% setImperfection(VEHID,IMPERFECTION) Sets the driver's imperfection
+% (dawdling). IMPERFECTION is a double precision integer ranging from
+% zero to one.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_IMPERFECTION, vehID, imperfection);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setLaneChangeMode.m b/tools/contributed/traci4matlab/+traci/+vehicle/setLaneChangeMode.m
new file mode 100644
index 0000000..89a6a72
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setLaneChangeMode.m
@@ -0,0 +1,18 @@
+function setLaneChangeMode(vehID, lcm)
+%setLaneChangeMode Sets the vehicle's lane change mode as a bitset.
+% setLaneChangeMode(VEHID, LCM)Sets the vehicle's lane change mode as a
+% bitset. For further details, see 'lane change mode' in
+% http://sumo.dlr.de/wiki/TraCI/Change_Vehicle_State
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendIntCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_LANECHANGEMODE, vehID, lcm);
+
+
+
+
+
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setLength.m b/tools/contributed/traci4matlab/+traci/+vehicle/setLength.m
new file mode 100644
index 0000000..223665c
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setLength.m
@@ -0,0 +1,11 @@
+function setLength(vehID, length)
+%setLength Sets the length in m for the given vehicle.
+% setLength(VEHID,LENGTH) Sets the length in m for the given vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_LENGTH, vehID, length);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setMaxSpeed.m b/tools/contributed/traci4matlab/+traci/+vehicle/setMaxSpeed.m
new file mode 100644
index 0000000..139dbb4
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setMaxSpeed.m
@@ -0,0 +1,11 @@
+function setMaxSpeed(vehID, speed)
+%setMaxSpeed Sets the maximum speed in m/s for this vehicle.
+% setMaxSpeed(VEHID,SPEED) Sets the maximum speed in m/s for this vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MAXSPEED, vehID, speed);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setMinGap.m b/tools/contributed/traci4matlab/+traci/+vehicle/setMinGap.m
new file mode 100644
index 0000000..ed7f5ef
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setMinGap.m
@@ -0,0 +1,12 @@
+function setMinGap(vehID, minGap)
+%setMinGap Sets the offset (gap to front vehicle) for this vehicle.
+% setMinGap(VEHID,MINGAP) Sets the offset (gap to front vehicle if
+% halting) for this vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MINGAP, vehID, minGap);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setRoute.m b/tools/contributed/traci4matlab/+traci/+vehicle/setRoute.m
new file mode 100644
index 0000000..0bde0b0
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setRoute.m
@@ -0,0 +1,28 @@
+function setRoute(vehID, edgeList)
+%setRoute Set the route of the vehicle.
+% setRoute(VEHID,EDGELIST) changes the vehicle route to given edges list.
+% The first edge in the list has to be the one that the vehicle is at at
+% the moment.
+%
+% Example:
+% traci.vehicle.setRoute{'1', {'1', '2', '4', '6', '7'}}
+%
+% changes the route for vehicle id 1 to edges 1-2-4-6-7.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+
+traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_ROUTE, vehID,...
+ 1+4+sum(cellfun('length', edgeList))+4*length(edgeList));
+message.string = [message.string uint8(sscanf(constants.TYPE_STRINGLIST,'%x')) ...
+ traci.packInt32(length(edgeList))];
+for i=1:length(edgeList)
+ message.string = [message.string traci.packInt32(length(edgeList{i})) ...
+ uint8(edgeList{i})];
+end
+traci.sendExact()
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setRouteID.m b/tools/contributed/traci4matlab/+traci/+vehicle/setRouteID.m
new file mode 100644
index 0000000..97f35f0
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setRouteID.m
@@ -0,0 +1,12 @@
+function setRouteID(vehID, routeID)
+%setRouteID Sets the id of the route for the named vehicle.
+% setRouteID(VEHID,ROUTEID) Sets the id of the route for the named
+% vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_ROUTE_ID, vehID, routeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setShapeClass.m b/tools/contributed/traci4matlab/+traci/+vehicle/setShapeClass.m
new file mode 100644
index 0000000..8939b9d
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setShapeClass.m
@@ -0,0 +1,11 @@
+function setShapeClass(vehID, clazz)
+%setShapeClass Sets the shape class for this vehicle.
+% setShapeClass(VEHID,CLASS) Sets the shape class for this vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SHAPECLASS, vehID, clazz);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setSignals.m b/tools/contributed/traci4matlab/+traci/+vehicle/setSignals.m
new file mode 100644
index 0000000..2f19886
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setSignals.m
@@ -0,0 +1,29 @@
+function setSignals(vehID, signals)
+%setSignals Sets an integer encoding the state of the vehicle's signals.
+% setSignalsVEHID,SIGNALS) Sets an integer encoding the state of the
+% vehicle's signals.
+% The following table shows the defined signals.
+%
+% Name Bit
+% VEH_SIGNAL_BLINKER_RIGHT 0
+% VEH_SIGNAL_BLINKER_LEFT 1
+% VEH_SIGNAL_BLINKER_EMERGENCY 2
+% VEH_SIGNAL_BRAKELIGHT 3
+% VEH_SIGNAL_FRONTLIGHT 4
+% VEH_SIGNAL_FOGLIGHT 5
+% VEH_SIGNAL_HIGHBEAM 6
+% VEH_SIGNAL_BACKDRIVE 7
+% VEH_SIGNAL_WIPER 8
+% VEH_SIGNAL_DOOR_OPEN_LEFT 9
+% VEH_SIGNAL_DOOR_OPEN_RIGHT 10
+% VEH_SIGNAL_EMERGENCY_BLUE 11
+% VEH_SIGNAL_EMERGENCY_RED 12
+% VEH_SIGNAL_EMERGENCY_YELLOW 13
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendIntCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SIGNALS, vehID, signals);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setSpeed.m b/tools/contributed/traci4matlab/+traci/+vehicle/setSpeed.m
new file mode 100644
index 0000000..cc894cf
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setSpeed.m
@@ -0,0 +1,12 @@
+function setSpeed(vehID, speed)
+%setSpeed Sets the speed in m/s for the named vehicle within the last step.
+% setSpeed(VEHID,SPEED) Sets the speed in m/s for the named vehicle
+% within the last step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SPEED, vehID, speed);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setSpeedDeviation.m b/tools/contributed/traci4matlab/+traci/+vehicle/setSpeedDeviation.m
new file mode 100644
index 0000000..9d6b22e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setSpeedDeviation.m
@@ -0,0 +1,12 @@
+function setSpeedDeviation(vehID, deviation)
+%setSpeedDeviation Sets the maximum speed deviation for this vehicle.
+% setSpeedDeviation(VEHID,DEVIATION) Sets the maximum speed deviation for
+% this vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SPEED_DEVIATION, vehID, deviation);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setSpeedFactor.m b/tools/contributed/traci4matlab/+traci/+vehicle/setSpeedFactor.m
new file mode 100644
index 0000000..31f7116
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setSpeedFactor.m
@@ -0,0 +1,12 @@
+function setSpeedFactor(vehID, factor)
+%setSpeedFactor Sets the speed factor within the last step.
+% setSpeedFactor(VEHID,FACTOR) Sets the speed factor for the named
+% vehicle within the last step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SPEED_FACTOR, vehID, factor);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setSpeedMode.m b/tools/contributed/traci4matlab/+traci/+vehicle/setSpeedMode.m
new file mode 100644
index 0000000..e780786
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setSpeedMode.m
@@ -0,0 +1,19 @@
+function setSpeedMode(vehID, sm)
+%setSpeedMode Sets the vehicle's speed mode as a bitset.
+% setSpeedMode(VEHID, SM) Sets the vehicle's speed mode as a bitset. For
+% further details, see 'speed mode' in http://sumo.dlr.de/wiki/TraCI/Change_Vehicle_State
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+
+import traci.constants
+traci.sendIntCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SPEEDSETMODE, vehID, sm);
+
+
+
+
+
+
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setStop.m b/tools/contributed/traci4matlab/+traci/+vehicle/setStop.m
new file mode 100644
index 0000000..d48b87e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setStop.m
@@ -0,0 +1,38 @@
+function setStop(vehID, edgeID, pos, laneIndex, duration)
+%setStop Set a stop for the vehicle.
+% setStop(VEHID,EDGEID) Sets a stop for the vehicle VEHID in the edge
+% EDGEID for the maximum allowed time. The position and the lane index
+% default to one and zero respectively.
+% setStop(...,POS) Specify the position of the stop in the lane.
+% setStop(...,LANEINDEX) Specify the lane index in which the stop will be
+% made.
+% setStop(...,DURATION) Specify the duration of the stop.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+
+import traci.constants
+global message
+if nargin < 5
+ duration = 2^31-1;
+ if nargin < 4
+ laneIndex = 0;
+ if nargin < 3
+ pos = 1;
+ end
+ end
+end
+traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_STOP,...
+ vehID, 1+4+1+4+length(edgeID)+1+8+1+1+1+4);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(4)];
+message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
+ traci.packInt32(length(edgeID)) uint8(edgeID)];
+message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
+ traci.packInt64(pos) uint8([sscanf(constants.TYPE_BYTE,'%x') ...
+ laneIndex sscanf(constants.TYPE_INTEGER,'%x')]) ...
+ traci.packInt32(duration)];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setTau.m b/tools/contributed/traci4matlab/+traci/+vehicle/setTau.m
new file mode 100644
index 0000000..cd065ed
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setTau.m
@@ -0,0 +1,11 @@
+function setTau(vehID, tau)
+%setTau Sets the driver's reaction time in s for this vehicle.
+% setTau(VEHID,TAU) Sets the driver's reaction time in s for this vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_TAU, vehID, tau);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setVehicleClass.m b/tools/contributed/traci4matlab/+traci/+vehicle/setVehicleClass.m
new file mode 100644
index 0000000..aad6fb4
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setVehicleClass.m
@@ -0,0 +1,12 @@
+function setVehicleClass(vehID, clazz)
+%setVehicleClass Sets the vehicle class for this vehicle.
+% setVehicleClass(VEHID,CLASS) Sets the vehicle class for this vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+
+import traci.constants
+traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_VEHICLECLASS, vehID, clazz);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/setWidth.m b/tools/contributed/traci4matlab/+traci/+vehicle/setWidth.m
new file mode 100644
index 0000000..f84df15
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/setWidth.m
@@ -0,0 +1,11 @@
+function setWidth(vehID, width)
+%setWidth Sets the width in m for this vehicle.
+% setWidth(VEHID,WIDTH) Sets the width in m for this vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_WIDTH, vehID, width);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/slowDown.m b/tools/contributed/traci4matlab/+traci/+vehicle/slowDown.m
new file mode 100644
index 0000000..79e43ee
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/slowDown.m
@@ -0,0 +1,19 @@
+function slowDown(vehID, speed, duration)
+%slowDown Reduces the speed of the vehicle.
+% slowDown(VEHID,SPEED,DURATION) Reduces the speed of the vehicle to the
+% given for the given amount of time.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_SLOWDOWN,...
+ vehID, 1+4+1+8+1+4);
+message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ...
+ traci.packInt32(2) uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
+ traci.packInt64(speed) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
+ traci.packInt32(duration)];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/subscribe.m b/tools/contributed/traci4matlab/+traci/+vehicle/subscribe.m
new file mode 100644
index 0000000..2932b4f
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/subscribe.m
@@ -0,0 +1,38 @@
+function subscribe(vehID, varargin)
+%subscribe Subscribe to vehicle variable.
+% subscribe(VEHID) Subscribe to the VAR_ROAD_ID and VAR_LANEPOSITION
+% values for the maximum allowed interval.
+% subscribe(VEHID,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS for the maximum allowed interval.
+% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
+% allowed end time.
+% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
+% END.
+% A call to this function clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global vehSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'vehicle.subscribe';
+p.addRequired('vehID', at ischar)
+p.addOptional('varIDs', {constants.VAR_ROAD_ID, constants.VAR_LANEPOSITION}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(vehID, varargin{:})
+vehID = p.Results.vehID;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+vehSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicle);
+
+vehSubscriptionResults.reset()
+traci.subscribe(constants.CMD_SUBSCRIBE_VEHICLE_VARIABLE,...
+ subscriptionBegin, subscriptionEnd, vehID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicle/subscribeContext.m b/tools/contributed/traci4matlab/+traci/+vehicle/subscribeContext.m
new file mode 100644
index 0000000..35f1d05
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicle/subscribeContext.m
@@ -0,0 +1,46 @@
+function subscribeContext(vehID, domain, dist, varargin)
+%subscribeContext Subscribe to a vehicle's context variable.
+% subscribeContext(VEHID,DOMAIN,DIST) Subscribe to the VAR_ROAD_ID and
+% VAR_LANEPOSITION value of the SUMO objects that surround the vehicle
+% specified by VEHID at a distance given by DIST, for the maximum allowed
+% interval. The type of objets that surround the vehicle are defined in
+% the DOMAIN parameter. Note that not all the SUMO object types support
+% the variables VAR_ROAD_ID and VAR_LANEPOSITION.
+% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS.
+% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
+% maximum allowed end time.
+% subscribeContext(...,END) Subscribe for the time interval defined by
+% BEGIN and END.
+% A call to this method clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global vehSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'vehicle.subscribeContext';
+p.addRequired('vehID', at ischar)
+p.addRequired('domain', at ischar)
+p.addRequired('dist', at isnumeric)
+p.addOptional('varIDs', {constants.VAR_ROAD_ID, constants.VAR_LANEPOSITION}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(vehID, domain, dist, varargin{:})
+vehID = p.Results.vehID;
+domain = p.Results.domain;
+dist = p.Results.dist;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+vehSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicle);
+
+vehSubscriptionResults.reset()
+traci.subscribeContext(constants.CMD_SUBSCRIBE_VEHICLE_CONTEXT,...
+ subscriptionBegin, subscriptionEnd, vehID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getAccel.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getAccel.m
new file mode 100644
index 0000000..a6b304c
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getAccel.m
@@ -0,0 +1,12 @@
+function accel = getAccel(typeID)
+%getAccel Returns the maximum acceleration of vehicles of this type.
+% accel = getAccel(TYPEID) Returns the maximum acceleration in m/s^2 of
+% vehicles of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+accel = traci.vehicletype.getUniversal(constants.VAR_ACCEL, typeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getColor.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getColor.m
new file mode 100644
index 0000000..c24b82c
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getColor.m
@@ -0,0 +1,11 @@
+function color = getColor(typeID)
+%getColor Returns the color of this type of vehicle.
+% color = getColor(TYPEID)Returns the color of this type of vehicle.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+color = traci.vehicletype.getUniversal(constants.VAR_COLOR, typeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getContextSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getContextSubscriptionResults.m
new file mode 100644
index 0000000..42ca65f
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getContextSubscriptionResults.m
@@ -0,0 +1,26 @@
+function ContextSubscriptionResults = getContextSubscriptionResults(typeID)
+%getContextSubscriptionResults Get the context subscription results for the
+% last time step.
+% contextSubscriptionResults = getContextSubscriptionResults(TYPEID)
+% Returns the context subscription results for the last time step and the
+% given vehicle type. If no vehicle type id is given, all subscription
+% results are returned in a containers.Map data struccure. If the vehicle
+% type id is unknown or the subscription did for any reason return no
+% data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global typeSubscriptionResults
+if isempty(typeSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ typeID=None;
+end
+ContextSubscriptionResults = typeSubscriptionResults.getContext(typeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getDecel.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getDecel.m
new file mode 100644
index 0000000..7621da6
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getDecel.m
@@ -0,0 +1,12 @@
+function decel = getDecel(typeID)
+%getDecel Returns the maximum deceleration in of vehicles of this type.
+% decel = getDecel(TYPEID) Returns the maximum deceleration in m/s^2 of
+% vehicles of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+decel = traci.vehicletype.getUniversal(constants.VAR_DECEL, typeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getEmissionClass.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getEmissionClass.m
new file mode 100644
index 0000000..8ace3f7
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getEmissionClass.m
@@ -0,0 +1,12 @@
+function emissionClass = getEmissionClass(typeID)
+%getEmissionClass Returns the emission class of vehicles of this type.
+% emissionClass = getEmissionClass(TYPEID) Returns the emission class of
+% vehicles of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+emissionClass = traci.vehicletype.getUniversal(constants.VAR_EMISSIONCLASS, typeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getIDList.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getIDList.m
new file mode 100644
index 0000000..0b01686
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getIDList.m
@@ -0,0 +1,12 @@
+function IDList = getIDList()
+%getIDList Get the IDs of the vehicle types in the network.
+% IDList = getIDList() Returns a cell array of strings containing the IDs
+% of the vehicle types in the SUMO network.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+IDList = traci.vehicletype.getUniversal(constants.ID_LIST, '');
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getImperfection.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getImperfection.m
new file mode 100644
index 0000000..321f7ec
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getImperfection.m
@@ -0,0 +1,12 @@
+function imperfection = getImperfection(typeID)
+%getImperfection Returns the driver's imperfection of vehicles of this type.
+% imperfection = getImperfection(TYPEID) Returns the driver's imperfection
+% (dawdling) [0,1] of vehicles of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+imperfection = traci.vehicletype.getUniversal(constants.VAR_IMPERFECTION, typeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getLength.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getLength.m
new file mode 100644
index 0000000..f77dff2
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getLength.m
@@ -0,0 +1,12 @@
+function length = getLength(typeID)
+%getLength Returns the length in m of the vehicles of this type.
+% length = getLength(TYPEID) Returns the length in m of the vehicles of
+% this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+length = traci.vehicletype.getUniversal(constants.VAR_LENGTH, typeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getMaxSpeed.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getMaxSpeed.m
new file mode 100644
index 0000000..ffb9faf
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getMaxSpeed.m
@@ -0,0 +1,12 @@
+function maxSpeed = getMaxSpeed(typeID)
+%getMaxSpeed Returns the maximum speed in m/s of vehicles of this type.
+% maxSpeed = getMaxSpeed(TYPEID) Returns the maximum speed in m/s of
+% vehicles of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+maxSpeed = traci.vehicletype.getUniversal(constants.VAR_MAXSPEED, typeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getMinGap.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getMinGap.m
new file mode 100644
index 0000000..05cbe92
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getMinGap.m
@@ -0,0 +1,12 @@
+function minGap = getMinGap(typeID)
+%getMinGap Returns the offset of vehicles of this type.
+% minGap = getMinGap(TYPEID) Returns the offset (gap to front vehicle if
+% halting) of vehicles of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+minGap = traci.vehicletype.getUniversal(constants.VAR_MINGAP, typeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getShapeClass.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getShapeClass.m
new file mode 100644
index 0000000..a09c799
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getShapeClass.m
@@ -0,0 +1,12 @@
+function shapeClass = getShapeClass(typeID)
+%getShapeClass Returns the shape class of vehicles of this type.
+% shapeClass = getShapeClass(TYPEID) Returns the shape class of vehicles
+% of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+shapeClass = traci.vehicletype.getUniversal(constants.VAR_SHAPECLASS, typeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getSpeedDeviation.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getSpeedDeviation.m
new file mode 100644
index 0000000..8fdf2d5
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getSpeedDeviation.m
@@ -0,0 +1,12 @@
+function speedDeviation = getSpeedDeviation(typeID)
+%getSpeedDeviation Returns the maximum speed deviation of vehicles of this type.
+% speedDeviation = getSpeedDeviation(TYPEID) Returns the maximum speed
+% deviation of vehicles of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+speedDeviation = traci.vehicletype.getUniversal(constants.VAR_SPEED_DEVIATION, typeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getSpeedFactor.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getSpeedFactor.m
new file mode 100644
index 0000000..26699ca
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getSpeedFactor.m
@@ -0,0 +1,12 @@
+function speedFactor = getSpeedFactor(typeID)
+%getSpeedFactor Returns the chosen speed factor for vehicles of this type.
+% speedFactor = getSpeedFactor(TYPEID) Returns the chosen speed factor for
+% vehicles of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+speedFactor = traci.vehicletype.getUniversal(constants.VAR_SPEED_FACTOR, typeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getSubscriptionResults.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getSubscriptionResults.m
new file mode 100644
index 0000000..4f98acf
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getSubscriptionResults.m
@@ -0,0 +1,26 @@
+function subscriptionResults = getSubscriptionResults(typeID)
+%getSubscriptionResults Get the subscription results for the last time step.
+% subscriptionResults = getSubscriptionResults(TYPEID) Returns the
+% subscription results for the last time step and the given vehicle type.
+% If no vehicle type id is given, all subscription results are returned
+% in a containers.Map data structure.
+% If the vehicle type id is unknown or the subscription did for any reason return
+% no data, 'None' is returned.
+% It is not possible to retrieve older subscription results than the ones
+% from the last time step.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global typeSubscriptionResults
+if isempty(typeSubscriptionResults)
+ throw(MException('traci:FatalTraCIError',...
+ 'You have to subscribe to the variable'));
+end
+if nargin < 1
+ typeID = 'None';
+end
+
+subscriptionResults = typeSubscriptionResults.get(typeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getTau.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getTau.m
new file mode 100644
index 0000000..9f57854
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getTau.m
@@ -0,0 +1,12 @@
+function tau = getTau(typeID)
+%getTau Returns the driver's reaction time in s for vehicles of this type.
+% tau = getTau(TYPEID) Returns the driver's reaction time in s for
+% vehicles of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+tau = traci.vehicletype.getUniversal(constants.VAR_TAU, typeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getUniversal.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getUniversal.m
new file mode 100644
index 0000000..b2d4b14
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getUniversal.m
@@ -0,0 +1,25 @@
+function returnedValue = getUniversal(varID, typeID)
+%getUniversal An internal function to send the get command and read the
+%variable value.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global typeSubscriptionResults
+
+if isempty(typeSubscriptionResults)
+ returnValueFunc = traci.RETURN_VALUE_FUNC.vehicletype;
+else
+ returnValueFunc = typeSubscriptionResults.valueFunc;
+end
+
+% Prepare the outgoing message and read the response. The result variable
+% is a traci.Storage object
+result = traci.sendReadOneStringCmd(constants.CMD_GET_VEHICLETYPE_VARIABLE,varID,typeID);
+handleReturValueFunc = str2func(returnValueFunc(varID));
+
+% Use the proper method to read the variable of interest from the result
+returnedValue = handleReturValueFunc(result);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getVehicleClass.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getVehicleClass.m
new file mode 100644
index 0000000..2c59cf0
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getVehicleClass.m
@@ -0,0 +1,12 @@
+function vehicleClass = getVehicleClass(typeID)
+%getVehicleClass Returns the class of vehicles of this type.
+% vehicleClass = getVehicleClass(TYPEID) Returns the class of vehicles of
+% this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+vehicleClass = traci.vehicletype.getUniversal(constants.VAR_VEHICLECLASS, typeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/getWidth.m b/tools/contributed/traci4matlab/+traci/+vehicletype/getWidth.m
new file mode 100644
index 0000000..c714558
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/getWidth.m
@@ -0,0 +1,12 @@
+function width = getWidth(typeID)
+%getVehicleClass
+% vehicleClass = getVehicleClass(TYPEID) Returns the width in m of
+% vehicles of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+width = traci.vehicletype.getUniversal(constants.VAR_WIDTH, typeID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/setAccel.m b/tools/contributed/traci4matlab/+traci/+vehicletype/setAccel.m
new file mode 100644
index 0000000..bb67ac6
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/setAccel.m
@@ -0,0 +1,12 @@
+function setAccel(typeID, accel)
+%setAccel Sets the maximum acceleration for vehicles of this type.
+% setAccel(TYPEID,ACCEL) Sets the maximum acceleration in m/s^2 for
+% vehicles of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_ACCEL, typeID, accel);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/setColor.m b/tools/contributed/traci4matlab/+traci/+vehicletype/setColor.m
new file mode 100644
index 0000000..20b2adf
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/setColor.m
@@ -0,0 +1,16 @@
+function setColor(typeID, color)
+%setColor Set the color of the vehicle.
+% setColor(TYPEID,COLOR) Sets color for vehicle vehicles of this type,
+% i.e. (255,0,0,0) for the color red. The fourth integer (alpha) is
+% currently ignored
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_COLOR, typeID, 1+1+1+1+1);
+message.string = [message.string uint8([sscanf(constants.TYPE_COLOR,'%x') color])];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/setDecel.m b/tools/contributed/traci4matlab/+traci/+vehicletype/setDecel.m
new file mode 100644
index 0000000..9e479c6
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/setDecel.m
@@ -0,0 +1,12 @@
+function setDecel(typeID, decel)
+%setDecel Sets the maximum deceleration for vehicles of this type.
+% setDecel(TYPEID,DECEL) Sets the maximum deceleration in m/s^2 for
+% vehicles of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_DECEL, typeID, decel);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/setEmissionClass.m b/tools/contributed/traci4matlab/+traci/+vehicletype/setEmissionClass.m
new file mode 100644
index 0000000..4ffb69a
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/setEmissionClass.m
@@ -0,0 +1,12 @@
+function setEmissionClass(typeID, clazz)
+%setEmissionClass ets the emission class of vehicles for this type.
+% setEmissionClass(TYPEID,CLASS) Sets the emission class of vehicles of
+% this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendStringCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_EMISSIONCLASS, typeID, clazz);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/setImperfection.m b/tools/contributed/traci4matlab/+traci/+vehicletype/setImperfection.m
new file mode 100644
index 0000000..346a291
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/setImperfection.m
@@ -0,0 +1,13 @@
+function setImperfection(typeID, imperfection)
+%setImperfection Sets the driver's imperfection for vehicles of this class.
+% setImperfection(TYPEID,IMPERFECTION) Sets the driver's imperfection
+% (dawdling) for vehicles of this class. IMPERFECTION is a double
+% precision integer rnging from zero to one.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_IMPERFECTION, typeID, imperfection);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/setLength.m b/tools/contributed/traci4matlab/+traci/+vehicletype/setLength.m
new file mode 100644
index 0000000..52ad5b9
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/setLength.m
@@ -0,0 +1,12 @@
+function setLength(typeID, length)
+%setLength Sets the length in m of the vehicles of this type.
+% setLength(TYPEID,LENGTH) Sets the length in m of the vehicles of this
+% type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_LENGTH, typeID, length);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/setMaxSpeed.m b/tools/contributed/traci4matlab/+traci/+vehicletype/setMaxSpeed.m
new file mode 100644
index 0000000..031b0ba
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/setMaxSpeed.m
@@ -0,0 +1,12 @@
+function setMaxSpeed(typeID, speed)
+%setMaxSpeed Sets the maximum speed for vehicles of this type.
+% setMaxSpeed(TYPEID,SPEED) Sets the maximum speed in m/s for vehicles of
+% this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_MAXSPEED, typeID, speed);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/setMinGap.m b/tools/contributed/traci4matlab/+traci/+vehicletype/setMinGap.m
new file mode 100644
index 0000000..ae2eeec
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/setMinGap.m
@@ -0,0 +1,12 @@
+function setMinGap(typeID, minGap)
+%setMinGap Sets the offset for vehicles of this type.
+% setMinGap(TYPEID,MINGAP) Sets the offset (gap to front vehicle if
+% halting) for vehicles of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_MINGAP, typeID, minGap);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/setShapeClass.m b/tools/contributed/traci4matlab/+traci/+vehicletype/setShapeClass.m
new file mode 100644
index 0000000..0318ab7
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/setShapeClass.m
@@ -0,0 +1,12 @@
+function setShapeClass(typeID, clazz)
+%setShapeClass Sets the shape class for vehicles of this type.
+% setShapeClass(TYPEID,CLASS) Sets the shape class for vehicles of this
+% type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendStringCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_SHAPECLASS, typeID, clazz);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/setSpeedDeviation.m b/tools/contributed/traci4matlab/+traci/+vehicletype/setSpeedDeviation.m
new file mode 100644
index 0000000..3e5e03e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/setSpeedDeviation.m
@@ -0,0 +1,12 @@
+function setSpeedDeviation(typeID, deviation)
+%setSpeedDeviation Sets the maximum speed deviation for vehicles of this type.
+% setSpeedDeviation(TYPEID,DEVIATION) Sets the maximum speed deviation
+% for vehicles of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_SPEED_DEVIATION, typeID, deviation);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/setSpeedFactor.m b/tools/contributed/traci4matlab/+traci/+vehicletype/setSpeedFactor.m
new file mode 100644
index 0000000..0bb3e0e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/setSpeedFactor.m
@@ -0,0 +1,12 @@
+function setSpeedFactor(typeID, factor)
+%setSpeedFactor Sets the speed factor for vehicles of this type.
+% setSpeedFactor(TYPEID,FACTOR) Sets the speed factor for vehicles of
+% this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_SPEED_FACTOR, typeID, factor);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/setTau.m b/tools/contributed/traci4matlab/+traci/+vehicletype/setTau.m
new file mode 100644
index 0000000..08d382e
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/setTau.m
@@ -0,0 +1,12 @@
+function setTau(typeID, tau)
+%setTau Sets the driver's reaction time for vehicles of this type.
+% setTau(TYPEID,TAU) Sets the driver's reaction time in s for vehicles of
+% this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_TAU, typeID, tau);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/setVehicleClass.m b/tools/contributed/traci4matlab/+traci/+vehicletype/setVehicleClass.m
new file mode 100644
index 0000000..0d2844f
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/setVehicleClass.m
@@ -0,0 +1,11 @@
+function setVehicleClass(typeID, clazz)
+%setVehicleClass Sets the class for vehicles of this type.
+% setVehicleClass(TYPEID,CLASS) Sets the class for vehicles of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendStringCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_VEHICLECLASS, typeID, clazz);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/setWidth.m b/tools/contributed/traci4matlab/+traci/+vehicletype/setWidth.m
new file mode 100644
index 0000000..a54da53
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/setWidth.m
@@ -0,0 +1,11 @@
+function setWidth(typeID, width)
+%setWidth Sets the width in m for vehicles of this type.
+% setWidth(TYPEID,WIDTH) Sets the width in m of vehicles of this type.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_WIDTH, typeID, width);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/subscribe.m b/tools/contributed/traci4matlab/+traci/+vehicletype/subscribe.m
new file mode 100644
index 0000000..a7c3110
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/subscribe.m
@@ -0,0 +1,38 @@
+function subscribe(typeID, varargin)
+%subscribe Subscribe to vehicle type variable.
+% subscribe(TYPEID) Subscribe to the VAR_MAXSPEED value for the maximum
+% allowed interval.
+% subscribe(TYPEID,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS for the maximum allowed interval.
+% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum
+% allowed end time.
+% subscribe(...,END) Subscribe for the time interval defined by BEGIN and
+% END.
+% A call to this function clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global typeSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'vehicletype.subscribe';
+p.addRequired('typeID', at ischar)
+p.addOptional('varIDs', {constants.VAR_MAXSPEED}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(typeID, varargin{:})
+typeID = p.Results.typeID;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+typeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicletype);
+
+typeSubscriptionResults.reset()
+traci.subscribe(constants.CMD_SUBSCRIBE_VEHICLETYPE_VARIABLE,...
+ subscriptionBegin, subscriptionEnd, typeID, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/+vehicletype/subscribeContext.m b/tools/contributed/traci4matlab/+traci/+vehicletype/subscribeContext.m
new file mode 100644
index 0000000..5423342
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/+vehicletype/subscribeContext.m
@@ -0,0 +1,46 @@
+function subscribeContext(typeID, domain, dist, varargin)
+%subscribeContext Subscribe to a vehicle type's context variable.
+% subscribeContext(TYPEID,DOMAIN,DIST) Subscribe to the VAR_MAXSPEED
+% value of the SUMO objects that surround the vehicle type specified by
+% TYPEID at a distance given by DIST, for the maximum allowed interval.
+% The type of objets that surround the vehicle type are defined in the
+% DOMAIN parameter. Note that not all the SUMO object types support the
+% variable VAR_MAXSPEED.
+% subscribeContext(...,VARIDS) Subscribe to the values given in the cell
+% array of strings VARIDS.
+% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the
+% maximum allowed end time.
+% subscribeContext(...,END) Subscribe for the time interval defined by
+% BEGIN and END.
+% A call to this method clears all previous subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global typeSubscriptionResults
+import traci.constants
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'type.subscribeContext';
+p.addRequired('typeID', at ischar)
+p.addRequired('domain', at ischar)
+p.addRequired('dist', at isnumeric)
+p.addOptional('varIDs', {constants.VAR_MAXSPEED}, @iscell)
+p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1)
+p.parse(typeID, domain, dist, varargin{:})
+typeID = p.Results.typeID;
+domain = p.Results.domain;
+dist = p.Results.dist;
+varIDs = p.Results.varIDs;
+subscriptionBegin = p.Results.subscriptionBegin;
+subscriptionEnd = p.Results.subscriptionEnd;
+
+typeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicletype);
+
+typeSubscriptionResults.reset()
+traci.subscribeContext(constants.CMD_SUBSCRIBE_VEHICLETYPE_CONTEXT,...
+ subscriptionBegin, subscriptionEnd, typeID, domain, dist, varIDs)
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/Message.m b/tools/contributed/traci4matlab/+traci/Message.m
new file mode 100644
index 0000000..bc734b2
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/Message.m
@@ -0,0 +1,13 @@
+classdef Message
+%Message A container for outgoing TraCI messages.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+ properties
+ string
+ queue
+ end
+end
diff --git a/tools/contributed/traci4matlab/+traci/RETURN_VALUE_FUNC.m b/tools/contributed/traci4matlab/+traci/RETURN_VALUE_FUNC.m
new file mode 100644
index 0000000..162230f
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/RETURN_VALUE_FUNC.m
@@ -0,0 +1,243 @@
+classdef RETURN_VALUE_FUNC
+ %RETURN_VALUE_FUNC A class to store the functions to read the TraCI
+ %results for each SUMO object.
+
+ % Copyright 2015 Universidad Nacional de Colombia,
+ % Politecnico Jaime Isaza Cadavid.
+ % Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+ % $Id$
+
+ properties (Constant)
+ areal = containers.Map({...
+ traci.constants.ID_LIST...
+ traci.constants.ID_COUNT,...
+ traci.constants.JAM_LENGTH_METERS,...
+ traci.constants.JAM_LENGTH_VEHICLE,...
+ traci.constants.LAST_STEP_MEAN_SPEED,...
+ traci.constants.LAST_STEP_OCCUPANCY},...
+ {'readStringList','readInt','readDouble','readInt','readDouble','readDouble'});
+ edge = containers.Map({...
+ traci.constants.ID_LIST,...
+ traci.constants.ID_COUNT,...
+ traci.constants.VAR_EDGE_TRAVELTIME,...
+ traci.constants.VAR_EDGE_EFFORT,...
+ traci.constants.VAR_CO2EMISSION,...
+ traci.constants.VAR_COEMISSION,...
+ traci.constants.VAR_HCEMISSION,...
+ traci.constants.VAR_PMXEMISSION,...
+ traci.constants.VAR_NOXEMISSION,...
+ traci.constants.VAR_FUELCONSUMPTION,...
+ traci.constants.VAR_NOISEEMISSION,...
+ traci.constants.LAST_STEP_MEAN_SPEED,...
+ traci.constants.LAST_STEP_OCCUPANCY,...
+ traci.constants.LAST_STEP_LENGTH,...
+ traci.constants.VAR_CURRENT_TRAVELTIME,...
+ traci.constants.LAST_STEP_VEHICLE_NUMBER,...
+ traci.constants.LAST_STEP_VEHICLE_HALTING_NUMBER,...
+ traci.constants.LAST_STEP_VEHICLE_ID_LIST,...
+ traci.constants.LAST_STEP_PERSON_ID_LIST},...
+ {'readStringList','readInt','readDouble','readDouble','readDouble',...
+ 'readDouble','readDouble','readDouble','readDouble','readDouble',...
+ 'readDouble','readDouble','readDouble','readDouble','readDouble',...
+ 'readInt','readInt','readStringList','readStringList'});
+ gui = containers.Map({...
+ traci.constants.ID_LIST,...
+ traci.constants.VAR_VIEW_ZOOM,...
+ traci.constants.VAR_VIEW_OFFSET,...
+ traci.constants.VAR_VIEW_SCHEMA,...
+ traci.constants.VAR_VIEW_BOUNDARY},...
+ {'readStringList','readDouble','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')',...
+ 'readString','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8)) fliplr(result.read(8)) fliplr(result.read(8))],''double'')'});
+ inductionloop = containers.Map({...
+ traci.constants.ID_LIST,...
+ traci.constants.VAR_POSITION,...
+ traci.constants.VAR_LANE_ID,...
+ traci.constants.LAST_STEP_VEHICLE_NUMBER,...
+ traci.constants.LAST_STEP_MEAN_SPEED,...
+ traci.constants.LAST_STEP_VEHICLE_ID_LIST,...
+ traci.constants.LAST_STEP_OCCUPANCY,...
+ traci.constants.LAST_STEP_LENGTH,...
+ traci.constants.LAST_STEP_TIME_SINCE_DETECTION,...
+ traci.constants.LAST_STEP_VEHICLE_DATA},...
+ {'readStringList','readDouble','readString',...
+ 'readInt','readDouble','readStringList',...
+ 'readDouble','readDouble','readDouble',...
+ 'traci.inductionloop.readVehicleData'});
+ junction = containers.Map({...
+ traci.constants.ID_LIST,...
+ traci.constants.VAR_POSITION},...
+ {'readStringList','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')'});
+ lane = containers.Map({...
+ traci.constants.ID_LIST,...
+ traci.constants.VAR_LENGTH,...
+ traci.constants.VAR_MAXSPEED,...
+ traci.constants.VAR_WIDTH,...
+ traci.constants.LANE_ALLOWED,...
+ traci.constants.LANE_DISALLOWED,...
+ traci.constants.LANE_LINK_NUMBER,...
+ traci.constants.LANE_LINKS,...
+ traci.constants.VAR_SHAPE,...
+ traci.constants.LANE_EDGE_ID,...
+ traci.constants.VAR_CO2EMISSION,...
+ traci.constants.VAR_COEMISSION,...
+ traci.constants.VAR_HCEMISSION,...
+ traci.constants.VAR_PMXEMISSION,...
+ traci.constants.VAR_NOXEMISSION,...
+ traci.constants.VAR_FUELCONSUMPTION,...
+ traci.constants.VAR_NOISEEMISSION,...
+ traci.constants.LAST_STEP_MEAN_SPEED,...
+ traci.constants.LAST_STEP_OCCUPANCY,...
+ traci.constants.LAST_STEP_LENGTH,...
+ traci.constants.VAR_CURRENT_TRAVELTIME,...
+ traci.constants.LAST_STEP_VEHICLE_NUMBER,...
+ traci.constants.LAST_STEP_VEHICLE_HALTING_NUMBER,...
+ traci.constants.LAST_STEP_VEHICLE_ID_LIST},...
+ {'readStringList','readDouble','readDouble','readDouble','readStringList',...
+ 'readStringList','@(result) result.read(1)','traci.lane.readLinks','readShape','readString',...
+ 'readDouble','readDouble','readDouble','readDouble','readDouble',...
+ 'readDouble','readDouble','readDouble','readDouble','readDouble',...
+ 'readDouble','readInt','readInt','readStringList'});
+ multientryexit = containers.Map({...
+ traci.constants.ID_LIST,...
+ traci.constants.LAST_STEP_VEHICLE_NUMBER,...
+ traci.constants.LAST_STEP_MEAN_SPEED,...
+ traci.constants.LAST_STEP_VEHICLE_ID_LIST,...
+ traci.constants.LAST_STEP_VEHICLE_HALTING_NUMBER},...
+ {'readStringList','readInt','readDouble','readStringList','readInt'});
+ person = containers.Map({traci.constants.ID_LIST,...
+ traci.constants.ID_COUNT,...
+ traci.constants.VAR_SPEED,...
+ traci.constants.VAR_POSITION,...
+ traci.constants.VAR_ANGLE,...
+ traci.constants.VAR_ROAD_ID,...
+ traci.constants.VAR_TYPE,...
+ traci.constants.VAR_ROUTE_ID,...
+ traci.constants.VAR_COLOR,...
+ traci.constants.VAR_LANEPOSITION,...
+ traci.constants.VAR_LENGTH,...
+ traci.constants.VAR_WAITING_TIME,...
+ traci.constants.VAR_WIDTH,...
+ traci.constants.VAR_MINGAP,...
+ traci.constants.VAR_NEXT_EDGE},...
+ {'readStringList','readInt','readDouble',...
+ '@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')',...
+ 'readDouble','readString','readString','readString',...
+ '@(result) result.read(4)','readDouble','readDouble','readDouble',...
+ 'readDouble','readDouble','readString'});
+ poi = containers.Map({...
+ traci.constants.ID_LIST,...
+ traci.constants.VAR_TYPE,...
+ traci.constants.VAR_POSITION,...
+ traci.constants.VAR_COLOR},...
+ {'readStringList','readString','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')',...
+ '@(result) result.read(4)'});
+ polygon = containers.Map({...
+ traci.constants.ID_LIST,...
+ traci.constants.VAR_TYPE,...
+ traci.constants.VAR_SHAPE,...
+ traci.constants.VAR_COLOR},...
+ {'readStringList','readString','readShape','@(result) result.read(4)'});
+ route = containers.Map({...
+ traci.constants.ID_LIST,...
+ traci.constants.VAR_EDGES},...
+ {'readStringList','readStringList'});
+ simulation = containers.Map({...
+ traci.constants.VAR_TIME_STEP,...
+ traci.constants.VAR_LOADED_VEHICLES_NUMBER,...
+ traci.constants.VAR_LOADED_VEHICLES_IDS,...
+ traci.constants.VAR_DEPARTED_VEHICLES_NUMBER,...
+ traci.constants.VAR_DEPARTED_VEHICLES_IDS,...
+ traci.constants.VAR_ARRIVED_VEHICLES_NUMBER,...
+ traci.constants.VAR_ARRIVED_VEHICLES_IDS,...
+ traci.constants.VAR_MIN_EXPECTED_VEHICLES,...
+ traci.constants.VAR_TELEPORT_STARTING_VEHICLES_NUMBER,...
+ traci.constants.VAR_TELEPORT_STARTING_VEHICLES_IDS,...
+ traci.constants.VAR_TELEPORT_ENDING_VEHICLES_NUMBER,...
+ traci.constants.VAR_TELEPORT_ENDING_VEHICLES_IDS,...
+ traci.constants.VAR_DELTA_T,...
+ traci.constants.VAR_NET_BOUNDING_BOX},...
+ {'readInt','readInt','readStringList','readInt',...
+ 'readStringList','readInt','readStringList','readInt',...
+ 'readInt','readStringList','readInt','readStringList',...
+ 'readInt','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8)) fliplr(result.read(8)) fliplr(result.read(8))],''double'')'});
+ trafficlights = containers.Map({...
+ traci.constants.ID_LIST,...
+ traci.constants.TL_RED_YELLOW_GREEN_STATE,...
+ traci.constants.TL_COMPLETE_DEFINITION_RYG,...
+ traci.constants.TL_CONTROLLED_LANES,...
+ traci.constants.TL_CONTROLLED_LINKS,...
+ traci.constants.TL_CURRENT_PROGRAM,...
+ traci.constants.TL_CURRENT_PHASE,...
+ traci.constants.TL_NEXT_SWITCH},...
+ {'readStringList','readString','traci.trafficlights.readLogics',...
+ 'readStringList','traci.trafficlights.readLinks','readString',...
+ 'readInt','readInt'});
+ vehicle = containers.Map({...
+ traci.constants.ID_LIST,...
+ traci.constants.VAR_SPEED,...
+ traci.constants.VAR_SPEED_WITHOUT_TRACI,...
+ traci.constants.VAR_POSITION,...
+ traci.constants.VAR_ANGLE,...
+ traci.constants.VAR_ROAD_ID,...
+ traci.constants.VAR_LANE_ID,...
+ traci.constants.VAR_LANE_INDEX,...
+ traci.constants.VAR_TYPE,...
+ traci.constants.VAR_ROUTE_ID,...
+ traci.constants.VAR_COLOR,...
+ traci.constants.VAR_LANEPOSITION,...
+ traci.constants.VAR_CO2EMISSION,...
+ traci.constants.VAR_COEMISSION,...
+ traci.constants.VAR_HCEMISSION,...
+ traci.constants.VAR_PMXEMISSION,...
+ traci.constants.VAR_NOXEMISSION,...
+ traci.constants.VAR_FUELCONSUMPTION,...
+ traci.constants.VAR_NOISEEMISSION,...
+ traci.constants.VAR_EDGE_TRAVELTIME,...
+ traci.constants.VAR_EDGE_EFFORT,...
+ traci.constants.VAR_ROUTE_VALID,...
+ traci.constants.VAR_EDGES,...
+ traci.constants.VAR_SIGNALS,...
+ traci.constants.VAR_LENGTH,...
+ traci.constants.VAR_MAXSPEED,...
+ traci.constants.VAR_VEHICLECLASS,...
+ traci.constants.VAR_SPEED_FACTOR,...
+ traci.constants.VAR_SPEED_DEVIATION,...
+ traci.constants.VAR_EMISSIONCLASS,...
+ traci.constants.VAR_WIDTH,...
+ traci.constants.VAR_MINGAP,...
+ traci.constants.VAR_SHAPECLASS,...
+ traci.constants.VAR_ACCEL,...
+ traci.constants.VAR_DECEL,...
+ traci.constants.VAR_IMPERFECTION,...
+ traci.constants.VAR_TAU,...
+ traci.constants.VAR_BEST_LANES,...
+ traci.constants.DISTANCE_REQUEST},...
+ {'readStringList','readDouble','readDouble','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')',...
+ 'readDouble','readString','readString','readInt','readString',...
+ 'readString','@(result) result.read(4)','readDouble','readDouble','readDouble',...
+ 'readDouble','readDouble','readDouble','readDouble','readDouble',...
+ 'readDouble','readDouble','@(result) result.read(1)','readStringList',...
+ 'readInt','readDouble','readDouble','readString','readDouble','readDouble',...
+ 'readString','readDouble','readDouble','readString','readDouble','readDouble',...
+ 'readDouble','readDouble','traci.vehicle.readBestLanes','readDouble'});
+ vehicletype = containers.Map({...
+ traci.constants.ID_LIST,...
+ traci.constants.VAR_LENGTH,...
+ traci.constants.VAR_MAXSPEED,...
+ traci.constants.VAR_SPEED_FACTOR,...
+ traci.constants.VAR_SPEED_DEVIATION,...
+ traci.constants.VAR_ACCEL,...
+ traci.constants.VAR_DECEL,...
+ traci.constants.VAR_IMPERFECTION,...
+ traci.constants.VAR_TAU,...
+ traci.constants.VAR_VEHICLECLASS,...
+ traci.constants.VAR_EMISSIONCLASS,...
+ traci.constants.VAR_SHAPECLASS,...
+ traci.constants.VAR_MINGAP,...
+ traci.constants.VAR_WIDTH,...
+ traci.constants.VAR_COLOR},...
+ {'readStringList','readDouble','readDouble','readDouble','readDouble',...
+ 'readDouble','readDouble','readDouble','readDouble','readString',...
+ 'readString','readString','readDouble','readDouble','@(result) result.read(4)'});
+ end
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/Socket.m b/tools/contributed/traci4matlab/+traci/Socket.m
new file mode 100644
index 0000000..c04a0e9
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/Socket.m
@@ -0,0 +1,35 @@
+classdef Socket < handle
+%Socket A class which wraps a Java socket to implement
+% TCP/IP communications in Matlab.
+
+% Copyright 2014 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+ properties
+ socket
+ dis
+ dos
+ dataReader
+ end
+ methods
+ function this = connect(this, host, port)
+ import co.edu.unalmed.gaunal.traci4matlab.utils.*
+ import java.net.*
+ import java.io.*
+ this.socket = Socket();
+ inetSocketAddress = InetSocketAddress(...
+ InetAddress.getByName(host), port);
+ try
+ this.socket.connect(inetSocketAddress);
+ catch err
+ disp(err.getReport);
+% throw(MException('Connection:ConnectionRefused', err.getReport));
+ end
+ this.dis = DataInputStream(this.socket.getInputStream());
+ this.dataReader = DataReader(this.dis);
+ this.dos = DataOutputStream(this.socket.getOutputStream());
+ end
+ end
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/Storage.m b/tools/contributed/traci4matlab/+traci/Storage.m
new file mode 100644
index 0000000..27087ef
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/Storage.m
@@ -0,0 +1,70 @@
+classdef Storage < handle
+%Storage A container for responses from SUMO server.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+ properties
+ content
+ pos
+ end
+ methods
+ function this = Storage(content)
+ this.content = content;
+ this.pos = 1;
+ end
+ function value = read(this,numbytes)
+ oldpos = this.pos;
+ this.pos = this.pos + numbytes;
+ value = this.content(oldpos:this.pos-1);
+
+% interval = round(numbytes/nargout);
+% for i=1:nargout
+% oldpos = this.pos;
+% this.pos = this.pos + interval;
+% varargout{i} = this.content(oldpos:this.pos-1);
+% end
+ end
+ function value = readInt(this)
+ value = double(typecast(fliplr(uint8(this.read(4))),'int32'));
+ end
+
+ function value = readDouble(this)
+ value = typecast(fliplr(this.read(8)),'double');
+ end
+
+ function len = readLength(this)
+ len = this.read(1);
+ if len > 0
+ return
+ end
+ len = this.readInt();
+ end
+ function value = readString(this)
+ len = typecast(fliplr(this.read(4)),'int32');
+ if len == 0
+ value = '';
+ return
+ end
+ value = char(this.read(len));
+ end
+ function stringList = readStringList(this)
+ n = this.readInt();
+ stringList = cell(1,n);
+ for i=1:n
+ stringList{i} = this.readString();
+ end
+ end
+
+ function shape = readShape(this)
+ len = this.read(1);
+ shape = cell(1,len);
+ for i=1:len
+ shape{i} = typecast([fliplr(this.read(8)) fliplr(this.read(8))],'double');
+ end
+ end
+
+ end
+end
diff --git a/tools/contributed/traci4matlab/+traci/SubscriptionResults.m b/tools/contributed/traci4matlab/+traci/SubscriptionResults.m
new file mode 100644
index 0000000..77a3494
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/SubscriptionResults.m
@@ -0,0 +1,87 @@
+classdef SubscriptionResults < handle
+%SubscriptionResults A container for the subscription results.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+ properties
+ results
+ contextResults
+ valueFunc
+ end
+
+ methods
+ function this = SubscriptionResults(valueFunc)
+ this.results = containers.Map;
+ this.contextResults = containers.Map;
+ this.valueFunc = valueFunc;
+ end
+
+ function result = parse(this, varID, data)
+ if ~isKey(this.valueFunc, varID)
+ throw(MException('traci:FatalTraCIError', 'Unknown variable %.2x',varID))
+ end
+ resultHandle = str2func(this.valueFunc(varID));
+ result = resultHandle(data);
+ end
+
+ function reset(this)
+ this.results = containers.Map;
+ this.contextResults = containers.Map;
+ end
+
+ function add(this, refID, varID, data)
+ if ~isKey(this.results, refID)
+ this.results(refID) = containers.Map;
+ end
+ handle1results = this.results(refID);
+ handle1results(varID) = this.parse(varID, data);
+ end
+
+ function subscriptionResults = get(this, refID)
+ refID = num2str(refID);
+ if nargin < 2
+ refID = 'None';
+ end
+ if strcmp(refID,'None') == 1
+ subscriptionResults = this.results;
+ return
+ end
+ if isKey(this.results, refID)
+ subscriptionResults = this.results(refID);
+ else
+ subscriptionResults = 'None';
+ end
+ end
+
+ function addContext(this, refID, domain, objID, varID, data)
+ if ~isKey(this.contextResults, refID)
+ this.contextResults(refID) = containers.Map;
+ end
+ if ~isKey(this.contextResults(refID), objID)
+ this.contextResults(refID) = subsasgn(this.contextResults(refID),...
+ struct('type','()','subs',{objID}),containers.Map);
+ end
+ handle1ContextResults = this.contextResults(refID);
+ handle2ContextResults = handle1ContextResults(objID);
+ handle2ContextResults(varID) = domain.parse(varID, data);
+ end
+
+ function context = getContext(this, refID)
+ if nargin < 2
+ refID = 'None';
+ end
+ if strcmp(refID, 'None') == 1
+ context = this.contextResults;
+ return
+ end
+ if isKey(this.contextResults, refID)
+ context = this.contextResults(refID);
+ else
+ context = 'None';
+ end
+ end
+ end
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/beginMessage.m b/tools/contributed/traci4matlab/+traci/beginMessage.m
new file mode 100644
index 0000000..e668d16
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/beginMessage.m
@@ -0,0 +1,29 @@
+function beginMessage(cmdID, varID, objID, len)
+%beginMessage Internal function to build the TraCI message.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global message
+if nargin < 4
+ len = 0;
+end
+
+% Put the command in the queue
+message.queue = [message.queue uint8(sscanf(cmdID,'%x'))];
+
+% Compute the command length
+len = len+1+1+1+4+length(objID);
+
+% Build the message string depending on the length of the message
+if len <= 255
+ message.string = [message.string uint8([len sscanf(cmdID,'%x') sscanf(varID,'%x')])...
+ traci.packInt32(length(objID)) uint8(objID)];
+else
+ message.string = [message.string uint8(0) traci.packInt32(len+4) ...
+ uint8([sscanf(cmdID,'%x') sscanf(varID,'%x')])...
+ traci.packInt32(length(objID)) uint8(objID)];
+end
+
diff --git a/tools/contributed/traci4matlab/+traci/checkResult.m b/tools/contributed/traci4matlab/+traci/checkResult.m
new file mode 100644
index 0000000..264437f
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/checkResult.m
@@ -0,0 +1,33 @@
+function result = checkResult(cmdID, varID, objID)
+%checkResult Internal function to receive and parse the response from SUMO
+%server.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+% Send the message and read the result
+result = traci.sendExact();
+
+% Read the response length
+result.readLength();
+
+% Read the response and the id of the returned variable
+response = result.read(1);
+retVarID = result.read(1);
+
+% Read the acknowledged object ID
+objectID = result.readString();
+
+% Check whether the response corresponds to the requested command. The
+% TraCI protocol is designed so that the response and the command ID
+% difference is 16
+if response - uint8(sscanf(cmdID,'%x')) ~= 16 || retVarID ~= uint8(sscanf(varID,'%x'))...
+ || ~strcmp(objectID,objID)
+ fprintf('Received answer %s,%s,%s for command %s,%s,%s.'...
+ ,response, retVarID, objectID, cmdID, varID, objID);
+end
+
+% Read the type of the variable
+result.read(1);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/close.m b/tools/contributed/traci4matlab/+traci/close.m
new file mode 100644
index 0000000..85f217c
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/close.m
@@ -0,0 +1,28 @@
+function close()
+%CLOSE Close the connection with the SUMO server.
+% CLOSE() Close the default connection with the SUMO server. If several
+% connections have to be closed, they must be enabled through the
+% traci.switch() command, and closed with CLOSE().
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global connections message
+import traci.constants
+
+% Build the close command
+command = uint8(sscanf(constants.CMD_CLOSE,'%x'));
+message.queue = [message.queue command];
+message.string = [message.string uint8(1+1) command];
+
+% Send the close command
+traci.sendExact();
+
+% Close and clear the tcp object
+if isKey(connections,'')
+ activeConnection = connections('');
+ activeConnection.socket.close();
+ clear connections('')
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/constants.m b/tools/contributed/traci4matlab/+traci/constants.m
new file mode 100644
index 0000000..afe0c70
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/constants.m
@@ -0,0 +1,746 @@
+classdef constants
+ %The SUMO hexadecimal constants.
+
+ % Copyright 2014 Universidad Nacional de Colombia,
+ % Politecnico Jaime Isaza Cadavid.
+ % Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+ % $Id$
+
+ properties (Constant = true)
+ % ****************************************
+ % VERSION
+ % ****************************************
+ TRACI_VERSION = 9
+
+
+ % ****************************************
+ % COMMANDS
+ % ****************************************
+ % command: get version
+ CMD_GETVERSION = '0x00'
+
+ % command: simulation step
+ CMD_SIMSTEP2 = '0x02'
+
+ % command: stop node
+ CMD_STOP = '0x12'
+
+ % command: Resume from parking
+ CMD_RESUME = '0x19'
+
+ % command: set lane
+ CMD_CHANGELANE = '0x13'
+
+ % command: slow down
+ CMD_SLOWDOWN = '0x14'
+
+ % command: change target
+ CMD_CHANGETARGET = '0x31'
+
+ % command: close sumo
+ CMD_CLOSE = '0x7F'
+
+
+ % command: subscribe induction loop (e1) context
+ CMD_SUBSCRIBE_INDUCTIONLOOP_CONTEXT = '0x80'
+ % response: subscribe induction loop (e1) context
+ RESPONSE_SUBSCRIBE_INDUCTIONLOOP_CONTEXT = '0x90'
+ % command: get induction loop (e1) variable
+ CMD_GET_INDUCTIONLOOP_VARIABLE = '0xa0'
+ % response: get induction loop (e1) variable
+ RESPONSE_GET_INDUCTIONLOOP_VARIABLE = '0xb0'
+ % command: subscribe induction loop (e1) variable
+ CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE = '0xd0'
+ % response: subscribe induction loop (e1) variable
+ RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE = '0xe0'
+
+ % command: subscribe multi-entry/multi-exit detector (e3) context
+ CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT = '0x81'
+ % response: subscribe multi-entry/multi-exit detector (e3) context
+ RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT = '0x91'
+ % command: get multi-entry/multi-exit detector (e3) variable
+ CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE = '0xa1'
+ % response: get multi-entry/multi-exit detector (e3) variable
+ RESPONSE_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE = '0xb1'
+ % command: subscribe multi-entry/multi-exit detector (e3) variable
+ CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE = '0xd1'
+ % response: subscribe multi-entry/multi-exit detector (e3) variable
+ RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE = '0xe1'
+
+ % command: subscribe traffic lights context
+ CMD_SUBSCRIBE_TL_CONTEXT = '0x82'
+ % response: subscribe traffic lights context
+ RESPONSE_SUBSCRIBE_TL_CONTEXT = '0x92'
+ % command: get traffic lights variable
+ CMD_GET_TL_VARIABLE = '0xa2'
+ % response: get traffic lights variable
+ RESPONSE_GET_TL_VARIABLE = '0xb2'
+ % command: set traffic lights variable
+ CMD_SET_TL_VARIABLE = '0xc2'
+ % command: subscribe traffic lights variable
+ CMD_SUBSCRIBE_TL_VARIABLE = '0xd2'
+ % response: subscribe traffic lights variable
+ RESPONSE_SUBSCRIBE_TL_VARIABLE = '0xe2'
+
+ % command: subscribe lane context
+ CMD_SUBSCRIBE_LANE_CONTEXT = '0x83'
+ % response: subscribe lane context
+ RESPONSE_SUBSCRIBE_LANE_CONTEXT = '0x93'
+ % command: get lane variable
+ CMD_GET_LANE_VARIABLE = '0xa3'
+ % response: get lane variable
+ RESPONSE_GET_LANE_VARIABLE = '0xb3'
+ % command: set lane variable
+ CMD_SET_LANE_VARIABLE = '0xc3'
+ % command: subscribe lane variable
+ CMD_SUBSCRIBE_LANE_VARIABLE = '0xd3'
+ % response: subscribe lane variable
+ RESPONSE_SUBSCRIBE_LANE_VARIABLE = '0xe3'
+
+ % command: subscribe vehicle context
+ CMD_SUBSCRIBE_VEHICLE_CONTEXT = '0x84'
+ % response: subscribe vehicle context
+ RESPONSE_SUBSCRIBE_VEHICLE_CONTEXT = '0x94'
+ % command: get vehicle variable
+ CMD_GET_VEHICLE_VARIABLE = '0xa4'
+ % response: get vehicle variable
+ RESPONSE_GET_VEHICLE_VARIABLE = '0xb4'
+ % command: set vehicle variable
+ CMD_SET_VEHICLE_VARIABLE = '0xc4'
+ % command: subscribe vehicle variable
+ CMD_SUBSCRIBE_VEHICLE_VARIABLE = '0xd4'
+ % response: subscribe vehicle variable
+ RESPONSE_SUBSCRIBE_VEHICLE_VARIABLE = '0xe4'
+
+ % command: subscribe vehicle type context
+ CMD_SUBSCRIBE_VEHICLETYPE_CONTEXT = '0x85'
+ % response: subscribe vehicle type context
+ RESPONSE_SUBSCRIBE_VEHICLETYPE_CONTEXT = '0x95'
+ % command: get vehicle type variable
+ CMD_GET_VEHICLETYPE_VARIABLE = '0xa5'
+ % response: get vehicle type variable
+ RESPONSE_GET_VEHICLETYPE_VARIABLE = '0xb5'
+ % command: set vehicle type variable
+ CMD_SET_VEHICLETYPE_VARIABLE = '0xc5'
+ % command: subscribe vehicle type variable
+ CMD_SUBSCRIBE_VEHICLETYPE_VARIABLE = '0xd5'
+ % response: subscribe vehicle type variable
+ RESPONSE_SUBSCRIBE_VEHICLETYPE_VARIABLE = '0xe5'
+
+ % command: subscribe route context
+ CMD_SUBSCRIBE_ROUTE_CONTEXT = '0x86'
+ % response: subscribe route context
+ RESPONSE_SUBSCRIBE_ROUTE_CONTEXT = '0x96'
+ % command: get route variable
+ CMD_GET_ROUTE_VARIABLE = '0xa6'
+ % response: get route variable
+ RESPONSE_GET_ROUTE_VARIABLE = '0xb6'
+ % command: set route variable
+ CMD_SET_ROUTE_VARIABLE = '0xc6'
+ % command: subscribe route variable
+ CMD_SUBSCRIBE_ROUTE_VARIABLE = '0xd6'
+ % response: subscribe route variable
+ RESPONSE_SUBSCRIBE_ROUTE_VARIABLE = '0xe6'
+
+ % command: subscribe poi context
+ CMD_SUBSCRIBE_POI_CONTEXT = '0x87'
+ % response: subscribe poi context
+ RESPONSE_SUBSCRIBE_POI_CONTEXT = '0x97'
+ % command: get poi variable
+ CMD_GET_POI_VARIABLE = '0xa7'
+ % response: get poi variable
+ RESPONSE_GET_POI_VARIABLE = '0xb7'
+ % command: set poi variable
+ CMD_SET_POI_VARIABLE = '0xc7'
+ % command: subscribe poi variable
+ CMD_SUBSCRIBE_POI_VARIABLE = '0xd7'
+ % response: subscribe poi variable
+ RESPONSE_SUBSCRIBE_POI_VARIABLE = '0xe7'
+
+ % command: subscribe polygon context
+ CMD_SUBSCRIBE_POLYGON_CONTEXT = '0x88'
+ % response: subscribe polygon context
+ RESPONSE_SUBSCRIBE_POLYGON_CONTEXT = '0x98'
+ % command: get polygon variable
+ CMD_GET_POLYGON_VARIABLE = '0xa8'
+ % response: get polygon variable
+ RESPONSE_GET_POLYGON_VARIABLE = '0xb8'
+ % command: set polygon variable
+ CMD_SET_POLYGON_VARIABLE = '0xc8'
+ % command: subscribe polygon variable
+ CMD_SUBSCRIBE_POLYGON_VARIABLE = '0xd8'
+ % response: subscribe polygon variable
+ RESPONSE_SUBSCRIBE_POLYGON_VARIABLE = '0xe8'
+
+ % command: subscribe junction context
+ CMD_SUBSCRIBE_JUNCTION_CONTEXT = '0x89'
+ % response: subscribe junction context
+ RESPONSE_SUBSCRIBE_JUNCTION_CONTEXT = '0x99'
+ % command: get junction variable
+ CMD_GET_JUNCTION_VARIABLE = '0xa9'
+ % response: get junction variable
+ RESPONSE_GET_JUNCTION_VARIABLE = '0xb9'
+ % command: set junction variable
+ CMD_SET_JUNCTION_VARIABLE = '0xc9'
+ % command: subscribe junction variable
+ CMD_SUBSCRIBE_JUNCTION_VARIABLE = '0xd9'
+ % response: subscribe junction variable
+ RESPONSE_SUBSCRIBE_JUNCTION_VARIABLE = '0xe9'
+
+ % command: subscribe edge context
+ CMD_SUBSCRIBE_EDGE_CONTEXT = '0x8a'
+ % response: subscribe edge context
+ RESPONSE_SUBSCRIBE_EDGE_CONTEXT = '0x9a'
+ % command: get edge variable
+ CMD_GET_EDGE_VARIABLE = '0xaa'
+ % response: get edge variable
+ RESPONSE_GET_EDGE_VARIABLE = '0xba'
+ % command: set edge variable
+ CMD_SET_EDGE_VARIABLE = '0xca'
+ % command: subscribe edge variable
+ CMD_SUBSCRIBE_EDGE_VARIABLE = '0xda'
+ % response: subscribe edge variable
+ RESPONSE_SUBSCRIBE_EDGE_VARIABLE = '0xea'
+
+ % command: subscribe simulation context
+ CMD_SUBSCRIBE_SIM_CONTEXT = '0x8b'
+ % response: subscribe simulation context
+ RESPONSE_SUBSCRIBE_SIM_CONTEXT = '0x9b'
+ % command: get simulation variable
+ CMD_GET_SIM_VARIABLE = '0xab'
+ % response: get simulation variable
+ RESPONSE_GET_SIM_VARIABLE = '0xbb'
+ % command: set simulation variable
+ CMD_SET_SIM_VARIABLE = '0xcb'
+ % command: subscribe simulation variable
+ CMD_SUBSCRIBE_SIM_VARIABLE = '0xdb'
+ % response: subscribe simulation variable
+ RESPONSE_SUBSCRIBE_SIM_VARIABLE = '0xeb'
+
+ % command: subscribe GUI context
+ CMD_SUBSCRIBE_GUI_CONTEXT = '0x8c'
+ % response: subscribe GUI context
+ RESPONSE_SUBSCRIBE_GUI_CONTEXT = '0x9c'
+ % command: get GUI variable
+ CMD_GET_GUI_VARIABLE = '0xac'
+ % response: get GUI variable
+ RESPONSE_GET_GUI_VARIABLE = '0xbc'
+ % command: set GUI variable
+ CMD_SET_GUI_VARIABLE = '0xcc'
+ % command: subscribe GUI variable
+ CMD_SUBSCRIBE_GUI_VARIABLE = '0xdc'
+ % response: subscribe GUI variable
+ RESPONSE_SUBSCRIBE_GUI_VARIABLE = '0xec'
+
+ % command: subscribe areal detector (e2) context
+ CMD_SUBSCRIBE_AREAL_DETECTOR_CONTEXT = '0x8d'
+ % response: subscribe areal detector (e2) context
+ RESPONSE_SUBSCRIBE_AREAL_DETECTOR_CONTEXT = '0x9d'
+ % command: get areal detector (e2) variable
+ CMD_GET_AREAL_DETECTOR_VARIABLE = '0xad'
+ % response: get areal detector (e2) variable
+ RESPONSE_GET_AREAL_DETECTOR_VARIABLE = '0xbd'
+ % command: subscribe areal detector (e2) variable
+ CMD_SUBSCRIBE_AREAL_DETECTOR_VARIABLE = '0xdd'
+ % response: subscribe areal detector (e2) variable
+ RESPONSE_SUBSCRIBE_AREAL_DETECTOR_VARIABLE = '0xed'
+
+ % command: subscribe person context
+ CMD_SUBSCRIBE_PERSON_CONTEXT = '0x8e'
+ % response: subscribe person context
+ RESPONSE_SUBSCRIBE_PERSON_CONTEXT = '0x9e'
+ % command: get person variable
+ CMD_GET_PERSON_VARIABLE = '0xae'
+ % response: get person variable
+ RESPONSE_GET_PERSON_VARIABLE = '0xbe'
+ % command: set person variable
+ CMD_SET_PERSON_VARIABLE = '0xce'
+ % command: subscribe person variable
+ CMD_SUBSCRIBE_PERSON_VARIABLE = '0xde'
+ % response: subscribe person variable
+ RESPONSE_SUBSCRIBE_PERSON_VARIABLE = '0xee'
+
+
+ % ****************************************
+ % POSITION REPRESENTATIONS
+ % ****************************************
+ % Position in geo-coordinates
+ POSITION_LON_LAT = '0x00'
+ % 2D cartesian coordinates
+ POSITION_2D = '0x01'
+ % Position in geo-coordinates with altitude
+ POSITION_LON_LAT_ALT = '0x02'
+ % 3D cartesian coordinates
+ POSITION_3D = '0x03'
+ % Position on road map
+ POSITION_ROADMAP = '0x04'
+
+
+ % ****************************************
+ % DATA TYPES
+ % ****************************************
+ % Boundary Box (4 doubles)
+ TYPE_BOUNDINGBOX = '0x05'
+ % Polygon (2*n doubles)
+ TYPE_POLYGON = '0x06'
+ % unsigned byte
+ TYPE_UBYTE = '0x07'
+ % signed byte
+ TYPE_BYTE = '0x08'
+ % 32 bit signed integer
+ TYPE_INTEGER = '0x09'
+ % float
+ TYPE_FLOAT = '0x0A'
+ % double
+ TYPE_DOUBLE = '0x0B'
+ % 8 bit ASCII string
+ TYPE_STRING = '0x0C'
+ % list of traffic light phases
+ TYPE_TLPHASELIST = '0x0D'
+ % list of strings
+ TYPE_STRINGLIST = '0x0E'
+ % compound object
+ TYPE_COMPOUND = '0x0F'
+ % color (four ubytes)
+ TYPE_COLOR = '0x11'
+
+
+ % ****************************************
+ % RESULT TYPES
+ % ****************************************
+ % result type: Ok
+ RTYPE_OK = '0x00'
+ % result type: not implemented
+ RTYPE_NOTIMPLEMENTED = '0x01'
+ % result type: error
+ RTYPE_ERR = '0xFF'
+
+ % return value for invalid queries (especially vehicle is not on the road)
+ INVALID_DOUBLE_VALUE = -1001.
+ % return value for invalid queries (especially vehicle is not on the road)
+ INVALID_INT_VALUE = -1
+
+
+ % ****************************************
+ % TRAFFIC LIGHT PHASES
+ % ****************************************
+ % red phase
+ TLPHASE_RED = '0x01'
+ % yellow phase
+ TLPHASE_YELLOW = '0x02'
+ % green phase
+ TLPHASE_GREEN = '0x03'
+ % tl is blinking
+ TLPHASE_BLINKING = '0x04'
+ % tl is off and not blinking
+ TLPHASE_NOSIGNAL = '0x05'
+
+
+ % ****************************************
+ % DIFFERENT DISTANCE REQUESTS
+ % ****************************************
+ % air distance
+ REQUEST_AIRDIST = '0x00'
+ % driving distance
+ REQUEST_DRIVINGDIST = '0x01'
+
+
+ % ****************************************
+ % VEHICLE REMOVAL REASONS
+ % ****************************************
+ % vehicle started teleport
+ REMOVE_TELEPORT = '0x00'
+ % vehicle removed while parking
+ REMOVE_PARKING = '0x01'
+ % vehicle arrived
+ REMOVE_ARRIVED = '0x02'
+ % vehicle was vaporized
+ REMOVE_VAPORIZED = '0x03'
+ % vehicle finished route during teleport
+ REMOVE_TELEPORT_ARRIVED = '0x04'
+
+
+ % ****************************************
+ % VARIABLE TYPES (for CMD_GET_*_VARIABLE)
+ % ****************************************
+ % list of instances' ids (get: all)
+ ID_LIST = '0x00'
+
+ % count of instances (get: all)
+ ID_COUNT = '0x01'
+
+ % subscribe object variables (get: all)
+ OBJECT_VARIABLES_SUBSCRIPTION = '0x02'
+
+ % subscribe context variables (get: all)
+ SURROUNDING_VARIABLES_SUBSCRIPTION = '0x03'
+
+ % last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges)
+ LAST_STEP_VEHICLE_NUMBER = '0x10'
+
+ % last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges)
+ LAST_STEP_MEAN_SPEED = '0x11'
+
+ % last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges)
+ LAST_STEP_VEHICLE_ID_LIST = '0x12'
+
+ % last step occupancy (get: induction loops, lanes, edges)
+ LAST_STEP_OCCUPANCY = '0x13'
+
+ % last step vehicle halting number (get: multi-entry/multi-exit detector, lanes, edges)
+ LAST_STEP_VEHICLE_HALTING_NUMBER = '0x14'
+
+ % last step mean vehicle length (get: induction loops, lanes, edges)
+ LAST_STEP_LENGTH = '0x15'
+
+ % last step time since last detection (get: induction loops)
+ LAST_STEP_TIME_SINCE_DETECTION = '0x16'
+
+ % entry times
+ LAST_STEP_VEHICLE_DATA = '0x17'
+
+ % last step jam length in vehicles
+ JAM_LENGTH_VEHICLE = '0x18'
+
+ % last step jam length in meters
+ JAM_LENGTH_METERS = '0x19'
+
+ % last step person list (get: edges)
+ LAST_STEP_PERSON_ID_LIST = '0x1a'
+
+ % traffic light states, encoded as rRgGyYoO tuple (get: traffic lights)
+ TL_RED_YELLOW_GREEN_STATE = '0x20'
+
+ % index of the phase (set: traffic lights)
+ TL_PHASE_INDEX = '0x22'
+
+ % traffic light program (set: traffic lights)
+ TL_PROGRAM = '0x23'
+
+ % phase duration (set: traffic lights)
+ TL_PHASE_DURATION = '0x24'
+
+ % controlled lanes (get: traffic lights)
+ TL_CONTROLLED_LANES = '0x26'
+
+ % controlled links (get: traffic lights)
+ TL_CONTROLLED_LINKS = '0x27'
+
+ % index of the current phase (get: traffic lights)
+ TL_CURRENT_PHASE = '0x28'
+
+ % name of the current program (get: traffic lights)
+ TL_CURRENT_PROGRAM = '0x29'
+
+ % controlled junctions (get: traffic lights)
+ TL_CONTROLLED_JUNCTIONS = '0x2a'
+
+ % complete definition (get: traffic lights)
+ TL_COMPLETE_DEFINITION_RYG = '0x2b'
+
+ % complete program (set: traffic lights)
+ TL_COMPLETE_PROGRAM_RYG = '0x2c'
+
+ % assumed time to next switch (get: traffic lights)
+ TL_NEXT_SWITCH = '0x2d'
+
+ % current state, using external signal names (get: traffic lights)
+ TL_EXTERNAL_STATE = '0x2e'
+
+ % outgoing link number (get: lanes)
+ LANE_LINK_NUMBER = '0x30'
+
+ % id of parent edge (get: lanes)
+ LANE_EDGE_ID = '0x31'
+
+ % outgoing link definitions (get: lanes)
+ LANE_LINKS = '0x33'
+
+ % list of allowed vehicle classes (get&set: lanes)
+ LANE_ALLOWED = '0x34'
+
+ % list of not allowed vehicle classes (get&set: lanes)
+ LANE_DISALLOWED = '0x35'
+
+
+ % speed (get: vehicle)
+ VAR_SPEED = '0x40'
+
+ % maximum allowed/possible speed (get: vehicle types, lanes, set: edges, lanes)
+ VAR_MAXSPEED = '0x41'
+
+ % position (2D) (get: vehicle, poi, set: poi)
+ VAR_POSITION = '0x42'
+
+ % position (3D) (get: vehicle, poi, set: poi)
+ VAR_POSITION3D = '0x39'
+
+ % angle (get: vehicle)
+ VAR_ANGLE = '0x43'
+
+ % angle (get: vehicle types, lanes, set: lanes)
+ VAR_LENGTH = '0x44'
+
+ % color (get: vehicles, vehicle types, polygons, pois)
+ VAR_COLOR = '0x45'
+
+ % max. acceleration (get: vehicle types)
+ VAR_ACCEL = '0x46'
+
+ % max. deceleration (get: vehicle types)
+ VAR_DECEL = '0x47'
+
+ % driver reaction time (get: vehicle types)
+ VAR_TAU = '0x48'
+
+ % vehicle class (get: vehicle types)
+ VAR_VEHICLECLASS = '0x49'
+
+ % emission class (get: vehicle types)
+ VAR_EMISSIONCLASS = '0x4a'
+
+ % shape class (get: vehicle types)
+ VAR_SHAPECLASS = '0x4b'
+
+ % minimum gap (get: vehicle types)
+ VAR_MINGAP = '0x4c'
+
+ % width (get: vehicle types, lanes)
+ VAR_WIDTH = '0x4d'
+
+ % shape (get: polygons)
+ VAR_SHAPE = '0x4e'
+
+ % type id (get: vehicles, polygons, pois)
+ VAR_TYPE = '0x4f'
+
+ % road id (get: vehicles)
+ VAR_ROAD_ID = '0x50'
+
+ % lane id (get: vehicles)
+ VAR_LANE_ID = '0x51'
+
+ % lane index (get: vehicles)
+ VAR_LANE_INDEX = '0x52'
+
+ % route id (get & set: vehicles)
+ VAR_ROUTE_ID = '0x53'
+
+ % edges (get: routes)
+ VAR_EDGES = '0x54'
+
+ % filled? (get: polygons)
+ VAR_FILL = '0x55'
+
+ % position (1D along lane) (get: vehicle)
+ VAR_LANEPOSITION = '0x56'
+
+ % route (set: vehicles)
+ VAR_ROUTE = '0x57'
+
+ % travel time information (get&set: vehicle)
+ VAR_EDGE_TRAVELTIME = '0x58'
+
+ % effort information (get&set: vehicle)
+ VAR_EDGE_EFFORT = '0x59'
+
+ % last step travel time (get: edge, lane)
+ VAR_CURRENT_TRAVELTIME = '0x5a'
+
+ % signals state (get/set: vehicle)
+ VAR_SIGNALS = '0x5b'
+
+ % new lane/position along (set: vehicle)
+ VAR_MOVE_TO = '0x5c'
+
+ % driver imperfection (set: vehicle)
+ VAR_IMPERFECTION = '0x5d'
+
+ % speed factor (set: vehicle)
+ VAR_SPEED_FACTOR = '0x5e'
+
+ % speed deviation (set: vehicle)
+ VAR_SPEED_DEVIATION = '0x5f'
+
+ % speed without TraCI influence (get: vehicle)
+ VAR_SPEED_WITHOUT_TRACI = '0xb1'
+
+ % best lanes (get: vehicle)
+ VAR_BEST_LANES = '0xb2'
+
+ % how speed is set (set: vehicle)
+ VAR_SPEEDSETMODE = '0xb3'
+
+ % move vehicle, VTD version (set: vehicle)
+ VAR_MOVE_TO_VTD = '0xb4'
+
+ % is the vehicle stopped, and if so parked and/or triggered?
+ % value = stopped + 2 * parking + 4 * triggered
+ VAR_STOPSTATE = '0xb5'
+
+ % how lane changing is performed (set: vehicle)
+ VAR_LANECHANGE_MODE = '0xb6'
+
+ % maximum speed regarding max speed on the current lane and speed factor (get: vehicle)
+ VAR_ALLOWED_SPEED = '0xb7'
+
+ % current CO2 emission of a node (get: vehicle, lane, edge)
+ VAR_CO2EMISSION = '0x60'
+
+ % current CO emission of a node (get: vehicle, lane, edge)
+ VAR_COEMISSION = '0x61'
+
+ % current HC emission of a node (get: vehicle, lane, edge)
+ VAR_HCEMISSION = '0x62'
+
+ % current PMx emission of a node (get: vehicle, lane, edge)
+ VAR_PMXEMISSION = '0x63'
+
+ % current NOx emission of a node (get: vehicle, lane, edge)
+ VAR_NOXEMISSION = '0x64'
+
+ % current fuel consumption of a node (get: vehicle, lane, edge)
+ VAR_FUELCONSUMPTION = '0x65'
+
+ % current noise emission of a node (get: vehicle, lane, edge)
+ VAR_NOISEEMISSION = '0x66'
+
+ % current person number (get: vehicle)
+ VAR_PERSON_NUMBER = '0x67'
+ VAR_BUS_STOP_WAITING = '0x67'
+
+ % current leader together with gap (get: vehicle)
+ VAR_LEADER = '0x68'
+
+ %current waiting time (get: vehicle, lane)
+ VAR_WAITING_TIME = '0x7a'
+
+ % current time step (get: simulation)
+ VAR_TIME_STEP = '0x70'
+
+ % number of loaded vehicles (get: simulation)
+ VAR_LOADED_VEHICLES_NUMBER = '0x71'
+
+ % loaded vehicle ids (get: simulation)
+ VAR_LOADED_VEHICLES_IDS = '0x72'
+
+ % number of departed vehicle (get: simulation)
+ VAR_DEPARTED_VEHICLES_NUMBER = '0x73'
+
+ % departed vehicle ids (get: simulation)
+ VAR_DEPARTED_VEHICLES_IDS = '0x74'
+
+ % number of vehicles starting to teleport (get: simulation)
+ VAR_TELEPORT_STARTING_VEHICLES_NUMBER = '0x75'
+
+ % ids of vehicles starting to teleport (get: simulation)
+ VAR_TELEPORT_STARTING_VEHICLES_IDS = '0x76'
+
+ % number of vehicles ending to teleport (get: simulation)
+ VAR_TELEPORT_ENDING_VEHICLES_NUMBER = '0x77'
+
+ % ids of vehicles ending to teleport (get: simulation)
+ VAR_TELEPORT_ENDING_VEHICLES_IDS = '0x78'
+
+ % number of arrived vehicles (get: simulation)
+ VAR_ARRIVED_VEHICLES_NUMBER = '0x79'
+
+ % ids of arrived vehicles (get: simulation)
+ VAR_ARRIVED_VEHICLES_IDS = '0x7a'
+
+ % delta t (get: simulation)
+ VAR_DELTA_T = '0x7b'
+
+ % bounding box (get: simulation)
+ VAR_NET_BOUNDING_BOX = '0x7c'
+
+ % minimum number of expected vehicles (get: simulation)
+ VAR_MIN_EXPECTED_VEHICLES = '0x7d'
+
+ % number of vehicles starting to park (get: simulation)
+ VAR_STOP_STARTING_VEHICLES_NUMBER = '0x68'
+
+ % ids of vehicles starting to park (get: simulation)
+ VAR_STOP_STARTING_VEHICLES_IDS = '0x69'
+
+ % number of vehicles ending to park (get: simulation)
+ VAR_STOP_ENDING_VEHICLES_NUMBER = '0x6a'
+
+ % ids of vehicles ending to park (get: simulation)
+ VAR_STOP_ENDING_VEHICLES_IDS = '0x6b'
+
+ % number of vehicles starting to park (get: simulation)
+ VAR_PARKING_STARTING_VEHICLES_NUMBER = '0x6c'
+
+ % ids of vehicles starting to park (get: simulation)
+ VAR_PARKING_STARTING_VEHICLES_IDS = '0x6d'
+
+ % number of vehicles ending to park (get: simulation)
+ VAR_PARKING_ENDING_VEHICLES_NUMBER = '0x6e'
+
+ % ids of vehicles ending to park (get: simulation)
+ VAR_PARKING_ENDING_VEHICLES_IDS = '0x6f'
+
+ % clears the simulation of all not inserted vehicles (set: simulation)
+ CMD_CLEAR_PENDING_VEHICLES = '0x94'
+
+ % sets/retrieves abstract parameter
+ VAR_PARAMETER = '0x7e'
+
+ % add an instance (poi, polygon, vehicle, route)
+ ADD = '0x80'
+
+ % remove an instance (poi, polygon)
+ REMOVE = '0x81'
+
+ % convert coordinates
+ POSITION_CONVERSION = '0x82'
+
+ % distance between points or vehicles
+ DISTANCE_REQUEST = '0x83'
+
+ %the current driving distance
+ VAR_DISTANCE = '0x84'
+
+ % add a fully specified instance (vehicle)
+ ADD_FULL = '0x85'
+
+ % force rerouting based on travel time (vehicles)
+ CMD_REROUTE_TRAVELTIME = '0x90'
+
+ % force rerouting based on effort (vehicles)
+ CMD_REROUTE_EFFORT = '0x91'
+
+ % validates current route (vehicles)
+ VAR_ROUTE_VALID = '0x92'
+
+ % retrieve information regarding the current person/container stage
+ VAR_STAGE = '0xc0'
+
+ % retrieve information regarding the next edge including crossings and walkingAreas (pedestrians only)
+ VAR_NEXT_EDGE = '0xc1'
+
+ % retrieve the number of stages (person, container)
+ VAR_NUM_STAGES = '0xc2'
+
+
+ % zoom
+ VAR_VIEW_ZOOM = '0xa0'
+
+ % view position
+ VAR_VIEW_OFFSET = '0xa1'
+
+ % view schema
+ VAR_VIEW_SCHEMA = '0xa2'
+
+ % view by boundary
+ VAR_VIEW_BOUNDARY = '0xa3'
+
+ % screenshot
+ VAR_SCREENSHOT = '0xa5'
+
+ % track vehicle
+ VAR_TRACK_VEHICLE = '0xa6'
+
+ end
+end
diff --git a/tools/contributed/traci4matlab/+traci/getVersion.m b/tools/contributed/traci4matlab/+traci/getVersion.m
new file mode 100644
index 0000000..70b22a1
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/getVersion.m
@@ -0,0 +1,33 @@
+function [traciversion, sumoversion] = getVersion()
+%getVersion Get the TraCI and SUMO versions.
+% [TRACIVERSION SUMOVERSION] = getVersion() Returns the current TraCI and
+% SUMO versions.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global message
+import traci.constants
+message = traci.Message();
+% Get the command ID from the traci Constants.
+strcommand = constants.CMD_GETVERSION;
+command = sscanf(strcommand,'%x');
+
+% Prepare the outgoing message
+message.queue = [message.queue command];
+message.string = uint8([message.string 1+1 command]);
+
+% Send the outgoing message and receive the result
+result = traci.sendExact();
+
+result.readLength();
+response = result.read(1);
+if response~=command
+ throw(MException('traci:FatalTraciError','Received answer 0x%.2X for command 0x%.2X.\n',...
+ response, command));
+else
+ traciversion = result.readInt();
+ sumoversion = result.readString();
+end
diff --git a/tools/contributed/traci4matlab/+traci/init.m b/tools/contributed/traci4matlab/+traci/init.m
new file mode 100644
index 0000000..09cb9b0
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/init.m
@@ -0,0 +1,70 @@
+function [traciVersion, sumoVersion] = init(varargin)
+%INIT Initialize the connection to the SUMO server.
+% INIT() Initialize the connection to the SUMO server using the socket
+% localhost:8813. The SUMO server must be listening on the same socket.
+% The label of the connection is 'default'. The connection is attempted
+% for a number of retries of ten.
+%
+% INIT(PORT) Initialize the connection to the SUMO server in the
+% localhost:PORT socket.
+%
+% INIT(PORT,NUMRETRIES) Try the connection for the given number of
+% retries.
+%
+% INIT(...,HOST) Specify the ip address of the SUMO server as a string
+% e.g. '192.168.1.15'.
+%
+% INIT(...,LABEL) Specify a label for the connection.
+%
+% [TRACIVERSION,SUMOVERSION] = INIT(...) Returns the TRACIVERSION and the
+% SUMOVERSION.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+
+% Add the DataReader class
+[pathstr,~,~] = fileparts(which('traci.init'));
+javaaddpath([pathstr '\..\traci4matlab.jar']);
+
+global connections
+
+% Parse the input
+p = inputParser;
+p.FunctionName = 'traci.init';
+p.addOptional('port', 8873, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('numRetries', 10, @(x)isnumeric(x) && length(x)==1)
+p.addOptional('host', '127.0.0.1', @ischar)
+p.addOptional('label', 'default', @ischar)
+p.parse(varargin{:})
+
+port = p.Results.port;
+numRetries = p.Results.numRetries;
+host = p.Results.host;
+label = p.Results.label;
+
+% Create the tcp object
+if isempty(connections)
+ connections = containers.Map();
+ connections(label) = traci.Socket();
+ connections('') = connections(label);
+end
+
+% Connect to the SUMO server within the given number of retries
+err = [];
+for i=1:numRetries
+ try
+ connections(label).connect(host, port);
+ break
+ catch err
+ pause(i)
+ end
+end
+if ~isempty(err)
+ disp(err);
+end
+
+[traciVersion sumoVersion] = traci.getVersion();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/packInt32.m b/tools/contributed/traci4matlab/+traci/packInt32.m
new file mode 100644
index 0000000..b63d4e7
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/packInt32.m
@@ -0,0 +1,14 @@
+function packedData = packInt32(data)
+%packInt32 Internal function to cast an int32 into
+% an uint8 array
+
+% Copyright 2014 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+if isa(data,'int32')
+ packedData = fliplr(typecast(data,'uint8'));
+else
+ packedData = fliplr(typecast(int32(data),'uint8'));
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/packInt64.m b/tools/contributed/traci4matlab/+traci/packInt64.m
new file mode 100644
index 0000000..57de79b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/packInt64.m
@@ -0,0 +1,10 @@
+function packedData = packInt64(data)
+%packInt32 Internal function to cast an int64 into
+% an uint8 array
+
+% Copyright 2014 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+packedData = fliplr(typecast(data,'uint8'));
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/readSubscription.m b/tools/contributed/traci4matlab/+traci/readSubscription.m
new file mode 100644
index 0000000..2a4d72c
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/readSubscription.m
@@ -0,0 +1,138 @@
+function [response, objectID] = readSubscription(result)
+%readSubscription Internal function to read the TraCI subscriptions.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global edgeSubscriptionResults guiSubscriptionResults ...
+ loopSubscriptionResults junctionSubscriptionResults ...
+ laneSubscriptionResults detSubscriptionResults ...
+ personSubscriptionResults poiSubscriptionResults...
+ polygonSubscriptionResults routeSubscriptionResults...
+ simSubscriptionResults tlSubscriptionResults...
+ vehSubscriptionResults typeSubscriptionResults
+
+subscriptionResults = containers.Map({...
+ constants.RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE,...
+ constants.RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE,...
+ constants.RESPONSE_SUBSCRIBE_TL_VARIABLE,...
+ constants.RESPONSE_SUBSCRIBE_LANE_VARIABLE,...
+ constants.RESPONSE_SUBSCRIBE_VEHICLE_VARIABLE,...
+ constants.RESPONSE_SUBSCRIBE_VEHICLETYPE_VARIABLE,...
+ constants.RESPONSE_SUBSCRIBE_ROUTE_VARIABLE,...
+ constants.RESPONSE_SUBSCRIBE_POI_VARIABLE,...
+ constants.RESPONSE_SUBSCRIBE_POLYGON_VARIABLE,...
+ constants.RESPONSE_SUBSCRIBE_JUNCTION_VARIABLE,...
+ constants.RESPONSE_SUBSCRIBE_EDGE_VARIABLE,...
+ constants.RESPONSE_SUBSCRIBE_SIM_VARIABLE,...
+ constants.RESPONSE_SUBSCRIBE_GUI_VARIABLE,...
+ constants.RESPONSE_SUBSCRIBE_PERSON_VARIABLE,...
+ constants.RESPONSE_SUBSCRIBE_INDUCTIONLOOP_CONTEXT,...
+ constants.RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT,...
+ constants.RESPONSE_SUBSCRIBE_TL_CONTEXT,...
+ constants.RESPONSE_SUBSCRIBE_LANE_CONTEXT,...
+ constants.RESPONSE_SUBSCRIBE_VEHICLE_CONTEXT,...
+ constants.RESPONSE_SUBSCRIBE_VEHICLETYPE_CONTEXT,...
+ constants.RESPONSE_SUBSCRIBE_ROUTE_CONTEXT,...
+ constants.RESPONSE_SUBSCRIBE_POI_CONTEXT,...
+ constants.RESPONSE_SUBSCRIBE_POLYGON_CONTEXT,...
+ constants.RESPONSE_SUBSCRIBE_JUNCTION_CONTEXT,...
+ constants.RESPONSE_SUBSCRIBE_EDGE_CONTEXT,...
+ constants.RESPONSE_SUBSCRIBE_SIM_CONTEXT,...
+ constants.RESPONSE_SUBSCRIBE_GUI_CONTEXT,...
+ constants.RESPONSE_SUBSCRIBE_PERSON_CONTEXT,...
+ constants.CMD_GET_INDUCTIONLOOP_VARIABLE,...
+ constants.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE,...
+ constants.CMD_GET_TL_VARIABLE,...
+ constants.CMD_GET_LANE_VARIABLE,...
+ constants.CMD_GET_VEHICLE_VARIABLE,...
+ constants.CMD_GET_VEHICLETYPE_VARIABLE,...
+ constants.CMD_GET_ROUTE_VARIABLE,...
+ constants.CMD_GET_POI_VARIABLE,...
+ constants.CMD_GET_POLYGON_VARIABLE,...
+ constants.CMD_GET_JUNCTION_VARIABLE,...
+ constants.CMD_GET_EDGE_VARIABLE,...
+ constants.CMD_GET_SIM_VARIABLE,...
+ constants.CMD_GET_GUI_VARIABLE,...
+ constants.CMD_GET_PERSON_VARIABLE},...
+ {loopSubscriptionResults, detSubscriptionResults,...
+ tlSubscriptionResults, laneSubscriptionResults,...
+ vehSubscriptionResults, typeSubscriptionResults,...
+ routeSubscriptionResults, poiSubscriptionResults,...
+ polygonSubscriptionResults, junctionSubscriptionResults,...
+ edgeSubscriptionResults, simSubscriptionResults,...
+ guiSubscriptionResults, personSubscriptionResults,...
+ loopSubscriptionResults, detSubscriptionResults,...
+ tlSubscriptionResults, laneSubscriptionResults,...
+ vehSubscriptionResults, typeSubscriptionResults,...
+ routeSubscriptionResults, poiSubscriptionResults,...
+ polygonSubscriptionResults, junctionSubscriptionResults,...
+ edgeSubscriptionResults, simSubscriptionResults,...
+ guiSubscriptionResults, personSubscriptionResults,...
+ loopSubscriptionResults, detSubscriptionResults,...
+ tlSubscriptionResults, laneSubscriptionResults,...
+ vehSubscriptionResults, typeSubscriptionResults,...
+ routeSubscriptionResults, poiSubscriptionResults,...
+ polygonSubscriptionResults, junctionSubscriptionResults,...
+ edgeSubscriptionResults, simSubscriptionResults,...
+ guiSubscriptionResults, personSubscriptionResults,...
+ });
+result.readLength();
+response = result.read(1);
+strresponse = ['0x' sprintf('%x',response)];
+% Determine if the subscription is context related.
+isVariableSubscription = response>=sscanf(...
+ traci.constants.RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE,'%x')...
+ && response<=sscanf(traci.constants.RESPONSE_SUBSCRIBE_PERSON_VARIABLE,'%x');
+objectID = result.readString();
+
+% Read the domain if the subscription was made to a context
+if ~isVariableSubscription
+ domain = result.read(1);
+ strdomain = ['0x' sprintf('%.2x',domain)];
+end
+
+% Read the number of variables to which the client is subscribed
+numVars = result.read(1);
+
+% Populate the global TraCI modules
+if isVariableSubscription
+ while numVars > 0
+ varID = result.read(1);
+ status = result.read(1);
+ result.read(1);
+ if status
+ fprintf('Error! %s\n', result.readString());
+ elseif isKey(subscriptionResults, strresponse)
+ subsResultsHandle = subscriptionResults(strresponse);
+ subsResultsHandle.add(objectID,...
+ ['0x' sprintf('%.2x',varID)], result);
+ else
+ throw(MException('traci:FatalTraciError','Cannot handle subscription response %s for %s\n',...
+ num2str(response), objectID));
+ end
+ numVars = numVars - 1;
+ end
+else
+ objectNo = result.readInt();
+ for o=1:objectNo
+ oid = result.readString();
+ for v=1:numVars
+ varID = result.read(1);
+ status = result.read(1);
+ result.read(1);
+ if status
+ fprintf('Error! %s\n', result.readString());
+ elseif isKey(subscriptionResults, strresponse)
+ subsResultsHandle = subscriptionResults(strresponse);
+ domainHandle = subscriptionResults(strdomain);
+ subsResultsHandle.addContext(objectID, domainHandle, oid, ['0x' sprintf('%.2x',varID)], result);
+ else
+ throw(MException('traci:FatalTraciError','Cannot handle subscription response %.2x for %s.', num2str(response), objectID));
+ end
+ end
+ end
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/recvExact.m b/tools/contributed/traci4matlab/+traci/recvExact.m
new file mode 100644
index 0000000..b153f81
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/recvExact.m
@@ -0,0 +1,52 @@
+function result = recvExact()
+%recvExact Internal function to receive the response from SUMO server.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global connections
+
+% recvlength = [];
+% connections('').BytesAvailable
+
+% Receive the total length of the response
+% while length(recvlength) < 1
+
+% We tried to address the issue that arises when the user closes
+% the SUMO GUI without closing the connection from the client through
+% this workaround. Unfortunately, it leads to an incredibly high
+% slowdown.
+% connClosed = strcmp(system('netstat | findstr 8813'),'');
+% if connClosed
+% result = [];
+% break
+% end
+% t = connections('').readInt();
+% if isempty(t)
+% result = [];
+% return
+% end
+% recvlength = [recvlength t];
+% end
+
+activeConnection = connections('');
+recvLength = activeConnection.dis.readInt() - 4;
+
+% Receive the response
+
+result = typecast(activeConnection.dataReader.readBuffer(recvLength),'uint8');
+
+% while length(result) < recvlength
+% t = fread(connections(''),recvlength-length(result),'uint8');
+% % flushinput(connections(''));
+% if isempty(t)
+% result = [];
+% return
+% end
+% result = [result t];
+% end
+
+% Construct the traci.Storage object containing the result
+result = traci.Storage(uint8(result'));
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/sendByteCmd.m b/tools/contributed/traci4matlab/+traci/sendByteCmd.m
new file mode 100644
index 0000000..246fa0d
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/sendByteCmd.m
@@ -0,0 +1,13 @@
+function sendByteCmd(cmdID, varID, objID, value)
+%sendByteCmd An internal function to build a message which sends a byte.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(cmdID, varID, objID, 1+1);
+message.string = [message.string uint8([sscanf(constants.TYPE_BYTE,'%x') value])];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/sendDoubleCmd.m b/tools/contributed/traci4matlab/+traci/sendDoubleCmd.m
new file mode 100644
index 0000000..b2699a6
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/sendDoubleCmd.m
@@ -0,0 +1,14 @@
+function sendDoubleCmd(cmdID, varID, objID, value)
+%sendDoubleCmd An internal function to build a message which sends a double.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(cmdID, varID, objID, 1+8);
+message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ...
+ traci.packInt64(value)];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/sendExact.m b/tools/contributed/traci4matlab/+traci/sendExact.m
new file mode 100644
index 0000000..bd542b2
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/sendExact.m
@@ -0,0 +1,62 @@
+function result = sendExact()
+%sendExact An internal function to send a message to the SUMO server and
+%parse the result.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global message connections
+import traci.constants
+% warning('off','instrument:fread:unsuccessfulRead');
+
+% Length of the command
+len = 4 + length(message.string);
+activeConnection = connections('');
+
+% Write the message to the tcp socket
+activeConnection.dos.writeInt(len);
+activeConnection.dos.write(message.string);
+
+% Read the result from the socket
+result = traci.recvExact();
+
+if isempty(result)
+ fclose(connections(''));
+ clear connections('')
+ throw(MException('traci:FatalTraciError','Connection closed by SUMO\n'))
+end
+
+% Parse the result
+for i= 1:length(message.queue)
+ prefix = result.read(3);
+ if prefix(3)==0
+ strresult = 'OK';
+ elseif prefix(3)==1
+ strresult = 'Not Implemented';
+ else
+ strresult = 'Error';
+ end
+ err = result.readString();
+ if prefix(3) || ~isempty(err)
+ message.string = [];
+ message.queue = [];
+ traci.close();
+ throw(MException('traci:FatalTraciError','%s %s %s\n', num2str(prefix), strresult, err));
+ elseif prefix(2) ~= message.queue(i)
+ traci.close();
+ throw(MException('traci:FatalTraciError','Received answer 0x%.2X for command 0x%.2x.\n',...
+ prefix(2), message.queue(i)));
+ elseif strcmp(prefix(2),constants.CMD_STOP)
+ len = result.read(1) - 1;
+ result.read(len + 1);
+ end
+end
+
+% Clear the message contents
+message.string = [];
+message.queue = [];
+
+
+
diff --git a/tools/contributed/traci4matlab/+traci/sendIntCmd.m b/tools/contributed/traci4matlab/+traci/sendIntCmd.m
new file mode 100644
index 0000000..7c1fcec
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/sendIntCmd.m
@@ -0,0 +1,14 @@
+function sendIntCmd(cmdID, varID, objID, value)
+%sendIntCmd An internal function to build a message which sends an int.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+import traci.constants
+global message
+traci.beginMessage(cmdID, varID, objID, 1+4);
+message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ...
+ traci.packInt32(value)];
+traci.sendExact();
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/sendReadOneStringCmd.m b/tools/contributed/traci4matlab/+traci/sendReadOneStringCmd.m
new file mode 100644
index 0000000..e8cc3a2
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/sendReadOneStringCmd.m
@@ -0,0 +1,11 @@
+function result = sendReadOneStringCmd(cmdID, varID, objID)
+%sendReadOneStringCmd An internal function to build an outgoing message to
+%the SUMO server and parse the response.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+traci.beginMessage(cmdID, varID, objID);
+result = traci.checkResult(cmdID, varID, objID);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/sendStringCmd.m b/tools/contributed/traci4matlab/+traci/sendStringCmd.m
new file mode 100644
index 0000000..56ec470
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/sendStringCmd.m
@@ -0,0 +1,18 @@
+function sendStringCmd(cmdID, varID, objID, value)
+%sendStringCmd An internal function to build a message which sends a string.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global message
+import traci.constants
+
+% Construct the TraCI message
+traci.beginMessage(cmdID, varID, objID, 1+4+length(value))
+message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ...
+ traci.packInt32(length(value)) uint8(value)];
+
+% Send the TraCI message
+traci.sendExact();
diff --git a/tools/contributed/traci4matlab/+traci/simulationStep.m b/tools/contributed/traci4matlab/+traci/simulationStep.m
new file mode 100644
index 0000000..f4db88b
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/simulationStep.m
@@ -0,0 +1,58 @@
+function responses = simulationStep(timeStep)
+%simulationStep Perform a simulation step in the SUMO server.
+%
+% simulationStep() Perform a simulation step in the SUMO server with
+% a time step of one second.
+%
+% simulationStep(STEP) Perform a simulation step in the SUMO server with
+% a time step STEP.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+
+global message edgeSubscriptionResults guiSubscriptionResults ...
+ loopSubscriptionResults junctionSubscriptionResults ...
+ laneSubscriptionResults detSubscriptionResults ...
+ poiSubscriptionResults polygonSubscriptionResults ...
+ routeSubscriptionResults simSubscriptionResults ...
+ tlSubscriptionResults vehSubscriptionResults ...
+ personSubscriptionResults typeSubscriptionResults
+
+modules = {edgeSubscriptionResults guiSubscriptionResults ...
+ loopSubscriptionResults junctionSubscriptionResults ...
+ laneSubscriptionResults detSubscriptionResults ...
+ poiSubscriptionResults polygonSubscriptionResults ...
+ routeSubscriptionResults simSubscriptionResults ...
+ tlSubscriptionResults vehSubscriptionResults ...
+ personSubscriptionResults typeSubscriptionResults};
+
+if nargin < 1
+ timeStep = 0;
+end
+import traci.constants
+
+% Prepare the message to be sent to the SUMO server
+message.queue = [message.queue uint8(sscanf(constants.CMD_SIMSTEP2,'%x'))];
+message.string = [message.string uint8([1+1+4 sscanf(constants.CMD_SIMSTEP2,'%x')]) ...
+ traci.packInt32(timeStep)];
+
+% Send the message
+result = traci.sendExact();
+
+% Clear the TraCI subscriptions
+for i=1:length(modules)
+ if ~isempty(modules{i})
+ modules{i}.reset();
+ end
+end
+
+% Get the number of subscriptions and populate them
+numSubs = result.readInt();
+responses = cell(1,2*numSubs);
+for i=1:numSubs
+ [response, objectID] = traci.readSubscription(result);
+ responses(2*i-1:2*i) = {response objectID};
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/subscribe.m b/tools/contributed/traci4matlab/+traci/subscribe.m
new file mode 100644
index 0000000..3a3a599
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/subscribe.m
@@ -0,0 +1,36 @@
+function subscribe(cmdID, subscriptionBegin, subscriptionEnd, objID, varIDs)
+%subscribe An internal function to build a subscription message and parse
+%the response.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global message
+
+% Construct the TraCI message
+message.queue = [message.queue uint8(sscanf(cmdID,'%x'))];
+len = 1+1+4+4+4+length(objID)+1+length(varIDs);
+if len <= 255
+ message.string = [message.string uint8(len)];
+else
+ message.string = [message.string uint8(0) traci.packInt32(len+4)];
+end
+message.string = [message.string uint8(sscanf(cmdID,'%x')),...
+ traci.packInt32([length(objID) subscriptionEnd ...
+ subscriptionBegin]) uint8(objID)];
+message.string = [message.string uint8(length(varIDs))];
+for v=1:length(varIDs)
+ message.string = [message.string sscanf(varIDs{v},'%x')];
+end
+
+% Send the TraCI message and receive the result
+result = traci.sendExact();
+
+% Populate the subsctiptions and parse the result
+[response, objectID] = traci.readSubscription(result);
+if response - uint8(sscanf(cmdID,'%x'))~=16 || ~strcmp(objectID,objID)
+ raise(MException('traci:FatalTraciError',['Received answer ' response ...
+ ', ' objectID 'for subscription command ' cmdID ', ' objID]));
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/subscribeContext.m b/tools/contributed/traci4matlab/+traci/subscribeContext.m
new file mode 100644
index 0000000..5d503ab
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/subscribeContext.m
@@ -0,0 +1,51 @@
+function subscribeContext(cmdID, subscriptionBegin, subscriptionEnd, objID, domain, dist, varIDs)
+%subscribeContext An internal function to build a context subscription
+%command and parse the response.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global message
+global loopSubscriptionResults laneSubscriptionResults vehSubscriptionResults ...
+ poiSubscriptionResults polygonSubscriptionResults junctionSubscriptionResults ...
+ edgeSubscriptionResults
+
+if strcmp(domain,'0xa0')
+ loopSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.inductionloop);
+elseif strcmp(domain,'0xa3')
+ laneSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.lane);
+elseif strcmp(domain,'0xa4')
+ vehSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicle);
+elseif strcmp(domain,'0xa7')
+ poiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.poi);
+elseif strcmp(domain,'0xa8')
+ polygonSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.polygon);
+elseif strcmp(domain,'0xa9')
+ junctionSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.junction);
+elseif strcmp(domain,'0xaa')
+ edgeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.edge);
+end
+
+message.queue = [message.queue uint8(sscanf(cmdID,'%x'))];
+len = 1+1+4+4+4+length(objID)+1+8+1+length(varIDs);
+if len<=255
+ message.string = [message.string uint8(len)];
+else
+ message.string = [message.string uint8(0) traci.packInt64(len+4)];
+end
+message.string = [message.string uint8(sscanf(cmdID,'%x')),...
+ traci.packInt32([length(objID)...
+ subscriptionEnd subscriptionBegin]) uint8(objID)];
+message.string = [message.string uint8(sscanf(domain,'%x')) ...
+ traci.packInt64(dist) uint8(length(varIDs))];
+for i=1:length(varIDs)
+ message.string = [message.string uint8(sscanf(varIDs{i},'%x'))];
+end
+result = traci.sendExact();
+[response, objectID] = traci.readSubscription(result);
+if response - uint8(sscanf(cmdID,'%x'))~=16 || ~strcmp(objectID,objID)
+ raise(MException('traci:FatalTraciError','Received answer %.2X,%s for context subscription command %.2X,%s\n',...
+ response, objectID, cmdID, objID));
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/switchConnection.m b/tools/contributed/traci4matlab/+traci/switchConnection.m
new file mode 100644
index 0000000..97c6a88
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/switchConnection.m
@@ -0,0 +1,13 @@
+function switchConnection(label)
+%switchConnection Switch to another connection with SUMO.
+%
+% switchConnection(label) Switch to the connection specified in LABEL
+% with the SUMO server.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+global connections
+connections('') = connections(label);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/+traci/time2steps.m b/tools/contributed/traci4matlab/+traci/time2steps.m
new file mode 100644
index 0000000..c7142d6
--- /dev/null
+++ b/tools/contributed/traci4matlab/+traci/time2steps.m
@@ -0,0 +1,10 @@
+function timeInMiliseconds = time2steps(time)
+%timeInMiliseconds An internal function to convert time in seconds to
+%miliseconds.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+timeInMiliseconds = int32(time*1000);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas.poly.xml b/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas.poly.xml
new file mode 100644
index 0000000..a7c5c1e
--- /dev/null
+++ b/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas.poly.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- generated on 06/19/15 09:59:57 by SUMO polyconvert Version dev-SVN-r18493
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/polyconvertConfiguration.xsd">
+
+ <input>
+ <net-file value="inter_palmas_notls_shaped_conns_joined_crossings.net.xml"/>
+ <osm-files value="inter_palmas_notls.osm"/>
+ <type-file value="C:\sumo\data\typemap\osmPolyconvert.typ.xml"/>
+ </input>
+
+ <output>
+ <output-file value="inter_palmas_notls.poly.xml"/>
+ </output>
+
+ <processing>
+ <ignore-errors value="true"/>
+ </processing>
+
+</configuration>
+-->
+
+<additional xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/additional_file.xsd">
+ <location netOffset="-436926.13,-689249.98" convBoundary="-0.00,-795.12,812.58,405.59" origBoundary="-75.570172,6.228117,-75.562822,6.238979" projParameter="+proj=utm +zone=18 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"/>
+
+ <poly id="153413634" type="building" color="255,230,230" fill="1" layer="-1.00" shape="16.29,92.48 85.46,61.31 103.90,136.10 135.93,121.91 146.54,106.87 158.38,85.63 170.23,62.04 197.12,-173.47 140.98,-173.71 129.77,-56.65 23.61,-60.54 16.29,92.48"/>
+ <poly id="153413634#1" type="shop" color="237,199,255" fill="1" layer="-1.00" shape="16.29,92.48 85.46,61.31 103.90,136.10 135.93,121.91 146.54,106.87 158.38,85.63 170.23,62.04 197.12,-173.47 140.98,-173.71 129.77,-56.65 23.61,-60.54 16.29,92.48"/>
+ <poly id="32853090" type="forest" color="140,196,107" fill="1" layer="-3.00" shape="432.30,-795.12 457.97,-776.29 469.45,-689.52 501.77,-660.31 521.74,-631.10 554.00,-613.74 565.01,-607.83 588.25,-595.33 610.74,-587.82 678.48,-565.23 729.78,-538.88 720.34,-488.88 720.35,-475.67 763.12,-449.30 792.57,-421.98 812.58,-365.42 802.16,-346.53 706.30,-300.21 701.54,-313.42 674.01,-303.96 689.25,-265.29 709.23,-223.81 731.08,-205.92 731.10,-195.54 709.25,-204.00 696.01,-159.66 701.72,-147.41 [...]
+ <poi id="1661049495" type="shop" color="237,199,255" layer="-1.00" x="122.78" y="38.21"/>
+ <poi id="1661049549" type="shop" color="237,199,255" layer="-1.00" x="114.54" y="99.53"/>
+ <poi id="1687253443" type="amenity" color="237,199,199" layer="-1.00" x="34.25" y="168.89"/>
+ <poi id="1687253447" type="shop" color="237,199,255" layer="-1.00" x="24.74" y="146.51"/>
+ <poi id="2428479773" type="shop" color="237,199,255" layer="-1.00" x="103.82" y="86.62"/>
+ <poi id="2529943443" type="shop" color="237,199,255" layer="-1.00" x="104.08" y="51.21"/>
+ <poi id="339905710" type="shop" color="237,199,255" layer="-1.00" x="37.83" y="67.21"/>
+ <poi id="567076682" type="amenity" color="237,199,199" layer="-1.00" x="85.46" y="61.31"/>
+</additional>
diff --git a/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_bus_stops.add.xml b/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_bus_stops.add.xml
new file mode 100644
index 0000000..798b94e
--- /dev/null
+++ b/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_bus_stops.add.xml
@@ -0,0 +1,4 @@
+<add>
+ <busStop id="sanDiegoE" lane="-465_1" lines="--"/>
+ <busStop id="sanDiegoW" lane="-447_1" lines="--"/>
+</add>
diff --git a/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_buses.rou.alt.xml b/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_buses.rou.alt.xml
new file mode 100644
index 0000000..8417746
--- /dev/null
+++ b/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_buses.rou.alt.xml
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- generated on 06/19/15 14:15:40 by SUMO duarouter Version dev-SVN-r18493
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/duarouterConfiguration.xsd">
+
+ <input>
+ <net-file value="inter_palmas_notls.net.xml"/>
+ <additional-files value="inter_palmas_bus_stops.add.xml"/>
+ <flow-files value="inter_palmas_buses.trips.xml"/>
+ </input>
+
+ <output>
+ <output-file value="inter_palmas_buses.rou.xml"/>
+ </output>
+
+ <processing>
+ <ignore-errors value="true"/>
+ </processing>
+
+ <report>
+ <verbose value="true"/>
+ </report>
+
+</configuration>
+-->
+
+<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
+ <vType id="bus" vClass="bus" guiShape="bus" color="green"/>
+ <vehicle id="buses_EW.0" type="bus" depart="50400.00">
+ <routeDistribution last="0">
+ <route cost="17.30" probability="1.00000000" edges="-380 -465 -436#0 -436#1"/>
+ </routeDistribution>
+ <stop busStop="sanDiegoE" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_WE.0" type="bus" depart="50400.00">
+ <routeDistribution last="0">
+ <route cost="15.35" probability="1.00000000" edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </routeDistribution>
+ <stop busStop="sanDiegoW" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_EW.1" type="bus" depart="50850.00">
+ <routeDistribution last="0">
+ <route cost="17.30" probability="1.00000000" edges="-380 -465 -436#0 -436#1"/>
+ </routeDistribution>
+ <stop busStop="sanDiegoE" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_WE.1" type="bus" depart="50850.00">
+ <routeDistribution last="0">
+ <route cost="15.35" probability="1.00000000" edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </routeDistribution>
+ <stop busStop="sanDiegoW" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_EW.2" type="bus" depart="51300.00">
+ <routeDistribution last="0">
+ <route cost="17.30" probability="1.00000000" edges="-380 -465 -436#0 -436#1"/>
+ </routeDistribution>
+ <stop busStop="sanDiegoE" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_WE.2" type="bus" depart="51300.00">
+ <routeDistribution last="0">
+ <route cost="15.35" probability="1.00000000" edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </routeDistribution>
+ <stop busStop="sanDiegoW" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_EW.3" type="bus" depart="51750.00">
+ <routeDistribution last="0">
+ <route cost="17.30" probability="1.00000000" edges="-380 -465 -436#0 -436#1"/>
+ </routeDistribution>
+ <stop busStop="sanDiegoE" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_WE.3" type="bus" depart="51750.00">
+ <routeDistribution last="0">
+ <route cost="15.35" probability="1.00000000" edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </routeDistribution>
+ <stop busStop="sanDiegoW" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_EW.4" type="bus" depart="52200.00">
+ <routeDistribution last="0">
+ <route cost="17.30" probability="1.00000000" edges="-380 -465 -436#0 -436#1"/>
+ </routeDistribution>
+ <stop busStop="sanDiegoE" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_WE.4" type="bus" depart="52200.00">
+ <routeDistribution last="0">
+ <route cost="15.35" probability="1.00000000" edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </routeDistribution>
+ <stop busStop="sanDiegoW" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_EW.5" type="bus" depart="52650.00">
+ <routeDistribution last="0">
+ <route cost="17.30" probability="1.00000000" edges="-380 -465 -436#0 -436#1"/>
+ </routeDistribution>
+ <stop busStop="sanDiegoE" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_WE.5" type="bus" depart="52650.00">
+ <routeDistribution last="0">
+ <route cost="15.35" probability="1.00000000" edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </routeDistribution>
+ <stop busStop="sanDiegoW" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_EW.6" type="bus" depart="53100.00">
+ <routeDistribution last="0">
+ <route cost="17.30" probability="1.00000000" edges="-380 -465 -436#0 -436#1"/>
+ </routeDistribution>
+ <stop busStop="sanDiegoE" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_WE.6" type="bus" depart="53100.00">
+ <routeDistribution last="0">
+ <route cost="15.35" probability="1.00000000" edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </routeDistribution>
+ <stop busStop="sanDiegoW" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_EW.7" type="bus" depart="53550.00">
+ <routeDistribution last="0">
+ <route cost="17.30" probability="1.00000000" edges="-380 -465 -436#0 -436#1"/>
+ </routeDistribution>
+ <stop busStop="sanDiegoE" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_WE.7" type="bus" depart="53550.00">
+ <routeDistribution last="0">
+ <route cost="15.35" probability="1.00000000" edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </routeDistribution>
+ <stop busStop="sanDiegoW" duration="120.00"/>
+ </vehicle>
+</routes>
diff --git a/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_buses.rou.xml b/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_buses.rou.xml
new file mode 100644
index 0000000..c6eb15a
--- /dev/null
+++ b/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_buses.rou.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- generated on 06/19/15 14:15:40 by SUMO duarouter Version dev-SVN-r18493
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/duarouterConfiguration.xsd">
+
+ <input>
+ <net-file value="inter_palmas_notls.net.xml"/>
+ <additional-files value="inter_palmas_bus_stops.add.xml"/>
+ <flow-files value="inter_palmas_buses.trips.xml"/>
+ </input>
+
+ <output>
+ <output-file value="inter_palmas_buses.rou.xml"/>
+ </output>
+
+ <processing>
+ <ignore-errors value="true"/>
+ </processing>
+
+ <report>
+ <verbose value="true"/>
+ </report>
+
+</configuration>
+-->
+
+<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
+ <vType id="bus" vClass="bus" guiShape="bus" color="green"/>
+ <vehicle id="buses_EW.0" type="bus" depart="50400.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ <stop busStop="sanDiegoE" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_WE.0" type="bus" depart="50400.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ <stop busStop="sanDiegoW" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_EW.1" type="bus" depart="50850.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ <stop busStop="sanDiegoE" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_WE.1" type="bus" depart="50850.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ <stop busStop="sanDiegoW" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_EW.2" type="bus" depart="51300.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ <stop busStop="sanDiegoE" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_WE.2" type="bus" depart="51300.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ <stop busStop="sanDiegoW" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_EW.3" type="bus" depart="51750.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ <stop busStop="sanDiegoE" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_WE.3" type="bus" depart="51750.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ <stop busStop="sanDiegoW" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_EW.4" type="bus" depart="52200.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ <stop busStop="sanDiegoE" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_WE.4" type="bus" depart="52200.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ <stop busStop="sanDiegoW" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_EW.5" type="bus" depart="52650.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ <stop busStop="sanDiegoE" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_WE.5" type="bus" depart="52650.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ <stop busStop="sanDiegoW" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_EW.6" type="bus" depart="53100.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ <stop busStop="sanDiegoE" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_WE.6" type="bus" depart="53100.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ <stop busStop="sanDiegoW" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_EW.7" type="bus" depart="53550.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ <stop busStop="sanDiegoE" duration="120.00"/>
+ </vehicle>
+ <vehicle id="buses_WE.7" type="bus" depart="53550.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ <stop busStop="sanDiegoW" duration="120.00"/>
+ </vehicle>
+</routes>
diff --git a/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_buses.trips.xml b/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_buses.trips.xml
new file mode 100644
index 0000000..b18bcdb
--- /dev/null
+++ b/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_buses.trips.xml
@@ -0,0 +1,9 @@
+<flows>
+ <vType id="bus" color="0,1,0" vClass="bus" guiShape="bus"/>
+ <flow id="buses_EW" begin="50400" end="54000" period="450" from="-380" to="-436#1" type="bus">
+ <stop busStop="sanDiegoE" duration="120"/>
+ </flow>
+ <flow id="buses_WE" begin="50400" end="54000" period="450" from="33463249#0" to="-461#1" type="bus">
+ <stop busStop="sanDiegoW" duration="120"/>
+ </flow>
+</flows>
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_demand.rou.xml b/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_demand.rou.xml
new file mode 100644
index 0000000..b1ab858
--- /dev/null
+++ b/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_demand.rou.xml
@@ -0,0 +1,6332 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- generated on 06/22/15 10:10:44 by SUMO jtrrouter Version dev-SVN-r18493
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/jtrrouterConfiguration.xsd">
+
+ <input>
+ <net-file value="inter_palmas_notls.net.xml"/>
+ <flow-files value="inter_palmas_demand.trips.xml"/>
+ <turn-ratio-files value="inter_palmas_demand.turns.xml"/>
+ </input>
+
+ <output>
+ <output-file value="inter_palmas_demand.rou.xml"/>
+ </output>
+
+ <processing>
+ <ignore-errors value="true"/>
+ </processing>
+
+ <report>
+ <verbose value="true"/>
+ </report>
+
+</configuration>
+-->
+
+<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
+ <vType id="taxi" vClass="taxi"/>
+ <vehicle id="-3801.0" type="taxi" depart="50400.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vType id="carro" vClass="passenger" guiShape="passenger" color="red"/>
+ <vehicle id="30659373#01.0" type="carro" depart="50400.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.0" type="taxi" depart="50400.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.1" type="taxi" depart="50404.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.1" type="taxi" depart="50404.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.1" type="carro" depart="50407.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.2" type="taxi" depart="50409.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.2" type="taxi" depart="50409.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.3" type="taxi" depart="50413.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.3" type="taxi" depart="50413.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.2" type="carro" depart="50414.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.4" type="taxi" depart="50418.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.4" type="taxi" depart="50418.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.3" type="carro" depart="50421.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.5" type="taxi" depart="50422.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.5" type="taxi" depart="50422.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.6" type="taxi" depart="50427.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.6" type="taxi" depart="50427.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.4" type="carro" depart="50428.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.7" type="taxi" depart="50431.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.7" type="taxi" depart="50431.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.8" type="taxi" depart="50436.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.5" type="carro" depart="50436.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.8" type="taxi" depart="50436.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.9" type="taxi" depart="50440.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.9" type="taxi" depart="50440.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.6" type="carro" depart="50443.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.10" type="taxi" depart="50445.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.10" type="taxi" depart="50445.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.11" type="taxi" depart="50449.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.11" type="taxi" depart="50449.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.7" type="carro" depart="50450.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.12" type="taxi" depart="50454.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.12" type="taxi" depart="50454.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.8" type="carro" depart="50457.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.13" type="taxi" depart="50458.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.13" type="taxi" depart="50458.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.14" type="taxi" depart="50463.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.14" type="taxi" depart="50463.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.9" type="carro" depart="50464.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.15" type="taxi" depart="50467.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.15" type="taxi" depart="50467.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.16" type="taxi" depart="50472.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.10" type="carro" depart="50472.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.16" type="taxi" depart="50472.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.17" type="taxi" depart="50476.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.17" type="taxi" depart="50476.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.11" type="carro" depart="50479.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.18" type="taxi" depart="50481.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.18" type="taxi" depart="50481.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.19" type="taxi" depart="50485.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.19" type="taxi" depart="50485.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.12" type="carro" depart="50486.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.20" type="taxi" depart="50490.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.20" type="taxi" depart="50490.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.13" type="carro" depart="50493.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.21" type="taxi" depart="50494.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.21" type="taxi" depart="50494.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.22" type="taxi" depart="50499.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.22" type="taxi" depart="50499.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.14" type="carro" depart="50500.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.23" type="taxi" depart="50503.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.23" type="taxi" depart="50503.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.24" type="taxi" depart="50508.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.15" type="carro" depart="50508.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.24" type="taxi" depart="50508.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.25" type="taxi" depart="50512.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.25" type="taxi" depart="50512.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.16" type="carro" depart="50515.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.26" type="taxi" depart="50517.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.26" type="taxi" depart="50517.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.27" type="taxi" depart="50521.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.27" type="taxi" depart="50521.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.17" type="carro" depart="50522.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.28" type="taxi" depart="50526.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.28" type="taxi" depart="50526.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.18" type="carro" depart="50529.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.29" type="taxi" depart="50530.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.29" type="taxi" depart="50530.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.30" type="taxi" depart="50535.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.30" type="taxi" depart="50535.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.19" type="carro" depart="50536.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.31" type="taxi" depart="50539.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.31" type="taxi" depart="50539.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.32" type="taxi" depart="50544.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.20" type="carro" depart="50544.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.32" type="taxi" depart="50544.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.33" type="taxi" depart="50548.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.33" type="taxi" depart="50548.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.21" type="carro" depart="50551.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.34" type="taxi" depart="50553.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.34" type="taxi" depart="50553.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.35" type="taxi" depart="50557.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.35" type="taxi" depart="50557.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.22" type="carro" depart="50558.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.36" type="taxi" depart="50562.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.36" type="taxi" depart="50562.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.23" type="carro" depart="50565.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.37" type="taxi" depart="50566.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.37" type="taxi" depart="50566.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.38" type="taxi" depart="50571.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.38" type="taxi" depart="50571.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.24" type="carro" depart="50572.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.39" type="taxi" depart="50575.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.39" type="taxi" depart="50575.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.40" type="taxi" depart="50580.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.25" type="carro" depart="50580.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.40" type="taxi" depart="50580.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.41" type="taxi" depart="50584.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.41" type="taxi" depart="50584.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.26" type="carro" depart="50587.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.42" type="taxi" depart="50589.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.42" type="taxi" depart="50589.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.43" type="taxi" depart="50593.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.43" type="taxi" depart="50593.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.27" type="carro" depart="50594.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.44" type="taxi" depart="50598.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.44" type="taxi" depart="50598.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.28" type="carro" depart="50601.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.45" type="taxi" depart="50602.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.45" type="taxi" depart="50602.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.46" type="taxi" depart="50607.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.46" type="taxi" depart="50607.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.29" type="carro" depart="50608.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.47" type="taxi" depart="50611.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.47" type="taxi" depart="50611.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.48" type="taxi" depart="50616.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.30" type="carro" depart="50616.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.48" type="taxi" depart="50616.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.49" type="taxi" depart="50620.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.49" type="taxi" depart="50620.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.31" type="carro" depart="50623.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.50" type="taxi" depart="50625.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.50" type="taxi" depart="50625.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.51" type="taxi" depart="50629.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.51" type="taxi" depart="50629.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.32" type="carro" depart="50630.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.52" type="taxi" depart="50634.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.52" type="taxi" depart="50634.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.33" type="carro" depart="50637.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.53" type="taxi" depart="50638.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.53" type="taxi" depart="50638.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.54" type="taxi" depart="50643.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.54" type="taxi" depart="50643.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.34" type="carro" depart="50644.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.55" type="taxi" depart="50647.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.55" type="taxi" depart="50647.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.56" type="taxi" depart="50652.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.35" type="carro" depart="50652.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.56" type="taxi" depart="50652.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.57" type="taxi" depart="50656.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.57" type="taxi" depart="50656.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.36" type="carro" depart="50659.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.58" type="taxi" depart="50661.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.58" type="taxi" depart="50661.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.59" type="taxi" depart="50665.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.59" type="taxi" depart="50665.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.37" type="carro" depart="50666.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.60" type="taxi" depart="50670.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.60" type="taxi" depart="50670.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.38" type="carro" depart="50673.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.61" type="taxi" depart="50674.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.61" type="taxi" depart="50674.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.62" type="taxi" depart="50679.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.62" type="taxi" depart="50679.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.39" type="carro" depart="50680.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.63" type="taxi" depart="50683.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.63" type="taxi" depart="50683.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.64" type="taxi" depart="50688.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.40" type="carro" depart="50688.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.64" type="taxi" depart="50688.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.65" type="taxi" depart="50692.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.65" type="taxi" depart="50692.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.41" type="carro" depart="50695.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.66" type="taxi" depart="50697.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.66" type="taxi" depart="50697.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.67" type="taxi" depart="50701.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.67" type="taxi" depart="50701.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.42" type="carro" depart="50702.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.68" type="taxi" depart="50706.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.68" type="taxi" depart="50706.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.43" type="carro" depart="50709.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.69" type="taxi" depart="50710.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.69" type="taxi" depart="50710.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.70" type="taxi" depart="50715.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.70" type="taxi" depart="50715.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.44" type="carro" depart="50716.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.71" type="taxi" depart="50719.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.71" type="taxi" depart="50719.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.72" type="taxi" depart="50724.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.45" type="carro" depart="50724.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.72" type="taxi" depart="50724.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.73" type="taxi" depart="50728.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.73" type="taxi" depart="50728.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.46" type="carro" depart="50731.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.74" type="taxi" depart="50733.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.74" type="taxi" depart="50733.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.75" type="taxi" depart="50737.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.75" type="taxi" depart="50737.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.47" type="carro" depart="50738.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.76" type="taxi" depart="50742.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.76" type="taxi" depart="50742.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.48" type="carro" depart="50745.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.77" type="taxi" depart="50746.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.77" type="taxi" depart="50746.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.78" type="taxi" depart="50751.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.78" type="taxi" depart="50751.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.49" type="carro" depart="50752.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.79" type="taxi" depart="50755.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.79" type="taxi" depart="50755.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.80" type="taxi" depart="50760.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.50" type="carro" depart="50760.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.80" type="taxi" depart="50760.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.81" type="taxi" depart="50764.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.81" type="taxi" depart="50764.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.51" type="carro" depart="50767.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.82" type="taxi" depart="50769.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.82" type="taxi" depart="50769.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.83" type="taxi" depart="50773.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.83" type="taxi" depart="50773.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.52" type="carro" depart="50774.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.84" type="taxi" depart="50778.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.84" type="taxi" depart="50778.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.53" type="carro" depart="50781.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.85" type="taxi" depart="50782.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.85" type="taxi" depart="50782.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.86" type="taxi" depart="50787.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.86" type="taxi" depart="50787.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.54" type="carro" depart="50788.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.87" type="taxi" depart="50791.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.87" type="taxi" depart="50791.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.88" type="taxi" depart="50796.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.55" type="carro" depart="50796.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.88" type="taxi" depart="50796.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.89" type="taxi" depart="50800.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.89" type="taxi" depart="50800.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.56" type="carro" depart="50803.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.90" type="taxi" depart="50805.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.90" type="taxi" depart="50805.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.91" type="taxi" depart="50809.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.91" type="taxi" depart="50809.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.57" type="carro" depart="50810.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.92" type="taxi" depart="50814.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.92" type="taxi" depart="50814.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.58" type="carro" depart="50817.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.93" type="taxi" depart="50818.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.93" type="taxi" depart="50818.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.94" type="taxi" depart="50823.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.94" type="taxi" depart="50823.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.59" type="carro" depart="50824.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.95" type="taxi" depart="50827.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.95" type="taxi" depart="50827.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.96" type="taxi" depart="50832.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.60" type="carro" depart="50832.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.96" type="taxi" depart="50832.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.97" type="taxi" depart="50836.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.97" type="taxi" depart="50836.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.61" type="carro" depart="50839.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.98" type="taxi" depart="50841.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.98" type="taxi" depart="50841.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.99" type="taxi" depart="50845.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.99" type="taxi" depart="50845.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.62" type="carro" depart="50846.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.100" type="taxi" depart="50850.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.100" type="taxi" depart="50850.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.63" type="carro" depart="50853.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.101" type="taxi" depart="50854.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.101" type="taxi" depart="50854.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.102" type="taxi" depart="50859.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.102" type="taxi" depart="50859.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.64" type="carro" depart="50860.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.103" type="taxi" depart="50863.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.103" type="taxi" depart="50863.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.104" type="taxi" depart="50868.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.65" type="carro" depart="50868.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.104" type="taxi" depart="50868.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.105" type="taxi" depart="50872.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.105" type="taxi" depart="50872.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.66" type="carro" depart="50875.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.106" type="taxi" depart="50877.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.106" type="taxi" depart="50877.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.107" type="taxi" depart="50881.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.107" type="taxi" depart="50881.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.67" type="carro" depart="50882.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.108" type="taxi" depart="50886.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.108" type="taxi" depart="50886.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.68" type="carro" depart="50889.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.109" type="taxi" depart="50890.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.109" type="taxi" depart="50890.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.110" type="taxi" depart="50895.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.110" type="taxi" depart="50895.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.69" type="carro" depart="50896.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.111" type="taxi" depart="50899.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.111" type="taxi" depart="50899.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.112" type="taxi" depart="50904.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.70" type="carro" depart="50904.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.112" type="taxi" depart="50904.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.113" type="taxi" depart="50908.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.113" type="taxi" depart="50908.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.71" type="carro" depart="50911.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.114" type="taxi" depart="50913.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.114" type="taxi" depart="50913.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.115" type="taxi" depart="50917.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.115" type="taxi" depart="50917.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.72" type="carro" depart="50918.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.116" type="taxi" depart="50922.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.116" type="taxi" depart="50922.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.73" type="carro" depart="50925.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.117" type="taxi" depart="50926.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.117" type="taxi" depart="50926.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.118" type="taxi" depart="50931.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.118" type="taxi" depart="50931.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.74" type="carro" depart="50932.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.119" type="taxi" depart="50935.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.119" type="taxi" depart="50935.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.120" type="taxi" depart="50940.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.75" type="carro" depart="50940.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.120" type="taxi" depart="50940.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.121" type="taxi" depart="50944.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.121" type="taxi" depart="50944.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.76" type="carro" depart="50947.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.122" type="taxi" depart="50949.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.122" type="taxi" depart="50949.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.123" type="taxi" depart="50953.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.123" type="taxi" depart="50953.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.77" type="carro" depart="50954.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.124" type="taxi" depart="50958.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.124" type="taxi" depart="50958.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.78" type="carro" depart="50961.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.125" type="taxi" depart="50962.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.125" type="taxi" depart="50962.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.126" type="taxi" depart="50967.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.126" type="taxi" depart="50967.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.79" type="carro" depart="50968.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.127" type="taxi" depart="50971.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.127" type="taxi" depart="50971.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.128" type="taxi" depart="50976.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.80" type="carro" depart="50976.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.128" type="taxi" depart="50976.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.129" type="taxi" depart="50980.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.129" type="taxi" depart="50980.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.81" type="carro" depart="50983.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.130" type="taxi" depart="50985.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.130" type="taxi" depart="50985.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.131" type="taxi" depart="50989.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.131" type="taxi" depart="50989.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.82" type="carro" depart="50990.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.132" type="taxi" depart="50994.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.132" type="taxi" depart="50994.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.83" type="carro" depart="50997.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.133" type="taxi" depart="50998.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.133" type="taxi" depart="50998.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.134" type="taxi" depart="51003.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.134" type="taxi" depart="51003.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.84" type="carro" depart="51004.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.135" type="taxi" depart="51007.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.135" type="taxi" depart="51007.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.136" type="taxi" depart="51012.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.85" type="carro" depart="51012.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.136" type="taxi" depart="51012.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.137" type="taxi" depart="51016.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.137" type="taxi" depart="51016.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.86" type="carro" depart="51019.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.138" type="taxi" depart="51021.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.138" type="taxi" depart="51021.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.139" type="taxi" depart="51025.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.139" type="taxi" depart="51025.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.87" type="carro" depart="51026.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.140" type="taxi" depart="51030.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.140" type="taxi" depart="51030.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.88" type="carro" depart="51033.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.141" type="taxi" depart="51034.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.141" type="taxi" depart="51034.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.142" type="taxi" depart="51039.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.142" type="taxi" depart="51039.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.89" type="carro" depart="51040.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.143" type="taxi" depart="51043.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.143" type="taxi" depart="51043.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.144" type="taxi" depart="51048.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.90" type="carro" depart="51048.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.144" type="taxi" depart="51048.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.145" type="taxi" depart="51052.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.145" type="taxi" depart="51052.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.91" type="carro" depart="51055.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.146" type="taxi" depart="51057.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.146" type="taxi" depart="51057.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.147" type="taxi" depart="51061.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.147" type="taxi" depart="51061.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.92" type="carro" depart="51062.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.148" type="taxi" depart="51066.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.148" type="taxi" depart="51066.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.93" type="carro" depart="51069.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.149" type="taxi" depart="51070.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.149" type="taxi" depart="51070.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.150" type="taxi" depart="51075.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.150" type="taxi" depart="51075.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.94" type="carro" depart="51076.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.151" type="taxi" depart="51079.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.151" type="taxi" depart="51079.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.152" type="taxi" depart="51084.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.95" type="carro" depart="51084.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.152" type="taxi" depart="51084.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.153" type="taxi" depart="51088.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.153" type="taxi" depart="51088.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.96" type="carro" depart="51091.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.154" type="taxi" depart="51093.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.154" type="taxi" depart="51093.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.155" type="taxi" depart="51097.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.155" type="taxi" depart="51097.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.97" type="carro" depart="51098.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.156" type="taxi" depart="51102.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.156" type="taxi" depart="51102.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.98" type="carro" depart="51105.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.157" type="taxi" depart="51106.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.157" type="taxi" depart="51106.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.158" type="taxi" depart="51111.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.158" type="taxi" depart="51111.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.99" type="carro" depart="51112.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.159" type="taxi" depart="51115.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.159" type="taxi" depart="51115.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.160" type="taxi" depart="51120.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.100" type="carro" depart="51120.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.160" type="taxi" depart="51120.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.161" type="taxi" depart="51124.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.161" type="taxi" depart="51124.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.101" type="carro" depart="51127.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.162" type="taxi" depart="51129.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.162" type="taxi" depart="51129.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.163" type="taxi" depart="51133.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.163" type="taxi" depart="51133.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.102" type="carro" depart="51134.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.164" type="taxi" depart="51138.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.164" type="taxi" depart="51138.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.103" type="carro" depart="51141.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.165" type="taxi" depart="51142.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.165" type="taxi" depart="51142.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.166" type="taxi" depart="51147.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.166" type="taxi" depart="51147.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.104" type="carro" depart="51148.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.167" type="taxi" depart="51151.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.167" type="taxi" depart="51151.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.168" type="taxi" depart="51156.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.105" type="carro" depart="51156.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.168" type="taxi" depart="51156.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.169" type="taxi" depart="51160.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.169" type="taxi" depart="51160.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.106" type="carro" depart="51163.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.170" type="taxi" depart="51165.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.170" type="taxi" depart="51165.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.171" type="taxi" depart="51169.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.171" type="taxi" depart="51169.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.107" type="carro" depart="51170.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.172" type="taxi" depart="51174.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.172" type="taxi" depart="51174.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.108" type="carro" depart="51177.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.173" type="taxi" depart="51178.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.173" type="taxi" depart="51178.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.174" type="taxi" depart="51183.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.174" type="taxi" depart="51183.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.109" type="carro" depart="51184.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.175" type="taxi" depart="51187.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.175" type="taxi" depart="51187.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.176" type="taxi" depart="51192.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.110" type="carro" depart="51192.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.176" type="taxi" depart="51192.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.177" type="taxi" depart="51196.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.177" type="taxi" depart="51196.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.111" type="carro" depart="51199.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.178" type="taxi" depart="51201.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.178" type="taxi" depart="51201.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.179" type="taxi" depart="51205.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.179" type="taxi" depart="51205.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.112" type="carro" depart="51206.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.180" type="taxi" depart="51210.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.180" type="taxi" depart="51210.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.113" type="carro" depart="51213.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.181" type="taxi" depart="51214.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.181" type="taxi" depart="51214.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.182" type="taxi" depart="51219.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.182" type="taxi" depart="51219.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.114" type="carro" depart="51220.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.183" type="taxi" depart="51223.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.183" type="taxi" depart="51223.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.184" type="taxi" depart="51228.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.115" type="carro" depart="51228.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.184" type="taxi" depart="51228.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.185" type="taxi" depart="51232.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.185" type="taxi" depart="51232.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.116" type="carro" depart="51235.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.186" type="taxi" depart="51237.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.186" type="taxi" depart="51237.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.187" type="taxi" depart="51241.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.187" type="taxi" depart="51241.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.117" type="carro" depart="51242.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.188" type="taxi" depart="51246.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.188" type="taxi" depart="51246.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.118" type="carro" depart="51249.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.189" type="taxi" depart="51250.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.189" type="taxi" depart="51250.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.190" type="taxi" depart="51255.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.190" type="taxi" depart="51255.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.119" type="carro" depart="51256.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.191" type="taxi" depart="51259.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.191" type="taxi" depart="51259.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.192" type="taxi" depart="51264.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.120" type="carro" depart="51264.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.192" type="taxi" depart="51264.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.193" type="taxi" depart="51268.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.193" type="taxi" depart="51268.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.121" type="carro" depart="51271.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.194" type="taxi" depart="51273.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.194" type="taxi" depart="51273.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.195" type="taxi" depart="51277.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.195" type="taxi" depart="51277.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.122" type="carro" depart="51278.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.196" type="taxi" depart="51282.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.196" type="taxi" depart="51282.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.123" type="carro" depart="51285.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.197" type="taxi" depart="51286.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.197" type="taxi" depart="51286.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.198" type="taxi" depart="51291.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.198" type="taxi" depart="51291.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.124" type="carro" depart="51292.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.199" type="taxi" depart="51295.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.199" type="taxi" depart="51295.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.200" type="taxi" depart="51300.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.125" type="carro" depart="51300.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.200" type="taxi" depart="51300.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.201" type="taxi" depart="51304.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.201" type="taxi" depart="51304.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.126" type="carro" depart="51307.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.202" type="taxi" depart="51309.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.202" type="taxi" depart="51309.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.203" type="taxi" depart="51313.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.203" type="taxi" depart="51313.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.127" type="carro" depart="51314.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.204" type="taxi" depart="51318.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.204" type="taxi" depart="51318.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.128" type="carro" depart="51321.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.205" type="taxi" depart="51322.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.205" type="taxi" depart="51322.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.206" type="taxi" depart="51327.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.206" type="taxi" depart="51327.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.129" type="carro" depart="51328.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.207" type="taxi" depart="51331.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.207" type="taxi" depart="51331.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.208" type="taxi" depart="51336.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.130" type="carro" depart="51336.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.208" type="taxi" depart="51336.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.209" type="taxi" depart="51340.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.209" type="taxi" depart="51340.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.131" type="carro" depart="51343.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.210" type="taxi" depart="51345.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.210" type="taxi" depart="51345.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.211" type="taxi" depart="51349.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.211" type="taxi" depart="51349.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.132" type="carro" depart="51350.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.212" type="taxi" depart="51354.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.212" type="taxi" depart="51354.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.133" type="carro" depart="51357.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.213" type="taxi" depart="51358.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.213" type="taxi" depart="51358.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.214" type="taxi" depart="51363.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.214" type="taxi" depart="51363.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.134" type="carro" depart="51364.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.215" type="taxi" depart="51367.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.215" type="taxi" depart="51367.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.216" type="taxi" depart="51372.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.135" type="carro" depart="51372.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.216" type="taxi" depart="51372.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.217" type="taxi" depart="51376.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.217" type="taxi" depart="51376.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.136" type="carro" depart="51379.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.218" type="taxi" depart="51381.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.218" type="taxi" depart="51381.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.219" type="taxi" depart="51385.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.219" type="taxi" depart="51385.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.137" type="carro" depart="51386.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.220" type="taxi" depart="51390.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.220" type="taxi" depart="51390.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.138" type="carro" depart="51393.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.221" type="taxi" depart="51394.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.221" type="taxi" depart="51394.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.222" type="taxi" depart="51399.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.222" type="taxi" depart="51399.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.139" type="carro" depart="51400.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.223" type="taxi" depart="51403.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.223" type="taxi" depart="51403.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.224" type="taxi" depart="51408.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.140" type="carro" depart="51408.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.224" type="taxi" depart="51408.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.225" type="taxi" depart="51412.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.225" type="taxi" depart="51412.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.141" type="carro" depart="51415.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.226" type="taxi" depart="51417.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.226" type="taxi" depart="51417.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.227" type="taxi" depart="51421.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.227" type="taxi" depart="51421.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.142" type="carro" depart="51422.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.228" type="taxi" depart="51426.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.228" type="taxi" depart="51426.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.143" type="carro" depart="51429.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.229" type="taxi" depart="51430.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.229" type="taxi" depart="51430.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.230" type="taxi" depart="51435.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.230" type="taxi" depart="51435.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.144" type="carro" depart="51436.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.231" type="taxi" depart="51439.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.231" type="taxi" depart="51439.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.232" type="taxi" depart="51444.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.145" type="carro" depart="51444.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.232" type="taxi" depart="51444.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.233" type="taxi" depart="51448.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.233" type="taxi" depart="51448.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.146" type="carro" depart="51451.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.234" type="taxi" depart="51453.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.234" type="taxi" depart="51453.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.235" type="taxi" depart="51457.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.235" type="taxi" depart="51457.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.147" type="carro" depart="51458.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.236" type="taxi" depart="51462.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.236" type="taxi" depart="51462.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.148" type="carro" depart="51465.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.237" type="taxi" depart="51466.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.237" type="taxi" depart="51466.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.238" type="taxi" depart="51471.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.238" type="taxi" depart="51471.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.149" type="carro" depart="51472.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.239" type="taxi" depart="51475.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.239" type="taxi" depart="51475.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.240" type="taxi" depart="51480.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.150" type="carro" depart="51480.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.240" type="taxi" depart="51480.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.241" type="taxi" depart="51484.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.241" type="taxi" depart="51484.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.151" type="carro" depart="51487.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.242" type="taxi" depart="51489.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.242" type="taxi" depart="51489.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.243" type="taxi" depart="51493.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.243" type="taxi" depart="51493.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.152" type="carro" depart="51494.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.244" type="taxi" depart="51498.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.244" type="taxi" depart="51498.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.153" type="carro" depart="51501.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.245" type="taxi" depart="51502.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.245" type="taxi" depart="51502.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.246" type="taxi" depart="51507.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.246" type="taxi" depart="51507.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.154" type="carro" depart="51508.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.247" type="taxi" depart="51511.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.247" type="taxi" depart="51511.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.248" type="taxi" depart="51516.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.155" type="carro" depart="51516.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.248" type="taxi" depart="51516.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.249" type="taxi" depart="51520.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.249" type="taxi" depart="51520.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.156" type="carro" depart="51523.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.250" type="taxi" depart="51525.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.250" type="taxi" depart="51525.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.251" type="taxi" depart="51529.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.251" type="taxi" depart="51529.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.157" type="carro" depart="51530.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.252" type="taxi" depart="51534.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.252" type="taxi" depart="51534.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.158" type="carro" depart="51537.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.253" type="taxi" depart="51538.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.253" type="taxi" depart="51538.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.254" type="taxi" depart="51543.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.254" type="taxi" depart="51543.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.159" type="carro" depart="51544.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.255" type="taxi" depart="51547.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.255" type="taxi" depart="51547.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.256" type="taxi" depart="51552.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.160" type="carro" depart="51552.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.256" type="taxi" depart="51552.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.257" type="taxi" depart="51556.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.257" type="taxi" depart="51556.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.161" type="carro" depart="51559.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.258" type="taxi" depart="51561.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.258" type="taxi" depart="51561.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.259" type="taxi" depart="51565.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.259" type="taxi" depart="51565.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.162" type="carro" depart="51566.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.260" type="taxi" depart="51570.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.260" type="taxi" depart="51570.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.163" type="carro" depart="51573.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.261" type="taxi" depart="51574.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.261" type="taxi" depart="51574.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.262" type="taxi" depart="51579.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.262" type="taxi" depart="51579.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.164" type="carro" depart="51580.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.263" type="taxi" depart="51583.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.263" type="taxi" depart="51583.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.264" type="taxi" depart="51588.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.165" type="carro" depart="51588.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.264" type="taxi" depart="51588.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.265" type="taxi" depart="51592.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.265" type="taxi" depart="51592.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.166" type="carro" depart="51595.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.266" type="taxi" depart="51597.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.266" type="taxi" depart="51597.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.267" type="taxi" depart="51601.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.267" type="taxi" depart="51601.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.167" type="carro" depart="51602.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.268" type="taxi" depart="51606.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.268" type="taxi" depart="51606.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.168" type="carro" depart="51609.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.269" type="taxi" depart="51610.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.269" type="taxi" depart="51610.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.270" type="taxi" depart="51615.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.270" type="taxi" depart="51615.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.169" type="carro" depart="51616.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.271" type="taxi" depart="51619.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.271" type="taxi" depart="51619.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.272" type="taxi" depart="51624.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.170" type="carro" depart="51624.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.272" type="taxi" depart="51624.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.273" type="taxi" depart="51628.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.273" type="taxi" depart="51628.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.171" type="carro" depart="51631.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.274" type="taxi" depart="51633.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.274" type="taxi" depart="51633.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.275" type="taxi" depart="51637.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.275" type="taxi" depart="51637.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.172" type="carro" depart="51638.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.276" type="taxi" depart="51642.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.276" type="taxi" depart="51642.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.173" type="carro" depart="51645.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.277" type="taxi" depart="51646.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.277" type="taxi" depart="51646.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.278" type="taxi" depart="51651.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.278" type="taxi" depart="51651.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.174" type="carro" depart="51652.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.279" type="taxi" depart="51655.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.279" type="taxi" depart="51655.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.280" type="taxi" depart="51660.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.175" type="carro" depart="51660.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.280" type="taxi" depart="51660.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.281" type="taxi" depart="51664.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.281" type="taxi" depart="51664.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.176" type="carro" depart="51667.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.282" type="taxi" depart="51669.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.282" type="taxi" depart="51669.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.283" type="taxi" depart="51673.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.283" type="taxi" depart="51673.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.177" type="carro" depart="51674.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.284" type="taxi" depart="51678.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.284" type="taxi" depart="51678.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.178" type="carro" depart="51681.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.285" type="taxi" depart="51682.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.285" type="taxi" depart="51682.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.286" type="taxi" depart="51687.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.286" type="taxi" depart="51687.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.179" type="carro" depart="51688.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.287" type="taxi" depart="51691.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.287" type="taxi" depart="51691.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.288" type="taxi" depart="51696.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.180" type="carro" depart="51696.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.288" type="taxi" depart="51696.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.289" type="taxi" depart="51700.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.289" type="taxi" depart="51700.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.181" type="carro" depart="51703.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.290" type="taxi" depart="51705.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.290" type="taxi" depart="51705.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.291" type="taxi" depart="51709.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.291" type="taxi" depart="51709.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.182" type="carro" depart="51710.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.292" type="taxi" depart="51714.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.292" type="taxi" depart="51714.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.183" type="carro" depart="51717.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.293" type="taxi" depart="51718.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.293" type="taxi" depart="51718.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.294" type="taxi" depart="51723.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.294" type="taxi" depart="51723.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.184" type="carro" depart="51724.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.295" type="taxi" depart="51727.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.295" type="taxi" depart="51727.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.296" type="taxi" depart="51732.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.185" type="carro" depart="51732.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.296" type="taxi" depart="51732.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.297" type="taxi" depart="51736.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.297" type="taxi" depart="51736.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.186" type="carro" depart="51739.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.298" type="taxi" depart="51741.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.298" type="taxi" depart="51741.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.299" type="taxi" depart="51745.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.299" type="taxi" depart="51745.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.187" type="carro" depart="51746.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.300" type="taxi" depart="51750.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.300" type="taxi" depart="51750.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.188" type="carro" depart="51753.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.301" type="taxi" depart="51754.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.301" type="taxi" depart="51754.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.302" type="taxi" depart="51759.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.302" type="taxi" depart="51759.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.189" type="carro" depart="51760.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.303" type="taxi" depart="51763.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.303" type="taxi" depart="51763.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.304" type="taxi" depart="51768.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.190" type="carro" depart="51768.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.304" type="taxi" depart="51768.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.305" type="taxi" depart="51772.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.305" type="taxi" depart="51772.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.191" type="carro" depart="51775.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.306" type="taxi" depart="51777.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.306" type="taxi" depart="51777.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.307" type="taxi" depart="51781.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.307" type="taxi" depart="51781.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.192" type="carro" depart="51782.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.308" type="taxi" depart="51786.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.308" type="taxi" depart="51786.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.193" type="carro" depart="51789.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.309" type="taxi" depart="51790.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.309" type="taxi" depart="51790.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.310" type="taxi" depart="51795.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.310" type="taxi" depart="51795.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.194" type="carro" depart="51796.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.311" type="taxi" depart="51799.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.311" type="taxi" depart="51799.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.312" type="taxi" depart="51804.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.195" type="carro" depart="51804.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.312" type="taxi" depart="51804.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.313" type="taxi" depart="51808.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.313" type="taxi" depart="51808.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.196" type="carro" depart="51811.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.314" type="taxi" depart="51813.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.314" type="taxi" depart="51813.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.315" type="taxi" depart="51817.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.315" type="taxi" depart="51817.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.197" type="carro" depart="51818.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.316" type="taxi" depart="51822.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.316" type="taxi" depart="51822.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.198" type="carro" depart="51825.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.317" type="taxi" depart="51826.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.317" type="taxi" depart="51826.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.318" type="taxi" depart="51831.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.318" type="taxi" depart="51831.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.199" type="carro" depart="51832.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.319" type="taxi" depart="51835.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.319" type="taxi" depart="51835.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.320" type="taxi" depart="51840.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.200" type="carro" depart="51840.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.320" type="taxi" depart="51840.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.321" type="taxi" depart="51844.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.321" type="taxi" depart="51844.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.201" type="carro" depart="51847.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.322" type="taxi" depart="51849.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.322" type="taxi" depart="51849.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.323" type="taxi" depart="51853.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.323" type="taxi" depart="51853.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.202" type="carro" depart="51854.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.324" type="taxi" depart="51858.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.324" type="taxi" depart="51858.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.203" type="carro" depart="51861.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.325" type="taxi" depart="51862.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.325" type="taxi" depart="51862.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.326" type="taxi" depart="51867.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.326" type="taxi" depart="51867.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.204" type="carro" depart="51868.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.327" type="taxi" depart="51871.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.327" type="taxi" depart="51871.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.328" type="taxi" depart="51876.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.205" type="carro" depart="51876.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.328" type="taxi" depart="51876.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.329" type="taxi" depart="51880.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.329" type="taxi" depart="51880.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.206" type="carro" depart="51883.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.330" type="taxi" depart="51885.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.330" type="taxi" depart="51885.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.331" type="taxi" depart="51889.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.331" type="taxi" depart="51889.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.207" type="carro" depart="51890.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.332" type="taxi" depart="51894.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.332" type="taxi" depart="51894.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.208" type="carro" depart="51897.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.333" type="taxi" depart="51898.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.333" type="taxi" depart="51898.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.334" type="taxi" depart="51903.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.334" type="taxi" depart="51903.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.209" type="carro" depart="51904.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.335" type="taxi" depart="51907.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.335" type="taxi" depart="51907.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.336" type="taxi" depart="51912.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.210" type="carro" depart="51912.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.336" type="taxi" depart="51912.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.337" type="taxi" depart="51916.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.337" type="taxi" depart="51916.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.211" type="carro" depart="51919.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.338" type="taxi" depart="51921.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.338" type="taxi" depart="51921.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.339" type="taxi" depart="51925.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.339" type="taxi" depart="51925.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.212" type="carro" depart="51926.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.340" type="taxi" depart="51930.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.340" type="taxi" depart="51930.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.213" type="carro" depart="51933.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.341" type="taxi" depart="51934.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.341" type="taxi" depart="51934.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.342" type="taxi" depart="51939.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.342" type="taxi" depart="51939.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.214" type="carro" depart="51940.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.343" type="taxi" depart="51943.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.343" type="taxi" depart="51943.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.344" type="taxi" depart="51948.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.215" type="carro" depart="51948.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.344" type="taxi" depart="51948.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.345" type="taxi" depart="51952.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.345" type="taxi" depart="51952.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.216" type="carro" depart="51955.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.346" type="taxi" depart="51957.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.346" type="taxi" depart="51957.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.347" type="taxi" depart="51961.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.347" type="taxi" depart="51961.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.217" type="carro" depart="51962.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.348" type="taxi" depart="51966.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.348" type="taxi" depart="51966.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.218" type="carro" depart="51969.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.349" type="taxi" depart="51970.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.349" type="taxi" depart="51970.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.350" type="taxi" depart="51975.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.350" type="taxi" depart="51975.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.219" type="carro" depart="51976.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.351" type="taxi" depart="51979.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.351" type="taxi" depart="51979.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.352" type="taxi" depart="51984.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.220" type="carro" depart="51984.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.352" type="taxi" depart="51984.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.353" type="taxi" depart="51988.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.353" type="taxi" depart="51988.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.221" type="carro" depart="51991.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.354" type="taxi" depart="51993.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.354" type="taxi" depart="51993.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.355" type="taxi" depart="51997.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.355" type="taxi" depart="51997.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.222" type="carro" depart="51998.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.356" type="taxi" depart="52002.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.356" type="taxi" depart="52002.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.223" type="carro" depart="52005.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.357" type="taxi" depart="52006.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.357" type="taxi" depart="52006.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.358" type="taxi" depart="52011.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.358" type="taxi" depart="52011.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.224" type="carro" depart="52012.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.359" type="taxi" depart="52015.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.359" type="taxi" depart="52015.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.360" type="taxi" depart="52020.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.225" type="carro" depart="52020.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.360" type="taxi" depart="52020.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.361" type="taxi" depart="52024.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.361" type="taxi" depart="52024.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.226" type="carro" depart="52027.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.362" type="taxi" depart="52029.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.362" type="taxi" depart="52029.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.363" type="taxi" depart="52033.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.363" type="taxi" depart="52033.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.227" type="carro" depart="52034.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.364" type="taxi" depart="52038.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.364" type="taxi" depart="52038.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.228" type="carro" depart="52041.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.365" type="taxi" depart="52042.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.365" type="taxi" depart="52042.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.366" type="taxi" depart="52047.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.366" type="taxi" depart="52047.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.229" type="carro" depart="52048.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.367" type="taxi" depart="52051.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.367" type="taxi" depart="52051.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.368" type="taxi" depart="52056.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.230" type="carro" depart="52056.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.368" type="taxi" depart="52056.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.369" type="taxi" depart="52060.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.369" type="taxi" depart="52060.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.231" type="carro" depart="52063.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.370" type="taxi" depart="52065.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.370" type="taxi" depart="52065.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.371" type="taxi" depart="52069.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.371" type="taxi" depart="52069.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.232" type="carro" depart="52070.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.372" type="taxi" depart="52074.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.372" type="taxi" depart="52074.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.233" type="carro" depart="52077.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.373" type="taxi" depart="52078.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.373" type="taxi" depart="52078.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.374" type="taxi" depart="52083.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.374" type="taxi" depart="52083.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.234" type="carro" depart="52084.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.375" type="taxi" depart="52087.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.375" type="taxi" depart="52087.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.376" type="taxi" depart="52092.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.235" type="carro" depart="52092.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.376" type="taxi" depart="52092.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.377" type="taxi" depart="52096.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.377" type="taxi" depart="52096.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.236" type="carro" depart="52099.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.378" type="taxi" depart="52101.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.378" type="taxi" depart="52101.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.379" type="taxi" depart="52105.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.379" type="taxi" depart="52105.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.237" type="carro" depart="52106.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.380" type="taxi" depart="52110.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.380" type="taxi" depart="52110.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.238" type="carro" depart="52113.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.381" type="taxi" depart="52114.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.381" type="taxi" depart="52114.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.382" type="taxi" depart="52119.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.382" type="taxi" depart="52119.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.239" type="carro" depart="52120.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.383" type="taxi" depart="52123.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.383" type="taxi" depart="52123.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.384" type="taxi" depart="52128.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.240" type="carro" depart="52128.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.384" type="taxi" depart="52128.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.385" type="taxi" depart="52132.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.385" type="taxi" depart="52132.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.241" type="carro" depart="52135.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.386" type="taxi" depart="52137.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.386" type="taxi" depart="52137.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.387" type="taxi" depart="52141.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.387" type="taxi" depart="52141.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.242" type="carro" depart="52142.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.388" type="taxi" depart="52146.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.388" type="taxi" depart="52146.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.243" type="carro" depart="52149.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.389" type="taxi" depart="52150.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.389" type="taxi" depart="52150.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.390" type="taxi" depart="52155.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.390" type="taxi" depart="52155.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.244" type="carro" depart="52156.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.391" type="taxi" depart="52159.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.391" type="taxi" depart="52159.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.392" type="taxi" depart="52164.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.245" type="carro" depart="52164.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.392" type="taxi" depart="52164.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.393" type="taxi" depart="52168.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.393" type="taxi" depart="52168.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.246" type="carro" depart="52171.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.394" type="taxi" depart="52173.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.394" type="taxi" depart="52173.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.395" type="taxi" depart="52177.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.395" type="taxi" depart="52177.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.247" type="carro" depart="52178.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.396" type="taxi" depart="52182.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.396" type="taxi" depart="52182.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.248" type="carro" depart="52185.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.397" type="taxi" depart="52186.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.397" type="taxi" depart="52186.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.398" type="taxi" depart="52191.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.398" type="taxi" depart="52191.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.249" type="carro" depart="52192.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.399" type="taxi" depart="52195.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.399" type="taxi" depart="52195.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.400" type="taxi" depart="52200.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.250" type="carro" depart="52200.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.400" type="taxi" depart="52200.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.401" type="taxi" depart="52204.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.401" type="taxi" depart="52204.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.251" type="carro" depart="52207.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.402" type="taxi" depart="52209.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.402" type="taxi" depart="52209.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.403" type="taxi" depart="52213.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.403" type="taxi" depart="52213.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.252" type="carro" depart="52214.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.404" type="taxi" depart="52218.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.404" type="taxi" depart="52218.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.253" type="carro" depart="52221.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.405" type="taxi" depart="52222.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.405" type="taxi" depart="52222.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.406" type="taxi" depart="52227.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.406" type="taxi" depart="52227.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.254" type="carro" depart="52228.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.407" type="taxi" depart="52231.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.407" type="taxi" depart="52231.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.408" type="taxi" depart="52236.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.255" type="carro" depart="52236.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.408" type="taxi" depart="52236.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.409" type="taxi" depart="52240.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.409" type="taxi" depart="52240.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.256" type="carro" depart="52243.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.410" type="taxi" depart="52245.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.410" type="taxi" depart="52245.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.411" type="taxi" depart="52249.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.411" type="taxi" depart="52249.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.257" type="carro" depart="52250.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.412" type="taxi" depart="52254.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.412" type="taxi" depart="52254.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.258" type="carro" depart="52257.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.413" type="taxi" depart="52258.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.413" type="taxi" depart="52258.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.414" type="taxi" depart="52263.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.414" type="taxi" depart="52263.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.259" type="carro" depart="52264.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.415" type="taxi" depart="52267.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.415" type="taxi" depart="52267.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.416" type="taxi" depart="52272.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.260" type="carro" depart="52272.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.416" type="taxi" depart="52272.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.417" type="taxi" depart="52276.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.417" type="taxi" depart="52276.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.261" type="carro" depart="52279.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.418" type="taxi" depart="52281.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.418" type="taxi" depart="52281.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.419" type="taxi" depart="52285.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.419" type="taxi" depart="52285.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.262" type="carro" depart="52286.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.420" type="taxi" depart="52290.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.420" type="taxi" depart="52290.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.263" type="carro" depart="52293.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.421" type="taxi" depart="52294.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.421" type="taxi" depart="52294.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.422" type="taxi" depart="52299.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.422" type="taxi" depart="52299.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.264" type="carro" depart="52300.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.423" type="taxi" depart="52303.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.423" type="taxi" depart="52303.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.424" type="taxi" depart="52308.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.265" type="carro" depart="52308.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.424" type="taxi" depart="52308.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.425" type="taxi" depart="52312.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.425" type="taxi" depart="52312.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.266" type="carro" depart="52315.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.426" type="taxi" depart="52317.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.426" type="taxi" depart="52317.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.427" type="taxi" depart="52321.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.427" type="taxi" depart="52321.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.267" type="carro" depart="52322.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.428" type="taxi" depart="52326.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.428" type="taxi" depart="52326.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.268" type="carro" depart="52329.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.429" type="taxi" depart="52330.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.429" type="taxi" depart="52330.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.430" type="taxi" depart="52335.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.430" type="taxi" depart="52335.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.269" type="carro" depart="52336.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.431" type="taxi" depart="52339.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.431" type="taxi" depart="52339.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.432" type="taxi" depart="52344.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.270" type="carro" depart="52344.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.432" type="taxi" depart="52344.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.433" type="taxi" depart="52348.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.433" type="taxi" depart="52348.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.271" type="carro" depart="52351.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.434" type="taxi" depart="52353.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.434" type="taxi" depart="52353.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.435" type="taxi" depart="52357.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.435" type="taxi" depart="52357.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.272" type="carro" depart="52358.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.436" type="taxi" depart="52362.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.436" type="taxi" depart="52362.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.273" type="carro" depart="52365.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.437" type="taxi" depart="52366.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.437" type="taxi" depart="52366.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.438" type="taxi" depart="52371.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.438" type="taxi" depart="52371.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.274" type="carro" depart="52372.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.439" type="taxi" depart="52375.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.439" type="taxi" depart="52375.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.440" type="taxi" depart="52380.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.275" type="carro" depart="52380.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.440" type="taxi" depart="52380.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.441" type="taxi" depart="52384.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.441" type="taxi" depart="52384.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.276" type="carro" depart="52387.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.442" type="taxi" depart="52389.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.442" type="taxi" depart="52389.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.443" type="taxi" depart="52393.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.443" type="taxi" depart="52393.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.277" type="carro" depart="52394.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.444" type="taxi" depart="52398.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.444" type="taxi" depart="52398.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.278" type="carro" depart="52401.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.445" type="taxi" depart="52402.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.445" type="taxi" depart="52402.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.446" type="taxi" depart="52407.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.446" type="taxi" depart="52407.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.279" type="carro" depart="52408.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.447" type="taxi" depart="52411.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.447" type="taxi" depart="52411.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.448" type="taxi" depart="52416.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.280" type="carro" depart="52416.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.448" type="taxi" depart="52416.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.449" type="taxi" depart="52420.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.449" type="taxi" depart="52420.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.281" type="carro" depart="52423.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.450" type="taxi" depart="52425.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.450" type="taxi" depart="52425.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.451" type="taxi" depart="52429.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.451" type="taxi" depart="52429.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.282" type="carro" depart="52430.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.452" type="taxi" depart="52434.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.452" type="taxi" depart="52434.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.283" type="carro" depart="52437.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.453" type="taxi" depart="52438.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.453" type="taxi" depart="52438.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.454" type="taxi" depart="52443.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.454" type="taxi" depart="52443.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.284" type="carro" depart="52444.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.455" type="taxi" depart="52447.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.455" type="taxi" depart="52447.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.456" type="taxi" depart="52452.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.285" type="carro" depart="52452.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.456" type="taxi" depart="52452.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.457" type="taxi" depart="52456.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.457" type="taxi" depart="52456.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.286" type="carro" depart="52459.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.458" type="taxi" depart="52461.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.458" type="taxi" depart="52461.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.459" type="taxi" depart="52465.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.459" type="taxi" depart="52465.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.287" type="carro" depart="52466.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.460" type="taxi" depart="52470.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.460" type="taxi" depart="52470.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.288" type="carro" depart="52473.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.461" type="taxi" depart="52474.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.461" type="taxi" depart="52474.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.462" type="taxi" depart="52479.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.462" type="taxi" depart="52479.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.289" type="carro" depart="52480.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.463" type="taxi" depart="52483.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.463" type="taxi" depart="52483.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.464" type="taxi" depart="52488.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.290" type="carro" depart="52488.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.464" type="taxi" depart="52488.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.465" type="taxi" depart="52492.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.465" type="taxi" depart="52492.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.291" type="carro" depart="52495.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.466" type="taxi" depart="52497.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.466" type="taxi" depart="52497.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.467" type="taxi" depart="52501.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.467" type="taxi" depart="52501.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.292" type="carro" depart="52502.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.468" type="taxi" depart="52506.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.468" type="taxi" depart="52506.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.293" type="carro" depart="52509.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.469" type="taxi" depart="52510.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.469" type="taxi" depart="52510.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.470" type="taxi" depart="52515.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.470" type="taxi" depart="52515.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.294" type="carro" depart="52516.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.471" type="taxi" depart="52519.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.471" type="taxi" depart="52519.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.472" type="taxi" depart="52524.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.295" type="carro" depart="52524.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.472" type="taxi" depart="52524.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.473" type="taxi" depart="52528.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.473" type="taxi" depart="52528.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.296" type="carro" depart="52531.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.474" type="taxi" depart="52533.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.474" type="taxi" depart="52533.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.475" type="taxi" depart="52537.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.475" type="taxi" depart="52537.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.297" type="carro" depart="52538.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.476" type="taxi" depart="52542.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.476" type="taxi" depart="52542.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.298" type="carro" depart="52545.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.477" type="taxi" depart="52546.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.477" type="taxi" depart="52546.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.478" type="taxi" depart="52551.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.478" type="taxi" depart="52551.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.299" type="carro" depart="52552.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.479" type="taxi" depart="52555.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.479" type="taxi" depart="52555.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.480" type="taxi" depart="52560.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.300" type="carro" depart="52560.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.480" type="taxi" depart="52560.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.481" type="taxi" depart="52564.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.481" type="taxi" depart="52564.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.301" type="carro" depart="52567.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.482" type="taxi" depart="52569.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.482" type="taxi" depart="52569.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.483" type="taxi" depart="52573.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.483" type="taxi" depart="52573.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.302" type="carro" depart="52574.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.484" type="taxi" depart="52578.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.484" type="taxi" depart="52578.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.303" type="carro" depart="52581.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.485" type="taxi" depart="52582.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.485" type="taxi" depart="52582.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.486" type="taxi" depart="52587.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.486" type="taxi" depart="52587.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.304" type="carro" depart="52588.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.487" type="taxi" depart="52591.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.487" type="taxi" depart="52591.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.488" type="taxi" depart="52596.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.305" type="carro" depart="52596.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.488" type="taxi" depart="52596.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.489" type="taxi" depart="52600.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.489" type="taxi" depart="52600.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.306" type="carro" depart="52603.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.490" type="taxi" depart="52605.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.490" type="taxi" depart="52605.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.491" type="taxi" depart="52609.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.491" type="taxi" depart="52609.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.307" type="carro" depart="52610.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.492" type="taxi" depart="52614.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.492" type="taxi" depart="52614.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.308" type="carro" depart="52617.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.493" type="taxi" depart="52618.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.493" type="taxi" depart="52618.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.494" type="taxi" depart="52623.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.494" type="taxi" depart="52623.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.309" type="carro" depart="52624.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.495" type="taxi" depart="52627.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.495" type="taxi" depart="52627.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.496" type="taxi" depart="52632.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.310" type="carro" depart="52632.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.496" type="taxi" depart="52632.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.497" type="taxi" depart="52636.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.497" type="taxi" depart="52636.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.311" type="carro" depart="52639.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.498" type="taxi" depart="52641.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.498" type="taxi" depart="52641.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.499" type="taxi" depart="52645.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.499" type="taxi" depart="52645.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.312" type="carro" depart="52646.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.500" type="taxi" depart="52650.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.500" type="taxi" depart="52650.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.313" type="carro" depart="52653.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.501" type="taxi" depart="52654.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.501" type="taxi" depart="52654.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.502" type="taxi" depart="52659.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.502" type="taxi" depart="52659.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.314" type="carro" depart="52660.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.503" type="taxi" depart="52663.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.503" type="taxi" depart="52663.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.504" type="taxi" depart="52668.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.315" type="carro" depart="52668.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.504" type="taxi" depart="52668.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.505" type="taxi" depart="52672.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.505" type="taxi" depart="52672.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.316" type="carro" depart="52675.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.506" type="taxi" depart="52677.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.506" type="taxi" depart="52677.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.507" type="taxi" depart="52681.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.507" type="taxi" depart="52681.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.317" type="carro" depart="52682.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.508" type="taxi" depart="52686.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.508" type="taxi" depart="52686.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.318" type="carro" depart="52689.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.509" type="taxi" depart="52690.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.509" type="taxi" depart="52690.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.510" type="taxi" depart="52695.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.510" type="taxi" depart="52695.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.319" type="carro" depart="52696.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.511" type="taxi" depart="52699.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.511" type="taxi" depart="52699.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.512" type="taxi" depart="52704.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.320" type="carro" depart="52704.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.512" type="taxi" depart="52704.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.513" type="taxi" depart="52708.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.513" type="taxi" depart="52708.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.321" type="carro" depart="52711.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.514" type="taxi" depart="52713.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.514" type="taxi" depart="52713.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.515" type="taxi" depart="52717.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.515" type="taxi" depart="52717.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.322" type="carro" depart="52718.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.516" type="taxi" depart="52722.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.516" type="taxi" depart="52722.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.323" type="carro" depart="52725.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.517" type="taxi" depart="52726.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.517" type="taxi" depart="52726.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.518" type="taxi" depart="52731.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.518" type="taxi" depart="52731.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.324" type="carro" depart="52732.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.519" type="taxi" depart="52735.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.519" type="taxi" depart="52735.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.520" type="taxi" depart="52740.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.325" type="carro" depart="52740.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.520" type="taxi" depart="52740.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.521" type="taxi" depart="52744.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.521" type="taxi" depart="52744.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.326" type="carro" depart="52747.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.522" type="taxi" depart="52749.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.522" type="taxi" depart="52749.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.523" type="taxi" depart="52753.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.523" type="taxi" depart="52753.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.327" type="carro" depart="52754.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.524" type="taxi" depart="52758.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.524" type="taxi" depart="52758.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.328" type="carro" depart="52761.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.525" type="taxi" depart="52762.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.525" type="taxi" depart="52762.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.526" type="taxi" depart="52767.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.526" type="taxi" depart="52767.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.329" type="carro" depart="52768.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.527" type="taxi" depart="52771.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.527" type="taxi" depart="52771.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.528" type="taxi" depart="52776.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.330" type="carro" depart="52776.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.528" type="taxi" depart="52776.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.529" type="taxi" depart="52780.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.529" type="taxi" depart="52780.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.331" type="carro" depart="52783.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.530" type="taxi" depart="52785.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.530" type="taxi" depart="52785.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.531" type="taxi" depart="52789.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.531" type="taxi" depart="52789.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.332" type="carro" depart="52790.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.532" type="taxi" depart="52794.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.532" type="taxi" depart="52794.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.333" type="carro" depart="52797.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.533" type="taxi" depart="52798.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.533" type="taxi" depart="52798.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.534" type="taxi" depart="52803.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.534" type="taxi" depart="52803.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.334" type="carro" depart="52804.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.535" type="taxi" depart="52807.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.535" type="taxi" depart="52807.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.536" type="taxi" depart="52812.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.335" type="carro" depart="52812.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.536" type="taxi" depart="52812.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.537" type="taxi" depart="52816.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.537" type="taxi" depart="52816.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.336" type="carro" depart="52819.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.538" type="taxi" depart="52821.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.538" type="taxi" depart="52821.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.539" type="taxi" depart="52825.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.539" type="taxi" depart="52825.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.337" type="carro" depart="52826.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.540" type="taxi" depart="52830.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.540" type="taxi" depart="52830.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.338" type="carro" depart="52833.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.541" type="taxi" depart="52834.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.541" type="taxi" depart="52834.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.542" type="taxi" depart="52839.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.542" type="taxi" depart="52839.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.339" type="carro" depart="52840.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.543" type="taxi" depart="52843.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.543" type="taxi" depart="52843.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.544" type="taxi" depart="52848.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.340" type="carro" depart="52848.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.544" type="taxi" depart="52848.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.545" type="taxi" depart="52852.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.545" type="taxi" depart="52852.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.341" type="carro" depart="52855.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.546" type="taxi" depart="52857.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.546" type="taxi" depart="52857.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.547" type="taxi" depart="52861.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.547" type="taxi" depart="52861.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.342" type="carro" depart="52862.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.548" type="taxi" depart="52866.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.548" type="taxi" depart="52866.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.343" type="carro" depart="52869.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.549" type="taxi" depart="52870.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.549" type="taxi" depart="52870.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.550" type="taxi" depart="52875.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.550" type="taxi" depart="52875.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.344" type="carro" depart="52876.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.551" type="taxi" depart="52879.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.551" type="taxi" depart="52879.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.552" type="taxi" depart="52884.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.345" type="carro" depart="52884.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.552" type="taxi" depart="52884.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.553" type="taxi" depart="52888.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.553" type="taxi" depart="52888.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.346" type="carro" depart="52891.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.554" type="taxi" depart="52893.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.554" type="taxi" depart="52893.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.555" type="taxi" depart="52897.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.555" type="taxi" depart="52897.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.347" type="carro" depart="52898.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.556" type="taxi" depart="52902.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.556" type="taxi" depart="52902.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.348" type="carro" depart="52905.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.557" type="taxi" depart="52906.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.557" type="taxi" depart="52906.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.558" type="taxi" depart="52911.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.558" type="taxi" depart="52911.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.349" type="carro" depart="52912.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.559" type="taxi" depart="52915.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.559" type="taxi" depart="52915.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.560" type="taxi" depart="52920.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.350" type="carro" depart="52920.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.560" type="taxi" depart="52920.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.561" type="taxi" depart="52924.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.561" type="taxi" depart="52924.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.351" type="carro" depart="52927.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.562" type="taxi" depart="52929.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.562" type="taxi" depart="52929.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.563" type="taxi" depart="52933.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.563" type="taxi" depart="52933.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.352" type="carro" depart="52934.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.564" type="taxi" depart="52938.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.564" type="taxi" depart="52938.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.353" type="carro" depart="52941.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.565" type="taxi" depart="52942.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.565" type="taxi" depart="52942.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.566" type="taxi" depart="52947.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.566" type="taxi" depart="52947.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.354" type="carro" depart="52948.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.567" type="taxi" depart="52951.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.567" type="taxi" depart="52951.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.568" type="taxi" depart="52956.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.355" type="carro" depart="52956.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.568" type="taxi" depart="52956.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.569" type="taxi" depart="52960.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.569" type="taxi" depart="52960.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.356" type="carro" depart="52963.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.570" type="taxi" depart="52965.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.570" type="taxi" depart="52965.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.571" type="taxi" depart="52969.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.571" type="taxi" depart="52969.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.357" type="carro" depart="52970.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.572" type="taxi" depart="52974.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.572" type="taxi" depart="52974.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.358" type="carro" depart="52977.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.573" type="taxi" depart="52978.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.573" type="taxi" depart="52978.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.574" type="taxi" depart="52983.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.574" type="taxi" depart="52983.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.359" type="carro" depart="52984.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.575" type="taxi" depart="52987.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.575" type="taxi" depart="52987.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.576" type="taxi" depart="52992.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.360" type="carro" depart="52992.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.576" type="taxi" depart="52992.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.577" type="taxi" depart="52996.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.577" type="taxi" depart="52996.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.361" type="carro" depart="52999.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.578" type="taxi" depart="53001.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.578" type="taxi" depart="53001.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.579" type="taxi" depart="53005.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.579" type="taxi" depart="53005.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.362" type="carro" depart="53006.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.580" type="taxi" depart="53010.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.580" type="taxi" depart="53010.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.363" type="carro" depart="53013.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.581" type="taxi" depart="53014.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.581" type="taxi" depart="53014.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.582" type="taxi" depart="53019.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.582" type="taxi" depart="53019.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.364" type="carro" depart="53020.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.583" type="taxi" depart="53023.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.583" type="taxi" depart="53023.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.584" type="taxi" depart="53028.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.365" type="carro" depart="53028.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.584" type="taxi" depart="53028.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.585" type="taxi" depart="53032.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.585" type="taxi" depart="53032.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.366" type="carro" depart="53035.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.586" type="taxi" depart="53037.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.586" type="taxi" depart="53037.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.587" type="taxi" depart="53041.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.587" type="taxi" depart="53041.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.367" type="carro" depart="53042.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.588" type="taxi" depart="53046.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.588" type="taxi" depart="53046.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.368" type="carro" depart="53049.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.589" type="taxi" depart="53050.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.589" type="taxi" depart="53050.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.590" type="taxi" depart="53055.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.590" type="taxi" depart="53055.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.369" type="carro" depart="53056.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.591" type="taxi" depart="53059.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.591" type="taxi" depart="53059.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.592" type="taxi" depart="53064.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.370" type="carro" depart="53064.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.592" type="taxi" depart="53064.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.593" type="taxi" depart="53068.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.593" type="taxi" depart="53068.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.371" type="carro" depart="53071.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.594" type="taxi" depart="53073.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.594" type="taxi" depart="53073.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.595" type="taxi" depart="53077.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.595" type="taxi" depart="53077.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.372" type="carro" depart="53078.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.596" type="taxi" depart="53082.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.596" type="taxi" depart="53082.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.373" type="carro" depart="53085.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.597" type="taxi" depart="53086.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.597" type="taxi" depart="53086.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.598" type="taxi" depart="53091.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.598" type="taxi" depart="53091.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.374" type="carro" depart="53092.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.599" type="taxi" depart="53095.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.599" type="taxi" depart="53095.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.600" type="taxi" depart="53100.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.375" type="carro" depart="53100.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.600" type="taxi" depart="53100.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.601" type="taxi" depart="53104.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.601" type="taxi" depart="53104.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.376" type="carro" depart="53107.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.602" type="taxi" depart="53109.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.602" type="taxi" depart="53109.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.603" type="taxi" depart="53113.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.603" type="taxi" depart="53113.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.377" type="carro" depart="53114.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.604" type="taxi" depart="53118.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.604" type="taxi" depart="53118.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.378" type="carro" depart="53121.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.605" type="taxi" depart="53122.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.605" type="taxi" depart="53122.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.606" type="taxi" depart="53127.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.606" type="taxi" depart="53127.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.379" type="carro" depart="53128.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.607" type="taxi" depart="53131.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.607" type="taxi" depart="53131.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.608" type="taxi" depart="53136.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.380" type="carro" depart="53136.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.608" type="taxi" depart="53136.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.609" type="taxi" depart="53140.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.609" type="taxi" depart="53140.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.381" type="carro" depart="53143.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.610" type="taxi" depart="53145.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.610" type="taxi" depart="53145.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.611" type="taxi" depart="53149.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.611" type="taxi" depart="53149.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.382" type="carro" depart="53150.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.612" type="taxi" depart="53154.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.612" type="taxi" depart="53154.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.383" type="carro" depart="53157.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.613" type="taxi" depart="53158.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.613" type="taxi" depart="53158.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.614" type="taxi" depart="53163.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.614" type="taxi" depart="53163.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.384" type="carro" depart="53164.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.615" type="taxi" depart="53167.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.615" type="taxi" depart="53167.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.616" type="taxi" depart="53172.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.385" type="carro" depart="53172.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.616" type="taxi" depart="53172.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.617" type="taxi" depart="53176.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.617" type="taxi" depart="53176.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.386" type="carro" depart="53179.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.618" type="taxi" depart="53181.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.618" type="taxi" depart="53181.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.619" type="taxi" depart="53185.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.619" type="taxi" depart="53185.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.387" type="carro" depart="53186.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.620" type="taxi" depart="53190.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.620" type="taxi" depart="53190.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.388" type="carro" depart="53193.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.621" type="taxi" depart="53194.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.621" type="taxi" depart="53194.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.622" type="taxi" depart="53199.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.622" type="taxi" depart="53199.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.389" type="carro" depart="53200.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.623" type="taxi" depart="53203.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.623" type="taxi" depart="53203.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.624" type="taxi" depart="53208.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.390" type="carro" depart="53208.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.624" type="taxi" depart="53208.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.625" type="taxi" depart="53212.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.625" type="taxi" depart="53212.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.391" type="carro" depart="53215.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.626" type="taxi" depart="53217.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.626" type="taxi" depart="53217.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.627" type="taxi" depart="53221.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.627" type="taxi" depart="53221.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.392" type="carro" depart="53222.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.628" type="taxi" depart="53226.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.628" type="taxi" depart="53226.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.393" type="carro" depart="53229.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.629" type="taxi" depart="53230.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.629" type="taxi" depart="53230.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.630" type="taxi" depart="53235.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.630" type="taxi" depart="53235.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.394" type="carro" depart="53236.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.631" type="taxi" depart="53239.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.631" type="taxi" depart="53239.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.632" type="taxi" depart="53244.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.395" type="carro" depart="53244.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.632" type="taxi" depart="53244.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.633" type="taxi" depart="53248.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.633" type="taxi" depart="53248.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.396" type="carro" depart="53251.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.634" type="taxi" depart="53253.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.634" type="taxi" depart="53253.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.635" type="taxi" depart="53257.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.635" type="taxi" depart="53257.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.397" type="carro" depart="53258.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.636" type="taxi" depart="53262.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.636" type="taxi" depart="53262.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.398" type="carro" depart="53265.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.637" type="taxi" depart="53266.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.637" type="taxi" depart="53266.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.638" type="taxi" depart="53271.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.638" type="taxi" depart="53271.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.399" type="carro" depart="53272.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.639" type="taxi" depart="53275.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.639" type="taxi" depart="53275.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.640" type="taxi" depart="53280.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.400" type="carro" depart="53280.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.640" type="taxi" depart="53280.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.641" type="taxi" depart="53284.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.641" type="taxi" depart="53284.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.401" type="carro" depart="53287.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.642" type="taxi" depart="53289.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.642" type="taxi" depart="53289.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.643" type="taxi" depart="53293.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.643" type="taxi" depart="53293.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.402" type="carro" depart="53294.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.644" type="taxi" depart="53298.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.644" type="taxi" depart="53298.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.403" type="carro" depart="53301.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.645" type="taxi" depart="53302.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.645" type="taxi" depart="53302.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.646" type="taxi" depart="53307.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.646" type="taxi" depart="53307.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.404" type="carro" depart="53308.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.647" type="taxi" depart="53311.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.647" type="taxi" depart="53311.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.648" type="taxi" depart="53316.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.405" type="carro" depart="53316.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.648" type="taxi" depart="53316.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.649" type="taxi" depart="53320.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.649" type="taxi" depart="53320.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.406" type="carro" depart="53323.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.650" type="taxi" depart="53325.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.650" type="taxi" depart="53325.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.651" type="taxi" depart="53329.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.651" type="taxi" depart="53329.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.407" type="carro" depart="53330.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.652" type="taxi" depart="53334.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.652" type="taxi" depart="53334.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.408" type="carro" depart="53337.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.653" type="taxi" depart="53338.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.653" type="taxi" depart="53338.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.654" type="taxi" depart="53343.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.654" type="taxi" depart="53343.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.409" type="carro" depart="53344.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.655" type="taxi" depart="53347.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.655" type="taxi" depart="53347.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.656" type="taxi" depart="53352.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.410" type="carro" depart="53352.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.656" type="taxi" depart="53352.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.657" type="taxi" depart="53356.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.657" type="taxi" depart="53356.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.411" type="carro" depart="53359.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.658" type="taxi" depart="53361.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.658" type="taxi" depart="53361.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.659" type="taxi" depart="53365.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.659" type="taxi" depart="53365.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.412" type="carro" depart="53366.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.660" type="taxi" depart="53370.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.660" type="taxi" depart="53370.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.413" type="carro" depart="53373.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.661" type="taxi" depart="53374.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.661" type="taxi" depart="53374.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.662" type="taxi" depart="53379.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.662" type="taxi" depart="53379.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.414" type="carro" depart="53380.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.663" type="taxi" depart="53383.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.663" type="taxi" depart="53383.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.664" type="taxi" depart="53388.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.415" type="carro" depart="53388.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.664" type="taxi" depart="53388.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.665" type="taxi" depart="53392.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.665" type="taxi" depart="53392.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.416" type="carro" depart="53395.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.666" type="taxi" depart="53397.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.666" type="taxi" depart="53397.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.667" type="taxi" depart="53401.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.667" type="taxi" depart="53401.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.417" type="carro" depart="53402.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.668" type="taxi" depart="53406.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.668" type="taxi" depart="53406.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.418" type="carro" depart="53409.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.669" type="taxi" depart="53410.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.669" type="taxi" depart="53410.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.670" type="taxi" depart="53415.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.670" type="taxi" depart="53415.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.419" type="carro" depart="53416.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.671" type="taxi" depart="53419.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.671" type="taxi" depart="53419.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.672" type="taxi" depart="53424.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.420" type="carro" depart="53424.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.672" type="taxi" depart="53424.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.673" type="taxi" depart="53428.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.673" type="taxi" depart="53428.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.421" type="carro" depart="53431.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.674" type="taxi" depart="53433.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.674" type="taxi" depart="53433.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.675" type="taxi" depart="53437.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.675" type="taxi" depart="53437.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.422" type="carro" depart="53438.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.676" type="taxi" depart="53442.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.676" type="taxi" depart="53442.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.423" type="carro" depart="53445.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.677" type="taxi" depart="53446.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.677" type="taxi" depart="53446.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.678" type="taxi" depart="53451.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.678" type="taxi" depart="53451.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.424" type="carro" depart="53452.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.679" type="taxi" depart="53455.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.679" type="taxi" depart="53455.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.680" type="taxi" depart="53460.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.425" type="carro" depart="53460.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.680" type="taxi" depart="53460.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.681" type="taxi" depart="53464.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.681" type="taxi" depart="53464.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.426" type="carro" depart="53467.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.682" type="taxi" depart="53469.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.682" type="taxi" depart="53469.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.683" type="taxi" depart="53473.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.683" type="taxi" depart="53473.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.427" type="carro" depart="53474.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.684" type="taxi" depart="53478.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.684" type="taxi" depart="53478.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.428" type="carro" depart="53481.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.685" type="taxi" depart="53482.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.685" type="taxi" depart="53482.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.686" type="taxi" depart="53487.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.686" type="taxi" depart="53487.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.429" type="carro" depart="53488.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.687" type="taxi" depart="53491.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.687" type="taxi" depart="53491.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.688" type="taxi" depart="53496.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.430" type="carro" depart="53496.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.688" type="taxi" depart="53496.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.689" type="taxi" depart="53500.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.689" type="taxi" depart="53500.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.431" type="carro" depart="53503.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.690" type="taxi" depart="53505.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.690" type="taxi" depart="53505.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.691" type="taxi" depart="53509.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.691" type="taxi" depart="53509.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.432" type="carro" depart="53510.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.692" type="taxi" depart="53514.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.692" type="taxi" depart="53514.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.433" type="carro" depart="53517.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.693" type="taxi" depart="53518.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.693" type="taxi" depart="53518.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.694" type="taxi" depart="53523.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.694" type="taxi" depart="53523.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.434" type="carro" depart="53524.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.695" type="taxi" depart="53527.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.695" type="taxi" depart="53527.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.696" type="taxi" depart="53532.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.435" type="carro" depart="53532.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.696" type="taxi" depart="53532.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.697" type="taxi" depart="53536.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.697" type="taxi" depart="53536.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.436" type="carro" depart="53539.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.698" type="taxi" depart="53541.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.698" type="taxi" depart="53541.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.699" type="taxi" depart="53545.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.699" type="taxi" depart="53545.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.437" type="carro" depart="53546.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.700" type="taxi" depart="53550.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.700" type="taxi" depart="53550.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.438" type="carro" depart="53553.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.701" type="taxi" depart="53554.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.701" type="taxi" depart="53554.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.702" type="taxi" depart="53559.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.702" type="taxi" depart="53559.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.439" type="carro" depart="53560.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.703" type="taxi" depart="53563.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.703" type="taxi" depart="53563.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.704" type="taxi" depart="53568.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.440" type="carro" depart="53568.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.704" type="taxi" depart="53568.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.705" type="taxi" depart="53572.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.705" type="taxi" depart="53572.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.441" type="carro" depart="53575.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.706" type="taxi" depart="53577.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.706" type="taxi" depart="53577.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.707" type="taxi" depart="53581.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.707" type="taxi" depart="53581.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.442" type="carro" depart="53582.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.708" type="taxi" depart="53586.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.708" type="taxi" depart="53586.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.443" type="carro" depart="53589.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.709" type="taxi" depart="53590.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.709" type="taxi" depart="53590.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.710" type="taxi" depart="53595.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.710" type="taxi" depart="53595.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.444" type="carro" depart="53596.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.711" type="taxi" depart="53599.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.711" type="taxi" depart="53599.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.712" type="taxi" depart="53604.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.445" type="carro" depart="53604.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.712" type="taxi" depart="53604.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.713" type="taxi" depart="53608.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.713" type="taxi" depart="53608.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.446" type="carro" depart="53611.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.714" type="taxi" depart="53613.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.714" type="taxi" depart="53613.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.715" type="taxi" depart="53617.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.715" type="taxi" depart="53617.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.447" type="carro" depart="53618.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.716" type="taxi" depart="53622.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.716" type="taxi" depart="53622.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.448" type="carro" depart="53625.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.717" type="taxi" depart="53626.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.717" type="taxi" depart="53626.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.718" type="taxi" depart="53631.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.718" type="taxi" depart="53631.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.449" type="carro" depart="53632.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.719" type="taxi" depart="53635.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.719" type="taxi" depart="53635.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.720" type="taxi" depart="53640.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.450" type="carro" depart="53640.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.720" type="taxi" depart="53640.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.721" type="taxi" depart="53644.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.721" type="taxi" depart="53644.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.451" type="carro" depart="53647.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.722" type="taxi" depart="53649.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.722" type="taxi" depart="53649.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.723" type="taxi" depart="53653.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.723" type="taxi" depart="53653.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.452" type="carro" depart="53654.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.724" type="taxi" depart="53658.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.724" type="taxi" depart="53658.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.453" type="carro" depart="53661.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.725" type="taxi" depart="53662.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.725" type="taxi" depart="53662.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.726" type="taxi" depart="53667.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.726" type="taxi" depart="53667.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.454" type="carro" depart="53668.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.727" type="taxi" depart="53671.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.727" type="taxi" depart="53671.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.728" type="taxi" depart="53676.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.455" type="carro" depart="53676.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.728" type="taxi" depart="53676.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.729" type="taxi" depart="53680.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.729" type="taxi" depart="53680.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.456" type="carro" depart="53683.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.730" type="taxi" depart="53685.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.730" type="taxi" depart="53685.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.731" type="taxi" depart="53689.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.731" type="taxi" depart="53689.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.457" type="carro" depart="53690.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.732" type="taxi" depart="53694.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.732" type="taxi" depart="53694.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.458" type="carro" depart="53697.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.733" type="taxi" depart="53698.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.733" type="taxi" depart="53698.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.734" type="taxi" depart="53703.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.734" type="taxi" depart="53703.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.459" type="carro" depart="53704.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.735" type="taxi" depart="53707.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.735" type="taxi" depart="53707.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.736" type="taxi" depart="53712.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.460" type="carro" depart="53712.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.736" type="taxi" depart="53712.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.737" type="taxi" depart="53716.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.737" type="taxi" depart="53716.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.461" type="carro" depart="53719.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.738" type="taxi" depart="53721.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.738" type="taxi" depart="53721.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.739" type="taxi" depart="53725.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.739" type="taxi" depart="53725.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.462" type="carro" depart="53726.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.740" type="taxi" depart="53730.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.740" type="taxi" depart="53730.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.463" type="carro" depart="53733.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.741" type="taxi" depart="53734.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.741" type="taxi" depart="53734.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.742" type="taxi" depart="53739.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.742" type="taxi" depart="53739.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.464" type="carro" depart="53740.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.743" type="taxi" depart="53743.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.743" type="taxi" depart="53743.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.744" type="taxi" depart="53748.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.465" type="carro" depart="53748.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.744" type="taxi" depart="53748.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.745" type="taxi" depart="53752.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.745" type="taxi" depart="53752.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.466" type="carro" depart="53755.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.746" type="taxi" depart="53757.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.746" type="taxi" depart="53757.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.747" type="taxi" depart="53761.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.747" type="taxi" depart="53761.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.467" type="carro" depart="53762.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.748" type="taxi" depart="53766.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.748" type="taxi" depart="53766.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.468" type="carro" depart="53769.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.749" type="taxi" depart="53770.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.749" type="taxi" depart="53770.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.750" type="taxi" depart="53775.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.750" type="taxi" depart="53775.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.469" type="carro" depart="53776.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.751" type="taxi" depart="53779.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.751" type="taxi" depart="53779.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.752" type="taxi" depart="53784.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.470" type="carro" depart="53784.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.752" type="taxi" depart="53784.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.753" type="taxi" depart="53788.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.753" type="taxi" depart="53788.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.471" type="carro" depart="53791.20">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.754" type="taxi" depart="53793.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.754" type="taxi" depart="53793.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.755" type="taxi" depart="53797.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.755" type="taxi" depart="53797.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.472" type="carro" depart="53798.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.756" type="taxi" depart="53802.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.756" type="taxi" depart="53802.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.473" type="carro" depart="53805.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.757" type="taxi" depart="53806.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.757" type="taxi" depart="53806.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.758" type="taxi" depart="53811.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.758" type="taxi" depart="53811.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.474" type="carro" depart="53812.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.759" type="taxi" depart="53815.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.759" type="taxi" depart="53815.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.760" type="taxi" depart="53820.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.475" type="carro" depart="53820.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.760" type="taxi" depart="53820.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.761" type="taxi" depart="53824.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.761" type="taxi" depart="53824.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.476" type="carro" depart="53827.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.762" type="taxi" depart="53829.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.762" type="taxi" depart="53829.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.763" type="taxi" depart="53833.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.763" type="taxi" depart="53833.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.477" type="carro" depart="53834.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.764" type="taxi" depart="53838.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.764" type="taxi" depart="53838.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.478" type="carro" depart="53841.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.765" type="taxi" depart="53842.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.765" type="taxi" depart="53842.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.766" type="taxi" depart="53847.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.766" type="taxi" depart="53847.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.479" type="carro" depart="53848.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.767" type="taxi" depart="53851.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.767" type="taxi" depart="53851.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.768" type="taxi" depart="53856.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.480" type="carro" depart="53856.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.768" type="taxi" depart="53856.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.769" type="taxi" depart="53860.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.769" type="taxi" depart="53860.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.481" type="carro" depart="53863.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.770" type="taxi" depart="53865.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.770" type="taxi" depart="53865.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.771" type="taxi" depart="53869.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.771" type="taxi" depart="53869.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.482" type="carro" depart="53870.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.772" type="taxi" depart="53874.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.772" type="taxi" depart="53874.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.483" type="carro" depart="53877.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.773" type="taxi" depart="53878.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.773" type="taxi" depart="53878.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.774" type="taxi" depart="53883.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.774" type="taxi" depart="53883.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.484" type="carro" depart="53884.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.775" type="taxi" depart="53887.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.775" type="taxi" depart="53887.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.776" type="taxi" depart="53892.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.485" type="carro" depart="53892.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.776" type="taxi" depart="53892.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.777" type="taxi" depart="53896.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.777" type="taxi" depart="53896.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.486" type="carro" depart="53899.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.778" type="taxi" depart="53901.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.778" type="taxi" depart="53901.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="-3801.779" type="taxi" depart="53905.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.779" type="taxi" depart="53905.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.487" type="carro" depart="53906.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.780" type="taxi" depart="53910.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.780" type="taxi" depart="53910.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.488" type="carro" depart="53913.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.781" type="taxi" depart="53914.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.781" type="taxi" depart="53914.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.782" type="taxi" depart="53919.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.782" type="taxi" depart="53919.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.489" type="carro" depart="53920.80">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.783" type="taxi" depart="53923.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.783" type="taxi" depart="53923.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.784" type="taxi" depart="53928.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.490" type="carro" depart="53928.00">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.784" type="taxi" depart="53928.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.785" type="taxi" depart="53932.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.785" type="taxi" depart="53932.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.491" type="carro" depart="53935.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.786" type="taxi" depart="53937.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.786" type="taxi" depart="53937.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.787" type="taxi" depart="53941.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.787" type="taxi" depart="53941.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.492" type="carro" depart="53942.40">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.788" type="taxi" depart="53946.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.788" type="taxi" depart="53946.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.493" type="carro" depart="53949.60">
+ <route edges="30659373#0 30659373#1 30659170 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.789" type="taxi" depart="53950.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.789" type="taxi" depart="53950.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.790" type="taxi" depart="53955.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.790" type="taxi" depart="53955.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.494" type="carro" depart="53956.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.791" type="taxi" depart="53959.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.791" type="taxi" depart="53959.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.792" type="taxi" depart="53964.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.495" type="carro" depart="53964.00">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.792" type="taxi" depart="53964.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.793" type="taxi" depart="53968.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.793" type="taxi" depart="53968.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.496" type="carro" depart="53971.20">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.794" type="taxi" depart="53973.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.794" type="taxi" depart="53973.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.795" type="taxi" depart="53977.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.795" type="taxi" depart="53977.50">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.497" type="carro" depart="53978.40">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.796" type="taxi" depart="53982.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.796" type="taxi" depart="53982.00">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="30659373#01.498" type="carro" depart="53985.60">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.797" type="taxi" depart="53986.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.797" type="taxi" depart="53986.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+ <vehicle id="-3801.798" type="taxi" depart="53991.00">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.798" type="taxi" depart="53991.00">
+ <route edges="33463249#0 30659403 30659405"/>
+ </vehicle>
+ <vehicle id="30659373#01.499" type="carro" depart="53992.80">
+ <route edges="30659373#0 30659375 -436#1"/>
+ </vehicle>
+ <vehicle id="-3801.799" type="taxi" depart="53995.50">
+ <route edges="-380 -465 -436#0 -436#1"/>
+ </vehicle>
+ <vehicle id="33463249#01.799" type="taxi" depart="53995.50">
+ <route edges="33463249#0 33463249#1 -447 -461#0 -461#1"/>
+ </vehicle>
+</routes>
diff --git a/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_pedestrians.trip.xml b/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_pedestrians.trip.xml
new file mode 100644
index 0000000..1274a31
--- /dev/null
+++ b/tools/contributed/traci4matlab/examples/inter_palmas/inter_palmas_pedestrians.trip.xml
@@ -0,0 +1,366 @@
+<?xml version="1.0"?>
+<!-- generated on 2015-06-22 14:59:00.669000 by $Id: randomTrips.py 18450 2015-05-27 12:43:14Z namdre $
+ options: -n inter_palmas_notls.net.xml -o inter_palmas_pedestrians.trip.xml <doubleminus>pedestrians -b 50400 -e 54000 -p 30 <doubleminus>trip-attributes=departPos="random" arrivalPos="random"
+-->
+<trips>
+ <person id="0" depart="50400.00" >
+ <walk from="-461#0" to="-380" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="1" depart="50430.00" >
+ <walk from="-447" to="-380" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="2" depart="50460.00" >
+ <walk from="33463249#0" to="33463249#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="3" depart="50490.00" >
+ <walk from="-447" to="33463249#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="4" depart="50520.00" >
+ <walk from="33463249#1" to="-465" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="5" depart="50550.00" >
+ <walk from="33463249#1" to="-436#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="6" depart="50580.00" >
+ <walk from="-436#0" to="-465" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="7" depart="50610.00" >
+ <walk from="-436#1" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="8" depart="50640.00" >
+ <walk from="-447" to="-461#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="9" depart="50670.00" >
+ <walk from="33463249#0" to="-380" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="10" depart="50700.00" >
+ <walk from="-436#1" to="33463249#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="11" depart="50730.00" >
+ <walk from="-461#0" to="-436#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="12" depart="50760.00" >
+ <walk from="-380" to="-461#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="13" depart="50790.00" >
+ <walk from="33463249#0" to="-436#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="14" depart="50820.00" >
+ <walk from="33463249#1" to="-461#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="15" depart="50850.00" >
+ <walk from="-447" to="-380" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="16" depart="50880.00" >
+ <walk from="-447" to="33463249#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="17" depart="50910.00" >
+ <walk from="-436#1" to="-461#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="18" depart="50940.00" >
+ <walk from="-447" to="-461#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="19" depart="50970.00" >
+ <walk from="-447" to="33463249#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="20" depart="51000.00" >
+ <walk from="33463249#1" to="33463249#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="21" depart="51030.00" >
+ <walk from="-461#0" to="-436#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="22" depart="51060.00" >
+ <walk from="-461#1" to="33463249#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="23" depart="51090.00" >
+ <walk from="-436#1" to="-436#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="24" depart="51120.00" >
+ <walk from="-436#1" to="33463249#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="25" depart="51150.00" >
+ <walk from="-436#1" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="26" depart="51180.00" >
+ <walk from="-436#1" to="-436#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="27" depart="51210.00" >
+ <walk from="-465" to="-465" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="28" depart="51240.00" >
+ <walk from="-447" to="-461#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="29" depart="51270.00" >
+ <walk from="33463249#1" to="-465" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="30" depart="51300.00" >
+ <walk from="-447" to="-461#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="31" depart="51330.00" >
+ <walk from="-447" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="32" depart="51360.00" >
+ <walk from="-461#0" to="-465" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="33" depart="51390.00" >
+ <walk from="-465" to="-380" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="34" depart="51420.00" >
+ <walk from="-461#0" to="-436#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="35" depart="51450.00" >
+ <walk from="-461#1" to="-436#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="36" depart="51480.00" >
+ <walk from="33463249#1" to="33463249#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="37" depart="51510.00" >
+ <walk from="-436#0" to="33463249#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="38" depart="51540.00" >
+ <walk from="-461#0" to="-436#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="39" depart="51570.00" >
+ <walk from="33463249#1" to="-436#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="40" depart="51600.00" >
+ <walk from="33463249#1" to="-461#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="41" depart="51630.00" >
+ <walk from="-436#1" to="33463249#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="42" depart="51660.00" >
+ <walk from="-447" to="-461#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="43" depart="51690.00" >
+ <walk from="-461#0" to="-465" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="44" depart="51720.00" >
+ <walk from="-380" to="-436#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="45" depart="51750.00" >
+ <walk from="-380" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="46" depart="51780.00" >
+ <walk from="-461#1" to="-465" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="47" depart="51810.00" >
+ <walk from="-465" to="-436#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="48" depart="51840.00" >
+ <walk from="-465" to="-461#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="49" depart="51870.00" >
+ <walk from="33463249#0" to="33463249#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="50" depart="51900.00" >
+ <walk from="-461#0" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="51" depart="51930.00" >
+ <walk from="-447" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="52" depart="51960.00" >
+ <walk from="33463249#0" to="33463249#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="53" depart="51990.00" >
+ <walk from="-465" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="54" depart="52020.00" >
+ <walk from="-436#0" to="33463249#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="55" depart="52050.00" >
+ <walk from="-436#1" to="-436#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="56" depart="52080.00" >
+ <walk from="-461#1" to="-461#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="57" depart="52110.00" >
+ <walk from="-465" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="58" depart="52140.00" >
+ <walk from="33463249#0" to="33463249#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="59" depart="52170.00" >
+ <walk from="-461#1" to="-380" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="60" depart="52200.00" >
+ <walk from="-461#1" to="-461#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="61" depart="52230.00" >
+ <walk from="-436#1" to="-461#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="62" depart="52260.00" >
+ <walk from="-465" to="33463249#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="63" depart="52290.00" >
+ <walk from="33463249#1" to="-436#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="64" depart="52320.00" >
+ <walk from="-380" to="-461#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="65" depart="52350.00" >
+ <walk from="-465" to="-436#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="66" depart="52380.00" >
+ <walk from="-447" to="33463249#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="67" depart="52410.00" >
+ <walk from="-447" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="68" depart="52440.00" >
+ <walk from="33463249#0" to="-436#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="69" depart="52470.00" >
+ <walk from="-465" to="-436#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="70" depart="52500.00" >
+ <walk from="-380" to="33463249#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="71" depart="52530.00" >
+ <walk from="-447" to="-436#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="72" depart="52560.00" >
+ <walk from="-461#0" to="-461#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="73" depart="52590.00" >
+ <walk from="-461#0" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="74" depart="52620.00" >
+ <walk from="-380" to="33463249#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="75" depart="52650.00" >
+ <walk from="-436#1" to="-380" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="76" depart="52680.00" >
+ <walk from="-447" to="-461#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="77" depart="52710.00" >
+ <walk from="33463249#0" to="-436#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="78" depart="52740.00" >
+ <walk from="-436#1" to="33463249#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="79" depart="52770.00" >
+ <walk from="-461#0" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="80" depart="52800.00" >
+ <walk from="-447" to="-465" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="81" depart="52830.00" >
+ <walk from="-461#0" to="-461#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="82" depart="52860.00" >
+ <walk from="-461#1" to="33463249#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="83" depart="52890.00" >
+ <walk from="-436#1" to="-380" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="84" depart="52920.00" >
+ <walk from="-461#0" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="85" depart="52950.00" >
+ <walk from="33463249#0" to="-461#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="86" depart="52980.00" >
+ <walk from="33463249#0" to="-461#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="87" depart="53010.00" >
+ <walk from="-461#1" to="-461#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="88" depart="53040.00" >
+ <walk from="33463249#0" to="33463249#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="89" depart="53070.00" >
+ <walk from="-461#1" to="-465" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="90" depart="53100.00" >
+ <walk from="-465" to="33463249#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="91" depart="53130.00" >
+ <walk from="-461#1" to="33463249#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="92" depart="53160.00" >
+ <walk from="-447" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="93" depart="53190.00" >
+ <walk from="33463249#0" to="-461#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="94" depart="53220.00" >
+ <walk from="-461#0" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="95" depart="53250.00" >
+ <walk from="-380" to="33463249#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="96" depart="53280.00" >
+ <walk from="-465" to="33463249#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="97" depart="53310.00" >
+ <walk from="-436#1" to="-380" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="98" depart="53340.00" >
+ <walk from="-447" to="-465" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="99" depart="53370.00" >
+ <walk from="-436#1" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="100" depart="53400.00" >
+ <walk from="-465" to="-436#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="101" depart="53430.00" >
+ <walk from="-447" to="-461#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="102" depart="53460.00" >
+ <walk from="-436#1" to="-465" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="103" depart="53490.00" >
+ <walk from="-461#0" to="-465" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="104" depart="53520.00" >
+ <walk from="-380" to="-461#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="105" depart="53550.00" >
+ <walk from="-436#1" to="-380" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="106" depart="53580.00" >
+ <walk from="-380" to="-465" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="107" depart="53610.00" >
+ <walk from="33463249#0" to="-461#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="108" depart="53640.00" >
+ <walk from="33463249#0" to="-461#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="109" depart="53670.00" >
+ <walk from="-436#0" to="-461#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="110" depart="53700.00" >
+ <walk from="-461#0" to="-436#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="111" depart="53730.00" >
+ <walk from="-436#1" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="112" depart="53760.00" >
+ <walk from="-436#1" to="-461#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="113" depart="53790.00" >
+ <walk from="-461#0" to="-465" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="114" depart="53820.00" >
+ <walk from="-447" to="33463249#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="115" depart="53850.00" >
+ <walk from="-380" to="-380" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="116" depart="53880.00" >
+ <walk from="-380" to="-436#1" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="117" depart="53910.00" >
+ <walk from="-461#0" to="-436#0" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="118" depart="53940.00" >
+ <walk from="-461#0" to="-447" departPos="random" arrivalPos="random"/>
+ </person>
+ <person id="119" depart="53970.00" >
+ <walk from="-436#0" to="-461#0" departPos="random" arrivalPos="random"/>
+ </person>
+</trips>
diff --git a/tools/contributed/traci4matlab/examples/inter_palmas/tls_actuated/checkWaitingPersons.m b/tools/contributed/traci4matlab/examples/inter_palmas/tls_actuated/checkWaitingPersons.m
new file mode 100644
index 0000000..d8735d3
--- /dev/null
+++ b/tools/contributed/traci4matlab/examples/inter_palmas/tls_actuated/checkWaitingPersons.m
@@ -0,0 +1,25 @@
+function [activeRequest, numPeds] = checkWaitingPersons(WALKINGAREAS, CROSSINGS)
+% Function used by the TraCI4Matlab pedestrian test to check whether a
+% person has requested to cross the street.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+% check both sides of the crossing
+for i = 1:length(WALKINGAREAS)
+ numPeds = traci.edge.getLastStepPersonIDs(WALKINGAREAS{i});
+ % check who is waiting at the crossing
+ % we assume that pedestrians push the button upon
+ % standing still for 1s
+ for j = 1:length(numPeds)
+ if traci.person.getWaitingTime(numPeds{j}) == 1 &&...
+ ismember(traci.person.getNextEdge(numPeds{j}),CROSSINGS)
+ fprintf('%s pushes the button\n', numPeds{j});
+ activeRequest = 1;
+ return
+ end
+ end
+ activeRequest = 0;
+end
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/examples/inter_palmas/tls_actuated/inter_palmas.net.xml b/tools/contributed/traci4matlab/examples/inter_palmas/tls_actuated/inter_palmas.net.xml
new file mode 100644
index 0000000..c975079
--- /dev/null
+++ b/tools/contributed/traci4matlab/examples/inter_palmas/tls_actuated/inter_palmas.net.xml
@@ -0,0 +1,323 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- generated on 06/19/15 17:31:01 by SUMO netconvert Version dev-SVN-r18493
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netconvertConfiguration.xsd">
+
+ <input>
+ <sumo-net-file value="C:/Users/AndresFelipe/Documents/SUMO/inter_palmas/final/inter_palmas_notls_shaped_conns_joined_crossings.net.xml"/>
+ <node-files value="C:/Users/AndresFelipe/Documents/SUMO/inter_palmas/final/patch_node.nod.xml"/>
+ <tllogic-files value="C:/Users/AndresFelipe/Documents/SUMO/inter_palmas/final/patch_tls.tll.xml"/>
+ </input>
+
+ <output>
+ <output-file value="C:/Users/AndresFelipe/Documents/SUMO/inter_palmas/final/inter_palmas_notls_shaped_conns_joined_crossings.net.xml"/>
+ <output.street-names value="true"/>
+ </output>
+
+ <processing>
+ <no-turnarounds value="true"/>
+ <offset.disable-normalization value="true"/>
+ </processing>
+
+</configuration>
+-->
+<net version="0.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/net_file.xsd">
+ <location origBoundary="-75.570172,6.235311,-75.568126,6.238647" convBoundary="0.00,0.00,227.10,369.18" projParameter="+proj=utm +zone=18 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" netOffset="-436926.13,-689249.98"/>
+ <edge function="internal" id=":339060251_0">
+ <lane index="0" length="11.74" shape="183.56,68.28 186.18,66.47 188.61,65.46 190.77,64.10 192.60,61.27" id=":339060251_0_0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="15.29"/>
+ </edge>
+ <edge function="internal" id=":339060251_1">
+ <lane index="0" width="2.00" length="10.69" allow="pedestrian" shape="186.11,70.16 187.29,67.21 188.09,65.19 188.90,63.17 190.11,60.23" id=":339060251_1_0" speed="16.67"/>
+ <lane index="1" length="10.69" shape="188.61,71.18 189.79,68.24 190.59,66.22 191.39,64.20 192.60,61.27" id=":339060251_1_1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ <lane index="2" length="10.69" shape="191.66,72.43 192.85,69.49 193.64,67.48 194.44,65.46 195.65,62.54" id=":339060251_1_2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ </edge>
+ <edge function="internal" id=":339060265_0">
+ <lane index="0" length="0.10" shape="77.51,254.19 77.51,254.19" id=":339060265_0_0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90"/>
+ </edge>
+ <edge function="internal" id=":339061351_0">
+ <lane index="0" width="2.00" length="10.79" allow="pedestrian" shape="82.21,164.90 85.00,163.35 86.90,162.27 88.79,161.18 91.56,159.58" id=":339061351_0_0" speed="16.67"/>
+ </edge>
+ <edge function="internal" id=":339061351_1">
+ <lane index="0" length="2.52" shape="83.52,167.26 83.96,166.47 84.28,164.89" id=":339061351_1_0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="15.29"/>
+ </edge>
+ <edge function="internal" id=":339061351_2">
+ <lane index="0" length="10.79" shape="83.52,167.26 86.31,165.70 88.22,164.62 90.12,163.52 92.90,161.93" id=":339061351_2_0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ <lane index="1" length="10.79" shape="85.11,170.15 87.93,168.58 89.84,167.50 91.75,166.40 94.54,164.79" id=":339061351_2_1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ </edge>
+ <edge function="internal" id=":339061351_4">
+ <lane index="0" length="7.23" shape="84.28,164.89 84.34,164.61 84.67,161.69 84.95,157.70" id=":339061351_4_0" speed="15.29"/>
+ </edge>
+ <edge crossingEdges="30659403" function="crossing" id=":339061351_c0">
+ <lane index="0" width="4.00" length="6.50" allow="pedestrian" shape="83.24,159.61 89.73,159.96" id=":339061351_c0_0" speed="1.00"/>
+ </edge>
+ <edge function="walkingarea" id=":339061351_w0">
+ <lane index="0" width="4.00" length="1.86" allow="pedestrian" shape="92.05,160.45 91.06,158.72 89.84,157.96 89.62,161.96" id=":339061351_w0_0" speed="1.00"/>
+ </edge>
+ <edge function="walkingarea" id=":339061351_w1">
+ <lane index="0" width="4.00" length="5.40" allow="pedestrian" shape="83.13,161.60 83.35,157.61 81.72,164.03 82.70,165.78" id=":339061351_w1_0" speed="1.00"/>
+ </edge>
+ <edge function="internal" id=":339061421_0">
+ <lane index="0" length="2.48" shape="123.75,143.97 126.07,142.74" id=":339061421_0_0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ <lane index="1" length="2.48" shape="125.41,146.82 127.48,145.72" id=":339061421_0_1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ </edge>
+ <edge function="walkingarea" id=":339061421_w0">
+ <lane index="0" width="2.00" length="4.44" allow="pedestrian" shape="125.34,141.20 124.48,139.40 120.23,137.92 121.24,139.65" id=":339061421_w0_0" speed="1.00"/>
+ </edge>
+ <edge function="internal" id=":339061695_0">
+ <lane index="0" width="2.00" length="5.31" allow="pedestrian" shape="175.94,130.32 173.91,136.96" id=":339061695_0_0" speed="16.67"/>
+ <lane index="1" length="5.31" allow="taxi bus" shape="173.73,128.77 172.35,134.76" id=":339061695_0_1" speed="16.67"/>
+ <lane index="2" length="5.31" shape="173.73,128.77 170.45,132.06" id=":339061695_0_2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ <lane index="3" length="5.31" shape="171.03,126.88 168.55,129.36" id=":339061695_0_3" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ </edge>
+ <edge function="internal" id=":339061699_0">
+ <lane index="0" length="9.16" shape="80.92,189.93 80.31,187.19 79.10,185.73 77.30,185.53 74.89,186.62" id=":339061699_0_0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="15.29"/>
+ </edge>
+ <edge function="internal" id=":339061699_1">
+ <lane index="0" width="2.00" length="7.87" allow="pedestrian" shape="83.02,185.00 76.35,188.89" id=":339061699_1_0" speed="16.67"/>
+ <lane index="1" length="7.87" shape="81.68,182.65 74.89,186.62" id=":339061699_1_1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ <lane index="2" length="7.87" shape="80.04,179.79 73.12,183.83" id=":339061699_1_2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ </edge>
+ <edge function="internal" id=":339062566_0">
+ <lane index="0" length="11.06" shape="83.76,269.74 82.33,267.00 80.76,265.24 78.88,263.67 76.52,261.56" id=":339062566_0_0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90"/>
+ </edge>
+ <edge function="internal" id=":339062566_1">
+ <lane index="0" length="11.04" shape="83.76,269.74 82.58,266.84 81.69,264.62 80.80,262.40 79.64,259.49" id=":339062566_1_0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90"/>
+ </edge>
+ <edge function="internal" id=":339062833_0">
+ <lane index="0" length="3.48" shape="86.92,85.35 86.87,84.91 86.71,84.53 86.46,84.21 86.09,83.95" id=":339062833_0_0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90"/>
+ <lane index="1" length="3.48" shape="90.22,85.35 90.06,83.99 89.59,82.83 88.79,81.85 87.69,81.06" id=":339062833_0_1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90"/>
+ </edge>
+ <edge function="internal" id=":cluster_-427_339061698_0">
+ <lane index="0" width="2.00" length="2.89" allow="pedestrian" shape="104.48,176.57 100.78,174.83" id=":cluster_-427_339061698_0_0" speed="16.67"/>
+ <lane index="1" length="2.89" shape="101.45,171.38 99.43,172.49" id=":cluster_-427_339061698_0_1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ <lane index="2" length="2.89" shape="99.79,168.52 97.79,169.62" id=":cluster_-427_339061698_0_2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ </edge>
+ <edge function="internal" id=":cluster_-427_339061698_3">
+ <lane index="0" width="2.00" length="3.09" allow="pedestrian" shape="91.92,159.37 92.16,155.43" id=":cluster_-427_339061698_3_0" speed="16.67"/>
+ <lane index="1" length="3.09" allow="taxi bus" shape="93.27,161.72 93.52,157.77" id=":cluster_-427_339061698_3_1" speed="16.67"/>
+ <lane index="2" length="3.09" shape="93.27,161.72 95.18,160.62" id=":cluster_-427_339061698_3_2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ <lane index="3" length="3.09" shape="94.91,164.58 96.85,163.47" id=":cluster_-427_339061698_3_3" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ </edge>
+ <edge crossingEdges="-465" function="crossing" id=":cluster_-427_339061698_c0">
+ <lane index="0" width="4.00" length="9.81" allow="pedestrian" shape="97.28,168.01 102.07,176.57" id=":cluster_-427_339061698_c0_0" speed="1.00"/>
+ </edge>
+ <edge crossingEdges="-447" function="crossing" id=":cluster_-427_339061698_c1">
+ <lane index="0" width="4.00" length="9.80" allow="pedestrian" shape="90.99,157.39 95.92,165.86" id=":cluster_-427_339061698_c1_0" speed="1.00"/>
+ </edge>
+ <edge function="walkingarea" id=":cluster_-427_339061698_w0">
+ <lane index="0" width="4.00" length="2.89" allow="pedestrian" shape="100.28,173.96 101.27,175.70 104.93,177.46 104.02,175.68 103.81,175.59 100.32,177.54" id=":cluster_-427_339061698_w0_0" speed="1.00"/>
+ </edge>
+ <edge function="walkingarea" id=":cluster_-427_339061698_w1">
+ <lane index="0" width="4.00" length="2.81" allow="pedestrian" shape="89.26,158.40 92.67,156.30 91.66,154.57 91.43,158.51 92.42,160.24" id=":cluster_-427_339061698_w1_0" speed="1.00"/>
+ </edge>
+ <edge function="walkingarea" id=":cluster_-427_339061698_w2">
+ <lane index="0" width="4.00" length="2.54" allow="pedestrian" shape="94.19,166.87 97.65,164.85 99.02,167.03 95.53,168.99" id=":cluster_-427_339061698_w2_0" speed="1.00"/>
+ </edge>
+ <edge priority="-1" to="339061695" type="highway.trunk" shape="227.10,0.59 214.81,38.33 204.37,69.52 193.00,95.04 187.28,108.34 172.04,130.14" id="-380" from="339061690" spreadType="center" name="Vía Las Palmas">
+ <lane index="0" width="2.00" length="139.62" allow="pedestrian" shape="230.24,1.61 217.95,39.35 207.50,70.57 196.01,96.38 190.18,109.95 175.94,130.32" id="-380_0" speed="16.67"/>
+ <lane index="1" length="139.62" shape="227.67,0.78 215.38,38.52 204.94,69.71 193.55,95.28 187.81,108.63 173.73,128.77" id="-380_1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ <lane index="2" length="139.62" shape="224.53,-0.25 212.24,37.49 201.81,68.66 190.53,93.94 184.91,107.02 171.03,126.88" id="-380_2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ </edge>
+ <edge priority="-1" to="339061699" type="highway.trunk" shape="100.42,171.23 75.82,185.32" id="-436#0" from="cluster_-427_339061698" spreadType="center" name="Vía Las Palmas">
+ <lane index="0" width="2.00" length="20.46" allow="pedestrian" shape="100.78,174.83 83.02,185.00" id="-436#0_0" speed="16.67"/>
+ <lane index="1" length="20.46" shape="99.43,172.49 81.68,182.65" id="-436#0_1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ <lane index="2" length="20.46" shape="97.79,169.62 80.04,179.79" id="-436#0_2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ </edge>
+ <edge priority="-1" to="339059944" type="highway.trunk" shape="75.86,185.29 64.11,192.78 51.48,204.67 39.15,219.02" id="-436#1" from="339061699" spreadType="center" name="Vía Las Palmas">
+ <lane index="0" width="2.00" length="48.56" allow="pedestrian" shape="76.35,188.89 66.15,195.40 53.74,207.07 41.65,221.17" id="-436#1_0" speed="16.67"/>
+ <lane index="1" length="48.56" shape="74.89,186.62 64.48,193.26 51.89,205.11 39.60,219.41" id="-436#1_1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ <lane index="2" length="48.56" shape="73.12,183.83 62.44,190.64 49.63,202.70 37.10,217.26" id="-436#1_2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ </edge>
+ <edge priority="-1" to="339061421" type="highway.trunk" shape="93.97,160.11 124.33,142.42" id="-447" from="cluster_-427_339061698" spreadType="center" name="Vía Las Palmas">
+ <lane index="0" width="2.00" length="33.07" allow="pedestrian" shape="92.16,155.43 120.73,138.79" id="-447_0" speed="16.67"/>
+ <lane index="1" length="33.07" allow="taxi bus" shape="93.52,157.77 122.09,141.12" id="-447_1" speed="16.67"/>
+ <lane index="2" length="33.07" shape="95.18,160.62 123.75,143.97" id="-447_2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ <lane index="3" length="33.07" shape="96.85,163.47 125.41,146.82" id="-447_3" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ </edge>
+ <edge priority="-1" to="339060251" type="highway.trunk" shape="125.23,143.80 145.09,134.38 154.44,127.86 163.80,118.54 171.31,108.27 181.67,89.50 186.53,77.86 195.69,55.40" id="-461#0" from="339061421" spreadType="center" name="Vía Las Palmas">
+ <lane index="0" width="2.00" length="98.83" allow="pedestrian" shape="124.91,140.30 143.68,131.40 152.55,125.15 161.47,116.20 168.65,106.32 178.78,87.91 183.48,76.59 186.11,70.16" id="-461#0_0" speed="16.67"/>
+ <lane index="1" length="98.83" shape="126.07,142.74 144.83,133.84 154.10,127.37 163.38,118.11 170.83,107.92 181.14,89.21 185.98,77.63 188.61,71.18" id="-461#0_1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ <lane index="2" length="98.83" shape="127.48,145.72 146.25,136.82 155.98,130.07 165.71,120.45 173.49,109.86 184.03,90.80 189.02,78.90 191.66,72.43" id="-461#0_2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ </edge>
+ <edge priority="-1" to="339061412" type="highway.trunk" shape="195.70,55.39 199.20,46.99 213.80,0.00" id="-461#1" from="339060251" spreadType="center" name="Vía Las Palmas">
+ <lane index="0" width="2.00" length="64.89" allow="pedestrian" shape="190.11,60.23 196.15,45.72 210.65,-0.98" id="-461#1_0" speed="16.67"/>
+ <lane index="1" length="64.89" shape="192.60,61.27 198.65,46.76 213.23,-0.18" id="-461#1_1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ <lane index="2" length="64.89" shape="195.65,62.54 201.69,48.03 216.38,0.80" id="-461#1_2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ </edge>
+ <edge priority="-1" to="cluster_-427_339061698" type="highway.trunk" shape="172.63,131.81 149.80,147.91 136.45,154.57 101.21,172.68" id="-465" from="339061695" spreadType="center" name="Vía Las Palmas">
+ <lane index="0" width="2.00" length="79.72" allow="pedestrian" shape="173.91,136.96 152.65,151.96 138.66,159.00 104.48,176.57" id="-465_0" speed="16.67"/>
+ <lane index="1" length="79.72" allow="taxi bus" shape="172.35,134.76 151.10,149.75 137.45,156.58 103.12,174.23" id="-465_1" speed="16.67"/>
+ <lane index="2" length="79.72" shape="170.45,132.06 149.19,147.05 135.98,153.63 101.45,171.38" id="-465_2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ <lane index="3" length="79.72" shape="168.55,129.36 147.29,144.36 134.51,150.68 99.79,168.52" id="-465_3" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ </edge>
+ <edge priority="-1" to="339060251" type="highway.secondary" shape="77.51,254.19 71.71,239.62 70.49,226.21 73.07,216.27 83.20,207.18 111.31,197.65 122.88,188.21 125.54,182.01 124.62,152.24 128.46,138.69 134.09,133.08 156.92,109.47 169.65,91.18 181.20,70.53 196.62,55.78" id="30659170" from="339060265" spreadType="center" name="Carrera 44">
+ <lane index="0" length="238.25" shape="77.51,254.19 71.71,239.62 70.49,226.21 73.07,216.27 83.20,207.18 111.31,197.65 122.88,188.21 125.54,182.01 124.62,152.24 128.46,138.69 134.09,133.08 156.92,109.47 169.65,91.18 181.20,70.53 183.56,68.28" id="30659170_0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90"/>
+ </edge>
+ <edge priority="-1" to="339062566" type="highway.secondary" shape="130.85,369.18 89.86,284.63 83.07,268.05" id="30659373#0" from="365768381" spreadType="center" name="Carrera 44">
+ <lane index="0" length="110.05" shape="130.85,369.18 89.86,284.63 83.76,269.74" id="30659373#0_0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90"/>
+ </edge>
+ <edge priority="-1" to="339060265" type="highway.secondary" id="30659373#1" from="339062566" spreadType="center" name="Carrera 44">
+ <lane index="0" length="5.72" shape="79.64,259.49 77.51,254.19" id="30659373#1_0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90"/>
+ </edge>
+ <edge priority="-1" to="339061699" type="highway.secondary" shape="83.07,268.05 74.88,259.94 63.72,241.15 60.17,232.66 60.33,222.15 70.02,207.90 77.28,199.49 81.33,194.28 80.69,187.43 75.32,184.45" id="30659375" from="339062566" spreadType="center" name="Carrera 44">
+ <lane index="0" length="83.18" shape="76.52,261.56 74.88,259.94 63.72,241.15 60.17,232.66 60.33,222.15 70.02,207.90 77.28,199.49 81.33,194.28 80.92,189.93" id="30659375_0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90"/>
+ </edge>
+ <edge priority="-1" to="339062833" type="highway.unclassified" shape="86.05,167.69 86.74,155.13 87.67,130.59 88.58,96.63 88.57,83.43" id="30659403" from="339061351" spreadType="center" name="Carrera 43 A">
+ <lane index="0" length="72.47" shape="84.95,157.70 85.09,155.04 86.02,130.53 86.93,96.59 86.92,85.35" id="30659403_0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90"/>
+ <lane index="1" length="72.47" shape="88.24,157.88 88.39,155.22 89.32,130.65 90.23,96.67 90.22,85.35" id="30659403_1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90"/>
+ </edge>
+ <edge priority="-1" to="339061974" type="highway.unclassified" shape="88.57,83.43 80.02,78.72 69.57,77.79 52.48,83.47 27.81,92.93 16.43,100.49 0.00,113.17" id="30659405" from="339062833" spreadType="center" name="Calle 36">
+ <lane index="0" length="97.18" shape="86.09,83.95 79.53,80.33 69.77,79.46 53.00,85.04 28.57,94.41 17.34,101.86 1.01,114.48" id="30659405_0" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90"/>
+ <lane index="1" length="97.18" shape="87.69,81.06 80.51,77.11 69.37,76.12 51.96,81.90 27.05,91.45 15.52,99.12 -1.01,111.86" id="30659405_1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="13.90"/>
+ </edge>
+ <edge priority="-1" to="339061351" type="highway.trunk" shape="28.26,184.70 42.01,184.36 57.21,180.36 73.27,173.62 85.57,166.81" id="33463249#0" from="339059941" spreadType="center" name="Vía Las Palmas">
+ <lane index="0" width="2.00" length="58.74" allow="pedestrian" shape="28.18,181.40 41.54,181.07 56.37,177.17 71.99,170.58 82.21,164.90" id="33463249#0_0" speed="16.67"/>
+ <lane index="1" length="58.74" shape="28.25,184.10 41.93,183.76 57.06,179.78 73.04,173.07 83.52,167.26" id="33463249#0_1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ <lane index="2" length="58.74" shape="28.33,187.40 42.39,187.05 57.90,182.97 74.31,176.11 85.11,170.15" id="33463249#0_2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ </edge>
+ <edge priority="-1" to="cluster_-427_339061698" type="highway.trunk" shape="85.56,166.82 94.80,161.53" id="33463249#1" from="339061351" spreadType="center" name="Vía Las Palmas">
+ <lane index="0" width="2.00" length="0.43" allow="pedestrian" shape="91.56,159.58 91.92,159.37" id="33463249#1_0" speed="16.67"/>
+ <lane index="1" length="0.43" shape="92.90,161.93 93.27,161.72" id="33463249#1_1" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ <lane index="2" length="0.43" shape="94.54,164.79 94.91,164.58" id="33463249#1_2" disallow="tram rail_urban rail rail_electric pedestrian ship" speed="16.67"/>
+ </edge>
+ <tlLogic type="static" id="sanDiego" programID="0" offset="0">
+ <phase duration="100000" state="rGGrGGGrrrr"/>
+ <phase duration="5" state="ryyryyyrrrr"/>
+ <phase duration="20" state="grrgrrrgggg"/>
+ <phase duration="10" state="rrrrrrrrrrr"/>
+ </tlLogic>
+ <junction x="28.29" y="185.70" type="unregulated" shape="28.37,189.00 28.16,180.40" id="339059941" incLanes="" intLanes=""/>
+ <junction x="38.39" y="218.37" type="unregulated" shape="42.41,221.82 35.88,216.22" id="339059944" incLanes="-436#1_0 -436#1_1 -436#1_2" intLanes=""/>
+ <junction x="196.62" y="55.78" type="priority" shape="197.12,63.15 189.19,59.84 182.45,67.12 184.66,69.43 185.18,69.78 193.14,73.03" id="339060251" incLanes="30659170_0 -461#0_0 -461#0_1 -461#0_2" intLanes=":339060251_0_0 :339060251_1_0 :339060251_1_1 :339060251_1_2">
+ <request index="0" foes="1110" cont="0" response="1110"/>
+ <request index="1" foes="0001" cont="0" response="0000"/>
+ <request index="2" foes="0001" cont="0" response="0000"/>
+ <request index="3" foes="0001" cont="0" response="0000"/>
+ </junction>
+ <junction x="77.51" y="254.19" type="priority" shape="76.02,254.79 78.99,253.59 76.02,254.78" id="339060265" incLanes="30659373#1_0" intLanes=":339060265_0_0">
+ <request index="0" foes="0" cont="0" response="0"/>
+ </junction>
+ <junction x="86.05" y="167.69" type="priority" shape="95.33,166.18 91.06,158.72 89.84,157.96 83.35,157.61 81.73,164.03 85.89,171.55" id="339061351" incLanes="33463249#0_0 33463249#0_1 33463249#0_2 :339061351_w1_0" intLanes=":339061351_0_0 :339061351_4_0 :339061351_2_0 :339061351_2_1 :339061351_c0_0">
+ <request index="0" foes="00000" cont="0" response="00000"/>
+ <request index="1" foes="10001" cont="1" response="10001"/>
+ <request index="2" foes="00000" cont="0" response="00000"/>
+ <request index="3" foes="00000" cont="0" response="00000"/>
+ <request index="4" foes="00010" cont="0" response="00000"/>
+ </junction>
+ <junction x="214.76" y="0.30" type="unregulated" shape="209.69,-1.27 217.91,1.28" id="339061412" incLanes="-461#1_0 -461#1_1 -461#1_2" intLanes=""/>
+ <junction x="125.66" y="144.70" type="priority" shape="128.17,147.17 124.48,139.40 120.23,137.92 126.22,148.21" id="339061421" incLanes="-447_0 -447_1 -447_2 -447_3" intLanes=":339061421_0_0 :339061421_0_1">
+ <request index="0" foes="00" cont="0" response="00"/>
+ <request index="1" foes="00" cont="0" response="00"/>
+ </junction>
+ <junction x="226.15" y="0.28" type="unregulated" shape="223.01,-0.74 231.19,1.92" id="339061690" incLanes="" intLanes=""/>
+ <junction x="171.22" y="129.56" type="priority" shape="176.76,130.89 169.71,125.96 167.63,128.06 174.49,137.78" id="339061695" incLanes="-380_0 -380_1 -380_2" intLanes=":339061695_0_0 :339061695_0_1 :339061695_0_2 :339061695_0_3">
+ <request index="0" foes="0000" cont="0" response="0000"/>
+ <request index="1" foes="0000" cont="0" response="0000"/>
+ <request index="2" foes="0000" cont="0" response="0000"/>
+ <request index="3" foes="0000" cont="0" response="0000"/>
+ </junction>
+ <junction x="75.32" y="184.45" type="priority" shape="79.49,191.76 82.36,188.10 83.52,185.86 79.25,178.40 72.26,182.49 76.88,189.74" id="339061699" incLanes="30659375_0 -436#0_0 -436#0_1 -436#0_2" intLanes=":339061699_0_0 :339061699_1_0 :339061699_1_1 :339061699_1_2">
+ <request index="0" foes="1110" cont="0" response="1110"/>
+ <request index="1" foes="0001" cont="0" response="0000"/>
+ <request index="2" foes="0001" cont="0" response="0000"/>
+ <request index="3" foes="0001" cont="0" response="0000"/>
+ </junction>
+ <junction x="0.00" y="113.17" type="unregulated" shape="1.99,115.74 -1.99,110.60" id="339061974" incLanes="30659405_0 30659405_1" intLanes=""/>
+ <junction x="83.07" y="268.05" type="priority" shape="82.28,270.35 85.24,269.13 81.12,258.90 78.15,260.09 77.65,260.43 75.39,262.70" id="339062566" incLanes="30659373#0_0" intLanes=":339062566_0_0 :339062566_1_0">
+ <request index="0" foes="00" cont="0" response="00"/>
+ <request index="1" foes="00" cont="0" response="00"/>
+ </junction>
+ <junction x="88.57" y="83.43" type="priority" shape="85.32,85.35 91.82,85.35 88.46,79.66 85.32,85.35" id="339062833" incLanes="30659403_0 30659403_1" intLanes=":339062833_0_0 :339062833_0_1">
+ <request index="0" foes="00" cont="0" response="00"/>
+ <request index="1" foes="00" cont="0" response="00"/>
+ </junction>
+ <junction x="130.85" y="369.18" type="unregulated" shape="132.29,368.48 129.41,369.88" id="365768381" incLanes="" intLanes=""/>
+ <junction x="97.61" y="166.38" type="traffic_light" shape="104.98,177.43 91.66,154.57 91.43,158.51 101.27,175.70" id="cluster_-427_339061698" incLanes="-465_0 -465_1 -465_2 -465_3 33463249#1_0 33463249#1_1 33463249#1_2 :cluster_-427_339061698_w2_0 :cluster_-427_339061698_w1_0" intLanes=":cluster_-427_339061698_0_0 :cluster_-427_339061698_0_1 :cluster_-427_339061698_0_2 :cluster_-427_339061698_3_0 :cluster_-427_339061698_3_1 :cluster_-427_339061698_3_2 :cluster_-427_339061698_3_3 :clu [...]
+ <request index="0" foes="010000000" cont="0" response="010000000"/>
+ <request index="1" foes="010000000" cont="0" response="010000000"/>
+ <request index="2" foes="010000000" cont="0" response="010000000"/>
+ <request index="3" foes="100000000" cont="0" response="100000000"/>
+ <request index="4" foes="100000000" cont="0" response="100000000"/>
+ <request index="5" foes="100000000" cont="0" response="100000000"/>
+ <request index="6" foes="100000000" cont="0" response="100000000"/>
+ <request index="7" foes="000000111" cont="0" response="000000000"/>
+ <request index="8" foes="001111000" cont="0" response="000000000"/>
+ </junction>
+ <junction x="84.28" y="164.89" type="internal" id=":339061351_4_0" incLanes=":339061351_1_0 33463249#0_0" intLanes=":339061351_0_0 :339061351_c0_0"/>
+ <connection fromLane="0" to="-465" toLane="0" via=":339061695_0_0" from="-380" state="M" dir="s"/>
+ <connection fromLane="1" to="-465" toLane="1" via=":339061695_0_1" from="-380" state="M" dir="s"/>
+ <connection fromLane="1" to="-465" toLane="2" via=":339061695_0_2" from="-380" state="M" dir="s"/>
+ <connection fromLane="2" to="-465" toLane="3" via=":339061695_0_3" from="-380" state="M" dir="s"/>
+ <connection fromLane="0" to="-436#1" toLane="0" via=":339061699_1_0" from="-436#0" state="M" dir="s"/>
+ <connection fromLane="1" to="-436#1" toLane="1" via=":339061699_1_1" from="-436#0" state="M" dir="s"/>
+ <connection fromLane="2" to="-436#1" toLane="2" via=":339061699_1_2" from="-436#0" state="M" dir="s"/>
+ <connection fromLane="2" to="-461#0" toLane="1" via=":339061421_0_0" from="-447" state="M" dir="s"/>
+ <connection fromLane="3" to="-461#0" toLane="2" via=":339061421_0_1" from="-447" state="M" dir="s"/>
+ <connection fromLane="0" to="-461#1" toLane="0" via=":339060251_1_0" from="-461#0" state="M" dir="s"/>
+ <connection fromLane="1" to="-461#1" toLane="1" via=":339060251_1_1" from="-461#0" state="M" dir="s"/>
+ <connection fromLane="2" to="-461#1" toLane="2" via=":339060251_1_2" from="-461#0" state="M" dir="s"/>
+ <connection fromLane="0" linkIndex="0" tl="sanDiego" to="-436#0" toLane="0" via=":cluster_-427_339061698_0_0" from="-465" state="o" dir="s"/>
+ <connection fromLane="2" linkIndex="1" tl="sanDiego" to="-436#0" toLane="1" via=":cluster_-427_339061698_0_1" from="-465" state="o" dir="s"/>
+ <connection fromLane="3" linkIndex="2" tl="sanDiego" to="-436#0" toLane="2" via=":cluster_-427_339061698_0_2" from="-465" state="o" dir="s"/>
+ <connection fromLane="0" to="-461#1" toLane="1" via=":339060251_0_0" from="30659170" state="m" dir="s"/>
+ <connection fromLane="0" to="30659375" toLane="0" via=":339062566_0_0" from="30659373#0" state="M" dir="s"/>
+ <connection fromLane="0" to="30659373#1" toLane="0" via=":339062566_1_0" from="30659373#0" state="M" dir="s"/>
+ <connection fromLane="0" to="30659170" toLane="0" via=":339060265_0_0" from="30659373#1" state="M" dir="s"/>
+ <connection fromLane="0" to="-436#1" toLane="1" via=":339061699_0_0" from="30659375" state="m" dir="r"/>
+ <connection fromLane="0" to="30659405" toLane="0" via=":339062833_0_0" from="30659403" state="M" dir="r"/>
+ <connection fromLane="1" to="30659405" toLane="1" via=":339062833_0_1" from="30659403" state="M" dir="r"/>
+ <connection fromLane="0" to="33463249#1" toLane="0" via=":339061351_0_0" from="33463249#0" state="M" dir="s"/>
+ <connection fromLane="1" to="30659403" toLane="0" via=":339061351_1_0" from="33463249#0" state="m" dir="r"/>
+ <connection fromLane="1" to="33463249#1" toLane="1" via=":339061351_2_0" from="33463249#0" state="M" dir="s"/>
+ <connection fromLane="2" to="33463249#1" toLane="2" via=":339061351_2_1" from="33463249#0" state="M" dir="s"/>
+ <connection fromLane="0" linkIndex="3" tl="sanDiego" to="-447" toLane="0" via=":cluster_-427_339061698_3_0" from="33463249#1" state="o" dir="s"/>
+ <connection fromLane="1" linkIndex="4" tl="sanDiego" to="-447" toLane="1" via=":cluster_-427_339061698_3_1" from="33463249#1" state="o" dir="s"/>
+ <connection fromLane="1" linkIndex="5" tl="sanDiego" to="-447" toLane="2" via=":cluster_-427_339061698_3_2" from="33463249#1" state="o" dir="s"/>
+ <connection fromLane="2" linkIndex="6" tl="sanDiego" to="-447" toLane="3" via=":cluster_-427_339061698_3_3" from="33463249#1" state="o" dir="s"/>
+ <connection fromLane="0" to="-461#1" toLane="1" from=":339060251_0" state="M" dir="s"/>
+ <connection fromLane="0" to="-461#1" toLane="0" from=":339060251_1" state="M" dir="s"/>
+ <connection fromLane="1" to="-461#1" toLane="1" from=":339060251_1" state="M" dir="s"/>
+ <connection fromLane="2" to="-461#1" toLane="2" from=":339060251_1" state="M" dir="s"/>
+ <connection fromLane="0" to="30659170" toLane="0" from=":339060265_0" state="M" dir="s"/>
+ <connection fromLane="0" to="33463249#1" toLane="0" from=":339061351_0" state="M" dir="s"/>
+ <connection fromLane="0" to="30659403" toLane="0" via=":339061351_4_0" from=":339061351_1" state="m" dir="s"/>
+ <connection fromLane="0" to="30659403" toLane="0" from=":339061351_4" state="M" dir="s"/>
+ <connection fromLane="0" to="33463249#1" toLane="1" from=":339061351_2" state="M" dir="s"/>
+ <connection fromLane="1" to="33463249#1" toLane="2" from=":339061351_2" state="M" dir="s"/>
+ <connection fromLane="0" to="-461#0" toLane="1" from=":339061421_0" state="M" dir="s"/>
+ <connection fromLane="1" to="-461#0" toLane="2" from=":339061421_0" state="M" dir="s"/>
+ <connection fromLane="0" to="-465" toLane="0" from=":339061695_0" state="M" dir="s"/>
+ <connection fromLane="1" to="-465" toLane="1" from=":339061695_0" state="M" dir="s"/>
+ <connection fromLane="2" to="-465" toLane="2" from=":339061695_0" state="M" dir="s"/>
+ <connection fromLane="3" to="-465" toLane="3" from=":339061695_0" state="M" dir="s"/>
+ <connection fromLane="0" to="-436#1" toLane="1" from=":339061699_0" state="M" dir="s"/>
+ <connection fromLane="0" to="-436#1" toLane="0" from=":339061699_1" state="M" dir="s"/>
+ <connection fromLane="1" to="-436#1" toLane="1" from=":339061699_1" state="M" dir="s"/>
+ <connection fromLane="2" to="-436#1" toLane="2" from=":339061699_1" state="M" dir="s"/>
+ <connection fromLane="0" to="30659375" toLane="0" from=":339062566_0" state="M" dir="s"/>
+ <connection fromLane="0" to="30659373#1" toLane="0" from=":339062566_1" state="M" dir="s"/>
+ <connection fromLane="0" to="30659405" toLane="0" from=":339062833_0" state="M" dir="s"/>
+ <connection fromLane="1" to="30659405" toLane="1" from=":339062833_0" state="M" dir="s"/>
+ <connection fromLane="0" to="-436#0" toLane="0" from=":cluster_-427_339061698_0" state="M" dir="s"/>
+ <connection fromLane="1" to="-436#0" toLane="1" from=":cluster_-427_339061698_0" state="M" dir="s"/>
+ <connection fromLane="2" to="-436#0" toLane="2" from=":cluster_-427_339061698_0" state="M" dir="s"/>
+ <connection fromLane="0" to="-447" toLane="0" from=":cluster_-427_339061698_3" state="M" dir="s"/>
+ <connection fromLane="1" to="-447" toLane="1" from=":cluster_-427_339061698_3" state="M" dir="s"/>
+ <connection fromLane="2" to="-447" toLane="2" from=":cluster_-427_339061698_3" state="M" dir="s"/>
+ <connection fromLane="3" to="-447" toLane="3" from=":cluster_-427_339061698_3" state="M" dir="s"/>
+ <connection fromLane="0" to=":339061351_w0" toLane="0" from=":339061351_c0" state="M" dir="s"/>
+ <connection fromLane="0" to="33463249#1" toLane="0" from=":339061351_w0" state="M" dir="s"/>
+ <connection fromLane="0" to=":339061351_c0" toLane="0" from=":339061351_w1" state="M" dir="s"/>
+ <connection fromLane="0" to=":339061351_w1" toLane="0" from="33463249#0" state="M" dir="s"/>
+ <connection fromLane="0" to="-461#0" toLane="0" from=":339061421_w0" state="M" dir="s"/>
+ <connection fromLane="0" to=":339061421_w0" toLane="0" from="-447" state="M" dir="s"/>
+ <connection fromLane="0" to=":cluster_-427_339061698_w0" toLane="0" from=":cluster_-427_339061698_c0" state="M" dir="s"/>
+ <connection fromLane="0" to=":cluster_-427_339061698_w2" toLane="0" from=":cluster_-427_339061698_c1" state="M" dir="s"/>
+ <connection fromLane="0" to="-436#0" toLane="0" from=":cluster_-427_339061698_w0" state="M" dir="s"/>
+ <connection fromLane="0" to=":cluster_-427_339061698_w0" toLane="0" from="-465" state="M" dir="s"/>
+ <connection fromLane="0" linkIndex="10" tl="sanDiego" to=":cluster_-427_339061698_c1" toLane="0" from=":cluster_-427_339061698_w1" state="M" dir="s"/>
+ <connection fromLane="0" to="-447" toLane="0" from=":cluster_-427_339061698_w1" state="M" dir="s"/>
+ <connection fromLane="0" to=":cluster_-427_339061698_w1" toLane="0" from="33463249#1" state="M" dir="s"/>
+ <connection fromLane="0" linkIndex="9" tl="sanDiego" to=":cluster_-427_339061698_c0" toLane="0" from=":cluster_-427_339061698_w2" state="M" dir="s"/>
+</net>
diff --git a/tools/contributed/traci4matlab/examples/inter_palmas/tls_actuated/inter_palmas_actuated.m b/tools/contributed/traci4matlab/examples/inter_palmas/tls_actuated/inter_palmas_actuated.m
new file mode 100644
index 0000000..44c91eb
--- /dev/null
+++ b/tools/contributed/traci4matlab/examples/inter_palmas/tls_actuated/inter_palmas_actuated.m
@@ -0,0 +1,165 @@
+%% TRACI TEST: LAS PALMAS MULTIMODAL SCENARIO
+% This m-file shows how to use the Traci4Matlab's pedestrian component.
+% This example is reproduces from the TraCI-Python pedestrian tutorial,
+% see http://sumo.dlr.de/wiki/Tutorials/TraCIPedCrossing. If you
+% want to test a TraCI command, just uncomment it.
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+clear all
+close all
+clc
+
+import traci.constants
+
+% Get the filename of the example scenario
+[scenarioPath,~,~] = fileparts(which(mfilename));
+% scenarioPath = [scenarioPath '\inter_palmas'];
+cd(scenarioPath);
+
+system(['sumo-gui -c ' './inter_palmas_actuated.sumocfg&']);
+
+SIM_STEPS = [1 3600];
+beginTime = SIM_STEPS(1);
+duration = SIM_STEPS(2);
+endTime = SIM_STEPS(1) + SIM_STEPS(2) - 1;
+
+% minimum green time for the vehicles
+MIN_GREEN_TIME = 20;
+
+% the first phase in tls plan. see 'pedcrossing.tll.xml'
+VEHICLE_GREEN_PHASE = 0;
+
+% the id of the traffic light (there is only one). This is identical to the
+% id of the controlled intersection (by default)
+TLSID = 'sanDiego';
+
+% pedestrian edges at the controlled intersection
+WALKINGAREAS = {':cluster_-427_339061698_w0', ':cluster_-427_339061698_w1'};
+CROSSINGS = {':cluster_-427_339061698_c0', ':cluster_-427_339061698_c1'};
+
+% execute the TraCI control loop"""
+traci.init();
+
+% track the duration for which the green phase of the vehicles has been active
+greenTimeSoFar = 0;
+
+% whether the pedestrian button has been pressed
+activeRequest = 0;
+
+% Initialize the vectors where the emissions will be recorded
+greenPhase = ones(1,duration);
+pedAccum = zeros(1,duration);
+t = 50400:(54000 + duration -1);
+tlsSwitch = 0;
+
+% Variable for managing subscription to a person
+subscribedTo10 = 0;
+pedsInSim = {};
+
+% main loop. do something every simulation step until no more vehicles are
+% loaded or running
+for i = 1: duration
+ traci.simulationStep();
+
+ pedAccum(i) = length(traci.edge.getLastStepPersonIDs(':cluster_-427_339061698_w0'))...
+ + length(traci.edge.getLastStepPersonIDs(':cluster_-427_339061698_w1'));
+ if traci.trafficlights.getPhase(TLSID) ~= VEHICLE_GREEN_PHASE
+ greenPhase(i) = 0;
+ end
+
+
+ % In this block we will test the remaining pedestrian commands
+% pedsInSim = traci.person.getIDList();
+% noPedsInSim = traci.person.getIDCount();
+%
+% if ismember('10', pedsInSim)
+% if ~subscribedTo10
+% traci.person.subscribe('10');
+% traci.person.subscribeContext('10',...
+% constants.CMD_GET_VEHICLE_VARIABLE,20);
+% subscribedTo10 = 1;
+% end
+% angle10 = traci.person.getAngle('10');
+% fprintf('Angle of person 10: %d\n', angle10);
+% color10 = traci.person.getColor('10');
+% fprintf('Color of person 10: [%d %d %d]\n', color10(1),...
+% color10(2), color10(3));
+% lane10 = traci.person.getLanePosition('10');
+% fprintf('Person 10 is in lane position: %d\n', lane10);
+% length10 = traci.person.getLength('10');
+% fprintf('Length of person 10: %d\n', length10);
+% minGap10 = traci.person.getMinGap('10');
+% fprintf('Gap of person 10: %d\n', minGap10);
+% position10 = traci.person.getPosition('10');
+% fprintf('Position of person 10: [%d %d]\n', position10(1),...
+% position10(2));
+% roadID10 = traci.person.getRoadID('10');
+% fprintf('Person 10 is walking on road: %s\n', roadID10);
+% speed10 = traci.person.getSpeed('10');
+% fprintf('Speed of person 10: %d\n', speed10);
+% type10 = traci.person.getTypeID('10');
+% fprintf('Type ID of person 10: %s\n', type10);
+% width10 = traci.person.getWidth('10');
+% fprintf('Width of person 10: %d\n', width10);
+
+ % Using subscriptions
+% subsResults10 = traci.person.getSubscriptionResults('10');
+% roadID10fromSubs = subsResults10(constants.VAR_ROAD_ID);
+% lanePosition10fromSubs = subsResults10(constants.VAR_LANEPOSITION);
+% fprintf('From subscription - Person 10 is walking on road: %s\n',...
+% roadID10fromSubs);
+% fprintf('From subscription - Person 10 is in lane position: %d\n',...
+% lanePosition10fromSubs);
+
+ % Context subscriptions
+% contextSubsResults10 = traci.person.getContextSubscriptionResults('10');
+%
+% end
+
+ % decide wether there is a waiting pedestrian and switch if the green
+ % phase for the vehicles exceeds its minimum duration
+ if ~activeRequest
+ activeRequest = checkWaitingPersons(WALKINGAREAS, CROSSINGS);
+ end
+ if traci.trafficlights.getPhase(TLSID) == VEHICLE_GREEN_PHASE
+ greenTimeSoFar = greenTimeSoFar + 1;
+ if greenTimeSoFar > MIN_GREEN_TIME
+ % check whether someone has pushed the button
+
+ if activeRequest
+ % switch to the next phase
+ traci.trafficlights.setPhase(TLSID, VEHICLE_GREEN_PHASE + 1);
+ % reset state
+ activeRequest = 0;
+ greenTimeSoFar = 0;
+
+ tlsSwitch = tlsSwitch + 1;
+
+ end
+ end
+ end
+end
+
+traci.close()
+
+if duration > 330
+ timePlot = 1:360;
+else
+ timePlot = 1:duration;
+end
+
+plot(greenPhase(timePlot))
+hold on;
+plot(pedAccum(timePlot),'r')
+title('Green signal and pedestrian accumulation');
+xlabel('t')
+ylabel('Number of pedestrians in walking area')
+legend('Green signal for vehicles', 'Number of pedestrians on sidewalks')
+
+
+
+
diff --git a/tools/contributed/traci4matlab/examples/inter_palmas/tls_actuated/inter_palmas_actuated.sumocfg b/tools/contributed/traci4matlab/examples/inter_palmas/tls_actuated/inter_palmas_actuated.sumocfg
new file mode 100644
index 0000000..efbd90c
--- /dev/null
+++ b/tools/contributed/traci4matlab/examples/inter_palmas/tls_actuated/inter_palmas_actuated.sumocfg
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">
+
+ <input>
+ <net-file value="inter_palmas.net.xml"/>
+ <route-files value="../inter_palmas_pedestrians.trip.xml,../inter_palmas_demand.rou.xml,../inter_palmas_buses.rou.xml"/>
+ <additional-files value="../inter_palmas.poly.xml,../inter_palmas_bus_stops.add.xml"/>
+ </input>
+
+ <time>
+ <begin value="50400"/>
+ <end value="54000"/>
+ </time>
+
+ <report>
+ <verbose value="true"/>
+ <no-step-log value="true"/>
+ </report>
+
+ <gui_only>
+ <gui-settings-file value="../viewsettings.xml"/>
+ </gui_only>
+
+ <traci_server>
+ <remote-port value="8873"/>
+ </traci_server>
+
+</configuration>
diff --git a/tools/contributed/traci4matlab/examples/inter_palmas/viewsettings.xml b/tools/contributed/traci4matlab/examples/inter_palmas/viewsettings.xml
new file mode 100644
index 0000000..9734004
--- /dev/null
+++ b/tools/contributed/traci4matlab/examples/inter_palmas/viewsettings.xml
@@ -0,0 +1,488 @@
+<viewsettings>
+ <scheme name="custom_1">
+ <opengl antialiase="0" dither="0"/>
+ <background backgroundColor="51,128,51" showGrid="0" gridXSize="100.00" gridYSize="100.00"/>
+ <edges laneEdgeMode="0" scaleMode="0" laneShowBorders="1" showLinkDecals="1" showRails="1" hideConnectors="1" widthExaggeration="1.00"
+ edgeName_show="0" edgeName_size="50.00" edgeName_color="orange"
+ internalEdgeName_show="0" internalEdgeName_size="40.00" internalEdgeName_color="128,64,0"
+ cwaEdgeName_show="0" cwaEdgeName_size="50.00" cwaEdgeName_color="magenta"
+ streetName_show="0" streetName_size="55.00" streetName_color="yellow">
+ <colorScheme name="uniform">
+ <entry color="black" name="road"/>
+ <entry color="grey" name="sidewalk"/>
+ <entry color="192,66,44" name="bike lane"/>
+ <entry color="0,0,0,0" name="green verge"/>
+ <entry color="150,200,200" name="waterway"/>
+ <entry color="92,92,92" name="no passenger"/>
+ </colorScheme>
+ <colorScheme name="by selection (lane-/streetwise)">
+ <entry color="grey" name="unselected"/>
+ <entry color="0,80,180" name="selected"/>
+ </colorScheme>
+ <colorScheme name="by permission code" interpolated="1">
+ <entry color="240,240,240" threshold="0.00" name="nobody"/>
+ <entry color="10,10,10" threshold="32.00" name="passenger"/>
+ <entry color="166,147,26" threshold="128.00" name="taxi"/>
+ <entry color="40,100,40" threshold="256.00" name="bus"/>
+ <entry color="192,66,44" threshold="524288.00" name="bicycle"/>
+ <entry color="grey" threshold="1048576.00" name="pedestrian"/>
+ <entry color="80,80,80" threshold="1049600.00" name="pedestrian_delivery"/>
+ <entry color="150,200,200" threshold="4194304.00" name="waterway"/>
+ <entry color="64,0,86" threshold="31719423.00" name="disallow_apedestrian_bicycle"/>
+ <entry color="black" threshold="32505855.00" name="disallow_pedestrian"/>
+ <entry color="green" threshold="33554431.00" name="all"/>
+ </colorScheme>
+ <colorScheme name="by allowed speed (lanewise)" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="8.33"/>
+ <entry color="green" threshold="15.28"/>
+ <entry color="cyan" threshold="22.22"/>
+ <entry color="blue" threshold="33.33"/>
+ <entry color="magenta" threshold="41.67"/>
+ </colorScheme>
+ <colorScheme name="by current occupancy (lanewise, brutto)" interpolated="1">
+ <entry color="blue" threshold="0.00"/>
+ <entry color="red" threshold="0.95"/>
+ </colorScheme>
+ <colorScheme name="by current occupancy (lanewise, netto)" interpolated="1">
+ <entry color="blue" threshold="0.00"/>
+ <entry color="red" threshold="0.95"/>
+ </colorScheme>
+ <colorScheme name="by first vehicle waiting time (lanewise)" interpolated="1">
+ <entry color="blue" threshold="0.00"/>
+ <entry color="cyan" threshold="30.00"/>
+ <entry color="green" threshold="100.00"/>
+ <entry color="yellow" threshold="200.00"/>
+ <entry color="red" threshold="300.00"/>
+ </colorScheme>
+ <colorScheme name="by lane number (streetwise)" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="blue" threshold="5.00"/>
+ </colorScheme>
+ <colorScheme name="by CO2 emissions" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.27"/>
+ </colorScheme>
+ <colorScheme name="by CO emissions" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.00"/>
+ </colorScheme>
+ <colorScheme name="by PMx emissions" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.00"/>
+ </colorScheme>
+ <colorScheme name="by NOx emissions" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.00"/>
+ </colorScheme>
+ <colorScheme name="by HC emissions" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.00"/>
+ </colorScheme>
+ <colorScheme name="by fuel consumption" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.07"/>
+ </colorScheme>
+ <colorScheme name="by noise emissions (Harmonoise)" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="100.00"/>
+ </colorScheme>
+ <colorScheme name="by global travel time" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="100.00"/>
+ </colorScheme>
+ <colorScheme name="by global speed percentage" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="50.00"/>
+ <entry color="green" threshold="100.00"/>
+ </colorScheme>
+ <colorScheme name="by given length/geometrical length" interpolated="1">
+ <entry color="black" threshold="0.00"/>
+ <entry color="red" threshold="0.25"/>
+ <entry color="yellow" threshold="0.50"/>
+ <entry color="179,179,179" threshold="1.00"/>
+ <entry color="green" threshold="2.00"/>
+ <entry color="blue" threshold="4.00"/>
+ </colorScheme>
+ <colorScheme name="by angle">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="by loaded weight" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="100.00"/>
+ </colorScheme>
+ <colorScheme name="by priority" interpolated="1">
+ <entry color="red" threshold="-20.00"/>
+ <entry color="yellow" threshold="0.00"/>
+ <entry color="green" threshold="20.00"/>
+ </colorScheme>
+ <colorScheme name="by height at start" interpolated="1">
+ <entry color="blue" threshold="-10.00"/>
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="50.00"/>
+ <entry color="green" threshold="100.00"/>
+ <entry color="magenta" threshold="200.00"/>
+ </colorScheme>
+ <colorScheme name="by height at segment start" interpolated="1">
+ <entry color="blue" threshold="-10.00"/>
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="50.00"/>
+ <entry color="green" threshold="100.00"/>
+ <entry color="magenta" threshold="200.00"/>
+ </colorScheme>
+ <colorScheme name="by inclination" interpolated="1">
+ <entry color="blue" threshold="-0.30"/>
+ <entry color="green" threshold="-0.10"/>
+ <entry color="grey" threshold="0.00"/>
+ <entry color="yellow" threshold="0.10"/>
+ <entry color="red" threshold="0.30"/>
+ </colorScheme>
+ <colorScheme name="by segment inclination" interpolated="1">
+ <entry color="blue" threshold="-0.30"/>
+ <entry color="green" threshold="-0.10"/>
+ <entry color="grey" threshold="0.00"/>
+ <entry color="yellow" threshold="0.10"/>
+ <entry color="red" threshold="0.30"/>
+ </colorScheme>
+ <colorScheme name="by average speed" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="8.33"/>
+ <entry color="green" threshold="15.28"/>
+ <entry color="cyan" threshold="22.22"/>
+ <entry color="blue" threshold="33.33"/>
+ <entry color="magenta" threshold="41.67"/>
+ </colorScheme>
+ <colorScheme name="by average relative speed " interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="0.25"/>
+ <entry color="green" threshold="0.50"/>
+ <entry color="cyan" threshold="0.75"/>
+ <entry color="blue" threshold="1.00"/>
+ <entry color="magenta" threshold="1.25"/>
+ </colorScheme>
+ <scalingScheme name="default">
+ <entry color="1.00" name="uniform"/>
+ </scalingScheme>
+ <scalingScheme name="by selection (lane-/streetwise)">
+ <entry color="0.50" name="unselected"/>
+ <entry color="5.00" name="selected"/>
+ </scalingScheme>
+ <scalingScheme name="by allowed speed (lanewise)" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="41.67"/>
+ </scalingScheme>
+ <scalingScheme name="by current occupancy (lanewise, brutto)" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="0.95"/>
+ </scalingScheme>
+ <scalingScheme name="by current occupancy (lanewise, netto)" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="0.95"/>
+ </scalingScheme>
+ <scalingScheme name="by first vehicle waiting time (lanewise)" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="300.00"/>
+ </scalingScheme>
+ <scalingScheme name="by lane number (streetwise)" interpolated="1">
+ <entry color="1.00" threshold="0.00"/>
+ <entry color="10.00" threshold="5.00"/>
+ </scalingScheme>
+ <scalingScheme name="by CO2 emissions" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="0.27"/>
+ </scalingScheme>
+ <scalingScheme name="by CO emissions" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="0.00"/>
+ </scalingScheme>
+ <scalingScheme name="by PMx emissions" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="0.00"/>
+ </scalingScheme>
+ <scalingScheme name="by NOx emissions" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="0.00"/>
+ </scalingScheme>
+ <scalingScheme name="by HC emissions" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="0.00"/>
+ </scalingScheme>
+ <scalingScheme name="by fuel consumption" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="0.07"/>
+ </scalingScheme>
+ <scalingScheme name="by noise emissions (Harmonoise)" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="100.00"/>
+ </scalingScheme>
+ <scalingScheme name="by global travel time" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="100.00"/>
+ </scalingScheme>
+ <scalingScheme name="by global speed percentage" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="100.00"/>
+ </scalingScheme>
+ <scalingScheme name="by given length/geometrical length" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="10.00"/>
+ </scalingScheme>
+ <scalingScheme name="by loaded weight" interpolated="1">
+ <entry color="-1000.00" threshold="-1000.00"/>
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="1000.00" threshold="1000.00"/>
+ </scalingScheme>
+ <scalingScheme name="by priority" interpolated="1">
+ <entry color="0.50" threshold="-20.00"/>
+ <entry color="1.00" threshold="0.00"/>
+ <entry color="5.00" threshold="20.00"/>
+ </scalingScheme>
+ <scalingScheme name="by average speed" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="10.00" threshold="41.67"/>
+ </scalingScheme>
+ <scalingScheme name="by average relative speed" interpolated="1">
+ <entry color="0.00" threshold="0.00"/>
+ <entry color="0.50" threshold="0.50"/>
+ <entry color="2.00" threshold="1.00"/>
+ <entry color="10.00" threshold="2.00"/>
+ </scalingScheme>
+ </edges>
+ <vehicles vehicleMode="8" vehicleQuality="2" vehicle_minSize="0.00" vehicle_exaggeration="1.00" vehicle_constantSize="0" showBlinker="1"
+ vehicleName_show="0" vehicleName_size="50.00" vehicleName_color="204,153,0">
+ <colorScheme name="given vehicle/type/route color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="uniform">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="given/assigned vehicle color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="given/assigned type color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="given/assigned route color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="depart position as HSV">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="arrival position as HSV">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="direction/distance as HSV">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="by speed" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="8.33"/>
+ <entry color="green" threshold="15.28"/>
+ <entry color="cyan" threshold="22.22"/>
+ <entry color="blue" threshold="33.33"/>
+ <entry color="magenta" threshold="41.67"/>
+ </colorScheme>
+ <colorScheme name="by waiting time" interpolated="1">
+ <entry color="blue" threshold="0.00"/>
+ <entry color="cyan" threshold="30.00"/>
+ <entry color="green" threshold="100.00"/>
+ <entry color="yellow" threshold="200.00"/>
+ <entry color="red" threshold="300.00"/>
+ </colorScheme>
+ <colorScheme name="by time since lane change" interpolated="1">
+ <entry color="189,189,179" threshold="-180.00"/>
+ <entry color="yellow" threshold="-20.00"/>
+ <entry color="red" threshold="-1.00"/>
+ <entry color="179,179,179" threshold="0.00" name="0"/>
+ <entry color="blue" threshold="1.00"/>
+ <entry color="cyan" threshold="20.00"/>
+ <entry color="179,189,189" threshold="180.00"/>
+ </colorScheme>
+ <colorScheme name="by max speed" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="8.33"/>
+ <entry color="green" threshold="15.28"/>
+ <entry color="cyan" threshold="22.22"/>
+ <entry color="blue" threshold="33.33"/>
+ <entry color="magenta" threshold="41.67"/>
+ </colorScheme>
+ <colorScheme name="by CO2 emissions" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="5.00"/>
+ </colorScheme>
+ <colorScheme name="by CO emissions" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.05"/>
+ </colorScheme>
+ <colorScheme name="by PMx emissions" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.01"/>
+ </colorScheme>
+ <colorScheme name="by NOx emissions" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.13"/>
+ </colorScheme>
+ <colorScheme name="by HC emissions" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.02"/>
+ </colorScheme>
+ <colorScheme name="by fuel consumption" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="0.01"/>
+ </colorScheme>
+ <colorScheme name="by noise emissions (Harmonoise)" interpolated="1">
+ <entry color="green" threshold="0.00"/>
+ <entry color="red" threshold="100.00"/>
+ </colorScheme>
+ <colorScheme name="by reroute number" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="1.00"/>
+ <entry color="white" threshold="10.00"/>
+ </colorScheme>
+ <colorScheme name="by selection">
+ <entry color="179,179,179" name="unselected"/>
+ <entry color="0,102,204" name="selected"/>
+ </colorScheme>
+ <colorScheme name="by offset from best lane" interpolated="1">
+ <entry color="red" threshold="-3.00" name="-3"/>
+ <entry color="yellow" threshold="-1.00" name="-1"/>
+ <entry color="179,179,179" threshold="0.00" name="0"/>
+ <entry color="cyan" threshold="1.00" name="1"/>
+ <entry color="blue" threshold="3.00" name="3"/>
+ </colorScheme>
+ <colorScheme name="by acceleration" interpolated="1">
+ <entry color="red" threshold="-4.50"/>
+ <entry color="yellow" threshold="-0.10"/>
+ <entry color="179,179,179" threshold="0.00" name="0"/>
+ <entry color="cyan" threshold="0.10"/>
+ <entry color="blue" threshold="2.60"/>
+ </colorScheme>
+ <colorScheme name="by time gap" interpolated="1">
+ <entry color="179,179,179" threshold="-1.00"/>
+ <entry color="yellow" threshold="0.00" name="0"/>
+ <entry color="cyan" threshold="1.00"/>
+ <entry color="blue" threshold="2.00"/>
+ </colorScheme>
+ <colorScheme name="random">
+ <entry color="yellow"/>
+ </colorScheme>
+ </vehicles>
+ <persons personMode="6" personQuality="2" person_minSize="1.00" person_exaggeration="2.00" person_constantSize="0"
+ personName_show="0" personName_size="50.00" personName_color="0,153,204">
+ <colorScheme name="given person/type color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="uniform">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="given/assigned person color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="given/assigned type color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="by speed" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="0.69"/>
+ <entry color="green" threshold="1.39"/>
+ <entry color="blue" threshold="2.78"/>
+ </colorScheme>
+ <colorScheme name="by mode" interpolated="1">
+ <entry color="yellow" threshold="0.00"/>
+ <entry color="blue" threshold="1.00"/>
+ <entry color="red" threshold="2.00"/>
+ <entry color="green" threshold="3.00"/>
+ </colorScheme>
+ <colorScheme name="by waiting time" interpolated="1">
+ <entry color="blue" threshold="0.00"/>
+ <entry color="cyan" threshold="30.00"/>
+ <entry color="green" threshold="100.00"/>
+ <entry color="yellow" threshold="200.00"/>
+ <entry color="red" threshold="300.00"/>
+ </colorScheme>
+ <colorScheme name="by selection">
+ <entry color="179,179,179" name="unselected"/>
+ <entry color="0,102,204" name="selected"/>
+ </colorScheme>
+ <colorScheme name="by angle">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="random">
+ <entry color="yellow"/>
+ </colorScheme>
+ </persons>
+ <containers containerMode="0" containerQuality="2" container_minSize="1.00" container_exaggeration="2.00" container_constantSize="0"
+ containerName_show="0" containerName_size="50.00" containerName_color="0,153,204">
+ <colorScheme name="given person/type color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="uniform">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="given/assigned person color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="given/assigned type color">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="by speed" interpolated="1">
+ <entry color="red" threshold="0.00"/>
+ <entry color="yellow" threshold="0.69"/>
+ <entry color="green" threshold="1.39"/>
+ <entry color="blue" threshold="2.78"/>
+ </colorScheme>
+ <colorScheme name="by mode" interpolated="1">
+ <entry color="yellow" threshold="0.00"/>
+ <entry color="blue" threshold="1.00"/>
+ <entry color="red" threshold="2.00"/>
+ <entry color="green" threshold="3.00"/>
+ </colorScheme>
+ <colorScheme name="by waiting time" interpolated="1">
+ <entry color="blue" threshold="0.00"/>
+ <entry color="cyan" threshold="30.00"/>
+ <entry color="green" threshold="100.00"/>
+ <entry color="yellow" threshold="200.00"/>
+ <entry color="red" threshold="300.00"/>
+ </colorScheme>
+ <colorScheme name="by selection">
+ <entry color="179,179,179" name="unselected"/>
+ <entry color="0,102,204" name="selected"/>
+ </colorScheme>
+ <colorScheme name="by angle">
+ <entry color="yellow"/>
+ </colorScheme>
+ <colorScheme name="random">
+ <entry color="yellow"/>
+ </colorScheme>
+ </containers>
+ <junctions junctionMode="0" drawLinkTLIndex="0" drawLinkJunctionIndex="0"
+ junctionName_show="0" junctionName_size="50.00" junctionName_color="0,255,128"
+ internalJunctionName_show="0" internalJunctionName_size="50.00" internalJunctionName_color="0,204,128"
+ showLane2Lane="0" drawShape="1">
+ <colorScheme name="uniform">
+ <entry color="black"/>
+ <entry color="150,200,200" name="waterway"/>
+ </colorScheme>
+ <colorScheme name="by selection">
+ <entry color="grey" name="unselected"/>
+ <entry color="0,80,180" name="selected"/>
+ </colorScheme>
+ <colorScheme name="by type">
+ <entry color="green" name="traffic_light"/>
+ <entry color="0,128,0" name="traffic_light_unregulated"/>
+ <entry color="yellow" name="priority"/>
+ <entry color="red" name="priority_stop"/>
+ <entry color="blue" name="right_before_left"/>
+ <entry color="cyan" name="allway_stop"/>
+ <entry color="grey" name="district"/>
+ <entry color="magenta" name="unregulated"/>
+ <entry color="black" name="dead_end"/>
+ <entry color="orange" name="rail_signal"/>
+ </colorScheme>
+ </junctions>
+ <additionals addMode="0" add_minSize="1.00" add_exaggeration="1.00" add_constantSize="0" addName_show="0" addName_size="50.00" addName_color="255,0,128"/>
+ <pois poi_minSize="0.00" poi_exaggeration="1.00" poi_constantSize="0" poiName_show="0" poiName_size="50.00" poiName_color="255,0,128" poiType_show="0" poiType_size="50.00" poiType_color="255,0,128"/>
+ <polys poly_minSize="0.00" poly_exaggeration="1.00" poly_constantSize="0" polyName_show="0" polyName_size="50.00" polyName_color="255,0,128" polyType_show="0" polyType_size="50.00" polyType_color="255,0,128"/>
+ <legend showSizeLegend="1"/>
+ </scheme>
+</viewsettings>
diff --git a/tools/contributed/traci4matlab/examples/traci_test.m b/tools/contributed/traci4matlab/examples/traci_test.m
new file mode 100644
index 0000000..890d77e
--- /dev/null
+++ b/tools/contributed/traci4matlab/examples/traci_test.m
@@ -0,0 +1,19 @@
+%% SUMO TRACI TEST
+% THIS FILE AIMS TO TEST THE TRACI PROTOCOL FOR SUMO.
+
+% Copyright 2013 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+clear all
+close all
+clc
+
+%% MAIN
+% HERE, WE START THE SUMO SIMULATOR AND INITIALIZE IT, ACCORDING TO
+% THE EXAMPLE FOUND IN http://sumo-sim.org/userdoc/Tutorials/TraCI4Traffic_Lights.html
+system(['sumo-gui -c ' getenv('SUMO_HOME') '\docs\tutorial\traci_tls\data\cross.sumocfg&']);
+[traciVersion sumoVersion] = traci.init();
+traci.close();
+fprintf('SUMO version: %s\nTraCI version: %d\n',sumoVersion,traciVersion);
\ No newline at end of file
diff --git a/tools/contributed/traci4matlab/examples/traci_test2.m b/tools/contributed/traci4matlab/examples/traci_test2.m
new file mode 100644
index 0000000..aa83027
--- /dev/null
+++ b/tools/contributed/traci4matlab/examples/traci_test2.m
@@ -0,0 +1,634 @@
+%% TRACI TEST 2
+% This m-file shows how to use Traci4Matlab.
+% This example uses the files of the SUMO traci tutorial, see
+% http://sumo-sim.org/userdoc/Tutorials/TraCI4Traffic_Lights.html. If you
+% want to test a TraCI command, just uncomment it. The commands are
+% organized by SUMO object type, some of them needed to be included in
+% the main loop of the script. Note that you have to generate your own
+% traffic demand, we recommend to obtain it by running tha SUMO TraCI
+% tutorial using Python
+
+% Copyright 2015 Universidad Nacional de Colombia,
+% Politecnico Jaime Isaza Cadavid.
+% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
+% $Id$
+
+clear all
+close all
+clc
+
+%% MAIN
+% The scenario consists of a single intersection controlled by a traffic light
+% whose phases are changed if vehicles pass through an induction loop.
+
+% Initialize SUMO from the system. note that it is initialized in graphical
+% interface mode. You have to set the SUMO_HOME environment variable
+% pointing to your SUMO root directory and modify the windows path to
+% include the %SUMO_HOME%/bin directory.
+
+% Tutorial in docs
+scenarioPath = [getenv('SUMO_HOME') '\docs\tutorial\traci_tls\data\cross.sumocfg'];
+
+% Tutorial in tests
+if ~exist(scenarioPath, 'file')
+ scenarioPath = [getenv('SUMO_HOME') '\tests\complex\tutorial\traci_tls\data\cross.sumocfg'];
+end
+
+try
+ system(['sumo-gui -c ' scenarioPath '&']);
+catch err
+end
+
+
+% To test vehicle commands, we have to check wether the sumo 0.20.0
+% version is installed, because in that version the prefix of the vehicle
+% names has changed.
+sumoHome = getenv('SUMO_HOME');
+if isempty(strfind(sumoHome,'-'))
+ sumoVersion = 'unknown';
+ testVehicle = 'right_10';
+else
+ sumoVersion = str2double(sumoHome(9:12));
+ if sumoVersion < 0.20
+ testVehicle = '10';
+ else
+ testVehicle = 'right_10';
+ end
+end
+
+subscribedToTestVeh = 0;
+
+import traci.constants
+
+% Initialize TraCI
+traci.init();
+
+% Define the traffic light phases in a sumo-readable way
+NSGREEN = 'GrGr';
+NSYELLOW = 'yryr';
+WEGREEN = 'rGrG';
+WEYELLOW = 'ryry';
+
+% Define the traffic light program. The duration of the phases is based on
+% the time required for a car to cross the traffic light from north to
+% south
+PROGRAM = {WEYELLOW,WEYELLOW,WEYELLOW,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSYELLOW,NSYELLOW,WEGREEN};
+
+programPointer = length(PROGRAM);
+% step = 0;
+% steps = zeros(1,800);
+
+
+%% GETIDLIST COMMANDS
+
+
+% areal_dets = traci.areal.getIDList();
+% fprintf('IDs of the areal detectors in the simulation:\n')
+% for i=1:length(areal_dets)
+% fprintf('%s\n',areal_dets{i});
+% end
+% edges = traci.edge.getIDList();
+% fprintf('IDs of the edges in the simulation:\n')
+% for i=1:length(edges)
+% fprintf('%s\n',edges{i});
+% end
+% views = traci.gui.getIDList();
+% fprintf('IDs of the views in the simulacion:\n')
+% for i=1:length(views)
+% fprintf('%s\n',views{i});
+% end
+% inductionloops = traci.inductionloop.getIDList();
+% fprintf('IDs of the induction loops in the simulation:\n')
+% for i=1:length(inductionloops)
+% fprintf('%s\n',inductionloops{i});
+% end
+% junctions = traci.junction.getIDList();
+% fprintf('IDs of the junctions in the simulation:\n')
+% for i=1:length(junctions)
+% fprintf('%s\n',junctions{i});
+% end
+% lanes = traci.lane.getIDList();
+% fprintf('IDs of the lanes in the simulation:\n')
+% for i=1:length(lanes)
+% fprintf('%s\n',lanes{i});
+% end
+% detectors = traci.multientryexit.getIDList();
+% fprintf('IDs of the multi-entry/multi-exit detectors in the simulation:\n')
+% for i=1:length(detectors)
+% fprintf('%s\n',detectors{i});
+% end
+% polygons = traci.polygon.getIDList();
+% fprintf('IDs of te polygons in the simulation:\n')
+% for i=1:length(polygons)
+% fprintf('%s\n',polygons{i});
+% end
+% routes = traci.route.getIDList();
+% fprintf('IDs of the routes in the simulation:\n')
+% for i=1:length(routes)
+% fprintf('%s\n',routes{i});
+% end
+% trafficlights = traci.trafficlights.getIDList();
+% fprintf('IDs of the traffic lights in the simulation:\n')
+% for i=1:length(trafficlights)
+% fprintf('%s\n',trafficlights{i});
+% end
+% vehicletypes = traci.vehicletype.getIDList();
+% fprintf('IDs of the vehicle types in the simulation:\n')
+% for i=1:length(vehicletypes)
+% fprintf('%s\n',vehicletypes{i});
+% end
+
+% THE GETIDLIST COMMAND FOR POIS AND POLYGONS IS TESTED AFTER ADDING THOSE
+% OBJECTS TO THE SIMULATION
+%
+% THE GETIDLIST COMMAND FOR VEHICLES IS PERFOMED ONCE THE VEHICLES ARE
+% LOADED IN THE NETWORK, IN THE MAIN LOOP
+
+
+%% SUBSCIBE COMMANDS: Note that you have to create the required detectors in the cross.det.xml file
+
+% traci.edge.subscribe('1i');
+% traci.gui.subscribe('View #0');
+% traci.inductionloop.subscribe('0');
+% traci.junction.subscribe('0');
+% traci.lane.subscribe('1i_0');
+% traci.multientryexit.subscribe('e3_0_1i');
+% traci.route.subscribe('down');
+% traci.simulation.subscribe();
+% traci.trafficlights.subscribe('0',{constants.TL_RED_YELLOW_GREEN_STATE});
+% tlsCurrentPhaseHandle = traci.trafficlights.getSubscriptionResults('0');
+% tlsCurrentPhase = tlsCurrentPhaseHandle(constants.TL_RED_YELLOW_GREEN_STATE);
+% fprintf('Traffic lights phase: %s\n', tlsCurrentPhase);
+% traci.vehicletype.subscribe('typeWE');
+% maxSpeedWEHandle = traci.vehicletype.getSubscriptionResults('typeWE');
+% maxSpeedWE = maxSpeedWEHandle(constants.VAR_MAXSPEED);
+
+%% POI AND POLYGON COMMANDS
+
+% traci.poi.add('mypoi', 550, 550, [255 255 0 0], '', 1);
+% pois = traci.poi.getIDList();
+% fprintf('IDs of the pois in the simulation:\n')
+% for i=1:length(pois)
+% fprintf('%s\n',pois{i});
+% end
+% traci.poi.subscribe('mypoi');
+% poiposition = traci.poi.getPosition('mypoi')
+% poiColor = traci.poi.getColor('mypoi')
+% traci.poi.setType('mypoi', 'mypoitype');
+% poitype = traci.poi.getType('mypoi')
+% traci.poi.setPosition('mypoi', 550, 580);
+% poiposition = traci.poi.getPosition('mypoi')
+% traci.poi.setColor('mypoi', [255 255 255 0]);
+% % traci.poi.remove('mypoi', 1);
+%
+% traci.polygon.add('mypolygon', {[440,440],[440,450],[450,440],[450,450]},...
+% [0 255 255 0], false, '', 1);
+% traci.polygon.add('my2ndpolygon', {[400,400],[400,420],[430,420],[430,400],[400,400]},...
+% [255 0 0 0], true, '', 1);
+% polygons = traci.polygon.getIDList();
+% fprintf('IDs of the polygons in the simulation:\n')
+% for i=1:length(polygons)
+% fprintf('%s\n',polygons{i});
+% end
+% traci.polygon.subscribe('mypolygon');
+% polygonColor = traci.polygon.getColor('mypolygon')
+% traci.polygon.setType('mypolygon', 'mypolygontype');
+% polygontype = traci.polygon.getType('mypolygon')
+% traci.polygon.setShape('mypolygon', {[400,400],[400,420],[430,420],[430,400],[400,400]});
+% polygonshape = traci.polygon.getShape('mypolygon')
+% traci.polygon.setColor('mypolygon', [255 255 255 0]);
+% traci.polygon.remove('mypolygon', 1);
+
+
+%% CONTEXT SUBSCRIPTIONS
+% It's worth noting that, according to
+% http://sumo-sim.org/userdoc/TraCI/Object_Context_Subscription.html, only
+% the following SUMO objects are supported: inductive loops, lanes,
+% vehicles, points-of-interest, polygons, junctions, edges.
+
+% traci.edge.subscribeContext('4i',constants.CMD_GET_LANE_VARIABLE,50);
+% traci.inductionloop.subscribeContext('0',constants.CMD_GET_LANE_VARIABLE,20);
+% traci.junction.subscribeContext('0',constants.CMD_GET_VEHICLE_VARIABLE,20);
+% traci.lane.subscribeContext('4i_0',constants.CMD_GET_LANE_VARIABLE,50);
+% traci.poi.subscribeContext('mypoi',constants.CMD_GET_VEHICLE_VARIABLE,50);
+% traci.polygon.subscribeContext('mypolygon',constants.CMD_GET_POLYGON_VARIABLE,30);
+% traci.vehicle.subscribeContext(testVehicle,constants.CMD_GET_VEHICLE_VARIABLE,10);
+%
+% WElaneoccupancy = zeros(1,800);
+% NSlaneoccupancy = zeros(1,800);
+
+% getminexectednumber returns the number of expected vehicles to leave the
+% network, which will be the condition to execute the simulation.
+% MinExpectedNumber = traci.simulation.getMinExpectedNumber();
+
+%% GUI SET COMMANDS
+% traci.gui.setZoom('View #0', 1000);
+% traci.gui.setOffset('View #0', 523.7211, 525.9342);
+traci.gui.setSchema('View #0', 'real world');
+% traci.gui.setBoundary('View #0', 386.95, 485.88, 651.64, 589.01);
+
+%% LANE SET COMMANDS
+% traci.lane.setAllowed('1i_0',{'unknown'});
+% traci.lane.setDisallowed('1i_0',{'unknown'});
+% traci.lane.setMaxSpeed('1i_0',5);
+% traci.lane.setLength('1i_0',450);
+
+%% ROUTE COMMANDS
+% traci.route.add('up',{'53o','3i','4o','54i'});
+% routeUpEdges = traci.route.getEdges('up')
+
+%% VEHICLE SET COMMANDS
+% traci.vehicle.setMaxSpeed(testVehicle,5);
+% traci.vehicle.setStop(testVehicle,'1i',50,0,40000);
+% traci.vehicle.changeLane(testVehicle,0,40000);
+% traci.vehicle.slowDown(testVehicle,1,180000);
+% traci.vehicle.changeTarget(testVehicle,'2o');
+% traci.vehicle.setRouteID(testVehicle,'down');
+% traci.vehicle.setRoute(testVehicle,{'51o' '1i' '2o'});
+% traci.vehicle.setAdaptedTraveltime(testVehicle,10000,50000,'1i',15000);
+% % traci.vehicle.setEffort(testVehicle,10000,50000,'1i',0.125); %Not online
+% % traci.vehicle.rerouteTraveltime(testVehicle); %Not online
+% % traci.vehicle.rerouteEffort(testVehicle); %Not online
+% traci.vehicle.setSignals(testVehicle,2);
+% traci.vehicle.setSpeed(testVehicle,5);
+% traci.vehicle.setColor(testVehicle,[0 0 255 0]);
+% traci.vehicle.setLength(testVehicle,10);
+% traci.vehicle.setVehicleClass(testVehicle,'unknown');
+% traci.vehicle.setSpeedFactor(testVehicle,0.6);
+% % traci.vehicle.setSpeedDeviation(testVehicle,5); %Not online
+% traci.vehicle.setEmissionClass(testVehicle,'unknown');
+% traci.vehicle.setWidth(testVehicle,3);
+% traci.vehicle.setMinGap(testVehicle,10);
+% traci.vehicle.setShapeClass(testVehicle,'');
+% traci.vehicle.setAccel(testVehicle,2);
+% traci.vehicle.setDecel(testVehicle,2);
+% traci.vehicle.setImperfection(testVehicle,1);
+% traci.vehicle.setTau(testVehicle,1);
+% traci.vehicle.add('myvehicle','down');
+% traci.vehicle.remove('myvehicle');
+% traci.gui.trackVehicle('View #0', 'myvehicle');
+% traci.vehicle.moveToVTD('right_10','2o',0,608,509);
+
+%% VEHICLE TYPE COMMANDS
+
+% typeLength = traci.vehicletype.getLength('typeWE')
+% typeMaxSpeed = traci.vehicletype.getMaxSpeed('typeWE')
+% typeSpeedFactor = traci.vehicletype.getSpeedFactor('typeWE')
+% typeSpeedDeviation = traci.vehicletype.getSpeedDeviation('typeWE')
+% typeAccel = traci.vehicletype.getAccel('typeWE')
+% typeDecel = traci.vehicletype.getDecel('typeWE')
+% typeImperfection = traci.vehicletype.getImperfection('typeWE')
+% typeTau = traci.vehicletype.getTau('typeWE')
+% typeClass = traci.vehicletype.getVehicleClass('typeWE')
+% typeEmissionClass = traci.vehicletype.getEmissionClass('typeWE')
+% typeShapeClass = traci.vehicletype.getShapeClass('typeWE')
+% typeMinGap = traci.vehicletype.getShapeClass('typeWE')
+% typeWidth = traci.vehicletype.getWidth('typeWE')
+% typeColor = traci.vehicletype.getColor('typeWE')
+%
+% traci.vehicletype.setLength('typeWE',8);
+% traci.vehicletype.setMaxSpeed('typeWE',10);
+% traci.vehicletype.setVehicleClass('typeWE','passenger');
+% traci.vehicletype.setSpeedFactor('typeWE',0.8);
+% traci.vehicletype.setSpeedDeviation('typeWE',0.2);
+% traci.vehicletype.setEmissionClass('typeWE','unknown');
+% traci.vehicletype.setWidth('typeWE',1);
+% traci.vehicletype.setMinGap('typeWE',1);
+% traci.vehicletype.setShapeClass('typeWE','');
+% traci.vehicletype.setAccel('typeWE',5);
+% traci.vehicletype.setDecel('typeWE',3);
+% traci.vehicletype.setImperfection('typeWE',0.6);
+% traci.vehicletype.setTau('typeWE',0.1);
+% traci.vehicletype.setColor('typeWE',[255 255 255 0]);
+
+step = 1;
+% for i=1:length(steps)
+while traci.simulation.getMinExpectedNumber()>0
+ % Here, we demonstrate how to use the simulationStep command using an
+ % argument. In this case, the simulation is performed each 5 seconds,
+ % note the behavior when you increase the delay in the gui
+% traci.simulationStep(5000*step);
+% pause(1);
+ traci.simulationStep();
+ programPointer = min(programPointer+1, length(PROGRAM));
+
+ % Get the number of vehicles that passed through the induction loop in
+ % the last simulation step
+ numPriorityVehicles = traci.inductionloop.getLastStepVehicleNumber('0');
+
+ % SHOW THE VEHICLES IDS INSIDE THE NETWORK
+ vehicles = traci.vehicle.getIDList();
+ % fprintf('IDs of the vehicles in the simulation\n')
+ % for j=1:length(vehicles)
+ % fprintf('%s\n',vehicles{j});
+ % end
+
+ % Subscribe to the vehicle with the id contained in the variable "testVehicle"
+ % when it is loaded in the network
+ if ismember(testVehicle,vehicles)
+ if ~subscribedToTestVeh
+ traci.vehicle.subscribe(testVehicle);
+ subscribedToTestVeh = 1;
+ end
+ testVehicleHandle = traci.vehicle.getSubscriptionResults(testVehicle);
+ testVehicleHandle = {testVehicleHandle(constants.VAR_ROAD_ID) testVehicleHandle(constants.VAR_LANEPOSITION)};
+ end
+
+ %% GETSUBSCRIPTIONRESULTS COMMANDS: Note that you have to create the required detectors in the cross.det.xml file
+
+% occupancyEdge1Handle = traci.edge.getSubscriptionResults('1i');
+% WElaneoccupancy(i) = occupancyEdge1Handle(constants.LAST_STEP_VEHICLE_NUMBER);
+ % offsethandle = traci.gui.getSubscriptionResults('View #0');
+ % offset = offsethandle(traci.constants.VAR_VIEW_OFFSET);
+ % indloopSubsResults = traci.inductionloop.getSubscriptionResults('0');
+ % no = indloopSubsResults(constants.LAST_STEP_VEHICLE_NUMBER);
+ % junctionPositionHandle = traci.junction.getSubscriptionResults('0');
+ % junctionPosition = junctionPositionHandle(constants.VAR_POSITION);
+% occupancyLane1Handle = traci.lane.getSubscriptionResults('1i_0');
+% WElaneoccupancy(i) = occupancyLane1Handle(constants.LAST_STEP_VEHICLE_NUMBER);
+ % occupancyLane1Handle = traci.multientryexit.getSubscriptionResults('e3_0_1i');
+% WElaneoccupancy(i) = occupancyLane1Handle(constants.LAST_STEP_VEHICLE_NUMBER);
+ % poiPositionHandle = traci.poi.getSubscriptionResults('mypoi');
+ % poiPosition = poiPositionHandle(constants.VAR_POSITION);
+ % polygonPositionHandle = traci.polygon.getSubscriptionResults('mypolygon');
+ % polygonPosition = polygonPositionHandle(constants.VAR_SHAPE);
+ % routeListHandle = traci.route.getSubscriptionResults('down');
+ % routeList = routeListHandle(constants.ID_LIST);
+ % departedVehicleIDsHandle = traci.simulation.getSubscriptionResults();
+ % departedVehicleIDs = departedVehicleIDsHandle(constants.VAR_DEPARTED_VEHICLES_IDS);
+
+ %% GET CONTEXT SUBSCRIPTION RESULTS COMMANDS
+
+ % edge4i0ContextResults = traci.edge.getContextSubscriptionResults('4i');
+ % occupancy4i0Handle1 = edge4i0ContextResults('4i_0');
+ % occupancy4i0 = occupancy4i0Handle1(constants.LAST_STEP_VEHICLE_NUMBER);
+ % fprintf('%d\n',occupancy4i0);
+
+ % loop0ContextResults = traci.inductionloop.getContextSubscriptionResults('0');
+ % priorityVehiclesPassedHandle = loop0ContextResults('4i_0');
+ % priorityVehiclesPassed = priorityVehiclesPassedHandle(constants.LAST_STEP_VEHICLE_NUMBER);
+ % fprintf('%d\n',priorityVehiclesPassed);
+
+ % junctionContextResults = traci.junction.getContextSubscriptionResults('0');
+
+ % laneContextSubscriptionResults = traci.lane.getContextSubscriptionResults('4i_0');
+ % poiContextSubscriptionResults = traci.poi.getContextSubscriptionResults('mypoi');
+ % polygonContextSubscriptionResults = traci.polygon.getContextSubscriptionResults('mypolygon');
+ % vehicleContextSubscriptionResults = traci.vehicle.getContextSubscriptionResults(testVehicle);
+
+ %% AREAL DETECTOR COMMANDS: Note that you have to create the detector in the cross.det.xml file
+ % arealDetectorIDCount = traci.areal.getIDCount();
+ % fprintf('Number of areal detectors in the simulation: %d\n',arealDetectorIDCount);
+
+ % JamLengthVehicle = traci.areal.getJamLengthVehicle('0');
+ % fprintf('Jam lenght in vehicles in the areal detector 0: %d\n',JamLengthVehicle);
+
+ % JamLengthMeters = traci.areal.getJamLengthMeters('0');
+ % fprintf('Jam lenght in meters in the areal detector 0: %d\n',JamLengthMeters);
+
+ % vehicleMeanSpeedAreal0 = traci.areal.getLastStepMeanSpeed('0');
+ % fprintf('Average speed in the areal detector 0: %d\n',vehicleMeanSpeedAreal0);
+
+ % vehicleOccupancyAreal0 = traci.areal.getLastStepOccupancy('0');
+ % fprintf('Occupancy in the areal detector 0 1i: %d\n',vehicleOccupancyAreal0);
+
+
+ %% EDGE COMMANDS
+
+ % edgeIDCount = traci.edge.getIDCount();
+ % fprintf('Number of edges in the simulation: %d\n',edgeIDCount);
+
+ % travelTime = traci.edge.getAdaptedTraveltime('1i',10);
+ % fprintf('Travel time in 10 seconfs in the edge 1i: %d\n',travelTime);
+
+ % effort = traci.edge.getEffort('1i',10);
+ % fprintf('Travel effort in 10 seconds in the edge 1i: %d\n',effort);
+
+ % CO2EmissionEdge1i = traci.edge.getCO2Emission('1i');
+ % fprintf('CO2 emission in the edge 1i: %d\n',CO2EmissionEdge1i);
+
+ % COEmissionEdge1i = traci.edge.getCOEmission('1i');
+ % fprintf('CO emission in the edge 1i: %d\n',COEmissionEdge1i);
+
+ % HCEmissionEdge1i = traci.edge.getHCEmission('1i');
+ % fprintf('HC emission in the edge 1i: %d\n',HCEmissionEdge1i);
+
+ % PMxEmissionEdge1i = traci.edge.getPmxEmission('1i');
+ % fprintf('PMx emission in the edge 1i: %d\n',PMxEmissionEdge1i);
+
+ % NOxEmissionEdge1i = traci.edge.getNOxEmission('1i');
+ % fprintf('NOx emission in the edge 1i: %d\n',NOxEmissionEdge1i);
+
+ % fuelConsumptionEdge1i = traci.edge.getFuelConsumption('1i');
+ % fprintf('Fuel consumption in the edge 1i: %d\n',fuelConsumptionEdge1i);
+
+ % noiseEmissionEdge1i = traci.edge.getNoiseEmission('1i');
+ % fprintf('Noise emission in the edge 1i: %d\n',noiseEmissionEdge1i);
+
+ % vehicleMeanSpeedEdge1i = traci.edge.getLastStepMeanSpeed('1i');
+ % fprintf('Average speed in the edge 1i: %d\n',vehicleMeanSpeedEdge1i);
+
+ % vehicleOccupancyEdge1i = traci.edge.getLastStepOccupancy('1i');
+ % fprintf('Occupancy in the edge 1i: %d\n',vehicleOccupancyEdge1i);
+
+ % vehicleMeanLengthEdge1i = traci.edge.getLastStepLength('1i');
+ % fprintf('Average length in the edge 1i: %d\n',vehicleMeanLengthEdge1i);
+
+ % vehicleTravelTimeEdge1i = traci.edge.getTraveltime('1i');
+ % fprintf('Average time of the vehicles in the edge 1i: %d\n',vehicleTravelTimeEdge1i);
+
+ % vehicleHaltingEdge1i = traci.edge.getLastStepHaltingNumber('1i');
+ % fprintf('Stopped vehicles in the edge 1i: %d\n',vehicleHaltingEdge1i);
+
+ % vehicleIDsEdge1i = traci.edge.getLastStepVehicleIDs('1i');
+ % fprintf('IDs of the vehicles in the edge 1i: \n');
+ % disp(vehicleIDsEdge1i)
+
+ % traci.edge.adaptTraveltime('1i',15);
+
+ % traci.edge.setEffort('1i',1.343);
+
+ % traci.edge.setMaxSpeed('1i',5);
+
+ %% GUI COMMANDS
+ vehiclesInNetwork = traci.vehicle.getIDList();
+% if ~isempty(find(ismember(vehiclesInNetwork,testVehicle), 1))
+% traci.gui.trackVehicle('View #0', testVehicle);
+% end
+
+ % guizoom = traci.gui.getZoom()
+ % offset = traci.gui.getOffset()
+ % schema = traci.gui.getSchema()
+ % boundary = traci.gui.getBoundary()
+
+ %% INDUCTION LOOP COMMANDS
+
+ % loop0position = traci.inductionloop.getPosition('0');
+ % loop0LaneID = traci.inductionloop.getLaneID('0')
+ % loop0MeanSpeed = traci.inductionloop.getLastStepMeanSpeed('0')
+ % loop0VehicleIDs = traci.inductionloop.getLastStepVehicleIDs('0')
+ % loop0Occupancy = traci.inductionloop.getLastStepOccupancy('0')
+ % loop0MeanLength = traci.inductionloop.getLastStepMeanLength('0')
+ % loop0TimeSinceDetection = traci.inductionloop.getTimeSinceDetection('0')
+
+ %% JUNCTION COMMANDS
+
+ % junctionPosition = traci.junction.getPosition('0');
+
+ %% LANE GET COMMANDS
+
+ % lane1i0Length = traci.lane.getLength('1i_0');
+ % lane1i0MaxSpeed = traci.lane.getMaxSpeed('1i_0');
+ % lane1i0Width = traci.lane.getWidth('1i_0');
+ % lane1i0AllowedVehicles = traci.lane.getAllowed('1i_0');
+ % lane1i0DisallowedVehicles = traci.lane.getDisallowed('1i_0');
+ % lane1i0LinkNumber = traci.lane.getLinkNumber('1i_0');
+ % lane1i0Links = traci.lane.getLinks('1i_0');
+ % lane1i0Shape = traci.lane.getShape('1i_0');
+ % lane1i0EdgeID = traci.lane.getEdgeID('1i_0');
+ % lane1i0CO2Emmision = traci.lane.getCO2Emission('1i_0')
+ % lane1i0COEmmision = traci.lane.getCOEmission('1i_0')
+ % lane1i0HCEmmision = traci.lane.getHCEmission('1i_0')
+ % lane1i0PMxEmmision = traci.lane.getPMxEmission('1i_0')
+ % lane1i0NOxEmmision = traci.lane.getNOxEmission('1i_0')
+ % lane1i0FuelConsumption = traci.lane.getFuelConsumption('1i_0')
+ % lane1i0NoiseEmission = traci.lane.getNoiseEmission('1i_0')
+ % lane1i0MeanSpeed = traci.lane.getLastStepMeanSpeed('1i_0')
+ % lane1i0Occupancy = traci.lane.getLastStepOccupancy('1i_0')
+ % lane1i0MeanVehicleLength = traci.lane.getLastStepLength('1i_0')
+ % lane1i0TravelTime = traci.lane.getTraveltime('1i_0')
+ % lane1i0HalringNumber = traci.lane.getLastStepHaltingNumber('1i_0')
+ % lane1i0VehicleIDs = traci.lane.getLastStepVehicleIDs('1i_0')
+
+ %% MULTIENTRY=EXIT COMMANDS: Note that you have to create the detector in the cross.det.xml file
+
+ % muiVehicleNumber = traci.multientryexit.getLastStepVehicleNumber('e3_0_1i')
+ % muiMeanSpeed = traci.multientryexit.getLastStepMeanSpeed('e3_0_1i')
+ % muiVehIDs = traci.multientryexit.getLastStepVehicleIDs('e3_0_1i')
+ % muiHaltingVehicles = traci.multientryexit.getLastStepHaltingNumber('e3_0_1i')
+
+ %% SIMULATION COMMANDS
+
+ % clc
+ % currentTime = traci.simulation.getCurrentTime()
+ % loadedNumber = traci.simulation.getLoadedNumber()
+ % loadedIDList = traci.simulation.getLoadedIDList();
+ % departedNumber = traci.simulation.getDepartedNumber()
+ % departedIDList = traci.simulation.getDepartedIDList();
+ % if ismember(testVehicle,departedIDList)
+ % traci.vehicle.moveTo(testVehicle,'1i_0',20);
+ % end
+ % arrivedNumber = traci.simulation.getArrivedNumber()
+ % arrivedIDList = traci.simulation.getArrivedIDList()
+ % startingTeleportNumber = traci.simulation.getStartingTeleportNumber()
+ % startingTeleportIDList = traci.simulation.getStartingTeleportIDList()
+ % endingTeleportNumber = traci.simulation.getEndingTeleportNumber()
+ % deltaT = traci.simulation.getDeltaT()
+ % netBoundary = traci.simulation.getNetBoundary()
+ % [x y] = traci.simulation.convert2D('1i',10)
+ % [roadID pos laneID] = traci.simulation.convertRoad(20, 508.35)
+ % [longitude latitude] = traci.simulation.convertGeo(20, 508.35)
+ % distance2D = traci.simulation.getDistance2D(20, 508.35, 30, 508.35)
+ % distanceRoad = traci.simulation.getDistanceRoad('1i', 10, '1i', 20)
+
+ %% TRAFFIC LIGHTS COMMANDS
+
+ % tlsRYGState = traci.trafficlights.getRedYellowGreenState('0')
+ % tlsRYGDefinition = traci.trafficlights.getCompleteRedYellowGreenDefinition('0')
+ % tlscontrolledLanes = traci.trafficlights.getControlledLanes('0')
+ % tlscontrolledLinks = traci.trafficlights.getControlledLinks('0')
+ % tlsProgram = traci.trafficlights.getProgram('0')
+ % tlsPhase = traci.trafficlights.getPhase('0')
+ % traci.trafficlights.setPhase('0',0);
+ % traci.trafficlights.setProgram('0','0');
+ % traci.trafficlights.setPhaseDuration('0',5);
+% myRYGDefinition = traci.trafficlights.Logic('0',0,0,0,...
+% {traci.trafficlights.Phase(31000,31000,31000,'GrGr'),...
+% traci.trafficlights.Phase(31000,31000,31000,'rGrG'),...
+% traci.trafficlights.Phase(6000,6000,6000,'ryry')});
+ % traci.trafficlights.setCompleteRedYellowGreenDefinition('0',tlsRYGDefinition{1});
+ % tlsRYGDefinition = traci.trafficlights.getCompleteRedYellowGreenDefinition('0');
+
+ %% VEHICLE GET COMMANDS
+
+ % vehSpeed = traci.vehicle.getSpeed(testVehicle)
+ % vehSpeedWOTraci = traci.vehicle.getSpeedWithoutTraCI(testVehicle)
+ % vehPosition = traci.vehicle.getPosition(testVehicle)
+ % vehAngle = traci.vehicle.getAngle(testVehicle)
+ % vehRoadID = traci.vehicle.getRoadID(testVehicle)
+ % vehLaneID = traci.vehicle.getLaneID(testVehicle)
+ % vehLaneIndex = traci.vehicle.getLaneIndex(testVehicle)
+ % vehTypeID = traci.vehicle.getTypeID(testVehicle)
+ % vehRouteID = traci.vehicle.getRouteID(testVehicle)
+ % vehRoute = traci.vehicle.getRoute(testVehicle)
+ % vehLanePos = traci.vehicle.getLanePosition(testVehicle)
+ % vehColor = traci.vehicle.getColor(testVehicle)
+ % vehCO2Emission = traci.vehicle.getCO2Emission(testVehicle)
+ % vehCOEmission = traci.vehicle.getCOEmission(testVehicle)
+ % vehPmxEmission = traci.vehicle.getPMxEmission(testVehicle)
+ % vehNOxEmission = traci.vehicle.getNOxEmission(testVehicle)
+ % vehFuelConsumption = traci.vehicle.getFuelConsumption(testVehicle)
+ % vehAdaptedTraveltime = traci.vehicle.getAdaptedTraveltime(testVehicle,10,'1i')
+ % vehEffort = traci.vehicle.getEffort(testVehicle,10,'1i')
+ % vehValidRoute = traci.vehicle.isRouteValid(testVehicle)
+ % vehSignals = traci.vehicle.getSignals(testVehicle)
+ % vehMaxSpeed = traci.vehicle.getMaxSpeed(testVehicle)
+ % vehClass = traci.vehicle.getVehicleClass(testVehicle)
+ % vehSpeedFactor = traci.vehicle.getSpeedFactor(testVehicle)
+ % vehSpeedDeviation = traci.vehicle.getSpeedDeviation(testVehicle)
+ % vehEmissionClass = traci.vehicle.getEmissionClass(testVehicle)
+ % vehWidth = traci.vehicle.getWidth(testVehicle)
+ % vehMinGap = traci.vehicle.getMinGap(testVehicle)
+ % vehShapeClass = traci.vehicle.getShapeClass(testVehicle)
+ % vehAccel = traci.vehicle.getAccel(testVehicle)
+ % vehDecel = traci.vehicle.getDecel(testVehicle)
+ % vehImperfection = traci.vehicle.getImperfection(testVehicle)
+ % vehTau = traci.vehicle.getTau(testVehicle)
+% if ismember(testVehicle,vehicles)
+% vehLeader = traci.vehicle.getLeader(testVehicle, 1)
+% end
+ % vehBestLanes = traci.vehicle.getBestLanes(testVehicle)
+ % vehDrivingDistance = traci.vehicle.getDrivingDistance(testVehicle,'2o',30)
+ % vehDrivingDistance2D = traci.vehicle.getDrivingDistance2D(testVehicle,620,510)
+
+
+ % Change the phase of the traffic light if a vehicle passed through the
+ % induction loop
+ if numPriorityVehicles > 0
+ % traci.gui.screenshot('View #0','passedvehicle.bmp')
+ % loop0VehicleData = traci.inductionloop.getVehicleData('0')
+ if programPointer == length(PROGRAM)
+ programPointer = 1;
+ elseif ~strcmp(PROGRAM(programPointer), WEYELLOW)
+ programPointer = 4;
+ end
+ end
+ traci.trafficlights.setRedYellowGreenState('0', PROGRAM{programPointer});
+
+ % AN ADDITIONAL EVIDENCE OF THE TRAFFIC LIGHTS SUBSCRIPTION, DON'T
+ % FORGET TO SET THE SUBSCRIPTION BEFORE EXECUTING IT.
+ % if no > 0
+ % tlsCurrentPhaseHandle = traci.trafficlights.getSubscriptionResults('0');
+ % tlsCurrentPhase = tlsCurrentPhaseHandle(constants.TL_RED_YELLOW_GREEN_STATE);
+ % fprintf('The traffic lights'' phase changed to: %s\n', tlsCurrentPhase)
+ % end
+
+ % AN ADDITIONAL EVIDENCE OF THE LANE SUBSCRIPTIONS, ENABLE THE PLOTTING
+ % FUNCTIONS BELOW TO VISUALIZE IT.
+% WElaneoccupancy(i) = traci.lane.getLastStepVehicleNumber('1i_0')+...
+% traci.lane.getLastStepVehicleNumber('2i_0');
+% NSlaneoccupancy(i) = traci.lane.getLastStepVehicleNumber('3i_0')+...
+% traci.lane.getLastStepVehicleNumber('4i_0');
+% %
+% steps(i) = i;
+% MinExpectedNumber = traci.simulation.getMinExpectedNumber();
+ step = step + 1;
+end
+traci.close()
+% plot(steps, WElaneoccupancy)
+% hold;
+% plot(steps, NSlaneoccupancy, 'r')
+% legend('WE lane occupancy', 'NS lane occupancy')
+% title('Lane occupancy vs time')
+% xlabel('t (seconds)')
+% ylabel('number of vehicles')
\ No newline at end of file
diff --git a/tools/contributed/TraCI4Matlab/license.txt b/tools/contributed/traci4matlab/license.txt
similarity index 100%
rename from tools/contributed/TraCI4Matlab/license.txt
rename to tools/contributed/traci4matlab/license.txt
diff --git a/tools/contributed/TraCI4Matlab/src/co/edu/unalmed/gaunal/traci4matlab/utils/DataReader.java b/tools/contributed/traci4matlab/src/co/edu/unalmed/gaunal/traci4matlab/utils/DataReader.java
similarity index 100%
rename from tools/contributed/TraCI4Matlab/src/co/edu/unalmed/gaunal/traci4matlab/utils/DataReader.java
rename to tools/contributed/traci4matlab/src/co/edu/unalmed/gaunal/traci4matlab/utils/DataReader.java
diff --git a/tools/district/edgesInDistricts.py b/tools/district/edgesInDistricts.py
deleted file mode 100755
index 29ab98c..0000000
--- a/tools/district/edgesInDistricts.py
+++ /dev/null
@@ -1,235 +0,0 @@
-#!/usr/bin/env python
-"""
- at file edgesInDistricts.py
- at author Daniel Krajzewicz
- at author Michael Behrisch
- at author Jakob Erdmann
- at date 2007-07-26
- at version $Id: edgesInDistricts.py 18096 2015-03-17 09:50:59Z behrisch $
-
-Parsing a number of networks and taz (district) files with shapes
-this script writes a taz file with all the edges which are inside
-the relevant taz.
-
-SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
-Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors
-
-This file is part of SUMO.
-SUMO is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3 of the License, or
-(at your option) any later version.
-"""
-import sys
-import math
-from xml.sax import parse, handler
-from optparse import OptionParser
-
-
-def parseShape(shape):
- poses = shape.split()
- ret = []
- for pos in poses:
- xy = pos.split(",")
- ret.append((float(xy[0]), float(xy[1])))
- return ret
-
-
-def getBoundingBox(shape):
- min = [1e400, 1e400]
- max = [-1e400, -1e400]
- for pos in shape:
- for idx in [0, 1]:
- if pos[idx] > max[idx]:
- max[idx] = pos[idx]
- if pos[idx] < min[idx]:
- min[idx] = pos[idx]
- return min, max
-
-
-def angle2D(p1, p2):
- theta1 = math.atan2(p1[1], p1[0])
- theta2 = math.atan2(p2[1], p2[0])
- dtheta = theta2 - theta1
- while dtheta > math.pi:
- dtheta -= 2.0 * math.pi
- while dtheta < -math.pi:
- dtheta += 2.0 * math.pi
- return dtheta
-
-
-def isWithin(pos, shape):
- angle = 0.
- for i in range(0, len(shape) - 1):
- p1 = ((shape[i][0] - pos[0]), (shape[i][1] - pos[1]))
- p2 = ((shape[i + 1][0] - pos[0]), (shape[i + 1][1] - pos[1]))
- angle = angle + angle2D(p1, p2)
- i = len(shape) - 1
- p1 = ((shape[i][0] - pos[0]), (shape[i][1] - pos[1]))
- p2 = ((shape[0][0] - pos[0]), (shape[0][1] - pos[1]))
- angle = angle + angle2D(p1, p2)
- return math.fabs(angle) >= math.pi
-
-
-# written into the net. All members are "private".
-class NetDistrictEdgeHandler(handler.ContentHandler):
-
- def __init__(self):
- self._haveDistrict = False
- self._parsingDistrictShape = False
- self._parsingLaneShape = False
- self._currentID = ""
- self._shape = ""
- self._districtShapes = {}
- self._districtBoxes = {}
- self._edgeShapes = {}
- self._districtEdges = {}
- self._edgeDistricts = {}
- self._invalidatedEdges = []
- self._edgeSpeeds = {}
- self._edgeLengths = {}
- self._numLanes = {}
-
- def startElement(self, name, attrs):
- if name == 'taz' or name == 'poly':
- self._haveDistrict = True
- self._currentID = attrs['id']
- self._districtEdges[self._currentID] = []
- if attrs.has_key('shape'):
- self._shape = attrs['shape']
- elif name == 'shape' and self._haveDistrict:
- self._parsingDistrictShape = True
- elif name == 'edge':
- self._currentID = attrs['id']
- self._edgeDistricts[self._currentID] = []
- elif name == 'lane':
- self._parsingLaneShape = True
- if self._currentID not in self._numLanes:
- self._edgeSpeeds[self._currentID] = float(attrs['speed'])
- self._edgeLengths[self._currentID] = float(attrs['length'])
- self._numLanes[self._currentID] = 1
- if attrs.has_key('shape'):
- self._shape = attrs['shape']
- else:
- self._numLanes[self._currentID] += 1
-
- def characters(self, content):
- if self._parsingDistrictShape:
- self._shape += content
- if self._parsingLaneShape:
- self._shape += content
-
- def endElement(self, name):
- if name == 'taz' or name == 'poly':
- self._haveDistrict = False
- if self._shape != '':
- self._districtShapes[self._currentID] = parseShape(self._shape)
- self._districtBoxes[self._currentID] = getBoundingBox(
- self._districtShapes[self._currentID])
- self._shape = ""
- elif name == 'shape' and self._haveDistrict:
- self._parsingDistrictShape = False
- elif name == 'lane':
- self._parsingLaneShape = False
- if self._shape != '':
- self._edgeShapes[self._currentID] = parseShape(self._shape)
- self._shape = ""
-
- def computeWithin(self, complete, maxspeed, assignFrom, verbose):
- for idx, (edge, shape) in enumerate(self._edgeShapes.iteritems()):
- if self._edgeSpeeds[edge] < maxspeed:
- if assignFrom:
- min = max = shape[0]
- else:
- min, max = getBoundingBox(shape)
- for district, dshape in self._districtShapes.iteritems():
- dmin, dmax = self._districtBoxes[district]
- if dmin[0] <= max[0] and dmin[1] <= max[1] and dmax[0] >= min[0] and dmax[1] >= min[1]:
- if assignFrom:
- if isWithin(shape[0], dshape):
- self._districtEdges[district].append(edge)
- self._edgeDistricts[edge].append(district)
- break
- else:
- for pos in shape:
- if isWithin(pos, dshape):
- self._districtEdges[district].append(edge)
- self._edgeDistricts[edge].append(district)
- break
- if verbose and idx % 100 == 0:
- sys.stdout.write("%s/%s\r" % (idx, len(self._edgeShapes)))
- if complete:
- for edge, districts in self._edgeDistricts.iteritems():
- if len(districts) > 1:
- self._invalidatedEdges.append(edge)
-
- def getEdgeDistrictMap(self):
- result = {}
- for edge, districts in self._edgeDistricts.iteritems():
- if len(districts) == 1:
- result[edge] = districts[0]
- return result
-
- def writeResults(self, output, weighted):
- fd = open(output, "w")
- fd.write("<tazs>\n")
- for district, edges in self._districtEdges.iteritems():
- validEdgeCount = 0
- for edge in edges:
- if edge not in self._invalidatedEdges:
- validEdgeCount += 1
- if validEdgeCount == 0:
- print "District '" + district + "' has no edges!"
- else:
- fd.write(" <taz id=\"" + district + "\">\n")
- for edge in edges:
- if edge not in self._invalidatedEdges:
- weight = 1.
- if weighted:
- weight = self._edgeSpeeds[
- edge] * self._edgeLengths[edge]
- fd.write(
- " <tazSource id=\"" + edge + "\" weight=\"" + str(weight) + "\"/>\n")
- fd.write(
- " <tazSink id=\"" + edge + "\" weight=\"" + str(weight) + "\"/>\n")
- fd.write(" </taz>\n")
- fd.write("</tazs>\n")
- fd.close()
-
- def getTotalLength(self, edge):
- return self._edgeLengths[edge] * self._numLanes[edge]
-
-
-if __name__ == "__main__":
- optParser = OptionParser()
- optParser.add_option("-v", "--verbose", action="store_true",
- default=False, help="tell me what you are doing")
- optParser.add_option("-c", "--complete", action="store_true",
- default=False, help="assign edges only if they are not in more than one district")
- optParser.add_option("-n", "--net-files", dest="netfiles",
- help="read SUMO network(s) from FILE(s) (mandatory)", metavar="FILE")
- optParser.add_option("-o", "--output", default="districts.taz.xml",
- help="write results to FILE (default: %default)", metavar="FILE")
- optParser.add_option("-m", "--max-speed", type="float", dest="maxspeed",
- default=1000.0, help="use lanes where speed is not greater than this (m/s) (default: %default)")
- optParser.add_option("-w", "--weighted", action="store_true",
- default=False, help="Weights sources/sinks by lane number and length")
- optParser.add_option("-f", "--assign-from", action="store_true",
- default=False, help="Assign the edge always to the district where the \"from\" node is located")
- (options, args) = optParser.parse_args()
- if not options.netfiles:
- optParser.print_help()
- optParser.exit("Error! Providing networks is mandatory")
-
- reader = NetDistrictEdgeHandler()
- for netfile in options.netfiles.split(","):
- if options.verbose:
- print "Reading net '" + netfile + "'"
- parse(netfile, reader)
- if options.verbose:
- print "Calculating"
- reader.computeWithin(
- options.complete, options.maxspeed, options.assign_from, options.verbose)
- if options.verbose:
- print "Writing results"
- reader.writeResults(options.output, options.weighted)
diff --git a/tools/districts2poly.py b/tools/districts2poly.py
new file mode 100644
index 0000000..6a7e3d1
--- /dev/null
+++ b/tools/districts2poly.py
@@ -0,0 +1,77 @@
+#!/usr/bin/env python
+"""
+ at file districts2poly.py
+ at author Jakob Erdmann
+ at date 2015-07-31
+ at version $Id: districts2poly.py 18666 2015-08-19 14:23:53Z behrisch $
+
+From a sumo network and a taz (district) file, this script colors each district
+with a unique color (by creating a colored polygon for each edge in that
+district)
+These polygons can then be visualized in sumo-gui
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+import sys
+import os
+import itertools
+import random
+from optparse import OptionParser
+sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
+from sumolib.output import parse
+from sumolib.net import readNet
+from sumolib.miscutils import Colorgen
+
+
+def parse_args():
+ USAGE = "Usage: " + sys.argv[0] + " <netfile> <routefile> [options]"
+ optParser = OptionParser()
+ optParser.add_option("-o", "--outfile", help="name of output file")
+ optParser.add_option("-u", "--hue", default="random",
+ help="hue for polygons (float from [0,1] or 'random')")
+ optParser.add_option("-s", "--saturation", default=1,
+ help="saturation for polygons (float from [0,1] or 'random')")
+ optParser.add_option("-b", "--brightness", default=1,
+ help="brightness for polygons (float from [0,1] or 'random')")
+ optParser.add_option(
+ "-l", "--layer", default=100, help="layer for generated polygons")
+ options, args = optParser.parse_args()
+ try:
+ options.net, options.routefile = args
+ options.colorgen = Colorgen(
+ (options.hue, options.saturation, options.brightness))
+ except:
+ sys.exit(USAGE)
+ if options.outfile is None:
+ options.outfile = options.routefile + ".poly.xml"
+ return options
+
+
+def generate_poly(net, id, color, layer, edges, outf):
+ for edge in edges:
+ shape = net.getEdge(edge).getLane(0).getShape()
+ shapeString = ' '.join('%s,%s' % (x, y) for x, y in shape)
+ outf.write('<poly id="%s_%s" color="%s" layer="%s" type="taz_edge" shape="%s"/>\n' % (
+ id, net.getEdge(edge).getID(), color, layer, shapeString))
+
+
+def main():
+ random.seed(42)
+ options = parse_args()
+ net = readNet(options.net)
+ with open(options.outfile, 'w') as outf:
+ outf.write('<polygons>\n')
+ for taz in parse(options.routefile, 'taz'):
+ generate_poly(net, taz.id, options.colorgen(),
+ options.layer, taz.edges.split(), outf)
+ outf.write('</polygons>\n')
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/edgesInDistricts.py b/tools/edgesInDistricts.py
new file mode 100755
index 0000000..e12890f
--- /dev/null
+++ b/tools/edgesInDistricts.py
@@ -0,0 +1,159 @@
+#!/usr/bin/env python
+"""
+ at file edgesInDistricts.py
+ at author Daniel Krajzewicz
+ at author Michael Behrisch
+ at author Jakob Erdmann
+ at date 2007-07-26
+ at version $Id: edgesInDistricts.py 18756 2015-08-31 19:16:33Z behrisch $
+
+Parsing a number of networks and taz (district) files with shapes
+this script writes a taz file with all the edges which are inside
+the relevant taz.
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+from __future__ import print_function
+import sys
+import collections
+from optparse import OptionParser
+from xml.sax import parse
+import sumolib
+
+
+# written into the net. All members are "private".
+class DistrictEdgeComputer:
+
+ def __init__(self, net):
+ self._net = net
+ self._districtEdges = collections.defaultdict(list)
+ self._edgeDistricts = collections.defaultdict(list)
+ self._invalidatedEdges = set()
+
+ def computeWithin(self, polygons, options):
+ districtBoxes = {}
+ for district in polygons:
+ districtBoxes[district.id] = district.getBoundingBox()
+ for idx, edge in enumerate(self._net.getEdges()):
+ shape = edge.getShape()
+ if edge.getSpeed() < options.maxspeed and (options.internal or edge.getFunction() != "internal"):
+ if options.vclass is None or edge.allows(options.vclass):
+ if options.assign_from:
+ xmin, ymin = shape[0]
+ xmax, ymax = shape[0]
+ else:
+ xmin, ymin, xmax, ymax = edge.getBoundingBox()
+ for district in polygons:
+ dxmin, dymin, dxmax, dymax = districtBoxes[district.id]
+ if dxmin <= xmax and dymin <= ymax and dxmax >= xmin and dymax >= ymin:
+ if options.assign_from:
+ if sumolib.geomhelper.isWithin(shape[0], district.shape):
+ self._districtEdges[district].append(edge)
+ self._edgeDistricts[edge].append(district)
+ break
+ else:
+ for pos in shape:
+ if sumolib.geomhelper.isWithin(pos, district.shape):
+ self._districtEdges[
+ district].append(edge)
+ self._edgeDistricts[
+ edge].append(district)
+ break
+ if options.verbose and idx % 100 == 0:
+ sys.stdout.write("%s/%s\r" % (idx, len(self._net.getEdges())))
+ if options.complete:
+ for edge, districts in self._edgeDistricts.iteritems():
+ if len(districts) > 1:
+ self._invalidatedEdges.add(edge)
+
+ def getEdgeDistrictMap(self):
+ result = {}
+ for edge, districts in self._edgeDistricts.iteritems():
+ if len(districts) == 1:
+ result[edge] = districts[0]
+ return result
+
+ def writeResults(self, output, weighted):
+ fd = open(output, "w")
+ fd.write("<tazs>\n")
+ for district, edges in sorted(self._districtEdges.iteritems()):
+ filtered = [
+ edge for edge in edges if edge not in self._invalidatedEdges]
+ if len(filtered) == 0:
+ print("District '" + district + "' has no edges!")
+ else:
+ if weighted:
+ fd.write(' <taz id="%s">\n' % district.id)
+ for edge in filtered:
+ weight = edge.getSpeed() * edge.getLength()
+ fd.write(
+ ' <tazSource id="%s" weight="%.2f"/>\n' % (edge.getID(), weight))
+ fd.write(
+ ' <tazSink id="%s" weight="%.2f"/>\n' % (edge.getID(), weight))
+ fd.write(" </taz>\n")
+ else:
+ fd.write(' <taz id="%s" edges="%s"/>\n' %
+ (district.id, " ".join([e.getID() for e in filtered])))
+ fd.write("</tazs>\n")
+ fd.close()
+
+ def getTotalLength(self, edgeID):
+ edge = self._net.getEdge(edgeID)
+ return edge.getLength() * edge.getLaneNumber()
+
+
+def fillOptions(optParser):
+ optParser.add_option("-v", "--verbose", action="store_true",
+ default=False, help="tell me what you are doing")
+ optParser.add_option("-c", "--complete", action="store_true",
+ default=False, help="assign edges only if they are not in more than one district")
+ optParser.add_option("-n", "--net-file",
+ help="read SUMO network from FILE (mandatory)", metavar="FILE")
+ optParser.add_option("-t", "--taz-files",
+ help="read districts from FILEs", metavar="FILE")
+ optParser.add_option("-o", "--output", default="districts.taz.xml",
+ help="write results to FILE (default: %default)", metavar="FILE")
+ optParser.add_option("-m", "--max-speed", type="float", dest="maxspeed",
+ default=1000.0, help="use lanes where speed is not greater than this (m/s) (default: %default)")
+ optParser.add_option("-w", "--weighted", action="store_true",
+ default=False, help="Weights sources/sinks by lane number and length")
+ optParser.add_option("-f", "--assign-from", action="store_true",
+ default=False, help="Assign the edge always to the district where the \"from\" node is located")
+ optParser.add_option("-i", "--internal", action="store_true",
+ default=False, help="Include internal edges in output")
+ optParser.add_option(
+ "-l", "--vclass", help="Include only edges allowing VCLASS")
+
+
+if __name__ == "__main__":
+ optParser = OptionParser()
+ fillOptions(optParser)
+ (options, args) = optParser.parse_args()
+ if not options.net_file:
+ optParser.print_help()
+ optParser.exit("Error! Providing a network is mandatory")
+
+ if options.verbose:
+ print("Reading net '" + net_file + "'")
+ nets = options.net_file.split(",")
+ if len(nets) > 1:
+ print(
+ "Warning! Multiple networks specified. Parsing the first one for edges and tazs, the others for taz only.")
+ reader = DistrictEdgeComputer(sumolib.net.readNet(nets[0]))
+ tazFiles = nets + options.taz_files.split(",")
+ polyReader = sumolib.shapes.polygon.PolygonReader(True)
+ for tf in tazFiles:
+ parse(tf, polyReader)
+ if options.verbose:
+ print("Calculating")
+ reader.computeWithin(polyReader.getPolygons(), options)
+ if options.verbose:
+ print("Writing results")
+ reader.writeResults(options.output, options.weighted)
diff --git a/tools/extractTest.py b/tools/extractTest.py
new file mode 100755
index 0000000..f47672c
--- /dev/null
+++ b/tools/extractTest.py
@@ -0,0 +1,226 @@
+#!/usr/bin/env python
+"""
+ at file extractTest.py
+ at author Daniel Krajzewicz
+ at author Jakob Erdmann
+ at author Michael Behrisch
+ at date 2009-07-08
+ at version $Id: extractTest.py 18683 2015-08-21 13:56:04Z behrisch $
+
+Extract all files for a test case into a new dir.
+It may copy more files than needed because it copies everything
+that is mentioned in the config under copy_test_path.
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2009-2015 DLR/TS, Germany
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+import os
+import sys
+from os.path import join
+import optparse
+import os
+import glob
+import sys
+import shutil
+import subprocess
+from collections import defaultdict
+
+THIS_DIR = os.path.abspath(os.path.dirname(__file__))
+SUMO_HOME = join(THIS_DIR, '..')
+sys.path.append(join(SUMO_HOME, "tools"))
+
+from sumolib import checkBinary
+os.environ["PATH"] += os.pathsep + join(SUMO_HOME, 'bin')
+
+# cannot use ':' because it is a component of absolute paths on windows
+SOURCE_DEST_SEP = ';'
+
+
+def get_options(args=None):
+ optParser = optparse.OptionParser(usage="%prog <options> <test directory>")
+ optParser.add_option(
+ "-o", "--output", default=".", help="send output to directory")
+ optParser.add_option(
+ "-f", "--file", help="read list of source and target dirs from")
+ optParser.add_option("-i", "--intelligent-names", dest="names", action="store_true",
+ default=False, help="generate cfg name from directory name")
+ optParser.add_option(
+ "-a", "--application", help="sets the application to be used")
+ optParser.add_option("-s", "--skip-configuration",
+ dest="skip_configuration", default=False, action="store_true",
+ help="skips creation of an application config from the options.app file")
+ optParser.add_option("-x", "--skip-validation",
+ dest="skip_validation", default=False, action="store_true",
+ help="remove all options related to XML validation")
+ options, args = optParser.parse_args(args=args)
+ if not options.file and len(args) == 0:
+ optParser.print_help()
+ sys.exit(1)
+ options.args = args
+ return options
+
+
+def copy_merge(srcDir, dstDir, merge, exclude):
+ """merge contents of srcDir recursively into dstDir"""
+ for dir, subdirs, files in os.walk(srcDir):
+ for ex in exclude:
+ if ex in subdirs:
+ subdirs.remove(ex)
+ dst = dir.replace(srcDir, dstDir)
+ if os.path.exists(dst) and not merge:
+ shutil.rmtree(dst)
+ if not os.path.exists(dst):
+ # print "creating dir '%s' as a copy of '%s'" % (dst, srcDir)
+ os.mkdir(dst)
+ for file in files:
+ # print "copying file '%s' to '%s'" % (join(dir, file), join(dst,
+ # file))
+ shutil.copy(join(dir, file), join(dst, file))
+
+
+def generateTargetName(baseDir, source):
+ return source[len(os.path.commonprefix([baseDir, source])):].replace(os.sep, '_')
+
+
+def main(options):
+ targets = []
+ if options.file:
+ dirname = os.path.dirname(options.file)
+ for line in open(options.file):
+ line = line.strip()
+ if line and line[0] != '#':
+ l = line.split(SOURCE_DEST_SEP) + [""]
+ l[0] = join(dirname, l[0])
+ l[1] = join(dirname, l[1])
+ targets.append(l[:3])
+ for val in options.args:
+ source_and_maybe_target = val.split(SOURCE_DEST_SEP) + ["", ""]
+ targets.append(source_and_maybe_target[:3])
+
+ for source, target, app in targets:
+ outputFiles = glob.glob(join(source, "output.[0-9a-z]*"))
+ # print source, target, outputFiles
+ # XXX we should collect the options.app.variant files in all parent
+ # directories instead. This would allow us to save config files for all
+ # variants
+ appName = set([f.split('.')[-1] for f in outputFiles])
+ if len(appName) != 1:
+ if options.application in appName:
+ appName = set([options.application])
+ elif app in appName:
+ appName = set([app])
+ else:
+ print >> sys.stderr, "Skipping %s because the application was not unique (found %s)." % (
+ source, appName)
+ continue
+ app = iter(appName).next()
+ optionsFiles = []
+ potentials = defaultdict(list)
+ source = os.path.realpath(source)
+ curDir = source
+ if curDir[-1] == os.path.sep:
+ curDir = os.path.dirname(curDir)
+ while True:
+ for f in os.listdir(curDir):
+ path = join(curDir, f)
+ if not f in potentials or os.path.isdir(path):
+ potentials[f].append(path)
+ if f == "options." + app:
+ optionsFiles.append(path)
+ config = join(curDir, "config." + app)
+ if curDir == os.path.dirname(curDir):
+ break
+ if os.path.exists(config):
+ # there may be configs in subdirs but we only parse the main
+ # one which should contain all files we need to copy
+ validConfig = False
+ for line in open(config):
+ entry = line.strip().split(':')
+ if entry and "copy_test_path" in entry[0]:
+ validConfig = True
+ break
+ if validConfig:
+ break
+ curDir = os.path.dirname(curDir)
+ if not os.path.exists(config):
+ print >> sys.stderr, "Config '%s' not found for %s." % (
+ config, source)
+ continue
+ if target == "":
+ target = generateTargetName(curDir, source)
+ testPath = os.path.abspath(join(options.output, target))
+ if not os.path.exists(testPath):
+ os.makedirs(testPath)
+ net = None
+ skip = False
+ appOptions = []
+ for f in optionsFiles:
+ for o in open(f).read().split():
+ if skip:
+ skip = False
+ continue
+ if o == "--xml-validation" and options.skip_validation:
+ skip = True
+ continue
+ appOptions.append(o)
+ if "=" in o:
+ o = o.split("=")[-1]
+ if o[-8:] == ".net.xml":
+ net = o
+ nameBase = "test"
+ if options.names:
+ nameBase = os.path.basename(target)
+ exclude = []
+ # gather copy_test_path exclusions
+ for line in open(config):
+ entry = line.strip().split(':')
+ if entry and entry[0] == "test_data_ignore":
+ exclude.append(entry[1])
+ # copy test data from the tree
+ for line in open(config):
+ entry = line.strip().split(':')
+ if entry and "copy_test_path" in entry[0] and entry[1] in potentials:
+ if "net" in app or not net or entry[1][-8:] != ".net.xml" or entry[1] == net:
+ toCopy = potentials[entry[1]][0]
+ if os.path.isdir(toCopy):
+ # copy from least specific to most specific
+ merge = entry[0] == "copy_test_path_merge"
+ for toCopy in reversed(potentials[entry[1]]):
+ copy_merge(
+ toCopy, join(testPath, os.path.basename(toCopy)), merge, exclude)
+ else:
+ shutil.copy2(toCopy, testPath)
+ if options.skip_configuration:
+ continue
+ oldWorkDir = os.getcwd()
+ os.chdir(testPath)
+ if app in ["dfrouter", "duarouter", "jtrrouter", "marouter", "netconvert",
+ "netgen", "netgenerate", "od2trips", "polyconvert", "sumo", "activitygen"]:
+ appOptions += ['--save-configuration', '%s.%scfg' %
+ (nameBase, app[:4])]
+ if "meso" in testPath and app == "sumo":
+ app = "meso"
+ if app == "netgen":
+ # binary is now called differently but app still has the old
+ # name
+ app = "netgenerate"
+ subprocess.call([checkBinary(app)] + appOptions)
+ elif app == "tools":
+ if os.name == "posix" or options.file:
+ tool = join("$SUMO_HOME", appOptions[-1])
+ open(nameBase + ".sh", "w").write(tool +
+ " " + " ".join(appOptions[:-1]))
+ if os.name != "posix" or options.file:
+ tool = join("%SUMO_HOME%", appOptions[-1])
+ open(nameBase + ".bat", "w").write(tool +
+ " " + " ".join(appOptions[:-1]))
+ os.chdir(oldWorkDir)
+
+if __name__ == "__main__":
+ main(get_options())
diff --git a/tools/game/bs3Dosm.sumocfg b/tools/game/bs3Dosm.sumocfg
index af0b377..203176d 100644
--- a/tools/game/bs3Dosm.sumocfg
+++ b/tools/game/bs3Dosm.sumocfg
@@ -18,4 +18,5 @@
<no-step-log value="true"/>
</report>
<osg-view value="true"/>
+ <output-prefix value="bs3Dosm."/>
</configuration>
diff --git a/tools/game/bs3d.sumocfg b/tools/game/bs3d.sumocfg
index a41f710..af7d243 100644
--- a/tools/game/bs3d.sumocfg
+++ b/tools/game/bs3d.sumocfg
@@ -18,4 +18,5 @@
<no-step-log value="true"/>
</report>
<osg-view value="true"/>
+ <output-prefix value="bs3d."/>
</configuration>
diff --git a/tools/game/bs3d/bs3d.rou.xml b/tools/game/bs3d/bs3d.rou.xml
index cd7b50b..8be45fd 100644
--- a/tools/game/bs3d/bs3d.rou.xml
+++ b/tools/game/bs3d/bs3d.rou.xml
@@ -18,14 +18,14 @@
<route id="WS" edges="166445412 29136063#0"/>
<route id="ES" edges="61734682#3 166445407 29136063#0"/>
- <flow id="1_right" route="WS" begin="0" end="90000" period="30" departSpeed="13.89"/>
- <flow id="2_right" route="EN" begin="0" end="90000" period="30" departSpeed="13.89"/>
+ <flow id="1_right" route="WS" begin="20" end="90000" period="30" departSpeed="13.89"/>
+ <flow id="2_right" route="EN" begin="20" end="90000" period="30" departSpeed="13.89"/>
- <flow id="1_left" route="WN" begin="0" end="90000" period="45" departSpeed="13.89"/>
- <flow id="2_left" route="ES" begin="0" end="90000" period="55" departSpeed="13.89"/>
+ <flow id="1_left" route="WN" begin="20" end="90000" period="45" departSpeed="13.89"/>
+ <flow id="2_left" route="ES" begin="20" end="90000" period="55" departSpeed="13.89"/>
- <flow id="1_horizontal" route="WE" begin="0" end="90000" period="15" departSpeed="13.89"/>
- <flow id="2_horizontal" route="EW" begin="0" end="90000" period="15" departSpeed="13.89"/>
+ <flow id="1_horizontal" route="WE" begin="20" end="90000" period="15" departSpeed="13.89"/>
+ <flow id="2_horizontal" route="EW" begin="20" end="90000" period="15" departSpeed="13.89"/>
<flow id="3_right" route="NW" begin="20" end="90000" period="30" departSpeed="13.89"/>
<flow id="4_right" route="SE" begin="20" end="90000" period="40" departSpeed="13.89"/>
diff --git a/tools/game/bs3d/bs3d.settings.xml b/tools/game/bs3d/bs3d.settings.xml
index eb69420..2ebb00b 100644
--- a/tools/game/bs3d/bs3d.settings.xml
+++ b/tools/game/bs3d/bs3d.settings.xml
@@ -12,6 +12,103 @@
<light centerX="600" centerY="600" centerZ="300"/>
<scheme name="game_cross">
<opengl antialiase="0" dither="0"/>
+ <edges laneEdgeMode="1" laneShowBorders="0" showLinkDecals="1" showRails="1" hideConnectors="0"
+ edgeName_show="0" edgeName_size="50.00" edgeName_color="1.00,0.50,0.00"
+ internalEdgeName_show="0" internalEdgeName_size="40.00" internalEdgeName_color="0.50,0.25,0.00"
+ streetName_show="0" streetName_size="55.00" streetName_color="1.00,1.00,0.00" >
+ <colorScheme name="uniform">
+ <entry color="1.0,0,0,1.0"/>
+ </colorScheme>
+ <colorScheme name="by selection (lane-/streetwise)">
+ <entry color="0.0,0.0,0.0,0.0" name="unselected"/>
+ <entry color="0.00,0.40,0.80" name="selected"/>
+ </colorScheme>
+ <colorScheme name="by vclass">
+ <entry color="0.00,0.00,0.00" name="all"/>
+ <entry color="0.00,0.10,0.50" name="public"/>
+ </colorScheme>
+ <colorScheme name="by allowed speed (lanewise)" interpolated="1">
+ <entry color="1.00,0.00,0.00" threshold="0.00"/>
+ <entry color="0.00,0.00,1.00" threshold="41.67"/>
+ </colorScheme>
+ <colorScheme name="by current occupancy (lanewise)" interpolated="1">
+ <entry color="0.00,0.00,1.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="0.95"/>
+ </colorScheme>
+ <colorScheme name="by first vehicle waiting time (lanewise)" interpolated="1">
+ <entry color="0.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="200.00"/>
+ </colorScheme>
+ <colorScheme name="by lane number (streetwise)" interpolated="1">
+ <entry color="1.00,0.00,0.00" threshold="0.00"/>
+ <entry color="0.00,0.00,1.00" threshold="5.00"/>
+ </colorScheme>
+ <colorScheme name="by CO2 emissions (HBEFA)" interpolated="1">
+ <entry color="0.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="0.27"/>
+ </colorScheme>
+ <colorScheme name="by CO emissions (HBEFA)" interpolated="1">
+ <entry color="0.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="0.00"/>
+ </colorScheme>
+ <colorScheme name="by PMx emissions (HBEFA)" interpolated="1">
+ <entry color="0.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="0.00"/>
+ </colorScheme>
+ <colorScheme name="by NOx emissions (HBEFA)" interpolated="1">
+ <entry color="0.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="0.00"/>
+ </colorScheme>
+ <colorScheme name="by HC emissions (HBEFA)" interpolated="1">
+ <entry color="0.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="0.00"/>
+ </colorScheme>
+ <colorScheme name="by fuel consumption (HBEFA)" interpolated="1">
+ <entry color="0.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="0.07"/>
+ </colorScheme>
+ <colorScheme name="by noise emissions (Harmonoise)" interpolated="1">
+ <entry color="0.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="100.00"/>
+ </colorScheme>
+ <colorScheme name="by global travel time" interpolated="1">
+ <entry color="0.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="100.00"/>
+ </colorScheme>
+ <colorScheme name="by global speed percentage" interpolated="1">
+ <entry color="1.00,0.00,0.00" threshold="0.00"/>
+ <entry color="1.00,1.00,0.00" threshold="50.00"/>
+ <entry color="0.00,1.00,0.00" threshold="100.00"/>
+ </colorScheme>
+ <colorScheme name="uniform (streetwise)">
+ <entry color="0.00,0.00,0.00"/>
+ </colorScheme>
+ <colorScheme name="by selection (streetwise)">
+ <entry color="0.70,0.70,0.70" name="unselected"/>
+ <entry color="0.00,0.40,0.80" name="selected"/>
+ </colorScheme>
+ <colorScheme name="by purpose (streetwise)">
+ <entry color="0.00,0.00,0.00" name="normal"/>
+ <entry color="0.50,0.00,0.50" name="connector"/>
+ <entry color="0.00,0.00,1.00" name="internal"/>
+ </colorScheme>
+ <colorScheme name="by allowed speed (streetwise)" interpolated="1">
+ <entry color="1.00,0.00,0.00" threshold="0.00"/>
+ <entry color="0.00,0.00,1.00" threshold="41.67"/>
+ </colorScheme>
+ <colorScheme name="by current occupancy (streetwise)" interpolated="1">
+ <entry color="0.00,0.00,1.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="0.95"/>
+ </colorScheme>
+ <colorScheme name="by current speed (streetwise)" interpolated="1">
+ <entry color="1.00,0.00,0.00" threshold="0.00"/>
+ <entry color="0.00,0.00,1.00" threshold="41.67"/>
+ </colorScheme>
+ <colorScheme name="by current flow (streetwise)" interpolated="1">
+ <entry color="0.00,0.00,1.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="5000.00"/>
+ </colorScheme>
+ </edges>
<vehicles vehicleMode="9" vehicleQuality="2" minVehicleSize="1.00" vehicleExaggeration="1.00" showBlinker="1"
vehicleName_show="0" vehicleName_size="50.00" vehicleName_color="0.80,0.60,0.00" >
<colorScheme name="uniform">
@@ -85,6 +182,18 @@
<entry color="1.00,1.00,1.00" threshold="10.00"/>
</colorScheme>
</vehicles>
+ <junctions junctionMode="0" drawLinkTLIndex="0" drawLinkJunctionIndex="0"
+ junctionName_show="0" junctionName_size="50.00" junctionName_color="0.00,1.00,0.50"
+ internalJunctionName_show="0" internalJunctionName_size="50.00" internalJunctionName_color="0.00,0.80,0.50"
+ showLane2Lane="0">
+ <colorScheme name="uniform">
+ <entry color="0,0,0,0"/>
+ </colorScheme>
+ <colorScheme name="by selection">
+ <entry color="179,179,179" name="unselected"/>
+ <entry color="0,102,204" name="selected"/>
+ </colorScheme>
+ </junctions>
<legend showSizeLegend="1"/>
</scheme>
</viewsettings>
diff --git a/tools/game/bs3d/view_B.xml b/tools/game/bs3d/view_B.xml
index df92629..858685b 100644
--- a/tools/game/bs3d/view_B.xml
+++ b/tools/game/bs3d/view_B.xml
@@ -3,15 +3,15 @@
<opengl antialiase="0" dither="0"/>
<background backgroundColor="1.00,1.00,1.00"
showGrid="0" gridXSize="100.00" gridYSize="100.00"/>
- <edges laneEdgeMode="0" laneShowBorders="0" showLinkDecals="1" showRails="1" hideConnectors="0"
+ <edges laneEdgeMode="1" laneShowBorders="0" showLinkDecals="1" showRails="1" hideConnectors="0"
edgeName_show="0" edgeName_size="50.00" edgeName_color="1.00,0.50,0.00"
internalEdgeName_show="0" internalEdgeName_size="40.00" internalEdgeName_color="0.50,0.25,0.00"
streetName_show="0" streetName_size="55.00" streetName_color="1.00,1.00,0.00" >
<colorScheme name="uniform">
- <entry color="0,0,0,0"/>
+ <entry color="1.0,0,0,1.0"/>
</colorScheme>
<colorScheme name="by selection (lane-/streetwise)">
- <entry color="0.70,0.70,0.70" name="unselected"/>
+ <entry color="0.0,0.0,0.0,0.0" name="unselected"/>
<entry color="0.00,0.40,0.80" name="selected"/>
</colorScheme>
<colorScheme name="by vclass">
diff --git a/tools/game/cross.sumocfg b/tools/game/cross.sumocfg
index ebf4f8e..09990fc 100644
--- a/tools/game/cross.sumocfg
+++ b/tools/game/cross.sumocfg
@@ -12,5 +12,6 @@
<end value="180"/>
<step-length value=".2"/>
</time>
+ <output-prefix value="cross."/>
</configuration>
diff --git a/tools/game/cross_demo.sumocfg b/tools/game/cross_demo.sumocfg
index 5f93a9f..3a330f1 100644
--- a/tools/game/cross_demo.sumocfg
+++ b/tools/game/cross_demo.sumocfg
@@ -12,5 +12,6 @@
<end value="36000"/>
<step-length value=".2"/>
</time>
+ <output-prefix value="cross_demo."/>
</configuration>
diff --git a/tools/game/dlr_lndw_15_ts_4.gif b/tools/game/dlr_lndw_15_ts_4.gif
new file mode 100644
index 0000000..ca919fb
Binary files /dev/null and b/tools/game/dlr_lndw_15_ts_4.gif differ
diff --git a/tools/game/grid6.sumocfg b/tools/game/grid6.sumocfg
new file mode 100644
index 0000000..ab7be0f
--- /dev/null
+++ b/tools/game/grid6.sumocfg
@@ -0,0 +1,18 @@
+<configuration>
+
+ <input>
+ <net-file value="grid6/grid6.net.xml"/>
+ <gui-settings-file value="grid6/settings.xml"/>
+ <route-files value="grid6/grid6.rou.xml"/>
+ <additional-files value="input_additional.add.xml"/>
+ </input>
+
+ <time>
+ <begin value="0"/>
+ <end value="220"/>
+ <step-length value=".1"/>
+ </time>
+ <output-prefix value="grid6."/>
+ <weights.random-factor value="1.2"/>
+
+</configuration>
diff --git a/tools/game/grid6/dlr.gif b/tools/game/grid6/dlr.gif
new file mode 100644
index 0000000..776c703
Binary files /dev/null and b/tools/game/grid6/dlr.gif differ
diff --git a/tools/game/grid6/grid6.con.xml b/tools/game/grid6/grid6.con.xml
new file mode 100644
index 0000000..15ed446
--- /dev/null
+++ b/tools/game/grid6/grid6.con.xml
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- generated on Wed May 27 15:37:58 2015 by SUMO netconvert Version dev-SVN-r18449I
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netconvertConfiguration.xsd">
+
+ <input>
+ <sumo-net-file value="grid6.net.xml"/>
+ </input>
+
+ <output>
+ <plain-output-prefix value="grid6"/>
+ </output>
+
+ <processing>
+ <no-turnarounds value="true"/>
+ <offset.disable-normalization value="true"/>
+ </processing>
+
+</configuration>
+-->
+
+<connections version="0.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/connections_file.xsd">
+ <connection from="0/0to0/1" to="0/1to1/1" fromLane="0" toLane="0"/>
+ <connection from="0/0to0/1" to="0/1totop0" fromLane="0" toLane="0"/>
+
+ <connection from="0/0to1/0" to="1/0tobottom1" fromLane="0" toLane="0"/>
+ <connection from="0/0to1/0" to="1/0to2/0" fromLane="0" toLane="0"/>
+
+ <connection from="0/0tobottom0" to="gneE26" fromLane="0" toLane="0"/>
+
+ <connection from="0/0toleft0" to="gneE17" fromLane="0" toLane="0"/>
+
+ <connection from="0/1to0/0" to="0/0toleft0" fromLane="0" toLane="0"/>
+ <connection from="0/1to0/0" to="0/0tobottom0" fromLane="0" toLane="0"/>
+
+ <connection from="0/1to1/1" to="1/1to1/0" fromLane="0" toLane="0"/>
+ <connection from="0/1to1/1" to="1/1to2/1" fromLane="0" toLane="0"/>
+
+ <connection from="0/1toleft1" to="gneE13" fromLane="0" toLane="0"/>
+
+ <connection from="0/1totop0" to="gneE34" fromLane="0" toLane="0"/>
+
+ <connection from="1/0to0/0" to="0/0to0/1" fromLane="0" toLane="0"/>
+ <connection from="1/0to0/0" to="0/0toleft0" fromLane="0" toLane="0"/>
+
+ <connection from="1/0to1/1" to="1/1to2/1" fromLane="0" toLane="0"/>
+ <connection from="1/0to1/1" to="1/1totop1" fromLane="0" toLane="0"/>
+
+ <connection from="1/0to2/0" to="2/0tobottom2" fromLane="0" toLane="0"/>
+ <connection from="1/0to2/0" to="2/0toright0" fromLane="0" toLane="0"/>
+
+ <connection from="1/0tobottom1" to="gneE29" fromLane="0" toLane="0"/>
+
+ <connection from="1/1to0/1" to="0/1totop0" fromLane="0" toLane="0"/>
+ <connection from="1/1to0/1" to="0/1toleft1" fromLane="0" toLane="0"/>
+
+ <connection from="1/1to1/0" to="1/0to0/0" fromLane="0" toLane="0"/>
+ <connection from="1/1to1/0" to="1/0tobottom1" fromLane="0" toLane="0"/>
+
+ <connection from="1/1to2/1" to="2/1to2/0" fromLane="0" toLane="0"/>
+ <connection from="1/1to2/1" to="2/1toright1" fromLane="0" toLane="0"/>
+
+ <connection from="1/1totop1" to="gneE37" fromLane="0" toLane="0"/>
+
+ <connection from="2/0to1/0" to="1/0to1/1" fromLane="0" toLane="0"/>
+ <connection from="2/0to1/0" to="1/0to0/0" fromLane="0" toLane="0"/>
+
+ <connection from="2/0to2/1" to="2/1toright1" fromLane="0" toLane="0"/>
+ <connection from="2/0to2/1" to="2/1totop2" fromLane="0" toLane="0"/>
+
+ <connection from="2/0tobottom2" to="gneE30" fromLane="0" toLane="0"/>
+
+ <connection from="2/0toright0" to="gneE24" fromLane="0" toLane="0"/>
+
+ <connection from="2/1to1/1" to="1/1totop1" fromLane="0" toLane="0"/>
+ <connection from="2/1to1/1" to="1/1to0/1" fromLane="0" toLane="0"/>
+
+ <connection from="2/1to2/0" to="2/0to1/0" fromLane="0" toLane="0"/>
+ <connection from="2/1to2/0" to="2/0tobottom2" fromLane="0" toLane="0"/>
+
+ <connection from="2/1toright1" to="gneE20" fromLane="0" toLane="0"/>
+
+ <connection from="2/1totop2" to="gneE40" fromLane="0" toLane="0"/>
+
+ <connection from="bottom0to0/0" to="0/0to1/0" fromLane="0" toLane="0"/>
+ <connection from="bottom0to0/0" to="0/0to0/1" fromLane="0" toLane="0"/>
+
+ <connection from="bottom1to1/0" to="1/0to2/0" fromLane="0" toLane="0"/>
+ <connection from="bottom1to1/0" to="1/0to1/1" fromLane="0" toLane="0"/>
+
+ <connection from="bottom2to2/0" to="2/0toright0" fromLane="0" toLane="0"/>
+ <connection from="bottom2to2/0" to="2/0to2/1" fromLane="0" toLane="0"/>
+
+ <connection from="bottom_in" to="gneE31" fromLane="0" toLane="0"/>
+ <connection from="bottom_in" to="gneE28" fromLane="1" toLane="0"/>
+ <connection from="bottom_in" to="gneE27" fromLane="2" toLane="0"/>
+
+ <connection from="gneE12" to="left1to0/1" fromLane="0" toLane="0"/>
+
+ <connection from="gneE13" to="left_out" fromLane="0" toLane="0"/>
+
+ <connection from="gneE16" to="left0to0/0" fromLane="0" toLane="0"/>
+
+ <connection from="gneE17" to="left_out" fromLane="0" toLane="1"/>
+
+ <connection from="gneE20" to="right_out" fromLane="0" toLane="1"/>
+
+ <connection from="gneE21" to="right1to2/1" fromLane="0" toLane="0"/>
+
+ <connection from="gneE24" to="right_out" fromLane="0" toLane="0"/>
+
+ <connection from="gneE25" to="right0to2/0" fromLane="0" toLane="0"/>
+
+ <connection from="gneE26" to="bottom_out" fromLane="0" toLane="0"/>
+
+ <connection from="gneE27" to="bottom0to0/0" fromLane="0" toLane="0"/>
+
+ <connection from="gneE28" to="bottom1to1/0" fromLane="0" toLane="0"/>
+
+ <connection from="gneE29" to="bottom_out" fromLane="0" toLane="1"/>
+
+ <connection from="gneE30" to="bottom_out" fromLane="0" toLane="2"/>
+
+ <connection from="gneE31" to="bottom2to2/0" fromLane="0" toLane="0"/>
+
+ <connection from="gneE34" to="top_out" fromLane="0" toLane="2"/>
+
+ <connection from="gneE35" to="top0to0/1" fromLane="0" toLane="0"/>
+
+ <connection from="gneE36" to="top1to1/1" fromLane="0" toLane="0"/>
+
+ <connection from="gneE37" to="top_out" fromLane="0" toLane="1"/>
+
+ <connection from="gneE40" to="top_out" fromLane="0" toLane="0"/>
+
+ <connection from="gneE41" to="top2to2/1" fromLane="0" toLane="0"/>
+
+ <connection from="left0to0/0" to="0/0tobottom0" fromLane="0" toLane="0"/>
+ <connection from="left0to0/0" to="0/0to1/0" fromLane="0" toLane="0"/>
+
+ <connection from="left1to0/1" to="0/1to0/0" fromLane="0" toLane="0"/>
+ <connection from="left1to0/1" to="0/1to1/1" fromLane="0" toLane="0"/>
+
+ <connection from="left_in" to="gneE16" fromLane="0" toLane="0"/>
+ <connection from="left_in" to="gneE12" fromLane="1" toLane="0"/>
+
+ <connection from="right0to2/0" to="2/0to2/1" fromLane="0" toLane="0"/>
+ <connection from="right0to2/0" to="2/0to1/0" fromLane="0" toLane="0"/>
+
+ <connection from="right1to2/1" to="2/1totop2" fromLane="0" toLane="0"/>
+ <connection from="right1to2/1" to="2/1to1/1" fromLane="0" toLane="0"/>
+
+ <connection from="right_in" to="gneE21" fromLane="0" toLane="0"/>
+ <connection from="right_in" to="gneE25" fromLane="1" toLane="0"/>
+
+ <connection from="top0to0/1" to="0/1toleft1" fromLane="0" toLane="0"/>
+ <connection from="top0to0/1" to="0/1to0/0" fromLane="0" toLane="0"/>
+
+ <connection from="top1to1/1" to="1/1to0/1" fromLane="0" toLane="0"/>
+ <connection from="top1to1/1" to="1/1to1/0" fromLane="0" toLane="0"/>
+
+ <connection from="top2to2/1" to="2/1to1/1" fromLane="0" toLane="0"/>
+ <connection from="top2to2/1" to="2/1to2/0" fromLane="0" toLane="0"/>
+
+ <connection from="top_in" to="gneE35" fromLane="0" toLane="0"/>
+ <connection from="top_in" to="gneE36" fromLane="1" toLane="0"/>
+ <connection from="top_in" to="gneE41" fromLane="2" toLane="0"/>
+
+</connections>
diff --git a/tools/game/grid6/grid6.edg.xml b/tools/game/grid6/grid6.edg.xml
new file mode 100644
index 0000000..3857958
--- /dev/null
+++ b/tools/game/grid6/grid6.edg.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- generated on Wed May 27 15:37:58 2015 by SUMO netconvert Version dev-SVN-r18449I
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netconvertConfiguration.xsd">
+
+ <input>
+ <sumo-net-file value="grid6.net.xml"/>
+ </input>
+
+ <output>
+ <plain-output-prefix value="grid6"/>
+ </output>
+
+ <processing>
+ <no-turnarounds value="true"/>
+ <offset.disable-normalization value="true"/>
+ </processing>
+
+</configuration>
+-->
+
+<edges version="0.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/edges_file.xsd">
+ <edge id="0/0to0/1" from="0/0" to="0/1" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="0/0to1/0" from="0/0" to="1/0" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="0/0tobottom0" from="0/0" to="bottom0" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="0/0toleft0" from="0/0" to="left0" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="0/1to0/0" from="0/1" to="0/0" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="0/1to1/1" from="0/1" to="1/1" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="0/1toleft1" from="0/1" to="left1" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="0/1totop0" from="0/1" to="top0" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="1/0to0/0" from="1/0" to="0/0" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="1/0to1/1" from="1/0" to="1/1" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="1/0to2/0" from="1/0" to="2/0" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="1/0tobottom1" from="1/0" to="bottom1" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="1/1to0/1" from="1/1" to="0/1" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="1/1to1/0" from="1/1" to="1/0" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="1/1to2/1" from="1/1" to="2/1" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="1/1totop1" from="1/1" to="top1" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="2/0to1/0" from="2/0" to="1/0" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="2/0to2/1" from="2/0" to="2/1" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="2/0tobottom2" from="2/0" to="bottom2" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="2/0toright0" from="2/0" to="right0" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="2/1to1/1" from="2/1" to="1/1" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="2/1to2/0" from="2/1" to="2/0" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="2/1toright1" from="2/1" to="right1" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="2/1totop2" from="2/1" to="top2" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="bottom0to0/0" from="bottom0" to="0/0" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="bottom1to1/0" from="bottom1" to="1/0" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="bottom2to2/0" from="bottom2" to="2/0" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="bottom_in" from="gneJ16" to="gneJ14" priority="-1" numLanes="3" speed="13.90"/>
+ <edge id="bottom_out" from="gneJ14" to="gneJ16" priority="-1" numLanes="3" speed="13.90"/>
+ <edge id="gneE12" from="gneJ10" to="left1" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE13" from="left1" to="gneJ10" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE16" from="gneJ10" to="left0" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE17" from="left0" to="gneJ10" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE20" from="right1" to="gneJ12" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE21" from="gneJ12" to="right1" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE24" from="right0" to="gneJ12" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE25" from="gneJ12" to="right0" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE26" from="bottom0" to="gneJ14" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE27" from="gneJ14" to="bottom0" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE28" from="gneJ14" to="bottom1" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE29" from="bottom1" to="gneJ14" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE30" from="bottom2" to="gneJ14" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE31" from="gneJ14" to="bottom2" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE34" from="top0" to="gneJ17" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE35" from="gneJ17" to="top0" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE36" from="gneJ17" to="top1" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE37" from="top1" to="gneJ17" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE40" from="top2" to="gneJ17" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="gneE41" from="gneJ17" to="top2" priority="-1" numLanes="1" speed="13.90" length="80.00"/>
+ <edge id="left0to0/0" from="left0" to="0/0" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="left1to0/1" from="left1" to="0/1" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="left_in" from="gneJ9" to="gneJ10" priority="-1" numLanes="2" speed="13.90"/>
+ <edge id="left_out" from="gneJ10" to="gneJ9" priority="-1" numLanes="2" speed="13.90"/>
+ <edge id="right0to2/0" from="right0" to="2/0" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="right1to2/1" from="right1" to="2/1" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="right_in" from="gneJ13" to="gneJ12" priority="-1" numLanes="2" speed="13.90"/>
+ <edge id="right_out" from="gneJ12" to="gneJ13" priority="-1" numLanes="2" speed="13.90"/>
+ <edge id="top0to0/1" from="top0" to="0/1" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="top1to1/1" from="top1" to="1/1" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="top2to2/1" from="top2" to="2/1" priority="-1" numLanes="1" speed="13.90"/>
+ <edge id="top_in" from="gneJ18" to="gneJ17" priority="-1" numLanes="3" speed="13.90"/>
+ <edge id="top_out" from="gneJ17" to="gneJ18" priority="-1" numLanes="3" speed="13.90"/>
+</edges>
diff --git a/tools/game/grid6/grid6.net.xml b/tools/game/grid6/grid6.net.xml
new file mode 100644
index 0000000..63bc899
--- /dev/null
+++ b/tools/game/grid6/grid6.net.xml
@@ -0,0 +1,840 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- generated on Wed 27 May 2015 03:19:16 PM CEST by Netedit Version dev-SVN-r18449I
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netedit.exeConfiguration.xsd">
+
+ <input>
+ <sumo-net-file value="grid6.net.xml"/>
+ </input>
+
+ <output>
+ <output-file value="grid6.net.xml"/>
+ </output>
+
+ <processing>
+ <no-turnarounds value="true"/>
+ <offset.disable-normalization value="true"/>
+ </processing>
+
+</configuration>
+-->
+
+<net version="0.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/net_file.xsd">
+
+ <location netOffset="0.00,0.00" convBoundary="-150.00,-150.00,510.00,420.00" origBoundary="0.00,0.00,360.00,280.00" projParameter="!"/>
+
+ <edge id=":0/0_0" function="internal">
+ <lane id=":0/0_0_0" index="0" speed="13.90" length="5.00" shape="98.35,104.75 98.16,103.39 97.57,102.43 96.61,101.84 95.25,101.65"/>
+ </edge>
+ <edge id=":0/0_1" function="internal">
+ <lane id=":0/0_1_0" index="0" speed="13.90" length="9.50" shape="98.35,104.75 98.35,95.25"/>
+ </edge>
+ <edge id=":0/0_2" function="internal">
+ <lane id=":0/0_2_0" index="0" speed="13.90" length="5.00" shape="104.75,101.65 103.39,101.84 102.43,102.43 101.84,103.39 101.65,104.75"/>
+ </edge>
+ <edge id=":0/0_3" function="internal">
+ <lane id=":0/0_3_0" index="0" speed="13.90" length="9.50" shape="104.75,101.65 95.25,101.65"/>
+ </edge>
+ <edge id=":0/0_4" function="internal">
+ <lane id=":0/0_4_0" index="0" speed="13.90" length="5.00" shape="101.65,95.25 101.84,96.61 102.43,97.57 103.39,98.16 104.75,98.35"/>
+ </edge>
+ <edge id=":0/0_5" function="internal">
+ <lane id=":0/0_5_0" index="0" speed="13.90" length="9.50" shape="101.65,95.25 101.65,104.75"/>
+ </edge>
+ <edge id=":0/0_6" function="internal">
+ <lane id=":0/0_6_0" index="0" speed="13.90" length="5.00" shape="95.25,98.35 96.61,98.16 97.57,97.57 98.16,96.61 98.35,95.25"/>
+ </edge>
+ <edge id=":0/0_7" function="internal">
+ <lane id=":0/0_7_0" index="0" speed="13.90" length="9.50" shape="95.25,98.35 104.75,98.35"/>
+ </edge>
+ <edge id=":0/1_0" function="internal">
+ <lane id=":0/1_0_0" index="0" speed="13.90" length="5.00" shape="98.35,184.75 98.16,183.39 97.57,182.42 96.61,181.84 95.25,181.65"/>
+ </edge>
+ <edge id=":0/1_1" function="internal">
+ <lane id=":0/1_1_0" index="0" speed="13.90" length="9.50" shape="98.35,184.75 98.35,175.25"/>
+ </edge>
+ <edge id=":0/1_2" function="internal">
+ <lane id=":0/1_2_0" index="0" speed="13.90" length="5.00" shape="104.75,181.65 103.39,181.84 102.43,182.43 101.84,183.39 101.65,184.75"/>
+ </edge>
+ <edge id=":0/1_3" function="internal">
+ <lane id=":0/1_3_0" index="0" speed="13.90" length="9.50" shape="104.75,181.65 95.25,181.65"/>
+ </edge>
+ <edge id=":0/1_4" function="internal">
+ <lane id=":0/1_4_0" index="0" speed="13.90" length="5.00" shape="101.65,175.25 101.84,176.61 102.43,177.58 103.39,178.16 104.75,178.35"/>
+ </edge>
+ <edge id=":0/1_5" function="internal">
+ <lane id=":0/1_5_0" index="0" speed="13.90" length="9.50" shape="101.65,175.25 101.65,184.75"/>
+ </edge>
+ <edge id=":0/1_6" function="internal">
+ <lane id=":0/1_6_0" index="0" speed="13.90" length="5.00" shape="95.25,178.35 96.61,178.16 97.57,177.57 98.16,176.61 98.35,175.25"/>
+ </edge>
+ <edge id=":0/1_7" function="internal">
+ <lane id=":0/1_7_0" index="0" speed="13.90" length="9.50" shape="95.25,178.35 104.75,178.35"/>
+ </edge>
+ <edge id=":1/0_0" function="internal">
+ <lane id=":1/0_0_0" index="0" speed="13.90" length="5.00" shape="178.35,104.75 178.16,103.39 177.57,102.43 176.61,101.84 175.25,101.65"/>
+ </edge>
+ <edge id=":1/0_1" function="internal">
+ <lane id=":1/0_1_0" index="0" speed="13.90" length="9.50" shape="178.35,104.75 178.35,95.25"/>
+ </edge>
+ <edge id=":1/0_2" function="internal">
+ <lane id=":1/0_2_0" index="0" speed="13.90" length="5.00" shape="184.75,101.65 183.39,101.84 182.42,102.43 181.84,103.39 181.65,104.75"/>
+ </edge>
+ <edge id=":1/0_3" function="internal">
+ <lane id=":1/0_3_0" index="0" speed="13.90" length="9.50" shape="184.75,101.65 175.25,101.65"/>
+ </edge>
+ <edge id=":1/0_4" function="internal">
+ <lane id=":1/0_4_0" index="0" speed="13.90" length="5.00" shape="181.65,95.25 181.84,96.61 182.43,97.57 183.39,98.16 184.75,98.35"/>
+ </edge>
+ <edge id=":1/0_5" function="internal">
+ <lane id=":1/0_5_0" index="0" speed="13.90" length="9.50" shape="181.65,95.25 181.65,104.75"/>
+ </edge>
+ <edge id=":1/0_6" function="internal">
+ <lane id=":1/0_6_0" index="0" speed="13.90" length="5.00" shape="175.25,98.35 176.61,98.16 177.58,97.57 178.16,96.61 178.35,95.25"/>
+ </edge>
+ <edge id=":1/0_7" function="internal">
+ <lane id=":1/0_7_0" index="0" speed="13.90" length="9.50" shape="175.25,98.35 184.75,98.35"/>
+ </edge>
+ <edge id=":1/1_0" function="internal">
+ <lane id=":1/1_0_0" index="0" speed="13.90" length="5.00" shape="178.35,184.75 178.16,183.39 177.57,182.42 176.61,181.84 175.25,181.65"/>
+ </edge>
+ <edge id=":1/1_1" function="internal">
+ <lane id=":1/1_1_0" index="0" speed="13.90" length="9.50" shape="178.35,184.75 178.35,175.25"/>
+ </edge>
+ <edge id=":1/1_2" function="internal">
+ <lane id=":1/1_2_0" index="0" speed="13.90" length="5.00" shape="184.75,181.65 183.39,181.84 182.42,182.43 181.84,183.39 181.65,184.75"/>
+ </edge>
+ <edge id=":1/1_3" function="internal">
+ <lane id=":1/1_3_0" index="0" speed="13.90" length="9.50" shape="184.75,181.65 175.25,181.65"/>
+ </edge>
+ <edge id=":1/1_4" function="internal">
+ <lane id=":1/1_4_0" index="0" speed="13.90" length="5.00" shape="181.65,175.25 181.84,176.61 182.43,177.58 183.39,178.16 184.75,178.35"/>
+ </edge>
+ <edge id=":1/1_5" function="internal">
+ <lane id=":1/1_5_0" index="0" speed="13.90" length="9.50" shape="181.65,175.25 181.65,184.75"/>
+ </edge>
+ <edge id=":1/1_6" function="internal">
+ <lane id=":1/1_6_0" index="0" speed="13.90" length="5.00" shape="175.25,178.35 176.61,178.16 177.58,177.57 178.16,176.61 178.35,175.25"/>
+ </edge>
+ <edge id=":1/1_7" function="internal">
+ <lane id=":1/1_7_0" index="0" speed="13.90" length="9.50" shape="175.25,178.35 184.75,178.35"/>
+ </edge>
+ <edge id=":2/0_0" function="internal">
+ <lane id=":2/0_0_0" index="0" speed="13.90" length="5.00" shape="258.35,104.75 258.16,103.39 257.58,102.43 256.61,101.84 255.25,101.65"/>
+ </edge>
+ <edge id=":2/0_1" function="internal">
+ <lane id=":2/0_1_0" index="0" speed="13.90" length="9.50" shape="258.35,104.75 258.35,95.25"/>
+ </edge>
+ <edge id=":2/0_2" function="internal">
+ <lane id=":2/0_2_0" index="0" speed="13.90" length="5.00" shape="264.75,101.65 263.39,101.84 262.42,102.43 261.84,103.39 261.65,104.75"/>
+ </edge>
+ <edge id=":2/0_3" function="internal">
+ <lane id=":2/0_3_0" index="0" speed="13.90" length="9.50" shape="264.75,101.65 255.25,101.65"/>
+ </edge>
+ <edge id=":2/0_4" function="internal">
+ <lane id=":2/0_4_0" index="0" speed="13.90" length="5.00" shape="261.65,95.25 261.84,96.61 262.42,97.57 263.39,98.16 264.75,98.35"/>
+ </edge>
+ <edge id=":2/0_5" function="internal">
+ <lane id=":2/0_5_0" index="0" speed="13.90" length="9.50" shape="261.65,95.25 261.65,104.75"/>
+ </edge>
+ <edge id=":2/0_6" function="internal">
+ <lane id=":2/0_6_0" index="0" speed="13.90" length="5.00" shape="255.25,98.35 256.61,98.16 257.58,97.57 258.16,96.61 258.35,95.25"/>
+ </edge>
+ <edge id=":2/0_7" function="internal">
+ <lane id=":2/0_7_0" index="0" speed="13.90" length="9.50" shape="255.25,98.35 264.75,98.35"/>
+ </edge>
+ <edge id=":2/1_0" function="internal">
+ <lane id=":2/1_0_0" index="0" speed="13.90" length="5.00" shape="258.35,184.75 258.16,183.39 257.58,182.42 256.61,181.84 255.25,181.65"/>
+ </edge>
+ <edge id=":2/1_1" function="internal">
+ <lane id=":2/1_1_0" index="0" speed="13.90" length="9.50" shape="258.35,184.75 258.35,175.25"/>
+ </edge>
+ <edge id=":2/1_2" function="internal">
+ <lane id=":2/1_2_0" index="0" speed="13.90" length="5.00" shape="264.75,181.65 263.39,181.84 262.42,182.43 261.84,183.39 261.65,184.75"/>
+ </edge>
+ <edge id=":2/1_3" function="internal">
+ <lane id=":2/1_3_0" index="0" speed="13.90" length="9.50" shape="264.75,181.65 255.25,181.65"/>
+ </edge>
+ <edge id=":2/1_4" function="internal">
+ <lane id=":2/1_4_0" index="0" speed="13.90" length="5.00" shape="261.65,175.25 261.84,176.61 262.42,177.58 263.39,178.16 264.75,178.35"/>
+ </edge>
+ <edge id=":2/1_5" function="internal">
+ <lane id=":2/1_5_0" index="0" speed="13.90" length="9.50" shape="261.65,175.25 261.65,184.75"/>
+ </edge>
+ <edge id=":2/1_6" function="internal">
+ <lane id=":2/1_6_0" index="0" speed="13.90" length="5.00" shape="255.25,178.35 256.61,178.16 257.58,177.57 258.16,176.61 258.35,175.25"/>
+ </edge>
+ <edge id=":2/1_7" function="internal">
+ <lane id=":2/1_7_0" index="0" speed="13.90" length="9.50" shape="255.25,178.35 264.75,178.35"/>
+ </edge>
+ <edge id=":bottom0_0" function="internal">
+ <lane id=":bottom0_0_0" index="0" speed="13.90" length="3.24" shape="98.35,1.14 99.42,-1.92"/>
+ </edge>
+ <edge id=":bottom0_1" function="internal">
+ <lane id=":bottom0_1_0" index="0" speed="13.90" length="1.06" shape="102.00,0.14 101.65,1.14"/>
+ </edge>
+ <edge id=":bottom1_0" function="internal">
+ <lane id=":bottom1_0_0" index="0" speed="13.90" length="0.10" shape="178.35,0.00 178.35,0.00"/>
+ </edge>
+ <edge id=":bottom1_1" function="internal">
+ <lane id=":bottom1_1_0" index="0" speed="13.90" length="0.10" shape="181.65,0.00 181.65,0.00"/>
+ </edge>
+ <edge id=":bottom2_0" function="internal">
+ <lane id=":bottom2_0_0" index="0" speed="13.90" length="1.06" shape="258.35,1.14 258.00,0.14"/>
+ </edge>
+ <edge id=":bottom2_1" function="internal">
+ <lane id=":bottom2_1_0" index="0" speed="13.90" length="3.24" shape="260.58,-1.92 261.65,1.14"/>
+ </edge>
+ <edge id=":gneJ10_0" function="internal">
+ <lane id=":gneJ10_0_0" index="0" speed="13.90" length="3.66" shape="-90.39,145.62 -93.99,144.95"/>
+ </edge>
+ <edge id=":gneJ10_1" function="internal">
+ <lane id=":gneJ10_1_0" index="0" speed="13.90" length="6.40" shape="-89.16,137.44 -93.99,141.65"/>
+ </edge>
+ <edge id=":gneJ10_2" function="internal">
+ <lane id=":gneJ10_2_0" index="0" speed="13.90" length="3.66" shape="-93.99,135.05 -90.39,134.38"/>
+ </edge>
+ <edge id=":gneJ10_3" function="internal">
+ <lane id=":gneJ10_3_0" index="0" speed="13.90" length="6.40" shape="-93.99,138.35 -89.16,142.56"/>
+ </edge>
+ <edge id=":gneJ12_0" function="internal">
+ <lane id=":gneJ12_0_0" index="0" speed="13.90" length="3.55" shape="453.88,144.95 450.39,145.62"/>
+ </edge>
+ <edge id=":gneJ12_1" function="internal">
+ <lane id=":gneJ12_1_0" index="0" speed="13.90" length="6.32" shape="453.88,141.65 449.16,137.44"/>
+ </edge>
+ <edge id=":gneJ12_2" function="internal">
+ <lane id=":gneJ12_2_0" index="0" speed="13.90" length="3.55" shape="450.39,134.38 453.88,135.05"/>
+ </edge>
+ <edge id=":gneJ12_3" function="internal">
+ <lane id=":gneJ12_3_0" index="0" speed="13.90" length="6.32" shape="449.16,142.56 453.88,138.35"/>
+ </edge>
+ <edge id=":gneJ14_0" function="internal">
+ <lane id=":gneJ14_0_0" index="0" speed="13.90" length="6.12" shape="178.35,-89.23 175.05,-94.39"/>
+ </edge>
+ <edge id=":gneJ14_1" function="internal">
+ <lane id=":gneJ14_1_0" index="0" speed="13.90" length="11.15" shape="186.96,-88.66 184.30,-90.47 181.48,-91.05 179.26,-91.86 178.35,-94.39"/>
+ </edge>
+ <edge id=":gneJ14_2" function="internal">
+ <lane id=":gneJ14_2_0" index="0" speed="13.90" length="3.89" shape="188.25,-94.39 189.54,-90.72"/>
+ </edge>
+ <edge id=":gneJ14_3" function="internal">
+ <lane id=":gneJ14_3_0" index="0" speed="13.90" length="6.12" shape="184.95,-94.39 181.65,-89.23"/>
+ </edge>
+ <edge id=":gneJ14_4" function="internal">
+ <lane id=":gneJ14_4_0" index="0" speed="13.90" length="11.15" shape="181.65,-94.39 180.74,-91.86 178.52,-91.05 175.70,-90.47 173.04,-88.66"/>
+ </edge>
+ <edge id=":gneJ14_5" function="internal">
+ <lane id=":gneJ14_5_0" index="0" speed="13.90" length="3.89" shape="170.46,-90.72 171.75,-94.39"/>
+ </edge>
+ <edge id=":gneJ17_0" function="internal">
+ <lane id=":gneJ17_0_0" index="0" speed="13.90" length="3.89" shape="171.75,374.39 170.46,370.72"/>
+ </edge>
+ <edge id=":gneJ17_1" function="internal">
+ <lane id=":gneJ17_1_0" index="0" speed="13.90" length="6.12" shape="175.05,374.39 178.35,369.23"/>
+ </edge>
+ <edge id=":gneJ17_2" function="internal">
+ <lane id=":gneJ17_2_0" index="0" speed="13.90" length="11.15" shape="178.35,374.39 179.26,371.86 181.48,371.05 184.30,370.47 186.96,368.66"/>
+ </edge>
+ <edge id=":gneJ17_3" function="internal">
+ <lane id=":gneJ17_3_0" index="0" speed="13.90" length="3.89" shape="189.54,370.72 188.25,374.39"/>
+ </edge>
+ <edge id=":gneJ17_4" function="internal">
+ <lane id=":gneJ17_4_0" index="0" speed="13.90" length="6.12" shape="181.65,369.23 184.95,374.39"/>
+ </edge>
+ <edge id=":gneJ17_5" function="internal">
+ <lane id=":gneJ17_5_0" index="0" speed="13.90" length="11.15" shape="173.04,368.66 175.70,370.47 178.52,371.05 180.74,371.86 181.65,374.39"/>
+ </edge>
+ <edge id=":left0_0" function="internal">
+ <lane id=":left0_0_0" index="0" speed="13.90" length="0.61" shape="0.63,101.65 0.03,101.76"/>
+ </edge>
+ <edge id=":left0_1" function="internal">
+ <lane id=":left0_1_0" index="0" speed="13.90" length="1.85" shape="-1.19,98.70 0.63,98.35"/>
+ </edge>
+ <edge id=":left1_0" function="internal">
+ <lane id=":left1_0_0" index="0" speed="13.90" length="1.85" shape="0.63,181.65 -1.19,181.30"/>
+ </edge>
+ <edge id=":left1_1" function="internal">
+ <lane id=":left1_1_0" index="0" speed="13.90" length="0.61" shape="0.03,178.24 0.63,178.35"/>
+ </edge>
+ <edge id=":right0_0" function="internal">
+ <lane id=":right0_0_0" index="0" speed="13.90" length="0.61" shape="359.97,101.76 359.37,101.65"/>
+ </edge>
+ <edge id=":right0_1" function="internal">
+ <lane id=":right0_1_0" index="0" speed="13.90" length="1.85" shape="359.37,98.35 361.19,98.70"/>
+ </edge>
+ <edge id=":right1_0" function="internal">
+ <lane id=":right1_0_0" index="0" speed="13.90" length="1.85" shape="361.19,181.30 359.37,181.65"/>
+ </edge>
+ <edge id=":right1_1" function="internal">
+ <lane id=":right1_1_0" index="0" speed="13.90" length="0.61" shape="359.37,178.35 359.97,178.24"/>
+ </edge>
+ <edge id=":top0_0" function="internal">
+ <lane id=":top0_0_0" index="0" speed="13.90" length="3.24" shape="99.42,281.92 98.35,278.86"/>
+ </edge>
+ <edge id=":top0_1" function="internal">
+ <lane id=":top0_1_0" index="0" speed="13.90" length="1.06" shape="101.65,278.86 102.00,279.86"/>
+ </edge>
+ <edge id=":top1_0" function="internal">
+ <lane id=":top1_0_0" index="0" speed="13.90" length="0.10" shape="178.35,280.00 178.35,280.00"/>
+ </edge>
+ <edge id=":top1_1" function="internal">
+ <lane id=":top1_1_0" index="0" speed="13.90" length="0.10" shape="181.65,280.00 181.65,280.00"/>
+ </edge>
+ <edge id=":top2_0" function="internal">
+ <lane id=":top2_0_0" index="0" speed="13.90" length="3.24" shape="261.65,278.86 260.58,281.92"/>
+ </edge>
+ <edge id=":top2_1" function="internal">
+ <lane id=":top2_1_0" index="0" speed="13.90" length="1.06" shape="258.00,279.86 258.35,278.86"/>
+ </edge>
+
+ <edge id="0/0to0/1" from="0/0" to="0/1" priority="-1">
+ <lane id="0/0to0/1_0" index="0" speed="13.90" length="70.50" shape="101.65,104.75 101.65,175.25"/>
+ </edge>
+ <edge id="0/0to1/0" from="0/0" to="1/0" priority="-1">
+ <lane id="0/0to1/0_0" index="0" speed="13.90" length="70.50" shape="104.75,98.35 175.25,98.35"/>
+ </edge>
+ <edge id="0/0tobottom0" from="0/0" to="bottom0" priority="-1">
+ <lane id="0/0tobottom0_0" index="0" speed="13.90" length="94.11" shape="98.35,95.25 98.35,1.14"/>
+ </edge>
+ <edge id="0/0toleft0" from="0/0" to="left0" priority="-1">
+ <lane id="0/0toleft0_0" index="0" speed="13.90" length="94.62" shape="95.25,101.65 0.63,101.65"/>
+ </edge>
+ <edge id="0/1to0/0" from="0/1" to="0/0" priority="-1">
+ <lane id="0/1to0/0_0" index="0" speed="13.90" length="70.50" shape="98.35,175.25 98.35,104.75"/>
+ </edge>
+ <edge id="0/1to1/1" from="0/1" to="1/1" priority="-1">
+ <lane id="0/1to1/1_0" index="0" speed="13.90" length="70.50" shape="104.75,178.35 175.25,178.35"/>
+ </edge>
+ <edge id="0/1toleft1" from="0/1" to="left1" priority="-1">
+ <lane id="0/1toleft1_0" index="0" speed="13.90" length="94.62" shape="95.25,181.65 0.63,181.65"/>
+ </edge>
+ <edge id="0/1totop0" from="0/1" to="top0" priority="-1">
+ <lane id="0/1totop0_0" index="0" speed="13.90" length="94.11" shape="101.65,184.75 101.65,278.86"/>
+ </edge>
+ <edge id="1/0to0/0" from="1/0" to="0/0" priority="-1">
+ <lane id="1/0to0/0_0" index="0" speed="13.90" length="70.50" shape="175.25,101.65 104.75,101.65"/>
+ </edge>
+ <edge id="1/0to1/1" from="1/0" to="1/1" priority="-1">
+ <lane id="1/0to1/1_0" index="0" speed="13.90" length="70.50" shape="181.65,104.75 181.65,175.25"/>
+ </edge>
+ <edge id="1/0to2/0" from="1/0" to="2/0" priority="-1">
+ <lane id="1/0to2/0_0" index="0" speed="13.90" length="70.50" shape="184.75,98.35 255.25,98.35"/>
+ </edge>
+ <edge id="1/0tobottom1" from="1/0" to="bottom1" priority="-1">
+ <lane id="1/0tobottom1_0" index="0" speed="13.90" length="95.25" shape="178.35,95.25 178.35,0.00"/>
+ </edge>
+ <edge id="1/1to0/1" from="1/1" to="0/1" priority="-1">
+ <lane id="1/1to0/1_0" index="0" speed="13.90" length="70.50" shape="175.25,181.65 104.75,181.65"/>
+ </edge>
+ <edge id="1/1to1/0" from="1/1" to="1/0" priority="-1">
+ <lane id="1/1to1/0_0" index="0" speed="13.90" length="70.50" shape="178.35,175.25 178.35,104.75"/>
+ </edge>
+ <edge id="1/1to2/1" from="1/1" to="2/1" priority="-1">
+ <lane id="1/1to2/1_0" index="0" speed="13.90" length="70.50" shape="184.75,178.35 255.25,178.35"/>
+ </edge>
+ <edge id="1/1totop1" from="1/1" to="top1" priority="-1">
+ <lane id="1/1totop1_0" index="0" speed="13.90" length="95.25" shape="181.65,184.75 181.65,280.00"/>
+ </edge>
+ <edge id="2/0to1/0" from="2/0" to="1/0" priority="-1">
+ <lane id="2/0to1/0_0" index="0" speed="13.90" length="70.50" shape="255.25,101.65 184.75,101.65"/>
+ </edge>
+ <edge id="2/0to2/1" from="2/0" to="2/1" priority="-1">
+ <lane id="2/0to2/1_0" index="0" speed="13.90" length="70.50" shape="261.65,104.75 261.65,175.25"/>
+ </edge>
+ <edge id="2/0tobottom2" from="2/0" to="bottom2" priority="-1">
+ <lane id="2/0tobottom2_0" index="0" speed="13.90" length="94.11" shape="258.35,95.25 258.35,1.14"/>
+ </edge>
+ <edge id="2/0toright0" from="2/0" to="right0" priority="-1">
+ <lane id="2/0toright0_0" index="0" speed="13.90" length="94.62" shape="264.75,98.35 359.37,98.35"/>
+ </edge>
+ <edge id="2/1to1/1" from="2/1" to="1/1" priority="-1">
+ <lane id="2/1to1/1_0" index="0" speed="13.90" length="70.50" shape="255.25,181.65 184.75,181.65"/>
+ </edge>
+ <edge id="2/1to2/0" from="2/1" to="2/0" priority="-1">
+ <lane id="2/1to2/0_0" index="0" speed="13.90" length="70.50" shape="258.35,175.25 258.35,104.75"/>
+ </edge>
+ <edge id="2/1toright1" from="2/1" to="right1" priority="-1">
+ <lane id="2/1toright1_0" index="0" speed="13.90" length="94.62" shape="264.75,178.35 359.37,178.35"/>
+ </edge>
+ <edge id="2/1totop2" from="2/1" to="top2" priority="-1">
+ <lane id="2/1totop2_0" index="0" speed="13.90" length="94.11" shape="261.65,184.75 261.65,278.86"/>
+ </edge>
+ <edge id="bottom0to0/0" from="bottom0" to="0/0" priority="-1">
+ <lane id="bottom0to0/0_0" index="0" speed="13.90" length="94.11" shape="101.65,1.14 101.65,95.25"/>
+ </edge>
+ <edge id="bottom1to1/0" from="bottom1" to="1/0" priority="-1">
+ <lane id="bottom1to1/0_0" index="0" speed="13.90" length="95.25" shape="181.65,0.00 181.65,95.25"/>
+ </edge>
+ <edge id="bottom2to2/0" from="bottom2" to="2/0" priority="-1">
+ <lane id="bottom2to2/0_0" index="0" speed="13.90" length="94.11" shape="261.65,1.14 261.65,95.25"/>
+ </edge>
+ <edge id="bottom_in" from="gneJ16" to="gneJ14" priority="-1">
+ <lane id="bottom_in_0" index="0" speed="13.90" length="55.61" shape="188.25,-150.00 188.25,-94.39"/>
+ <lane id="bottom_in_1" index="1" speed="13.90" length="55.61" shape="184.95,-150.00 184.95,-94.39"/>
+ <lane id="bottom_in_2" index="2" speed="13.90" length="55.61" shape="181.65,-150.00 181.65,-94.39"/>
+ </edge>
+ <edge id="bottom_out" from="gneJ14" to="gneJ16" priority="-1">
+ <lane id="bottom_out_0" index="0" speed="13.90" length="55.61" shape="171.75,-94.39 171.75,-150.00"/>
+ <lane id="bottom_out_1" index="1" speed="13.90" length="55.61" shape="175.05,-94.39 175.05,-150.00"/>
+ <lane id="bottom_out_2" index="2" speed="13.90" length="55.61" shape="178.35,-94.39 178.35,-150.00"/>
+ </edge>
+ <edge id="gneE12" from="gneJ10" to="left1" priority="-1" length="80.00">
+ <lane id="gneE12_0" index="0" speed="13.90" length="80.00" shape="-89.16,142.56 0.03,178.24"/>
+ </edge>
+ <edge id="gneE13" from="left1" to="gneJ10" priority="-1" length="80.00">
+ <lane id="gneE13_0" index="0" speed="13.90" length="80.00" shape="-1.19,181.30 -90.39,145.62"/>
+ </edge>
+ <edge id="gneE16" from="gneJ10" to="left0" priority="-1" length="80.00">
+ <lane id="gneE16_0" index="0" speed="13.90" length="80.00" shape="-90.39,134.38 -1.19,98.70"/>
+ </edge>
+ <edge id="gneE17" from="left0" to="gneJ10" priority="-1" length="80.00">
+ <lane id="gneE17_0" index="0" speed="13.90" length="80.00" shape="0.03,101.76 -89.16,137.44"/>
+ </edge>
+ <edge id="gneE20" from="right1" to="gneJ12" priority="-1" length="80.00">
+ <lane id="gneE20_0" index="0" speed="13.90" length="80.00" shape="359.97,178.24 449.16,142.56"/>
+ </edge>
+ <edge id="gneE21" from="gneJ12" to="right1" priority="-1" length="80.00">
+ <lane id="gneE21_0" index="0" speed="13.90" length="80.00" shape="450.39,145.62 361.19,181.30"/>
+ </edge>
+ <edge id="gneE24" from="right0" to="gneJ12" priority="-1" length="80.00">
+ <lane id="gneE24_0" index="0" speed="13.90" length="80.00" shape="361.19,98.70 450.39,134.38"/>
+ </edge>
+ <edge id="gneE25" from="gneJ12" to="right0" priority="-1" length="80.00">
+ <lane id="gneE25_0" index="0" speed="13.90" length="80.00" shape="449.16,137.44 359.97,101.76"/>
+ </edge>
+ <edge id="gneE26" from="bottom0" to="gneJ14" priority="-1" length="80.00">
+ <lane id="gneE26_0" index="0" speed="13.90" length="80.00" shape="99.42,-1.92 170.46,-90.72"/>
+ </edge>
+ <edge id="gneE27" from="gneJ14" to="bottom0" priority="-1" length="80.00">
+ <lane id="gneE27_0" index="0" speed="13.90" length="80.00" shape="173.04,-88.66 102.00,0.14"/>
+ </edge>
+ <edge id="gneE28" from="gneJ14" to="bottom1" priority="-1" length="80.00">
+ <lane id="gneE28_0" index="0" speed="13.90" length="80.00" shape="181.65,-89.23 181.65,0.00"/>
+ </edge>
+ <edge id="gneE29" from="bottom1" to="gneJ14" priority="-1" length="80.00">
+ <lane id="gneE29_0" index="0" speed="13.90" length="80.00" shape="178.35,0.00 178.35,-89.23"/>
+ </edge>
+ <edge id="gneE30" from="bottom2" to="gneJ14" priority="-1" length="80.00">
+ <lane id="gneE30_0" index="0" speed="13.90" length="80.00" shape="258.00,0.14 186.96,-88.66"/>
+ </edge>
+ <edge id="gneE31" from="gneJ14" to="bottom2" priority="-1" length="80.00">
+ <lane id="gneE31_0" index="0" speed="13.90" length="80.00" shape="189.54,-90.72 260.58,-1.92"/>
+ </edge>
+ <edge id="gneE34" from="top0" to="gneJ17" priority="-1" length="80.00">
+ <lane id="gneE34_0" index="0" speed="13.90" length="80.00" shape="102.00,279.86 173.04,368.66"/>
+ </edge>
+ <edge id="gneE35" from="gneJ17" to="top0" priority="-1" length="80.00">
+ <lane id="gneE35_0" index="0" speed="13.90" length="80.00" shape="170.46,370.72 99.42,281.92"/>
+ </edge>
+ <edge id="gneE36" from="gneJ17" to="top1" priority="-1" length="80.00">
+ <lane id="gneE36_0" index="0" speed="13.90" length="80.00" shape="178.35,369.23 178.35,280.00"/>
+ </edge>
+ <edge id="gneE37" from="top1" to="gneJ17" priority="-1" length="80.00">
+ <lane id="gneE37_0" index="0" speed="13.90" length="80.00" shape="181.65,280.00 181.65,369.23"/>
+ </edge>
+ <edge id="gneE40" from="top2" to="gneJ17" priority="-1" length="80.00">
+ <lane id="gneE40_0" index="0" speed="13.90" length="80.00" shape="260.58,281.92 189.54,370.72"/>
+ </edge>
+ <edge id="gneE41" from="gneJ17" to="top2" priority="-1" length="80.00">
+ <lane id="gneE41_0" index="0" speed="13.90" length="80.00" shape="186.96,368.66 258.00,279.86"/>
+ </edge>
+ <edge id="left0to0/0" from="left0" to="0/0" priority="-1">
+ <lane id="left0to0/0_0" index="0" speed="13.90" length="94.62" shape="0.63,98.35 95.25,98.35"/>
+ </edge>
+ <edge id="left1to0/1" from="left1" to="0/1" priority="-1">
+ <lane id="left1to0/1_0" index="0" speed="13.90" length="94.62" shape="0.63,178.35 95.25,178.35"/>
+ </edge>
+ <edge id="left_in" from="gneJ9" to="gneJ10" priority="-1">
+ <lane id="left_in_0" index="0" speed="13.90" length="56.01" shape="-150.00,135.05 -93.99,135.05"/>
+ <lane id="left_in_1" index="1" speed="13.90" length="56.01" shape="-150.00,138.35 -93.99,138.35"/>
+ </edge>
+ <edge id="left_out" from="gneJ10" to="gneJ9" priority="-1">
+ <lane id="left_out_0" index="0" speed="13.90" length="56.01" shape="-93.99,144.95 -150.00,144.95"/>
+ <lane id="left_out_1" index="1" speed="13.90" length="56.01" shape="-93.99,141.65 -150.00,141.65"/>
+ </edge>
+ <edge id="right0to2/0" from="right0" to="2/0" priority="-1">
+ <lane id="right0to2/0_0" index="0" speed="13.90" length="94.62" shape="359.37,101.65 264.75,101.65"/>
+ </edge>
+ <edge id="right1to2/1" from="right1" to="2/1" priority="-1">
+ <lane id="right1to2/1_0" index="0" speed="13.90" length="94.62" shape="359.37,181.65 264.75,181.65"/>
+ </edge>
+ <edge id="right_in" from="gneJ13" to="gneJ12" priority="-1">
+ <lane id="right_in_0" index="0" speed="13.90" length="56.12" shape="510.00,144.95 453.88,144.95"/>
+ <lane id="right_in_1" index="1" speed="13.90" length="56.12" shape="510.00,141.65 453.88,141.65"/>
+ </edge>
+ <edge id="right_out" from="gneJ12" to="gneJ13" priority="-1">
+ <lane id="right_out_0" index="0" speed="13.90" length="56.12" shape="453.88,135.05 510.00,135.05"/>
+ <lane id="right_out_1" index="1" speed="13.90" length="56.12" shape="453.88,138.35 510.00,138.35"/>
+ </edge>
+ <edge id="top0to0/1" from="top0" to="0/1" priority="-1">
+ <lane id="top0to0/1_0" index="0" speed="13.90" length="94.11" shape="98.35,278.86 98.35,184.75"/>
+ </edge>
+ <edge id="top1to1/1" from="top1" to="1/1" priority="-1">
+ <lane id="top1to1/1_0" index="0" speed="13.90" length="95.25" shape="178.35,280.00 178.35,184.75"/>
+ </edge>
+ <edge id="top2to2/1" from="top2" to="2/1" priority="-1">
+ <lane id="top2to2/1_0" index="0" speed="13.90" length="94.11" shape="258.35,278.86 258.35,184.75"/>
+ </edge>
+ <edge id="top_in" from="gneJ18" to="gneJ17" priority="-1">
+ <lane id="top_in_0" index="0" speed="13.90" length="45.61" shape="171.75,420.00 171.75,374.39"/>
+ <lane id="top_in_1" index="1" speed="13.90" length="45.61" shape="175.05,420.00 175.05,374.39"/>
+ <lane id="top_in_2" index="2" speed="13.90" length="45.61" shape="178.35,420.00 178.35,374.39"/>
+ </edge>
+ <edge id="top_out" from="gneJ17" to="gneJ18" priority="-1">
+ <lane id="top_out_0" index="0" speed="13.90" length="45.61" shape="188.25,374.39 188.25,420.00"/>
+ <lane id="top_out_1" index="1" speed="13.90" length="45.61" shape="184.95,374.39 184.95,420.00"/>
+ <lane id="top_out_2" index="2" speed="13.90" length="45.61" shape="181.65,374.39 181.65,420.00"/>
+ </edge>
+
+ <tlLogic id="0/0" type="static" programID="0" offset="0">
+ <phase duration="1" state="uuyyuuyy"/>
+ <phase duration="1" state="uurruurr"/>
+ <phase duration="10000" state="GGrrGGrr"/>
+ </tlLogic>
+ <tlLogic id="0/0" type="static" programID="1" offset="0">
+ <phase duration="1" state="yyuuyyuu"/>
+ <phase duration="1" state="rruurruu"/>
+ <phase duration="10000" state="rrGGrrGG"/>
+ </tlLogic>
+ <tlLogic id="0/1" type="static" programID="0" offset="0">
+ <phase duration="1" state="uuyyuuyy"/>
+ <phase duration="1" state="uurruurr"/>
+ <phase duration="10000" state="GGrrGGrr"/>
+ </tlLogic>
+ <tlLogic id="0/1" type="static" programID="1" offset="0">
+ <phase duration="1" state="yyuuyyuu"/>
+ <phase duration="1" state="rruurruu"/>
+ <phase duration="10000" state="rrGGrrGG"/>
+ </tlLogic>
+ <tlLogic id="1/0" type="static" programID="0" offset="0">
+ <phase duration="1" state="uuyyuuyy"/>
+ <phase duration="1" state="uurruurr"/>
+ <phase duration="10000" state="GGrrGGrr"/>
+ </tlLogic>
+ <tlLogic id="1/0" type="static" programID="1" offset="0">
+ <phase duration="1" state="yyuuyyuu"/>
+ <phase duration="1" state="rruurruu"/>
+ <phase duration="10000" state="rrGGrrGG"/>
+ </tlLogic>
+ <tlLogic id="1/1" type="static" programID="0" offset="0">
+ <phase duration="1" state="uuyyuuyy"/>
+ <phase duration="1" state="uurruurr"/>
+ <phase duration="10000" state="GGrrGGrr"/>
+ </tlLogic>
+ <tlLogic id="1/1" type="static" programID="1" offset="0">
+ <phase duration="1" state="yyuuyyuu"/>
+ <phase duration="1" state="rruurruu"/>
+ <phase duration="10000" state="rrGGrrGG"/>
+ </tlLogic>
+ <tlLogic id="2/0" type="static" programID="0" offset="0">
+ <phase duration="1" state="uuyyuuyy"/>
+ <phase duration="1" state="uurruurr"/>
+ <phase duration="10000" state="GGrrGGrr"/>
+ </tlLogic>
+ <tlLogic id="2/0" type="static" programID="1" offset="0">
+ <phase duration="1" state="yyuuyyuu"/>
+ <phase duration="1" state="rruurruu"/>
+ <phase duration="10000" state="rrGGrrGG"/>
+ </tlLogic>
+ <tlLogic id="2/1" type="static" programID="0" offset="0">
+ <phase duration="1" state="uuyyuuyy"/>
+ <phase duration="1" state="uurruurr"/>
+ <phase duration="10000" state="GGrrGGrr"/>
+ </tlLogic>
+ <tlLogic id="2/1" type="static" programID="1" offset="0">
+ <phase duration="1" state="yyuuyyuu"/>
+ <phase duration="1" state="rruurruu"/>
+ <phase duration="10000" state="rrGGrrGG"/>
+ </tlLogic>
+
+ <junction id="0/0" type="traffic_light" x="100.00" y="100.00" incLanes="0/1to0/0_0 1/0to0/0_0 bottom0to0/0_0 left0to0/0_0" intLanes=":0/0_0_0 :0/0_1_0 :0/0_2_0 :0/0_3_0 :0/0_4_0 :0/0_5_0 :0/0_6_0 :0/0_7_0" shape="96.75,104.75 103.25,104.75 104.75,103.25 104.75,96.75 103.25,95.25 96.75,95.25 95.25,96.75 95.25,103.25">
+ <request index="0" response="00000000" foes="00001000" cont="0"/>
+ <request index="1" response="00000000" foes="11001000" cont="0"/>
+ <request index="2" response="00100000" foes="00100000" cont="0"/>
+ <request index="3" response="00100011" foes="00100011" cont="0"/>
+ <request index="4" response="00000000" foes="10000000" cont="0"/>
+ <request index="5" response="00000000" foes="10001100" cont="0"/>
+ <request index="6" response="00000010" foes="00000010" cont="0"/>
+ <request index="7" response="00110010" foes="00110010" cont="0"/>
+ </junction>
+ <junction id="0/1" type="traffic_light" x="100.00" y="180.00" incLanes="top0to0/1_0 1/1to0/1_0 0/0to0/1_0 left1to0/1_0" intLanes=":0/1_0_0 :0/1_1_0 :0/1_2_0 :0/1_3_0 :0/1_4_0 :0/1_5_0 :0/1_6_0 :0/1_7_0" shape="96.75,184.75 103.25,184.75 104.75,183.25 104.75,176.75 103.25,175.25 96.75,175.25 95.25,176.75 95.25,183.25">
+ <request index="0" response="00000000" foes="00001000" cont="0"/>
+ <request index="1" response="00000000" foes="11001000" cont="0"/>
+ <request index="2" response="00100000" foes="00100000" cont="0"/>
+ <request index="3" response="00100011" foes="00100011" cont="0"/>
+ <request index="4" response="00000000" foes="10000000" cont="0"/>
+ <request index="5" response="00000000" foes="10001100" cont="0"/>
+ <request index="6" response="00000010" foes="00000010" cont="0"/>
+ <request index="7" response="00110010" foes="00110010" cont="0"/>
+ </junction>
+ <junction id="1/0" type="traffic_light" x="180.00" y="100.00" incLanes="1/1to1/0_0 2/0to1/0_0 bottom1to1/0_0 0/0to1/0_0" intLanes=":1/0_0_0 :1/0_1_0 :1/0_2_0 :1/0_3_0 :1/0_4_0 :1/0_5_0 :1/0_6_0 :1/0_7_0" shape="176.75,104.75 183.25,104.75 184.75,103.25 184.75,96.75 183.25,95.25 176.75,95.25 175.25,96.75 175.25,103.25">
+ <request index="0" response="00000000" foes="00001000" cont="0"/>
+ <request index="1" response="00000000" foes="11001000" cont="0"/>
+ <request index="2" response="00100000" foes="00100000" cont="0"/>
+ <request index="3" response="00100011" foes="00100011" cont="0"/>
+ <request index="4" response="00000000" foes="10000000" cont="0"/>
+ <request index="5" response="00000000" foes="10001100" cont="0"/>
+ <request index="6" response="00000010" foes="00000010" cont="0"/>
+ <request index="7" response="00110010" foes="00110010" cont="0"/>
+ </junction>
+ <junction id="1/1" type="traffic_light" x="180.00" y="180.00" incLanes="top1to1/1_0 2/1to1/1_0 1/0to1/1_0 0/1to1/1_0" intLanes=":1/1_0_0 :1/1_1_0 :1/1_2_0 :1/1_3_0 :1/1_4_0 :1/1_5_0 :1/1_6_0 :1/1_7_0" shape="176.75,184.75 183.25,184.75 184.75,183.25 184.75,176.75 183.25,175.25 176.75,175.25 175.25,176.75 175.25,183.25">
+ <request index="0" response="00000000" foes="00001000" cont="0"/>
+ <request index="1" response="00000000" foes="11001000" cont="0"/>
+ <request index="2" response="00100000" foes="00100000" cont="0"/>
+ <request index="3" response="00100011" foes="00100011" cont="0"/>
+ <request index="4" response="00000000" foes="10000000" cont="0"/>
+ <request index="5" response="00000000" foes="10001100" cont="0"/>
+ <request index="6" response="00000010" foes="00000010" cont="0"/>
+ <request index="7" response="00110010" foes="00110010" cont="0"/>
+ </junction>
+ <junction id="2/0" type="traffic_light" x="260.00" y="100.00" incLanes="2/1to2/0_0 right0to2/0_0 bottom2to2/0_0 1/0to2/0_0" intLanes=":2/0_0_0 :2/0_1_0 :2/0_2_0 :2/0_3_0 :2/0_4_0 :2/0_5_0 :2/0_6_0 :2/0_7_0" shape="256.75,104.75 263.25,104.75 264.75,103.25 264.75,96.75 263.25,95.25 256.75,95.25 255.25,96.75 255.25,103.25">
+ <request index="0" response="00000000" foes="00001000" cont="0"/>
+ <request index="1" response="00000000" foes="11001000" cont="0"/>
+ <request index="2" response="00100000" foes="00100000" cont="0"/>
+ <request index="3" response="00100011" foes="00100011" cont="0"/>
+ <request index="4" response="00000000" foes="10000000" cont="0"/>
+ <request index="5" response="00000000" foes="10001100" cont="0"/>
+ <request index="6" response="00000010" foes="00000010" cont="0"/>
+ <request index="7" response="00110010" foes="00110010" cont="0"/>
+ </junction>
+ <junction id="2/1" type="traffic_light" x="260.00" y="180.00" incLanes="top2to2/1_0 right1to2/1_0 2/0to2/1_0 1/1to2/1_0" intLanes=":2/1_0_0 :2/1_1_0 :2/1_2_0 :2/1_3_0 :2/1_4_0 :2/1_5_0 :2/1_6_0 :2/1_7_0" shape="256.75,184.75 263.25,184.75 264.75,183.25 264.75,176.75 263.25,175.25 256.75,175.25 255.25,176.75 255.25,183.25">
+ <request index="0" response="00000000" foes="00001000" cont="0"/>
+ <request index="1" response="00000000" foes="11001000" cont="0"/>
+ <request index="2" response="00100000" foes="00100000" cont="0"/>
+ <request index="3" response="00100011" foes="00100011" cont="0"/>
+ <request index="4" response="00000000" foes="10000000" cont="0"/>
+ <request index="5" response="00000000" foes="10001100" cont="0"/>
+ <request index="6" response="00000010" foes="00000010" cont="0"/>
+ <request index="7" response="00110010" foes="00110010" cont="0"/>
+ </junction>
+ <junction id="bottom0" type="priority" x="100.00" y="0.00" incLanes="0/0tobottom0_0 gneE27_0" intLanes=":bottom0_0_0 :bottom0_1_0" shape="96.75,1.14 103.25,1.14 98.17,-2.92">
+ <request index="0" response="00" foes="00" cont="0"/>
+ <request index="1" response="00" foes="00" cont="0"/>
+ </junction>
+ <junction id="bottom1" type="priority" x="180.00" y="0.00" incLanes="1/0tobottom1_0 gneE28_0" intLanes=":bottom1_0_0 :bottom1_1_0" shape="176.75,0.00 183.25,0.00 176.75,-0.00">
+ <request index="0" response="00" foes="00" cont="0"/>
+ <request index="1" response="00" foes="00" cont="0"/>
+ </junction>
+ <junction id="bottom2" type="priority" x="260.00" y="0.00" incLanes="2/0tobottom2_0 gneE31_0" intLanes=":bottom2_0_0 :bottom2_1_0" shape="256.75,1.14 263.25,1.14 261.83,-2.92 256.75,1.14">
+ <request index="0" response="00" foes="00" cont="0"/>
+ <request index="1" response="00" foes="00" cont="0"/>
+ </junction>
+ <junction id="gneJ10" type="unregulated" x="-100.00" y="140.00" incLanes="gneE13_0 gneE17_0 left_in_0 left_in_1" intLanes=":gneJ10_0_0 :gneJ10_1_0 :gneJ10_2_0 :gneJ10_3_0" shape="-90.98,147.11 -88.57,141.07 -88.57,138.93 -90.98,132.89 -93.99,133.45 -93.99,146.55"/>
+ <junction id="gneJ12" type="unregulated" x="460.00" y="140.00" incLanes="right_in_0 right_in_1 gneE24_0 gneE20_0" intLanes=":gneJ12_0_0 :gneJ12_1_0 :gneJ12_2_0 :gneJ12_3_0" shape="453.88,146.55 453.88,133.45 450.98,132.89 448.57,138.93 448.57,141.07 450.98,147.11"/>
+ <junction id="gneJ13" type="dead_end" x="510.00" y="140.00" incLanes="right_out_0 right_out_1" intLanes="" shape="510.00,140.05 510.00,146.55 510.00,133.45 510.00,139.95"/>
+ <junction id="gneJ14" type="unregulated" x="180.00" y="-100.00" incLanes="gneE29_0 gneE30_0 bottom_in_0 bottom_in_1 bottom_in_2 gneE26_0" intLanes=":gneJ14_0_0 :gneJ14_1_0 :gneJ14_2_0 :gneJ14_3_0 :gneJ14_4_0 :gneJ14_5_0" shape="176.75,-89.23 183.25,-89.23 185.71,-87.66 190.79,-91.72 189.85,-94.39 170.15,-94.39 169.21,-91.72 174.29,-87.66"/>
+ <junction id="gneJ16" type="dead_end" x="180.00" y="-150.00" incLanes="bottom_out_0 bottom_out_1 bottom_out_2" intLanes="" shape="180.05,-150.00 189.85,-150.00 170.15,-150.00 179.95,-150.00"/>
+ <junction id="gneJ17" type="unregulated" x="180.00" y="380.00" incLanes="top_in_0 top_in_1 top_in_2 gneE40_0 gneE37_0 gneE34_0" intLanes=":gneJ17_0_0 :gneJ17_1_0 :gneJ17_2_0 :gneJ17_3_0 :gneJ17_4_0 :gneJ17_5_0" shape="170.15,374.39 189.85,374.39 190.79,371.72 185.71,367.66 183.25,369.23 176.75,369.23 174.29,367.66 169.21,371.72"/>
+ <junction id="gneJ18" type="dead_end" x="180.00" y="420.00" incLanes="top_out_0 top_out_1 top_out_2" intLanes="" shape="179.95,420.00 170.15,420.00 189.85,420.00 180.05,420.00"/>
+ <junction id="gneJ9" type="dead_end" x="-150.00" y="140.00" incLanes="left_out_0 left_out_1" intLanes="" shape="-150.00,139.95 -150.00,133.45 -150.00,146.55 -150.00,140.05"/>
+ <junction id="left0" type="priority" x="0.00" y="100.00" incLanes="0/0toleft0_0 gneE16_0" intLanes=":left0_0_0 :left0_1_0" shape="0.63,103.25 0.63,96.75 -1.79,97.21 0.63,103.25">
+ <request index="0" response="00" foes="00" cont="0"/>
+ <request index="1" response="00" foes="00" cont="0"/>
+ </junction>
+ <junction id="left1" type="priority" x="0.00" y="180.00" incLanes="0/1toleft1_0 gneE12_0" intLanes=":left1_0_0 :left1_1_0" shape="0.63,183.25 0.63,176.75 -1.79,182.79">
+ <request index="0" response="00" foes="00" cont="0"/>
+ <request index="1" response="00" foes="00" cont="0"/>
+ </junction>
+ <junction id="right0" type="priority" x="360.00" y="100.00" incLanes="gneE25_0 2/0toright0_0" intLanes=":right0_0_0 :right0_1_0" shape="359.37,103.25 361.79,97.21 359.37,96.75 359.37,103.25">
+ <request index="0" response="00" foes="00" cont="0"/>
+ <request index="1" response="00" foes="00" cont="0"/>
+ </junction>
+ <junction id="right1" type="priority" x="360.00" y="180.00" incLanes="gneE21_0 2/1toright1_0" intLanes=":right1_0_0 :right1_1_0" shape="361.79,182.79 359.37,176.75 359.37,183.25">
+ <request index="0" response="00" foes="00" cont="0"/>
+ <request index="1" response="00" foes="00" cont="0"/>
+ </junction>
+ <junction id="top0" type="priority" x="100.00" y="280.00" incLanes="gneE35_0 0/1totop0_0" intLanes=":top0_0_0 :top0_1_0" shape="98.17,282.92 103.25,278.86 96.75,278.86">
+ <request index="0" response="00" foes="00" cont="0"/>
+ <request index="1" response="00" foes="00" cont="0"/>
+ </junction>
+ <junction id="top1" type="priority" x="180.00" y="280.00" incLanes="gneE36_0 1/1totop1_0" intLanes=":top1_0_0 :top1_1_0" shape="176.75,280.00 183.25,280.00 176.75,280.00">
+ <request index="0" response="00" foes="00" cont="0"/>
+ <request index="1" response="00" foes="00" cont="0"/>
+ </junction>
+ <junction id="top2" type="priority" x="260.00" y="280.00" incLanes="2/1totop2_0 gneE41_0" intLanes=":top2_0_0 :top2_1_0" shape="263.25,278.86 256.75,278.86 261.83,282.92">
+ <request index="0" response="00" foes="00" cont="0"/>
+ <request index="1" response="00" foes="00" cont="0"/>
+ </junction>
+
+ <connection from="0/0to0/1" to="0/1to1/1" fromLane="0" toLane="0" via=":0/1_4_0" tl="0/1" linkIndex="4" dir="r" state="o"/>
+ <connection from="0/0to0/1" to="0/1totop0" fromLane="0" toLane="0" via=":0/1_5_0" tl="0/1" linkIndex="5" dir="s" state="o"/>
+ <connection from="0/0to1/0" to="1/0tobottom1" fromLane="0" toLane="0" via=":1/0_6_0" tl="1/0" linkIndex="6" dir="r" state="o"/>
+ <connection from="0/0to1/0" to="1/0to2/0" fromLane="0" toLane="0" via=":1/0_7_0" tl="1/0" linkIndex="7" dir="s" state="o"/>
+ <connection from="0/0tobottom0" to="gneE26" fromLane="0" toLane="0" via=":bottom0_0_0" dir="s" state="M"/>
+ <connection from="0/0toleft0" to="gneE17" fromLane="0" toLane="0" via=":left0_0_0" dir="s" state="M"/>
+ <connection from="0/1to0/0" to="0/0toleft0" fromLane="0" toLane="0" via=":0/0_0_0" tl="0/0" linkIndex="0" dir="r" state="o"/>
+ <connection from="0/1to0/0" to="0/0tobottom0" fromLane="0" toLane="0" via=":0/0_1_0" tl="0/0" linkIndex="1" dir="s" state="o"/>
+ <connection from="0/1to1/1" to="1/1to1/0" fromLane="0" toLane="0" via=":1/1_6_0" tl="1/1" linkIndex="6" dir="r" state="o"/>
+ <connection from="0/1to1/1" to="1/1to2/1" fromLane="0" toLane="0" via=":1/1_7_0" tl="1/1" linkIndex="7" dir="s" state="o"/>
+ <connection from="0/1toleft1" to="gneE13" fromLane="0" toLane="0" via=":left1_0_0" dir="s" state="M"/>
+ <connection from="0/1totop0" to="gneE34" fromLane="0" toLane="0" via=":top0_1_0" dir="s" state="M"/>
+ <connection from="1/0to0/0" to="0/0to0/1" fromLane="0" toLane="0" via=":0/0_2_0" tl="0/0" linkIndex="2" dir="r" state="o"/>
+ <connection from="1/0to0/0" to="0/0toleft0" fromLane="0" toLane="0" via=":0/0_3_0" tl="0/0" linkIndex="3" dir="s" state="o"/>
+ <connection from="1/0to1/1" to="1/1to2/1" fromLane="0" toLane="0" via=":1/1_4_0" tl="1/1" linkIndex="4" dir="r" state="o"/>
+ <connection from="1/0to1/1" to="1/1totop1" fromLane="0" toLane="0" via=":1/1_5_0" tl="1/1" linkIndex="5" dir="s" state="o"/>
+ <connection from="1/0to2/0" to="2/0tobottom2" fromLane="0" toLane="0" via=":2/0_6_0" tl="2/0" linkIndex="6" dir="r" state="o"/>
+ <connection from="1/0to2/0" to="2/0toright0" fromLane="0" toLane="0" via=":2/0_7_0" tl="2/0" linkIndex="7" dir="s" state="o"/>
+ <connection from="1/0tobottom1" to="gneE29" fromLane="0" toLane="0" via=":bottom1_0_0" dir="s" state="M"/>
+ <connection from="1/1to0/1" to="0/1totop0" fromLane="0" toLane="0" via=":0/1_2_0" tl="0/1" linkIndex="2" dir="r" state="o"/>
+ <connection from="1/1to0/1" to="0/1toleft1" fromLane="0" toLane="0" via=":0/1_3_0" tl="0/1" linkIndex="3" dir="s" state="o"/>
+ <connection from="1/1to1/0" to="1/0to0/0" fromLane="0" toLane="0" via=":1/0_0_0" tl="1/0" linkIndex="0" dir="r" state="o"/>
+ <connection from="1/1to1/0" to="1/0tobottom1" fromLane="0" toLane="0" via=":1/0_1_0" tl="1/0" linkIndex="1" dir="s" state="o"/>
+ <connection from="1/1to2/1" to="2/1to2/0" fromLane="0" toLane="0" via=":2/1_6_0" tl="2/1" linkIndex="6" dir="r" state="o"/>
+ <connection from="1/1to2/1" to="2/1toright1" fromLane="0" toLane="0" via=":2/1_7_0" tl="2/1" linkIndex="7" dir="s" state="o"/>
+ <connection from="1/1totop1" to="gneE37" fromLane="0" toLane="0" via=":top1_1_0" dir="s" state="M"/>
+ <connection from="2/0to1/0" to="1/0to1/1" fromLane="0" toLane="0" via=":1/0_2_0" tl="1/0" linkIndex="2" dir="r" state="o"/>
+ <connection from="2/0to1/0" to="1/0to0/0" fromLane="0" toLane="0" via=":1/0_3_0" tl="1/0" linkIndex="3" dir="s" state="o"/>
+ <connection from="2/0to2/1" to="2/1toright1" fromLane="0" toLane="0" via=":2/1_4_0" tl="2/1" linkIndex="4" dir="r" state="o"/>
+ <connection from="2/0to2/1" to="2/1totop2" fromLane="0" toLane="0" via=":2/1_5_0" tl="2/1" linkIndex="5" dir="s" state="o"/>
+ <connection from="2/0tobottom2" to="gneE30" fromLane="0" toLane="0" via=":bottom2_0_0" dir="s" state="M"/>
+ <connection from="2/0toright0" to="gneE24" fromLane="0" toLane="0" via=":right0_1_0" dir="s" state="M"/>
+ <connection from="2/1to1/1" to="1/1totop1" fromLane="0" toLane="0" via=":1/1_2_0" tl="1/1" linkIndex="2" dir="r" state="o"/>
+ <connection from="2/1to1/1" to="1/1to0/1" fromLane="0" toLane="0" via=":1/1_3_0" tl="1/1" linkIndex="3" dir="s" state="o"/>
+ <connection from="2/1to2/0" to="2/0to1/0" fromLane="0" toLane="0" via=":2/0_0_0" tl="2/0" linkIndex="0" dir="r" state="o"/>
+ <connection from="2/1to2/0" to="2/0tobottom2" fromLane="0" toLane="0" via=":2/0_1_0" tl="2/0" linkIndex="1" dir="s" state="o"/>
+ <connection from="2/1toright1" to="gneE20" fromLane="0" toLane="0" via=":right1_1_0" dir="s" state="M"/>
+ <connection from="2/1totop2" to="gneE40" fromLane="0" toLane="0" via=":top2_0_0" dir="s" state="M"/>
+ <connection from="bottom0to0/0" to="0/0to1/0" fromLane="0" toLane="0" via=":0/0_4_0" tl="0/0" linkIndex="4" dir="r" state="o"/>
+ <connection from="bottom0to0/0" to="0/0to0/1" fromLane="0" toLane="0" via=":0/0_5_0" tl="0/0" linkIndex="5" dir="s" state="o"/>
+ <connection from="bottom1to1/0" to="1/0to2/0" fromLane="0" toLane="0" via=":1/0_4_0" tl="1/0" linkIndex="4" dir="r" state="o"/>
+ <connection from="bottom1to1/0" to="1/0to1/1" fromLane="0" toLane="0" via=":1/0_5_0" tl="1/0" linkIndex="5" dir="s" state="o"/>
+ <connection from="bottom2to2/0" to="2/0toright0" fromLane="0" toLane="0" via=":2/0_4_0" tl="2/0" linkIndex="4" dir="r" state="o"/>
+ <connection from="bottom2to2/0" to="2/0to2/1" fromLane="0" toLane="0" via=":2/0_5_0" tl="2/0" linkIndex="5" dir="s" state="o"/>
+ <connection from="bottom_in" to="gneE31" fromLane="0" toLane="0" via=":gneJ14_2_0" dir="s" state="M"/>
+ <connection from="bottom_in" to="gneE28" fromLane="1" toLane="0" via=":gneJ14_3_0" dir="s" state="M"/>
+ <connection from="bottom_in" to="gneE27" fromLane="2" toLane="0" via=":gneJ14_4_0" dir="s" state="M"/>
+ <connection from="gneE12" to="left1to0/1" fromLane="0" toLane="0" via=":left1_1_0" dir="s" state="M"/>
+ <connection from="gneE13" to="left_out" fromLane="0" toLane="0" via=":gneJ10_0_0" dir="s" state="M"/>
+ <connection from="gneE16" to="left0to0/0" fromLane="0" toLane="0" via=":left0_1_0" dir="s" state="M"/>
+ <connection from="gneE17" to="left_out" fromLane="0" toLane="1" via=":gneJ10_1_0" dir="s" state="M"/>
+ <connection from="gneE20" to="right_out" fromLane="0" toLane="1" via=":gneJ12_3_0" dir="s" state="M"/>
+ <connection from="gneE21" to="right1to2/1" fromLane="0" toLane="0" via=":right1_0_0" dir="s" state="M"/>
+ <connection from="gneE24" to="right_out" fromLane="0" toLane="0" via=":gneJ12_2_0" dir="s" state="M"/>
+ <connection from="gneE25" to="right0to2/0" fromLane="0" toLane="0" via=":right0_0_0" dir="s" state="M"/>
+ <connection from="gneE26" to="bottom_out" fromLane="0" toLane="0" via=":gneJ14_5_0" dir="s" state="M"/>
+ <connection from="gneE27" to="bottom0to0/0" fromLane="0" toLane="0" via=":bottom0_1_0" dir="s" state="M"/>
+ <connection from="gneE28" to="bottom1to1/0" fromLane="0" toLane="0" via=":bottom1_1_0" dir="s" state="M"/>
+ <connection from="gneE29" to="bottom_out" fromLane="0" toLane="1" via=":gneJ14_0_0" dir="s" state="M"/>
+ <connection from="gneE30" to="bottom_out" fromLane="0" toLane="2" via=":gneJ14_1_0" dir="s" state="M"/>
+ <connection from="gneE31" to="bottom2to2/0" fromLane="0" toLane="0" via=":bottom2_1_0" dir="s" state="M"/>
+ <connection from="gneE34" to="top_out" fromLane="0" toLane="2" via=":gneJ17_5_0" dir="s" state="M"/>
+ <connection from="gneE35" to="top0to0/1" fromLane="0" toLane="0" via=":top0_0_0" dir="s" state="M"/>
+ <connection from="gneE36" to="top1to1/1" fromLane="0" toLane="0" via=":top1_0_0" dir="s" state="M"/>
+ <connection from="gneE37" to="top_out" fromLane="0" toLane="1" via=":gneJ17_4_0" dir="s" state="M"/>
+ <connection from="gneE40" to="top_out" fromLane="0" toLane="0" via=":gneJ17_3_0" dir="s" state="M"/>
+ <connection from="gneE41" to="top2to2/1" fromLane="0" toLane="0" via=":top2_1_0" dir="s" state="M"/>
+ <connection from="left0to0/0" to="0/0tobottom0" fromLane="0" toLane="0" via=":0/0_6_0" tl="0/0" linkIndex="6" dir="r" state="o"/>
+ <connection from="left0to0/0" to="0/0to1/0" fromLane="0" toLane="0" via=":0/0_7_0" tl="0/0" linkIndex="7" dir="s" state="o"/>
+ <connection from="left1to0/1" to="0/1to0/0" fromLane="0" toLane="0" via=":0/1_6_0" tl="0/1" linkIndex="6" dir="r" state="o"/>
+ <connection from="left1to0/1" to="0/1to1/1" fromLane="0" toLane="0" via=":0/1_7_0" tl="0/1" linkIndex="7" dir="s" state="o"/>
+ <connection from="left_in" to="gneE16" fromLane="0" toLane="0" via=":gneJ10_2_0" dir="s" state="M"/>
+ <connection from="left_in" to="gneE12" fromLane="1" toLane="0" via=":gneJ10_3_0" dir="s" state="M"/>
+ <connection from="right0to2/0" to="2/0to2/1" fromLane="0" toLane="0" via=":2/0_2_0" tl="2/0" linkIndex="2" dir="r" state="o"/>
+ <connection from="right0to2/0" to="2/0to1/0" fromLane="0" toLane="0" via=":2/0_3_0" tl="2/0" linkIndex="3" dir="s" state="o"/>
+ <connection from="right1to2/1" to="2/1totop2" fromLane="0" toLane="0" via=":2/1_2_0" tl="2/1" linkIndex="2" dir="r" state="o"/>
+ <connection from="right1to2/1" to="2/1to1/1" fromLane="0" toLane="0" via=":2/1_3_0" tl="2/1" linkIndex="3" dir="s" state="o"/>
+ <connection from="right_in" to="gneE21" fromLane="0" toLane="0" via=":gneJ12_0_0" dir="s" state="M"/>
+ <connection from="right_in" to="gneE25" fromLane="1" toLane="0" via=":gneJ12_1_0" dir="s" state="M"/>
+ <connection from="top0to0/1" to="0/1toleft1" fromLane="0" toLane="0" via=":0/1_0_0" tl="0/1" linkIndex="0" dir="r" state="o"/>
+ <connection from="top0to0/1" to="0/1to0/0" fromLane="0" toLane="0" via=":0/1_1_0" tl="0/1" linkIndex="1" dir="s" state="o"/>
+ <connection from="top1to1/1" to="1/1to0/1" fromLane="0" toLane="0" via=":1/1_0_0" tl="1/1" linkIndex="0" dir="r" state="o"/>
+ <connection from="top1to1/1" to="1/1to1/0" fromLane="0" toLane="0" via=":1/1_1_0" tl="1/1" linkIndex="1" dir="s" state="o"/>
+ <connection from="top2to2/1" to="2/1to1/1" fromLane="0" toLane="0" via=":2/1_0_0" tl="2/1" linkIndex="0" dir="r" state="o"/>
+ <connection from="top2to2/1" to="2/1to2/0" fromLane="0" toLane="0" via=":2/1_1_0" tl="2/1" linkIndex="1" dir="s" state="o"/>
+ <connection from="top_in" to="gneE35" fromLane="0" toLane="0" via=":gneJ17_0_0" dir="s" state="M"/>
+ <connection from="top_in" to="gneE36" fromLane="1" toLane="0" via=":gneJ17_1_0" dir="s" state="M"/>
+ <connection from="top_in" to="gneE41" fromLane="2" toLane="0" via=":gneJ17_2_0" dir="s" state="M"/>
+
+ <connection from=":0/0_0" to="0/0toleft0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":0/0_1" to="0/0tobottom0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":0/0_2" to="0/0to0/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":0/0_3" to="0/0toleft0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":0/0_4" to="0/0to1/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":0/0_5" to="0/0to0/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":0/0_6" to="0/0tobottom0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":0/0_7" to="0/0to1/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":0/1_0" to="0/1toleft1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":0/1_1" to="0/1to0/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":0/1_2" to="0/1totop0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":0/1_3" to="0/1toleft1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":0/1_4" to="0/1to1/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":0/1_5" to="0/1totop0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":0/1_6" to="0/1to0/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":0/1_7" to="0/1to1/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":1/0_0" to="1/0to0/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":1/0_1" to="1/0tobottom1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":1/0_2" to="1/0to1/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":1/0_3" to="1/0to0/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":1/0_4" to="1/0to2/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":1/0_5" to="1/0to1/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":1/0_6" to="1/0tobottom1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":1/0_7" to="1/0to2/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":1/1_0" to="1/1to0/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":1/1_1" to="1/1to1/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":1/1_2" to="1/1totop1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":1/1_3" to="1/1to0/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":1/1_4" to="1/1to2/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":1/1_5" to="1/1totop1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":1/1_6" to="1/1to1/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":1/1_7" to="1/1to2/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":2/0_0" to="2/0to1/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":2/0_1" to="2/0tobottom2" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":2/0_2" to="2/0to2/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":2/0_3" to="2/0to1/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":2/0_4" to="2/0toright0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":2/0_5" to="2/0to2/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":2/0_6" to="2/0tobottom2" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":2/0_7" to="2/0toright0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":2/1_0" to="2/1to1/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":2/1_1" to="2/1to2/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":2/1_2" to="2/1totop2" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":2/1_3" to="2/1to1/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":2/1_4" to="2/1toright1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":2/1_5" to="2/1totop2" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":2/1_6" to="2/1to2/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":2/1_7" to="2/1toright1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":bottom0_0" to="gneE26" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":bottom0_1" to="bottom0to0/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":bottom1_0" to="gneE29" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":bottom1_1" to="bottom1to1/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":bottom2_0" to="gneE30" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":bottom2_1" to="bottom2to2/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":gneJ10_0" to="left_out" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":gneJ10_1" to="left_out" fromLane="0" toLane="1" dir="s" state="M"/>
+ <connection from=":gneJ10_2" to="gneE16" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":gneJ10_3" to="gneE12" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":gneJ12_0" to="gneE21" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":gneJ12_1" to="gneE25" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":gneJ12_2" to="right_out" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":gneJ12_3" to="right_out" fromLane="0" toLane="1" dir="s" state="M"/>
+ <connection from=":gneJ14_0" to="bottom_out" fromLane="0" toLane="1" dir="s" state="M"/>
+ <connection from=":gneJ14_1" to="bottom_out" fromLane="0" toLane="2" dir="s" state="M"/>
+ <connection from=":gneJ14_2" to="gneE31" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":gneJ14_3" to="gneE28" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":gneJ14_4" to="gneE27" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":gneJ14_5" to="bottom_out" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":gneJ17_0" to="gneE35" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":gneJ17_1" to="gneE36" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":gneJ17_2" to="gneE41" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":gneJ17_3" to="top_out" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":gneJ17_4" to="top_out" fromLane="0" toLane="1" dir="s" state="M"/>
+ <connection from=":gneJ17_5" to="top_out" fromLane="0" toLane="2" dir="s" state="M"/>
+ <connection from=":left0_0" to="gneE17" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":left0_1" to="left0to0/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":left1_0" to="gneE13" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":left1_1" to="left1to0/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":right0_0" to="right0to2/0" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":right0_1" to="gneE24" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":right1_0" to="right1to2/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":right1_1" to="gneE20" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":top0_0" to="top0to0/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":top0_1" to="gneE34" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":top1_0" to="top1to1/1" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":top1_1" to="gneE37" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":top2_0" to="gneE40" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":top2_1" to="top2to2/1" fromLane="0" toLane="0" dir="s" state="M"/>
+
+</net>
diff --git a/tools/game/grid6/grid6.netgcfg b/tools/game/grid6/grid6.netgcfg
new file mode 100644
index 0000000..c1168fc
--- /dev/null
+++ b/tools/game/grid6/grid6.netgcfg
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netgenerateConfiguration.xsd">
+
+ <grid_network>
+ <grid value="true"/>
+ <grid.length value="80"/>
+ <grid.x-number value="3"/>
+ <grid.y-number value="2"/>
+ <grid.attach-length value="100"/>
+ </grid_network>
+
+ <output>
+ <output-file value="grid6.tmp.net.xml"/>
+ </output>
+
+ <processing>
+ <no-turnarounds value="true"/>
+ <no-left-connections value="true"/>
+ </processing>
+
+ <building_defaults>
+ <default-junction-type value="traffic_light"/>
+ </building_defaults>
+
+</configuration>
diff --git a/tools/game/grid6/grid6.nod.xml b/tools/game/grid6/grid6.nod.xml
new file mode 100644
index 0000000..fb088ea
--- /dev/null
+++ b/tools/game/grid6/grid6.nod.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- generated on Wed May 27 15:37:58 2015 by SUMO netconvert Version dev-SVN-r18449I
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netconvertConfiguration.xsd">
+
+ <input>
+ <sumo-net-file value="grid6.net.xml"/>
+ </input>
+
+ <output>
+ <plain-output-prefix value="grid6"/>
+ </output>
+
+ <processing>
+ <no-turnarounds value="true"/>
+ <offset.disable-normalization value="true"/>
+ </processing>
+
+</configuration>
+-->
+
+<nodes version="0.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/nodes_file.xsd">
+ <location netOffset="0.00,0.00" convBoundary="-150.00,-150.00,510.00,420.00" origBoundary="0.00,0.00,360.00,280.00" projParameter="!"/>
+
+ <node id="0/0" x="100.00" y="100.00" type="traffic_light" tl="0/0"/>
+ <node id="0/1" x="100.00" y="180.00" type="traffic_light" tl="0/1"/>
+ <node id="1/0" x="180.00" y="100.00" type="traffic_light" tl="1/0"/>
+ <node id="1/1" x="180.00" y="180.00" type="traffic_light" tl="1/1"/>
+ <node id="2/0" x="260.00" y="100.00" type="traffic_light" tl="2/0"/>
+ <node id="2/1" x="260.00" y="180.00" type="traffic_light" tl="2/1"/>
+ <node id="bottom0" x="100.00" y="0.00" type="priority"/>
+ <node id="bottom1" x="180.00" y="0.00" type="priority"/>
+ <node id="bottom2" x="260.00" y="0.00" type="priority"/>
+ <node id="gneJ10" x="-100.00" y="140.00" type="unregulated"/>
+ <node id="gneJ12" x="460.00" y="140.00" type="unregulated"/>
+ <node id="gneJ13" x="510.00" y="140.00" type="dead_end"/>
+ <node id="gneJ14" x="180.00" y="-100.00" type="unregulated"/>
+ <node id="gneJ16" x="180.00" y="-150.00" type="dead_end"/>
+ <node id="gneJ17" x="180.00" y="380.00" type="unregulated"/>
+ <node id="gneJ18" x="180.00" y="420.00" type="dead_end"/>
+ <node id="gneJ9" x="-150.00" y="140.00" type="dead_end"/>
+ <node id="left0" x="0.00" y="100.00" type="priority"/>
+ <node id="left1" x="0.00" y="180.00" type="priority"/>
+ <node id="right0" x="360.00" y="100.00" type="priority"/>
+ <node id="right1" x="360.00" y="180.00" type="priority"/>
+ <node id="top0" x="100.00" y="280.00" type="priority"/>
+ <node id="top1" x="180.00" y="280.00" type="priority"/>
+ <node id="top2" x="260.00" y="280.00" type="priority"/>
+</nodes>
diff --git a/tools/game/grid6/grid6.rou.xml b/tools/game/grid6/grid6.rou.xml
new file mode 100644
index 0000000..0d608a5
--- /dev/null
+++ b/tools/game/grid6/grid6.rou.xml
@@ -0,0 +1,17 @@
+<routes>
+ <vType id="DEFAULT_VEHTYPE" speedDev="0.1"/>
+ <flow id="leftRight" from="left_in" to="right_out" begin="0" end="90000" probability="0.125" departSpeed="max" departLane="best"/>
+ <flow id="rightLeft" from="right_in" to="left_out" begin="0" end="90000" probability="0.125" departSpeed="max" departLane="best"/>
+ <flow id="topBottom" from="top_in" to="bottom_out" begin="0" end="90000" probability="0.125" departSpeed="max" departLane="best"/>
+ <flow id="bottomTop" from="bottom_in" to="top_out" begin="0" end="90000" probability="0.125" departSpeed="max" departLane="best"/>
+
+ <flow id="leftRight2" from="left_in" to="right_out" begin="60" end="90000" probability="0.2" departSpeed="max" departLane="best"/>
+ <flow id="rightLeft2" from="right_in" to="left_out" begin="60" end="90000" probability="0.2" departSpeed="max" departLane="best"/>
+ <flow id="topBottom2" from="top_in" to="bottom_out" begin="60" end="90000" probability="0.2" departSpeed="max" departLane="best"/>
+ <flow id="bottomTop2" from="bottom_in" to="top_out" begin="60" end="90000" probability="0.2" departSpeed="max" departLane="best"/>
+
+ <flow id="leftRight3" from="left_in" to="right_out" begin="160" end="90000" probability="0.2" departSpeed="max" departLane="best"/>
+ <flow id="rightLeft3" from="right_in" to="left_out" begin="160" end="90000" probability="0.2" departSpeed="max" departLane="best"/>
+ <flow id="topBottom3" from="top_in" to="bottom_out" begin="160" end="90000" probability="0.2" departSpeed="max" departLane="best"/>
+ <flow id="bottomTop3" from="bottom_in" to="top_out" begin="160" end="90000" probability="0.2" departSpeed="max" departLane="best"/>
+</routes>
diff --git a/tools/game/grid6/grid6.tll.xml b/tools/game/grid6/grid6.tll.xml
new file mode 100644
index 0000000..cf6881c
--- /dev/null
+++ b/tools/game/grid6/grid6.tll.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- generated on Wed May 27 15:37:58 2015 by SUMO netconvert Version dev-SVN-r18449I
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netconvertConfiguration.xsd">
+
+ <input>
+ <sumo-net-file value="grid6.net.xml"/>
+ </input>
+
+ <output>
+ <plain-output-prefix value="grid6"/>
+ </output>
+
+ <processing>
+ <no-turnarounds value="true"/>
+ <offset.disable-normalization value="true"/>
+ </processing>
+
+</configuration>
+-->
+
+<tlLogics version="0.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/tllogic_file.xsd">
+ <tlLogic id="0/0" type="static" programID="0" offset="0">
+ <phase duration="1" state="uuyyuuyy"/>
+ <phase duration="1" state="uurruurr"/>
+ <phase duration="10000" state="GGrrGGrr"/>
+ </tlLogic>
+ <tlLogic id="0/0" type="static" programID="1" offset="0">
+ <phase duration="1" state="yyuuyyuu"/>
+ <phase duration="1" state="rruurruu"/>
+ <phase duration="10000" state="rrGGrrGG"/>
+ </tlLogic>
+ <tlLogic id="0/1" type="static" programID="0" offset="0">
+ <phase duration="1" state="uuyyuuyy"/>
+ <phase duration="1" state="uurruurr"/>
+ <phase duration="10000" state="GGrrGGrr"/>
+ </tlLogic>
+ <tlLogic id="0/1" type="static" programID="1" offset="0">
+ <phase duration="1" state="yyuuyyuu"/>
+ <phase duration="1" state="rruurruu"/>
+ <phase duration="10000" state="rrGGrrGG"/>
+ </tlLogic>
+ <tlLogic id="1/0" type="static" programID="0" offset="0">
+ <phase duration="1" state="uuyyuuyy"/>
+ <phase duration="1" state="uurruurr"/>
+ <phase duration="10000" state="GGrrGGrr"/>
+ </tlLogic>
+ <tlLogic id="1/0" type="static" programID="1" offset="0">
+ <phase duration="1" state="yyuuyyuu"/>
+ <phase duration="1" state="rruurruu"/>
+ <phase duration="10000" state="rrGGrrGG"/>
+ </tlLogic>
+ <tlLogic id="1/1" type="static" programID="0" offset="0">
+ <phase duration="1" state="uuyyuuyy"/>
+ <phase duration="1" state="uurruurr"/>
+ <phase duration="10000" state="GGrrGGrr"/>
+ </tlLogic>
+ <tlLogic id="1/1" type="static" programID="1" offset="0">
+ <phase duration="1" state="yyuuyyuu"/>
+ <phase duration="1" state="rruurruu"/>
+ <phase duration="10000" state="rrGGrrGG"/>
+ </tlLogic>
+ <tlLogic id="2/0" type="static" programID="0" offset="0">
+ <phase duration="1" state="uuyyuuyy"/>
+ <phase duration="1" state="uurruurr"/>
+ <phase duration="10000" state="GGrrGGrr"/>
+ </tlLogic>
+ <tlLogic id="2/0" type="static" programID="1" offset="0">
+ <phase duration="1" state="yyuuyyuu"/>
+ <phase duration="1" state="rruurruu"/>
+ <phase duration="10000" state="rrGGrrGG"/>
+ </tlLogic>
+ <tlLogic id="2/1" type="static" programID="0" offset="0">
+ <phase duration="1" state="uuyyuuyy"/>
+ <phase duration="1" state="uurruurr"/>
+ <phase duration="10000" state="GGrrGGrr"/>
+ </tlLogic>
+ <tlLogic id="2/1" type="static" programID="1" offset="0">
+ <phase duration="1" state="yyuuyyuu"/>
+ <phase duration="1" state="rruurruu"/>
+ <phase duration="10000" state="rrGGrrGG"/>
+ </tlLogic>
+
+ <connection from="0/0to0/1" to="0/1to1/1" fromLane="0" toLane="0" tl="0/1" linkIndex="4"/>
+ <connection from="0/0to0/1" to="0/1totop0" fromLane="0" toLane="0" tl="0/1" linkIndex="5"/>
+ <connection from="0/0to1/0" to="1/0tobottom1" fromLane="0" toLane="0" tl="1/0" linkIndex="6"/>
+ <connection from="0/0to1/0" to="1/0to2/0" fromLane="0" toLane="0" tl="1/0" linkIndex="7"/>
+ <connection from="0/1to0/0" to="0/0toleft0" fromLane="0" toLane="0" tl="0/0" linkIndex="0"/>
+ <connection from="0/1to0/0" to="0/0tobottom0" fromLane="0" toLane="0" tl="0/0" linkIndex="1"/>
+ <connection from="0/1to1/1" to="1/1to1/0" fromLane="0" toLane="0" tl="1/1" linkIndex="6"/>
+ <connection from="0/1to1/1" to="1/1to2/1" fromLane="0" toLane="0" tl="1/1" linkIndex="7"/>
+ <connection from="1/0to0/0" to="0/0to0/1" fromLane="0" toLane="0" tl="0/0" linkIndex="2"/>
+ <connection from="1/0to0/0" to="0/0toleft0" fromLane="0" toLane="0" tl="0/0" linkIndex="3"/>
+ <connection from="1/0to1/1" to="1/1to2/1" fromLane="0" toLane="0" tl="1/1" linkIndex="4"/>
+ <connection from="1/0to1/1" to="1/1totop1" fromLane="0" toLane="0" tl="1/1" linkIndex="5"/>
+ <connection from="1/0to2/0" to="2/0tobottom2" fromLane="0" toLane="0" tl="2/0" linkIndex="6"/>
+ <connection from="1/0to2/0" to="2/0toright0" fromLane="0" toLane="0" tl="2/0" linkIndex="7"/>
+ <connection from="1/1to0/1" to="0/1totop0" fromLane="0" toLane="0" tl="0/1" linkIndex="2"/>
+ <connection from="1/1to0/1" to="0/1toleft1" fromLane="0" toLane="0" tl="0/1" linkIndex="3"/>
+ <connection from="1/1to1/0" to="1/0to0/0" fromLane="0" toLane="0" tl="1/0" linkIndex="0"/>
+ <connection from="1/1to1/0" to="1/0tobottom1" fromLane="0" toLane="0" tl="1/0" linkIndex="1"/>
+ <connection from="1/1to2/1" to="2/1to2/0" fromLane="0" toLane="0" tl="2/1" linkIndex="6"/>
+ <connection from="1/1to2/1" to="2/1toright1" fromLane="0" toLane="0" tl="2/1" linkIndex="7"/>
+ <connection from="2/0to1/0" to="1/0to1/1" fromLane="0" toLane="0" tl="1/0" linkIndex="2"/>
+ <connection from="2/0to1/0" to="1/0to0/0" fromLane="0" toLane="0" tl="1/0" linkIndex="3"/>
+ <connection from="2/0to2/1" to="2/1toright1" fromLane="0" toLane="0" tl="2/1" linkIndex="4"/>
+ <connection from="2/0to2/1" to="2/1totop2" fromLane="0" toLane="0" tl="2/1" linkIndex="5"/>
+ <connection from="2/1to1/1" to="1/1totop1" fromLane="0" toLane="0" tl="1/1" linkIndex="2"/>
+ <connection from="2/1to1/1" to="1/1to0/1" fromLane="0" toLane="0" tl="1/1" linkIndex="3"/>
+ <connection from="2/1to2/0" to="2/0to1/0" fromLane="0" toLane="0" tl="2/0" linkIndex="0"/>
+ <connection from="2/1to2/0" to="2/0tobottom2" fromLane="0" toLane="0" tl="2/0" linkIndex="1"/>
+ <connection from="bottom0to0/0" to="0/0to1/0" fromLane="0" toLane="0" tl="0/0" linkIndex="4"/>
+ <connection from="bottom0to0/0" to="0/0to0/1" fromLane="0" toLane="0" tl="0/0" linkIndex="5"/>
+ <connection from="bottom1to1/0" to="1/0to2/0" fromLane="0" toLane="0" tl="1/0" linkIndex="4"/>
+ <connection from="bottom1to1/0" to="1/0to1/1" fromLane="0" toLane="0" tl="1/0" linkIndex="5"/>
+ <connection from="bottom2to2/0" to="2/0toright0" fromLane="0" toLane="0" tl="2/0" linkIndex="4"/>
+ <connection from="bottom2to2/0" to="2/0to2/1" fromLane="0" toLane="0" tl="2/0" linkIndex="5"/>
+ <connection from="left0to0/0" to="0/0tobottom0" fromLane="0" toLane="0" tl="0/0" linkIndex="6"/>
+ <connection from="left0to0/0" to="0/0to1/0" fromLane="0" toLane="0" tl="0/0" linkIndex="7"/>
+ <connection from="left1to0/1" to="0/1to0/0" fromLane="0" toLane="0" tl="0/1" linkIndex="6"/>
+ <connection from="left1to0/1" to="0/1to1/1" fromLane="0" toLane="0" tl="0/1" linkIndex="7"/>
+ <connection from="right0to2/0" to="2/0to2/1" fromLane="0" toLane="0" tl="2/0" linkIndex="2"/>
+ <connection from="right0to2/0" to="2/0to1/0" fromLane="0" toLane="0" tl="2/0" linkIndex="3"/>
+ <connection from="right1to2/1" to="2/1totop2" fromLane="0" toLane="0" tl="2/1" linkIndex="2"/>
+ <connection from="right1to2/1" to="2/1to1/1" fromLane="0" toLane="0" tl="2/1" linkIndex="3"/>
+ <connection from="top0to0/1" to="0/1toleft1" fromLane="0" toLane="0" tl="0/1" linkIndex="0"/>
+ <connection from="top0to0/1" to="0/1to0/0" fromLane="0" toLane="0" tl="0/1" linkIndex="1"/>
+ <connection from="top1to1/1" to="1/1to0/1" fromLane="0" toLane="0" tl="1/1" linkIndex="0"/>
+ <connection from="top1to1/1" to="1/1to1/0" fromLane="0" toLane="0" tl="1/1" linkIndex="1"/>
+ <connection from="top2to2/1" to="2/1to1/1" fromLane="0" toLane="0" tl="2/1" linkIndex="0"/>
+ <connection from="top2to2/1" to="2/1to2/0" fromLane="0" toLane="0" tl="2/1" linkIndex="1"/>
+</tlLogics>
diff --git a/tools/game/grid6/settings.xml b/tools/game/grid6/settings.xml
new file mode 100644
index 0000000..559c0da
--- /dev/null
+++ b/tools/game/grid6/settings.xml
@@ -0,0 +1,89 @@
+<viewsettings>
+ <viewport zoom="300" x="180" y="140"/>
+ <delay value="50.00"/>
+ <decal filename="dlr.gif" centerX="140" centerY="140" width="50" height="50" rotation="0.00"/>
+ <scheme name="game_square">
+ <opengl antialiase="0" dither="0"/>
+ <background backgroundColor="0.20,0.50,0.20"
+ showGrid="0" gridXSize="100.00" gridYSize="100.00"/>
+ <vehicles vehicleMode="9" vehicleQuality="2" minVehicleSize="1.00" vehicleExaggeration="1.00" showBlinker="1"
+ vehicleName_show="0" vehicleName_size="50.00" vehicleName_color="0.80,0.60,0.00" >
+ <colorScheme name="uniform">
+ <entry color="1.00,1.00,0.00"/>
+ </colorScheme>
+ <colorScheme name="given/assigned vehicle color">
+ <entry color="1.00,1.00,0.00"/>
+ </colorScheme>
+ <colorScheme name="given/assigned type color">
+ <entry color="1.00,1.00,0.00"/>
+ </colorScheme>
+ <colorScheme name="given/assigned route color">
+ <entry color="1.00,1.00,0.00"/>
+ </colorScheme>
+ <colorScheme name="depart position as HSV">
+ <entry color="1.00,1.00,0.00"/>
+ </colorScheme>
+ <colorScheme name="arrival position as HSV">
+ <entry color="1.00,1.00,0.00"/>
+ </colorScheme>
+ <colorScheme name="direction/distance as HSV">
+ <entry color="1.00,1.00,0.00"/>
+ </colorScheme>
+ <colorScheme name="by speed" interpolated="1">
+ <entry color="1.00,0.00,0.00" threshold="0.00"/>
+ <entry color="0.00,0.00,1.00" threshold="41.67"/>
+ </colorScheme>
+ <colorScheme name="by waiting time" interpolated="1">
+ <entry color="1.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="20.00"/>
+ </colorScheme>
+ <colorScheme name="by time since last lanechange" interpolated="1">
+ <entry color="1.00,1.00,1.00" threshold="0.00"/>
+ <entry color="0.50,0.50,0.50" threshold="300.00"/>
+ </colorScheme>
+ <colorScheme name="by max speed" interpolated="1">
+ <entry color="1.00,0.00,0.00" threshold="0.00"/>
+ <entry color="0.00,0.00,1.00" threshold="41.67"/>
+ </colorScheme>
+ <colorScheme name="by CO2 emissions (HBEFA)" interpolated="1">
+ <entry color="0.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="5.00"/>
+ </colorScheme>
+ <colorScheme name="by CO emissions (HBEFA)" interpolated="1">
+ <entry color="0.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="0.05"/>
+ </colorScheme>
+ <colorScheme name="by PMx emissions (HBEFA)" interpolated="1">
+ <entry color="0.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="0.01"/>
+ </colorScheme>
+ <colorScheme name="by NOx emissions (HBEFA)" interpolated="1">
+ <entry color="0.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="0.12"/>
+ </colorScheme>
+ <colorScheme name="by HC emissions (HBEFA)" interpolated="1">
+ <entry color="0.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="0.02"/>
+ </colorScheme>
+ <colorScheme name="by fuel consumption (HBEFA)" interpolated="1">
+ <entry color="0.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="0.01"/>
+ </colorScheme>
+ <colorScheme name="by noise emissions (Harmonoise)" interpolated="1">
+ <entry color="0.00,1.00,0.00" threshold="0.00"/>
+ <entry color="1.00,0.00,0.00" threshold="100.00"/>
+ </colorScheme>
+ <colorScheme name="by reroute number" interpolated="1">
+ <entry color="1.00,0.00,0.00" threshold="0.00"/>
+ <entry color="1.00,1.00,0.00" threshold="1.00"/>
+ <entry color="1.00,1.00,1.00" threshold="10.00"/>
+ </colorScheme>
+ </vehicles>
+ <legend showSizeLegend="1"/>
+ </scheme>
+
+ <event id="jam" commandPosix="play sounds/car_horn1.wav &" commandWindows="start /min vlc.exe -Idummy --play-and-exit sounds/car_horn1.wav" probability="0.001"/>
+ <event id="jam" commandPosix="play sounds/car_horn2.wav &" commandWindows="start /min vlc.exe -Idummy --play-and-exit sounds/car_horn2.wav" probability="0.001"/>
+ <event id="jam" commandPosix="play sounds/car_horn3.wav &" commandWindows="start /min vlc.exe -Idummy --play-and-exit sounds/car_horn3.wav" probability="0.001"/>
+ <jamTime value="40"/>
+</viewsettings>
diff --git a/tools/game/ramp.sumocfg b/tools/game/ramp.sumocfg
index 24b7d15..409aa72 100644
--- a/tools/game/ramp.sumocfg
+++ b/tools/game/ramp.sumocfg
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo-sim.org/xsd/sumoConfiguration.xsd">
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">
<input>
<net-file value="ramp/ramp.net.xml"/>
@@ -8,9 +8,13 @@
<additional-files value="input_additional.add.xml"/>
</input>
+ <output>
+ <output-prefix value="ramp."/>
+ </output>
+
<time>
<begin value="0"/>
- <end value="900"/>
+ <end value="400"/>
<step-length value=".2"/>
</time>
diff --git a/tools/game/ramp/ramp.net.xml b/tools/game/ramp/ramp.net.xml
index e394716..355e9ba 100644
--- a/tools/game/ramp/ramp.net.xml
+++ b/tools/game/ramp/ramp.net.xml
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- generated on Sat 10 May 2014 05:02:09 PM CEST by Netedit Version dev-SVN-r16338
+<!-- generated on Tue 19 May 2015 11:05:54 AM CEST by Netedit Version dev-SVN-r18398I
<?xml version="1.0" encoding="UTF-8"?>
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo-sim.org/xsd/netedit.exeConfiguration.xsd">
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netedit.exeConfiguration.xsd">
<input>
- <sumo-net-file value="/scr1/sumoI/sumo/tools/game/ramp/ramp.net.xml"/>
+ <sumo-net-file value="ramp.net.xml"/>
</input>
<output>
- <output-file value="/scr1/sumoI/sumo/tools/game/ramp/ramp.net.xml"/>
+ <output-file value="net.net.xml"/>
</output>
<processing>
@@ -21,9 +21,9 @@
</configuration>
-->
-<net version="0.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo-sim.org/xsd/net_file.xsd">
+<net version="0.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/net_file.xsd">
- <location netOffset="0.00,0.00" convBoundary="-377.08,-122.81,1409.70,62.04" origBoundary="-10000000000.00,-10000000000.00,10000000000.00,10000000000.00" projParameter="!"/>
+ <location netOffset="0.00,0.00" convBoundary="-577.08,-122.81,1409.70,62.04" origBoundary="-10000000000.00,-10000000000.00,10000000000.00,10000000000.00" projParameter="!"/>
<edge id=":gneJ13_0" function="internal">
<lane id=":gneJ13_0_0" index="0" speed="23.61" length="0.10" shape="58.48,34.10 58.47,34.08"/>
@@ -35,12 +35,12 @@
<lane id=":gneJ14_1_0" index="0" speed="13.89" length="8.88" shape="-47.14,20.33 -38.26,20.37"/>
</edge>
<edge id=":gneJ15_0" function="internal">
- <lane id=":gneJ15_0_0" index="0" speed="33.33" length="3.49" width="3.20" shape="-197.17,54.64 -194.17,51.34"/>
- <lane id=":gneJ15_0_1" index="1" speed="33.33" length="3.49" width="3.20" shape="-197.17,54.64 -194.17,54.64"/>
- <lane id=":gneJ15_0_2" index="2" speed="33.33" length="3.49" shape="-197.17,57.94 -194.17,57.94"/>
+ <lane id=":gneJ15_0_0" index="0" speed="33.33" length="0.10" width="3.20" shape="-195.67,51.34 -195.67,51.34"/>
+ <lane id=":gneJ15_0_1" index="1" speed="33.33" length="0.10" width="3.20" shape="-195.67,54.64 -195.67,54.64"/>
+ <lane id=":gneJ15_0_2" index="2" speed="33.33" length="0.10" shape="-195.67,57.94 -195.67,57.94"/>
</edge>
<edge id=":gneJ16_0" function="internal">
- <lane id=":gneJ16_0_0" index="0" speed="13.89" length="0.10" width="3.20" shape="-66.74,2.93 -66.74,2.93"/>
+ <lane id=":gneJ16_0_0" index="0" speed="13.89" length="0.10" width="3.20" shape="-66.74,2.92 -66.74,2.92"/>
</edge>
<edge id=":gneJ3_0" function="internal">
<lane id=":gneJ3_0_0" index="0" speed="23.61" length="5.02" shape="-143.69,51.34 -138.75,50.40"/>
@@ -70,11 +70,13 @@
<lane id=":gneJ7_0_1" index="1" speed="33.33" length="3.00" shape="192.63,57.98 195.63,57.98"/>
</edge>
<edge id=":gneJ8_0" function="internal">
- <lane id=":gneJ8_0_0" index="0" speed="33.33" length="5.79" shape="298.83,54.68 301.83,59.63"/>
+ <lane id=":gneJ8_0_0" index="0" speed="33.33" length="0.10" shape="300.34,54.68 300.34,54.68"/>
+ <lane id=":gneJ8_0_1" index="1" speed="33.33" length="0.10" shape="300.33,57.98 300.33,57.98"/>
</edge>
- <edge id="gneE11" from="gneJ8" to="gneJ11" priority="1" spreadType="center">
- <lane id="gneE11_0" index="0" speed="33.33" length="1107.88" shape="301.83,59.63 1409.70,62.04"/>
+ <edge id="gneE11" from="gneJ8" to="gneJ11" priority="1">
+ <lane id="gneE11_0" index="0" speed="33.33" length="1109.37" shape="300.34,54.68 1409.71,57.09"/>
+ <lane id="gneE11_1" index="1" speed="33.33" length="1109.37" shape="300.33,57.98 1409.70,60.39"/>
</edge>
<edge id="gneE13" from="gneJ6" to="gneJ13" priority="1">
<lane id="gneE13_0" index="0" speed="33.33" length="16.99" shape="46.18,22.37 58.48,34.10"/>
@@ -83,20 +85,21 @@
<lane id="gneE14_0" index="0" speed="13.89" length="23.22" shape="58.47,34.08 75.44,49.93"/>
</edge>
<edge id="gneE15" from="gneJ12" to="gneJ16" priority="1">
- <lane id="gneE15_0" index="0" speed="13.89" length="231.12" width="3.20" shape="-259.76,-124.19 -66.74,2.93"/>
+ <lane id="gneE15_0" index="0" speed="13.89" length="231.11" width="3.20" shape="-259.76,-124.19 -66.74,2.92"/>
</edge>
<edge id="gneE16" from="gneJ5" to="gneJ14" priority="1">
<lane id="gneE16_0" index="0" speed="13.89" length="37.30" shape="-84.44,20.07 -47.14,20.33"/>
</edge>
<edge id="gneE17" from="gneJ16" to="gneJ14" priority="2">
- <lane id="gneE17_0" index="0" speed="13.89" length="24.83" width="3.20" shape="-66.74,2.93 -46.00,16.58"/>
+ <lane id="gneE17_0" index="0" speed="13.89" length="24.84" width="3.20" shape="-66.74,2.92 -46.00,16.58"/>
</edge>
<edge id="gneE18" from="gneJ14" to="gneJ6" priority="1">
<lane id="gneE18_0" index="0" speed="13.89" length="79.03" shape="-38.26,20.37 40.77,20.08"/>
</edge>
<edge id="gneE2" from="gneJ2" to="gneJ15" priority="1">
- <lane id="gneE2_0" index="0" speed="33.33" length="179.91" width="3.20" shape="-377.08,54.64 -197.17,54.64"/>
- <lane id="gneE2_1" index="1" speed="33.33" length="179.91" width="3.20" shape="-377.08,57.94 -197.17,57.94"/>
+ <lane id="gneE2_0" index="0" speed="33.33" length="381.41" width="3.20" shape="-577.08,51.34 -195.67,51.34"/>
+ <lane id="gneE2_1" index="1" speed="33.33" length="381.41" width="3.20" shape="-577.08,54.64 -195.67,54.64"/>
+ <lane id="gneE2_2" index="2" speed="33.33" length="381.41" width="3.20" shape="-577.08,57.94 -195.67,57.94"/>
</edge>
<edge id="gneE3" from="gneJ3" to="gneJ4" priority="1">
<lane id="gneE3_0" index="0" speed="33.33" length="213.66" shape="-138.69,54.64 74.97,54.68"/>
@@ -111,16 +114,16 @@
<lane id="gneE7_2" index="2" speed="33.33" length="113.50" shape="79.13,57.98 192.63,57.98"/>
</edge>
<edge id="gneE8" from="gneJ7" to="gneJ8" priority="1">
- <lane id="gneE8_0" index="0" speed="33.33" length="103.20" shape="195.63,54.68 298.83,54.68"/>
- <lane id="gneE8_1" index="1" speed="33.33" length="103.20" shape="195.63,57.98 298.83,57.98"/>
+ <lane id="gneE8_0" index="0" speed="33.33" length="104.70" shape="195.63,54.68 300.34,54.68"/>
+ <lane id="gneE8_1" index="1" speed="33.33" length="104.70" shape="195.63,57.98 300.33,57.98"/>
</edge>
<edge id="gneE9" from="gneJ6" to="gneJ9" priority="1">
<lane id="gneE9_0" index="0" speed="33.33" length="197.41" shape="46.85,18.08 224.65,-67.71"/>
</edge>
<edge id="offramp" from="gneJ15" to="gneJ3" priority="1">
- <lane id="offramp_0" index="0" speed="33.33" length="50.48" width="3.20" shape="-194.17,51.34 -143.69,51.34"/>
- <lane id="offramp_1" index="1" speed="33.33" length="50.48" width="3.20" shape="-194.17,54.64 -143.69,54.64"/>
- <lane id="offramp_2" index="2" speed="33.33" length="50.48" shape="-194.17,57.94 -143.69,57.94"/>
+ <lane id="offramp_0" index="0" speed="33.33" length="51.98" width="3.20" shape="-195.67,51.34 -143.69,51.34"/>
+ <lane id="offramp_1" index="1" speed="33.33" length="51.98" width="3.20" shape="-195.67,54.64 -143.69,54.64"/>
+ <lane id="offramp_2" index="2" speed="33.33" length="51.98" shape="-195.67,57.94 -143.69,57.94"/>
</edge>
<tlLogic id="gneJ16" type="static" programID="0" offset="0">
@@ -132,7 +135,7 @@
<phase duration="10000" state="r"/>
</tlLogic>
- <junction id="gneJ11" type="unregulated" x="1409.70" y="62.04" incLanes="gneE11_0" intLanes="" shape="1409.70,60.44 1409.70,63.64"/>
+ <junction id="gneJ11" type="unregulated" x="1409.70" y="62.04" incLanes="gneE11_0 gneE11_1" intLanes="" shape="1409.71,55.49 1409.70,61.99"/>
<junction id="gneJ12" type="unregulated" x="-260.67" y="-122.81" incLanes="" intLanes="" shape="-260.64,-122.85 -258.88,-125.52"/>
<junction id="gneJ13" type="priority" x="57.34" y="35.29" incLanes="gneE13_0" intLanes=":gneJ13_0_0" shape="57.38,35.26 59.56,32.92 57.37,35.25">
<request index="0" response="0" foes="0" cont="0"/>
@@ -141,7 +144,7 @@
<request index="0" response="00" foes="10" cont="0"/>
<request index="1" response="01" foes="01" cont="0"/>
</junction>
- <junction id="gneJ15" type="priority" x="-195.67" y="59.59" incLanes="gneE2_0 gneE2_1" intLanes=":gneJ15_0_0 :gneJ15_0_1 :gneJ15_0_2" shape="-194.17,59.54 -194.17,49.74 -197.17,53.04 -197.17,59.54">
+ <junction id="gneJ15" type="priority" x="-195.67" y="59.59" incLanes="gneE2_0 gneE2_1 gneE2_2" intLanes=":gneJ15_0_0 :gneJ15_0_1 :gneJ15_0_2" shape="-195.67,59.54 -195.67,49.74 -195.67,59.54">
<request index="0" response="000" foes="000" cont="0"/>
<request index="1" response="000" foes="000" cont="0"/>
<request index="2" response="000" foes="000" cont="0"/>
@@ -149,7 +152,7 @@
<junction id="gneJ16" type="traffic_light" x="-67.65" y="4.30" incLanes="gneE15_0" intLanes=":gneJ16_0_0" shape="-67.62,4.26 -65.86,1.59 -67.62,4.26">
<request index="0" response="0" foes="0" cont="0"/>
</junction>
- <junction id="gneJ2" type="unregulated" x="-377.08" y="59.59" incLanes="" intLanes="" shape="-377.08,59.54 -377.08,53.04"/>
+ <junction id="gneJ2" type="unregulated" x="-577.08" y="59.59" incLanes="" intLanes="" shape="-577.08,59.54 -577.08,49.74"/>
<junction id="gneJ3" type="priority" x="-151.72" y="59.59" incLanes="offramp_0 offramp_1 offramp_2" intLanes=":gneJ3_0_0 :gneJ3_1_0 :gneJ3_1_1" shape="-138.69,59.54 -138.69,53.04 -137.97,51.79 -139.54,49.00 -143.69,49.74 -143.69,59.54">
<request index="0" response="000" foes="000" cont="0"/>
<request index="1" response="000" foes="000" cont="0"/>
@@ -171,8 +174,9 @@
<request index="0" response="00" foes="00" cont="0"/>
<request index="1" response="00" foes="00" cont="0"/>
</junction>
- <junction id="gneJ8" type="priority" x="300.33" y="59.63" incLanes="gneE8_0 gneE8_1" intLanes=":gneJ8_0_0" shape="301.82,61.23 301.83,58.03 298.83,53.08 298.83,59.58">
- <request index="0" response="0" foes="0" cont="0"/>
+ <junction id="gneJ8" type="priority" x="300.33" y="59.63" incLanes="gneE8_0 gneE8_1" intLanes=":gneJ8_0_0 :gneJ8_0_1" shape="300.33,59.58 300.34,53.08 300.33,59.58">
+ <request index="0" response="00" foes="00" cont="0"/>
+ <request index="1" response="00" foes="00" cont="0"/>
</junction>
<junction id="gneJ9" type="unregulated" x="225.37" y="-66.22" incLanes="gneE9_0" intLanes="" shape="223.96,-69.15 225.35,-66.27"/>
@@ -184,14 +188,15 @@
<connection from="gneE18" to="gneE9" fromLane="0" toLane="0" via=":gneJ6_0_0" dir="s" state="M"/>
<connection from="gneE18" to="gneE13" fromLane="0" toLane="0" via=":gneJ6_1_0" dir="s" state="M"/>
<connection from="gneE2" to="offramp" fromLane="0" toLane="0" via=":gneJ15_0_0" dir="s" state="M"/>
- <connection from="gneE2" to="offramp" fromLane="0" toLane="1" via=":gneJ15_0_1" dir="s" state="M"/>
- <connection from="gneE2" to="offramp" fromLane="1" toLane="2" via=":gneJ15_0_2" dir="s" state="M"/>
+ <connection from="gneE2" to="offramp" fromLane="1" toLane="1" via=":gneJ15_0_1" dir="s" state="M"/>
+ <connection from="gneE2" to="offramp" fromLane="2" toLane="2" via=":gneJ15_0_2" dir="s" state="M"/>
<connection from="gneE3" to="gneE7" fromLane="0" toLane="1" pass="1" via=":gneJ4_1_0" dir="s" state="M"/>
<connection from="gneE3" to="gneE7" fromLane="1" toLane="2" pass="1" via=":gneJ4_1_1" dir="s" state="M"/>
<connection from="gneE4" to="gneE16" fromLane="0" toLane="0" via=":gneJ5_0_0" dir="s" state="M"/>
<connection from="gneE7" to="gneE8" fromLane="1" toLane="0" via=":gneJ7_0_0" dir="s" state="M"/>
<connection from="gneE7" to="gneE8" fromLane="2" toLane="1" via=":gneJ7_0_1" dir="s" state="M"/>
<connection from="gneE8" to="gneE11" fromLane="0" toLane="0" via=":gneJ8_0_0" dir="s" state="M"/>
+ <connection from="gneE8" to="gneE11" fromLane="1" toLane="1" via=":gneJ8_0_1" dir="s" state="M"/>
<connection from="offramp" to="gneE4" fromLane="0" toLane="0" pass="1" via=":gneJ3_0_0" dir="s" state="M"/>
<connection from="offramp" to="gneE3" fromLane="1" toLane="0" pass="1" via=":gneJ3_1_0" dir="s" state="M"/>
<connection from="offramp" to="gneE3" fromLane="2" toLane="1" pass="1" via=":gneJ3_1_1" dir="s" state="M"/>
@@ -215,5 +220,6 @@
<connection from=":gneJ7_0" to="gneE8" fromLane="0" toLane="0" dir="s" state="M"/>
<connection from=":gneJ7_0" to="gneE8" fromLane="1" toLane="1" dir="s" state="M"/>
<connection from=":gneJ8_0" to="gneE11" fromLane="0" toLane="0" dir="s" state="M"/>
+ <connection from=":gneJ8_0" to="gneE11" fromLane="1" toLane="1" dir="s" state="M"/>
</net>
diff --git a/tools/game/ramp/ramp.rou.xml b/tools/game/ramp/ramp.rou.xml
index 2d0c35e..626239a 100644
--- a/tools/game/ramp/ramp.rou.xml
+++ b/tools/game/ramp/ramp.rou.xml
@@ -9,9 +9,19 @@
<route id="offramp" edges="gneE2 offramp gneE4 gneE16 gneE18 gneE9" color="green"/>
<route id="onramp" edges="gneE15 gneE17 gneE18 gneE13 gneE14 gneE7 gneE8 gneE11" color="magenta"/>
- <flow id="highway1" route="highway" begin="0" end="90000" vehsPerHour="1500" departSpeed="max" departLane="random" departPos="random"/>
- <flow id="offramp" route="offramp" begin="0" end="90000" vehsPerHour="500" departSpeed="max" departLane="0" departPos="random"/>
- <flow id="onramp" route="onramp" begin="0" end="90000" vehsPerHour="800" departSpeed="max"/>
+ <flow id="highway1" route="highway" begin="0" end="90000" vehsPerHour="2500" departSpeed="max" departLane="free" departPos="free"/>
+ <flow id="offramp" route="offramp" begin="0" end="90000" probability="0.22" departSpeed="max" departLane="0" departPos="random"/>
+ <flow id="onramp" route="onramp" begin="0" end="90000" probability="0.22" departSpeed="max"/>
+
+ <!-- increase flow after some time -->
+ <flow id="highway2" route="highway" begin="200" end="90000" probability="0.4" departSpeed="max" departLane="free" departPos="free"/>
+ <flow id="offramp2" route="offramp" begin="200" end="90000" probability="0.05" departSpeed="max" departLane="0" departPos="random"/>
+ <flow id="onramp2" route="onramp" begin="200" end="90000" probability="0.04" departSpeed="max"/>
+
+ <!-- increase flow after some time -->
+ <flow id="highway3" route="highway" begin="300" end="90000" probability="0.4" departSpeed="max" departLane="free" departPos="free"/>
+ <flow id="offramp3" route="offramp" begin="300" end="90000" probability="0.01" departSpeed="max" departLane="0" departPos="random"/>
+ <flow id="onramp3" route="onramp" begin="300" end="90000" probability="0.02" departSpeed="max"/>
</routes>
diff --git a/tools/game/ramp/ramp_settings.xml b/tools/game/ramp/ramp_settings.xml
index ecbe9a7..e374779 100644
--- a/tools/game/ramp/ramp_settings.xml
+++ b/tools/game/ramp/ramp_settings.xml
@@ -1,5 +1,5 @@
<viewsettings>
- <delay value="20"/>
+ <delay value="50"/>
<viewport zoom="400" x="-10" y="20"/>
<scheme name="game_ramp">
<opengl antialiase="0" dither="0"/>
diff --git a/tools/game/runner.py b/tools/game/runner.py
index 645a1fb..eca4b83 100755
--- a/tools/game/runner.py
+++ b/tools/game/runner.py
@@ -5,7 +5,7 @@
@author Michael Behrisch
@author Jakob Erdmann
@date 2010-01-30
- at version $Id: runner.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: runner.py 18756 2015-08-31 19:16:33Z behrisch $
This script runs the gaming GUI for the LNdW traffic light game.
It checks for possible scenarios in the current working directory
@@ -42,26 +42,38 @@ _LANGUAGE_EN = {'title': 'Interactive Traffic Light',
'cross': 'Simple Junction',
'cross_demo': 'Simple Junction (Demo)',
'square': 'Four Junctions',
+ 'grid6': 'Six Junctions',
'kuehne': 'Prof. Kühne',
'bs3d': '3D Junction Virtual World',
'bs3Dosm': '3D Junction OpenStreetMap',
- 'ramp': 'Highway Scenario',
+ 'ramp': 'Highway Ramp',
'high': 'Highscore',
'reset': 'Reset Highscore',
'lang': 'Deutsch',
- 'quit': 'Quit'}
+ 'quit': 'Quit',
+ 'Highscore': 'Highscore',
+ 'Congratulations': 'Congratulations!',
+ 'your score': 'Your Score',
+ 'Continue': 'Continue',
+ }
_LANGUAGE_DE = {'title': 'Interaktives Ampelspiel',
'cross': 'Einfache Kreuzung',
'cross_demo': 'Einfache Kreuzung (Demo)',
'square': 'Vier Kreuzungen',
+ 'grid6': 'Sechs Kreuzungen',
'kuehne': 'Prof. Kühne',
'bs3d': '3D Forschungskreuzung Virtuelle Welt',
'bs3Dosm': '3D Forschungskreuzung OpenStreetMap',
'ramp': 'Autobahnauffahrt',
- 'high': 'Highscore',
- 'reset': 'Highscore zurücksetzen',
+ 'high': 'Bestenliste',
+ 'reset': 'Bestenliste zurücksetzen',
'lang': 'Englisch',
- 'quit': 'Beenden'}
+ 'quit': 'Beenden',
+ 'Highscore': 'Bestenliste',
+ 'Congratulations': 'Gratulation!',
+ 'your score': 'Deine Punkte',
+ 'Continue': 'Weiter',
+ }
def loadHighscore():
@@ -75,8 +87,8 @@ def loadHighscore():
category, values = line.split()
scores[category] = _SCORES * [("", "", -1.)]
for idx, item in enumerate(values.split(':')):
- name, game, points = item.split(',')
- scores[category][idx] = (name, game, int(float(points)))
+ name, game, score = item.split(',')
+ scores[category][idx] = (name, game, int(float(score)))
return scores
except:
pass
@@ -96,18 +108,24 @@ def parseEndTime(cfg):
break
-class StartDialog:
+class IMAGE:
+ pass
+
- def __init__(self, lang):
+class StartDialog(Tkinter.Frame):
+
+ def __init__(self, parent, lang):
+ Tkinter.Frame.__init__(self, parent)
# variables for changing language
+ self.parent = parent
self._language_text = lang
- self.buttons = {}
+ self.buttons = []
# misc variables
self.name = ''
# setup gui
- self.root = Tkinter.Tk()
- self.root.title(self._language_text['title'])
- self.root.minsize(250, 50)
+ self.parent.title(self._language_text['title'])
+ self.parent.minsize(250, 50)
+ self.category = None
# we use a grid layout with 4 columns
COL_DLRLOGO, COL_START, COL_HIGH, COL_SUMOLOGO = range(4)
@@ -123,104 +141,151 @@ class StartDialog:
self.gametime = 0
self.ret = 0
# some pretty images
- dlrLogo = Tkinter.PhotoImage(file='dlr.gif')
- sumoLogo = Tkinter.PhotoImage(file='logo.gif')
- Tkinter.Label(self.root, image=dlrLogo).grid(
+ Tkinter.Label(self, image=IMAGE.dlrLogo).grid(
row=0, rowspan=numButtons, column=COL_DLRLOGO)
- Tkinter.Label(self.root, image=sumoLogo).grid(
+ Tkinter.Label(self, image=IMAGE.sumoLogo).grid(
row=0, rowspan=numButtons, column=COL_SUMOLOGO)
# 2 button for each config (start, highscore)
for row, cfg in enumerate(configs):
if "bs3" in cfg and "meso-gui" not in guisimPath:
continue
- category = os.path.basename(cfg)[:-8]
+ category = self.category_name(cfg)
# lambda must make a copy of cfg argument
- button = Tkinter.Button(self.root, width=bWidth_start,
+ button = Tkinter.Button(self, width=bWidth_start,
command=lambda cfg=cfg: self.start_cfg(cfg))
self.addButton(button, category)
button.grid(row=row, column=COL_START)
- button = Tkinter.Button(self.root, width=bWidth_high,
- command=lambda cfg=cfg: ScoreDialog([], None, self.category_name(cfg))) # .grid(row=row, column=COL_HIGH)
+ button = Tkinter.Button(self, width=bWidth_high,
+ command=lambda cfg=cfg: ScoreDialog(self, [],
+ None, self.category_name(cfg), self._language_text)) # .grid(row=row, column=COL_HIGH)
self.addButton(button, 'high')
button.grid(row=row, column=COL_HIGH)
# control buttons
button = Tkinter.Button(
- self.root, width=bWidth_control, command=high.clear)
+ self, width=bWidth_control, command=high.clear)
self.addButton(button, 'reset')
button.grid(row=numButtons - 3, column=COL_START, columnspan=2)
button = Tkinter.Button(
- self.root, width=bWidth_control, command=sys.exit)
+ self, width=bWidth_control, command=sys.exit)
self.addButton(button, 'quit')
button.grid(row=numButtons - 1, column=COL_START, columnspan=2)
button = Tkinter.Button(
- self.root, width=bWidth_control, command=lambda: self.change_language())
+ self, width=bWidth_control, command=lambda: self.change_language())
self.addButton(button, 'lang')
button.grid(row=numButtons - 2, column=COL_START, columnspan=2)
- self.root.grid()
+ self.grid()
# The following three commands are needed so the window pops
# up on top on Windows...
- self.root.iconify()
- self.root.update()
- self.root.deiconify()
- self.root.mainloop()
+ self.parent.iconify()
+ self.parent.update()
+ self.parent.deiconify()
def addButton(self, button, text):
button["text"] = self._language_text.get(text, text)
- self.buttons[text] = button
+ self.buttons.append((text, button))
def change_language(self):
if self._language_text == _LANGUAGE_DE:
self._language_text = _LANGUAGE_EN
else:
self._language_text = _LANGUAGE_DE
- for text, button in self.buttons.iteritems():
+ for text, button in self.buttons:
button["text"] = self._language_text[text]
def category_name(self, cfg):
return os.path.basename(cfg)[:-8]
def start_cfg(self, cfg):
- self.root.destroy()
+ # remember which which cfg was launched
+ self.category = self.category_name(cfg)
if _DEBUG:
print "starting", cfg
self.gametime = parseEndTime(cfg)
- self.ret = subprocess.call([guisimPath, "-S", "-G", "-Q", "-c", cfg])
- # remember which which cfg was launched
- self.category = self.category_name(cfg)
+ self.ret = subprocess.call(
+ [guisimPath, "-S", "-G", "-Q", "-c", cfg, '-l', 'log'], stderr=sys.stderr)
+ if _DEBUG:
+ print "ended", cfg
+
+ # compute score
+ totalDistance = 0
+ totalFuel = 0
+ totalArrived = 0
+ totalWaitingTime = 0
+ complete = True
+ for line in open(os.path.join(base, "%s.netstate.xml" % start.category)):
+ m = re.search('<interval begin="0(.00)?" end="([^"]*)"', line)
+ if m and float(m.group(2)) != start.gametime:
+ print "error: incomplete output"
+ complete = False
+ m = re.search('sampledSeconds="([^"]*)".*speed="([^"]*)"', line)
+ if m:
+ totalDistance += float(m.group(1)) * float(m.group(2))
+ m = re.search('fuel_abs="([^"]*)"', line)
+ if m:
+ totalFuel += float(m.group(1))
+ m = re.search('arrived="([^"]*)"', line)
+ if m:
+ totalArrived += float(m.group(1))
+ m = re.search('waitingTime="([^"]*)"', line)
+ if m:
+ totalWaitingTime += float(m.group(1))
+ switch = []
+ lastProg = {}
+ for line in open(os.path.join(base, "%s.tlsstate.xml" % start.category)):
+ m = re.search(
+ 'tlsstate time="(\d+(.\d+)?)" id="([^"]*)" programID="([^"]*)"', line)
+ if m:
+ tls = m.group(3)
+ program = m.group(4)
+ if tls not in lastProg or lastProg[tls] != program:
+ lastProg[tls] = program
+ switch += [m.group(3), m.group(1)]
+ # doing nothing gives a waitingTime of 6033 for cross and 6700 for
+ # square
+ score = 10000 - totalWaitingTime
+ lang = start._language_text
+ if _DEBUG:
+ print switch, score, totalArrived, complete
+ if complete:
+ ScoreDialog(self, switch, score, self.category, lang)
+ # if ret != 0:
+ # quit on error
+ # sys.exit(start.ret)
class ScoreDialog:
- def __init__(self, game, points, category):
- self.root = Tkinter.Tk()
+ def __init__(self, parent, switch, score, category, lang):
+ self.root = Tkinter.Toplevel(parent)
+ # self.root.transient(parent)
self.name = None
- self.game = game
- self.points = points
+ self.switch = switch
+ self.score = score
self.category = category
- haveHigh = False
- self.root.title("Highscore")
+ self.root.title(lang["Highscore"])
self.root.minsize(250, 50)
+ haveHigh = False
if not category in high:
high[category] = _SCORES * [("", "", -1.)]
idx = 0
for n, g, p in high[category]:
- if not haveHigh and p < points:
+ if not haveHigh and p < score:
Tkinter.Label(
self.root, text=(str(idx + 1) + '. ')).grid(row=idx)
self.name = Tkinter.Entry(self.root)
self.name.grid(row=idx, sticky=Tkinter.W, column=1)
- self.scoreLabel = Tkinter.Label(self.root, text=str(points),
+ self.scoreLabel = Tkinter.Label(self.root, text=str(score),
bg="pale green").grid(row=idx, column=2)
self.idx = idx
haveHigh = True
- self.root.title("Congratulations!")
+ self.root.title(lang["Congratulations"])
idx += 1
if p == -1 or idx == _SCORES:
break
@@ -230,18 +295,23 @@ class ScoreDialog:
Tkinter.Label(self.root, text=str(p)).grid(row=idx, column=2)
idx += 1
if not haveHigh:
- if points != None: # not called from the main menue
- Tkinter.Label(self.root, text='your score', padx=5,
+ if score != None: # not called from the main menue
+ Tkinter.Label(self.root, text=lang['your score'], padx=5,
bg="indian red").grid(row=idx, sticky=Tkinter.W, column=1)
- Tkinter.Label(self.root, text=str(points),
+ Tkinter.Label(self.root, text=str(score),
bg="indian red").grid(row=idx, column=2)
idx += 1
else:
self.saveBut = Tkinter.Button(
self.root, text="Save", command=self.save)
self.saveBut.grid(row=idx, column=1)
- Tkinter.Button(self.root, text="Continue", command=self.quit).grid(
+ Tkinter.Button(self.root, text=lang["Continue"], command=self.quit).grid(
row=idx, column=2)
+
+ # add QR-code for LNDW
+ Tkinter.Label(self.root, image=IMAGE.qrCode).grid(
+ row=1, column=3, rowspan=22)
+
self.root.grid()
self.root.bind("<Return>", self.save)
# self.root.wait_visibility()
@@ -250,16 +320,16 @@ class ScoreDialog:
self.name.focus_set()
# The following three commands are needed so the window pops
# up on top on Windows...
- self.root.iconify()
- self.root.update()
- self.root.deiconify()
- self.root.mainloop()
+ # self.root.iconify()
+ # self.root.update()
+ # self.root.deiconify()
+ # self.root.mainloop()
def save(self, event=None):
if self.name:
name = self.name.get()
high[self.category].insert(
- self.idx, (name, self.game, self.points))
+ self.idx, (name, self.switch, self.score))
high[self.category].pop()
self.saveBut.config(state=Tkinter.DISABLED)
self.name.destroy()
@@ -275,7 +345,7 @@ class ScoreDialog:
try:
conn = httplib.HTTPConnection(_SCORESERVER)
conn.request("GET", _SCORESCRIPT + "category=%s&name=%s&instance=%s&points=%s" % (
- self.category, name, "_".join(self.game), self.points))
+ self.category, name, "_".join(self.switch), self.score))
if _DEBUG:
r1 = conn.getresponse()
print r1.status, r1.reason, r1.read()
@@ -335,46 +405,9 @@ else:
os.environ["OSG_FILE_PATH"] = os.path.join(
os.environ.get("SUMO_HOME", ""), "data", "3D")
-while True:
- start = StartDialog(lang)
- totalDistance = 0
- totalFuel = 0
- totalArrived = 0
- totalWaitingTime = 0
- complete = True
- for line in open(os.path.join(base, "netstate.xml")):
- m = re.search('<interval begin="0(.00)?" end="([^"]*)"', line)
- if m and float(m.group(2)) != start.gametime:
- complete = False
- m = re.search('sampledSeconds="([^"]*)".*speed="([^"]*)"', line)
- if m:
- totalDistance += float(m.group(1)) * float(m.group(2))
- m = re.search('fuel_abs="([^"]*)"', line)
- if m:
- totalFuel += float(m.group(1))
- m = re.search('arrived="([^"]*)"', line)
- if m:
- totalArrived += float(m.group(1))
- m = re.search('waitingTime="([^"]*)"', line)
- if m:
- totalWaitingTime += float(m.group(1))
- switch = []
- lastProg = {}
- for line in open(os.path.join(base, "tlsstate.xml")):
- m = re.search(
- 'tlsstate time="(\d+(.\d+)?)" id="([^"]*)" programID="([^"]*)"', line)
- if m:
- tls = m.group(3)
- program = m.group(4)
- if tls not in lastProg or lastProg[tls] != program:
- lastProg[tls] = program
- switch += [m.group(3), m.group(1)]
- # doing nothing gives a waitingTime of 6033 for cross and 6700 for square
- score = 10000 - totalWaitingTime
- if _DEBUG:
- print switch, score, totalArrived, complete
- if complete:
- ScoreDialog(switch, score, start.category)
- if start.ret != 0:
- sys.exit(start.ret)
- lang = start._language_text
+root = Tkinter.Tk()
+IMAGE.dlrLogo = Tkinter.PhotoImage(file='dlr.gif')
+IMAGE.sumoLogo = Tkinter.PhotoImage(file='logo.gif')
+IMAGE.qrCode = Tkinter.PhotoImage(file='dlr_lndw_15_ts_4.gif')
+start = StartDialog(root, lang)
+root.mainloop()
diff --git a/tools/game/setup.py b/tools/game/setup.py
index 7d709ad..04fba18 100644
--- a/tools/game/setup.py
+++ b/tools/game/setup.py
@@ -3,7 +3,7 @@
@author Michael Behrisch
@author Jakob Erdmann
@date 2010-05-23
- at version $Id: setup.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: setup.py 18479 2015-06-08 11:53:18Z behrisch $
SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
@@ -46,13 +46,13 @@ os.mkdir("dist")
setup(console=[os.path.join(base, 'runner.py')])
-for f in glob.glob(os.path.join(base, "*.sumocfg")):
- shutil.copy2(f, "dist")
-for f in ['input_additional.add.xml', 'logo.gif', 'dlr.gif']:
- shutil.copy2(os.path.join(base, f), "dist")
-for dir in ['cross', 'square', 'kuehne', 'highway', 'sounds', 'ramp', 'bs3d']:
- subprocess.call(
- ['svn', 'export', os.path.join(base, dir), os.path.join("dist", dir)])
+for pattern in ['*.sumocfg', 'input_additional.add.xml', '*.gif']:
+ for f in glob.glob(os.path.join(base, pattern)):
+ shutil.copy2(f, "dist")
+for d in os.listdir(base):
+ path = os.path.join(base, d)
+ if os.path.isdir(path):
+ subprocess.call(['svn', 'export', path, os.path.join("dist", d)])
os.chdir("dist")
if internal:
for dll in glob.glob(os.path.join(nightlyDir, 'bin64', '*.dll')):
diff --git a/tools/game/square.sumocfg b/tools/game/square.sumocfg
index ca8f98a..1d391c8 100644
--- a/tools/game/square.sumocfg
+++ b/tools/game/square.sumocfg
@@ -12,5 +12,6 @@
<end value="180"/>
<step-length value=".1"/>
</time>
+ <output-prefix value="square."/>
</configuration>
diff --git a/tools/generateBidiDistricts.py b/tools/generateBidiDistricts.py
new file mode 100644
index 0000000..edd260f
--- /dev/null
+++ b/tools/generateBidiDistricts.py
@@ -0,0 +1,86 @@
+#!/usr/bin/env python
+"""
+ at file generateBidiDistricts.py
+ at author Jakob Erdmann
+ at date 2015-07-31
+ at version $Id: generateBidiDistricts.py 18756 2015-08-31 19:16:33Z behrisch $
+
+Generate a taz (district) file which groups edges in opposite directions
+belonging to the same road. For each edge, a taz is created which contains this edge
+and its opposite.
+This allows routing without the need for an
+initial/final turn-around by replacing the attribute names 'from' and 'to' with
+'fromTaz' and 'toTaz'
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+import sys
+import os
+import itertools
+from collections import defaultdict
+from optparse import OptionParser
+sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
+from sumolib.output import parse
+from sumolib.net import readNet
+from sumolib.miscutils import Colorgen
+from sumolib import geomhelper
+
+
+def parse_args():
+ USAGE = "Usage: " + sys.argv[0] + " <netfile> [options]"
+ optParser = OptionParser()
+ optParser.add_option("-o", "--outfile", help="name of output file")
+ options, args = optParser.parse_args()
+ try:
+ options.net, = args
+ except:
+ sys.exit(USAGE)
+ if options.outfile is None:
+ options.outfile = options.net + ".taz.xml"
+ return options
+
+DEBUGID = ["24214694", "-24214694"]
+
+
+def computeBidiTaz(net, radius=10):
+ taz = defaultdict(set)
+ for edge in net.getEdges():
+ candidates = []
+ r = min(radius, geomhelper.polyLength(edge.getShape()) / 2)
+ if edge.getID() in DEBUGID:
+ print r, edge.getLength(), edge.getShape()
+ for x, y in edge.getShape():
+ nearby = set()
+ for edge2, dist in net.getNeighboringEdges(x, y, r):
+ nearby.add(edge2)
+ if edge.getID() in DEBUGID:
+ print " ", [e.getID() for e in nearby]
+ candidates.append(nearby)
+ opposites = reduce(lambda a, b: a.intersection(b), candidates)
+ # XXX edges with the same endpoints should have roughly the same length
+ # to be considered as opposites
+ opposites.update(set(edge.getToNode().getOutgoing()).intersection(
+ set(edge.getFromNode().getIncoming())))
+ taz[edge.getID()] = opposites
+ return taz
+
+
+def main():
+ options = parse_args()
+ net = readNet(options.net)
+ with open(options.outfile, 'w') as outf:
+ outf.write('<tazs>\n')
+ for tazID, edges in computeBidiTaz(net).items():
+ outf.write(' <taz id="%s" edges="%s"/>\n' % (
+ tazID, ' '.join(sorted([e.getID() for e in edges]))))
+ outf.write('</tazs>\n')
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/import/osm/SimpleWebSocketServer.py b/tools/import/osm/SimpleWebSocketServer.py
new file mode 100644
index 0000000..9bf110c
--- /dev/null
+++ b/tools/import/osm/SimpleWebSocketServer.py
@@ -0,0 +1,742 @@
+"""
+ at file SimpleWebSocketServer.py
+ at author Dave Pallot
+ at date 2013
+ at version $Id: SimpleWebSocketServer.py 18764 2015-09-01 19:03:45Z behrisch $
+
+A web socket server implementation to be used by the osm server.py
+Originally distributed under the MIT license at
+https://github.com/dpallot/simple-websocket-server/tree/master/SimpleWebSocketServer.
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2015-2015 DLR (http://www.dlr.de/) and contributors
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+import SocketServer
+import hashlib
+import base64
+import socket
+import struct
+import ssl
+import sys
+import errno
+import codecs
+from collections import deque
+from BaseHTTPServer import BaseHTTPRequestHandler
+from StringIO import StringIO
+from select import select
+
+__all__ = ['WebSocket', 'SimpleWebSocketServer', 'SimpleSSLWebSocketServer']
+
+
+class HTTPRequest(BaseHTTPRequestHandler):
+
+ def __init__(self, request_text):
+ self.rfile = StringIO(request_text)
+ self.raw_requestline = self.rfile.readline()
+ self.error_code = self.error_message = None
+ self.parse_request()
+
+_VALID_STATUS_CODES = [
+ 1000, 1001, 1002, 1003, 1007, 1008, 1009, 1010, 1011, 3000, 3999, 4000, 4999]
+
+HANDSHAKE_STR = (
+ "HTTP/1.1 101 Switching Protocols\r\n"
+ "Upgrade: WebSocket\r\n"
+ "Connection: Upgrade\r\n"
+ "Sec-WebSocket-Accept: %(acceptstr)s\r\n\r\n"
+)
+
+GUID_STR = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
+
+STREAM = 0x0
+TEXT = 0x1
+BINARY = 0x2
+CLOSE = 0x8
+PING = 0x9
+PONG = 0xA
+
+HEADERB1 = 1
+HEADERB2 = 3
+LENGTHSHORT = 4
+LENGTHLONG = 5
+MASK = 6
+PAYLOAD = 7
+
+MAXHEADER = 65536
+MAXPAYLOAD = 33554432
+
+
+class WebSocket(object):
+
+ def __init__(self, server, sock, address):
+ self.server = server
+ self.client = sock
+ self.address = address
+
+ self.handshaked = False
+ self.headerbuffer = ''
+ self.headertoread = 2048
+
+ self.fin = 0
+ self.data = bytearray()
+ self.opcode = 0
+ self.hasmask = 0
+ self.maskarray = None
+ self.length = 0
+ self.lengtharray = None
+ self.index = 0
+ self.request = None
+ self.usingssl = False
+
+ self.frag_start = False
+ self.frag_type = BINARY
+ self.frag_buffer = None
+ self.frag_decoder = codecs.getincrementaldecoder(
+ 'utf-8')(errors='strict')
+ self.closed = False
+ self.sendq = deque()
+
+ self.state = HEADERB1
+
+ # restrict the size of header and payload for security reasons
+ self.maxheader = MAXHEADER
+ self.maxpayload = MAXPAYLOAD
+
+ def handleMessage(self):
+ """
+ Called when websocket frame is received.
+ To access the frame data call self.data.
+
+ If the frame is Text then self.data is a unicode object.
+ If the frame is Binary then self.data is a bytearray object.
+ """
+ pass
+
+ def handleConnected(self):
+ """
+ Called when a websocket client connects to the server.
+ """
+ pass
+
+ def handleClose(self):
+ """
+ Called when a websocket server gets a Close frame from a client.
+ """
+ pass
+
+ def _handlePacket(self):
+
+ if self.opcode == CLOSE:
+ pass
+ elif self.opcode == STREAM:
+ pass
+ elif self.opcode == TEXT:
+ pass
+ elif self.opcode == BINARY:
+ pass
+ elif self.opcode == PONG or self.opcode == PING:
+ if len(self.data) > 125:
+ raise Exception('control frame length can not be > 125')
+ else:
+ # unknown or reserved opcode so just close
+ raise Exception('unknown opcode')
+
+ if self.opcode == CLOSE:
+ status = 1000
+ reason = u''
+ length = len(self.data)
+
+ if length == 0:
+ pass
+ elif length >= 2:
+ status = struct.unpack_from('!H', self.data[:2])[0]
+ reason = self.data[2:]
+
+ if status not in _VALID_STATUS_CODES:
+ status = 1002
+
+ if len(reason) > 0:
+ try:
+ reason = reason.decode('utf-8', errors='strict')
+ except:
+ status = 1002
+ else:
+ status = 1002
+
+ self.close(status, reason)
+ return
+
+ elif self.fin == 0:
+ if self.opcode != STREAM:
+ if self.opcode == PING or self.opcode == PONG:
+ raise Exception('control messages can not be fragmented')
+
+ self.frag_type = self.opcode
+ self.frag_start = True
+ self.frag_decoder.reset()
+
+ if self.frag_type == TEXT:
+ self.frag_buffer = []
+ utf_str = self.frag_decoder.decode(self.data, final=False)
+ if utf_str:
+ self.frag_buffer.append(utf_str)
+ else:
+ self.frag_buffer = bytearray()
+ self.frag_buffer.extend(self.data)
+
+ else:
+ if self.frag_start is False:
+ raise Exception('fragmentation protocol error')
+
+ if self.frag_type == TEXT:
+ utf_str = self.frag_decoder.decode(self.data, final=False)
+ if utf_str:
+ self.frag_buffer.append(utf_str)
+ else:
+ self.frag_buffer.extend(self.data)
+
+ else:
+ if self.opcode == STREAM:
+ if self.frag_start is False:
+ raise Exception('fragmentation protocol error')
+
+ if self.frag_type == TEXT:
+ utf_str = self.frag_decoder.decode(self.data, final=True)
+ self.frag_buffer.append(utf_str)
+ self.data = u''.join(self.frag_buffer)
+ else:
+ self.frag_buffer.extend(self.data)
+ self.data = self.frag_buffer
+
+ self.handleMessage()
+
+ self.frag_decoder.reset()
+ self.frag_type = BINARY
+ self.frag_start = False
+ self.frag_buffer = None
+
+ elif self.opcode == PING:
+ self._sendMessage(False, PONG, self.data)
+
+ elif self.opcode == PONG:
+ pass
+
+ else:
+ if self.frag_start is True:
+ raise Exception('fragmentation protocol error')
+
+ if self.opcode == TEXT:
+ try:
+ self.data = self.data.decode('utf-8', errors='strict')
+ except Exception as exp:
+ raise Exception('invalid utf-8 payload')
+
+ self.handleMessage()
+
+ def _handleData(self):
+ # do the HTTP header and handshake
+ if self.handshaked is False:
+
+ data = self.client.recv(self.headertoread)
+ if not data:
+ raise Exception("remote socket closed")
+
+ else:
+ # accumulate
+ self.headerbuffer += data
+
+ if len(self.headerbuffer) >= self.maxheader:
+ raise Exception('header exceeded allowable size')
+
+ # indicates end of HTTP header
+ if '\r\n\r\n' in self.headerbuffer:
+ self.request = HTTPRequest(self.headerbuffer)
+
+ # handshake rfc 6455
+ if self.request.headers.has_key('Sec-WebSocket-Key'.lower()):
+ key = self.request.headers['Sec-WebSocket-Key'.lower()]
+ hStr = HANDSHAKE_STR % {
+ 'acceptstr': base64.b64encode(hashlib.sha1(key + GUID_STR).digest())}
+ self.sendq.append((BINARY, hStr))
+ self.handshaked = True
+ self.headerbuffer = ''
+ self.handleConnected()
+
+ else:
+ raise Exception('Sec-WebSocket-Key does not exist')
+
+ # else do normal data
+ else:
+ data = self.client.recv(8192)
+ if not data:
+ raise Exception("remote socket closed")
+
+ for d in data:
+ self._parseMessage(ord(d))
+
+ def close(self, status=1000, reason=u''):
+ """
+ Send Close frame to the client. The underlying socket is only closed
+ when the client acknowledges the Close frame.
+
+ status is the closing identifier.
+ reason is the reason for the close.
+ """
+ try:
+ if self.closed is False:
+ close_msg = bytearray()
+ close_msg.extend(struct.pack("!H", status))
+ if isinstance(reason, unicode):
+ close_msg.extend(reason.encode('utf-8'))
+ else:
+ close_msg.extend(reason)
+
+ self._sendMessage(False, CLOSE, str(close_msg))
+
+ finally:
+ self.closed = True
+
+ def _sendBuffer(self, buff):
+ size = len(buff)
+ tosend = size
+ already_sent = 0
+
+ while tosend > 0:
+ try:
+ # i should be able to send a bytearray
+ sent = self.client.send(buff[already_sent:])
+ if sent == 0:
+ raise RuntimeError("socket connection broken")
+
+ already_sent += sent
+ tosend -= sent
+
+ except socket.error as e:
+ # if we have full buffers then wait for them to drain and try
+ # again
+ if e.errno in [errno.EAGAIN, errno.EWOULDBLOCK]:
+ return buff[already_sent:]
+ else:
+ raise e
+
+ return None
+
+ def sendFragmentStart(self, data):
+ """
+ Send the start of a data fragment stream to a websocket client.
+ Subsequent data should be sent using sendFragment().
+ A fragment stream is completed when sendFragmentEnd() is called.
+
+ If data is a unicode object then the frame is sent as Text.
+ If the data is a bytearray object then the frame is sent as Binary.
+ """
+ opcode = BINARY
+ if isinstance(data, unicode):
+ opcode = TEXT
+ self._sendMessage(True, opcode, data)
+
+ def sendFragment(self, data):
+ """
+ see sendFragmentStart()
+
+ If data is a unicode object then the frame is sent as Text.
+ If the data is a bytearray object then the frame is sent as Binary.
+ """
+ self._sendMessage(True, STREAM, data)
+
+ def sendFragmentEnd(self, data):
+ """
+ see sendFragmentEnd()
+
+ If data is a unicode object then the frame is sent as Text.
+ If the data is a bytearray object then the frame is sent as Binary.
+ """
+ self._sendMessage(False, STREAM, data)
+
+ def sendMessage(self, data):
+ """
+ Send websocket data frame to the client.
+
+ If data is a unicode object then the frame is sent as Text.
+ If the data is a bytearray object then the frame is sent as Binary.
+ """
+ opcode = BINARY
+ if isinstance(data, unicode):
+ opcode = TEXT
+ self._sendMessage(False, opcode, data)
+
+ def _sendMessage(self, fin, opcode, data):
+ header = bytearray()
+ b1 = 0
+ b2 = 0
+ if fin is False:
+ b1 |= 0x80
+ b1 |= opcode
+
+ if isinstance(data, unicode):
+ data = data.encode('utf-8')
+
+ length = len(data)
+ header.append(b1)
+
+ if length <= 125:
+ b2 |= length
+ header.append(b2)
+
+ elif length >= 126 and length <= 65535:
+ b2 |= 126
+ header.append(b2)
+ header.extend(struct.pack("!H", length))
+
+ else:
+ b2 |= 127
+ header.append(b2)
+ header.extend(struct.pack("!Q", length))
+
+ payload = None
+ if length > 0:
+ payload = str(header) + str(data)
+ else:
+ payload = str(header)
+
+ self.sendq.append((opcode, payload))
+
+ def _parseMessage(self, byte):
+ # read in the header
+ if self.state == HEADERB1:
+
+ self.fin = byte & 0x80
+ self.opcode = byte & 0x0F
+ self.state = HEADERB2
+
+ self.index = 0
+ self.length = 0
+ self.lengtharray = bytearray()
+ self.data = bytearray()
+
+ rsv = byte & 0x70
+ if rsv != 0:
+ raise Exception('RSV bit must be 0')
+
+ elif self.state == HEADERB2:
+ mask = byte & 0x80
+ length = byte & 0x7F
+
+ if self.opcode == PING and length > 125:
+ raise Exception('ping packet is too large')
+
+ if mask == 128:
+ self.hasmask = True
+ else:
+ self.hasmask = False
+
+ if length <= 125:
+ self.length = length
+
+ # if we have a mask we must read it
+ if self.hasmask is True:
+ self.maskarray = bytearray()
+ self.state = MASK
+ else:
+ # if there is no mask and no payload we are done
+ if self.length <= 0:
+ try:
+ self._handlePacket()
+ finally:
+ self.state = self.HEADERB1
+ self.data = bytearray()
+
+ # we have no mask and some payload
+ else:
+ #self.index = 0
+ self.data = bytearray()
+ self.state = PAYLOAD
+
+ elif length == 126:
+ self.lengtharray = bytearray()
+ self.state = LENGTHSHORT
+
+ elif length == 127:
+ self.lengtharray = bytearray()
+ self.state = LENGTHLONG
+
+ elif self.state == LENGTHSHORT:
+ self.lengtharray.append(byte)
+
+ if len(self.lengtharray) > 2:
+ raise Exception('short length exceeded allowable size')
+
+ if len(self.lengtharray) == 2:
+ self.length = struct.unpack_from(
+ '!H', str(self.lengtharray))[0]
+
+ if self.hasmask is True:
+ self.maskarray = bytearray()
+ self.state = MASK
+ else:
+ # if there is no mask and no payload we are done
+ if self.length <= 0:
+ try:
+ self._handlePacket()
+ finally:
+ self.state = HEADERB1
+ self.data = bytearray()
+
+ # we have no mask and some payload
+ else:
+ #self.index = 0
+ self.data = bytearray()
+ self.state = PAYLOAD
+
+ elif self.state == LENGTHLONG:
+
+ self.lengtharray.append(byte)
+
+ if len(self.lengtharray) > 8:
+ raise Exception('long length exceeded allowable size')
+
+ if len(self.lengtharray) == 8:
+ self.length = struct.unpack_from(
+ '!Q', str(self.lengtharray))[0]
+
+ if self.hasmask is True:
+ self.maskarray = bytearray()
+ self.state = MASK
+ else:
+ # if there is no mask and no payload we are done
+ if self.length <= 0:
+ try:
+ self._handlePacket()
+ finally:
+ self.state = HEADERB1
+ self.data = bytearray()
+
+ # we have no mask and some payload
+ else:
+ #self.index = 0
+ self.data = bytearray()
+ self.state = PAYLOAD
+
+ # MASK STATE
+ elif self.state == MASK:
+ self.maskarray.append(byte)
+
+ if len(self.maskarray) > 4:
+ raise Exception('mask exceeded allowable size')
+
+ if len(self.maskarray) == 4:
+ # if there is no mask and no payload we are done
+ if self.length <= 0:
+ try:
+ self._handlePacket()
+ finally:
+ self.state = HEADERB1
+ self.data = bytearray()
+
+ # we have no mask and some payload
+ else:
+ #self.index = 0
+ self.data = bytearray()
+ self.state = PAYLOAD
+
+ # PAYLOAD STATE
+ elif self.state == PAYLOAD:
+ if self.hasmask is True:
+ self.data.append(byte ^ self.maskarray[self.index % 4])
+ else:
+ self.data.append(byte)
+
+ # if length exceeds allowable size then we except and remove the
+ # connection
+ if len(self.data) >= self.maxpayload:
+ raise Exception('payload exceeded allowable size')
+
+ # check if we have processed length bytes; if so we are done
+ if (self.index + 1) == self.length:
+ try:
+ self._handlePacket()
+ finally:
+ #self.index = 0
+ self.state = HEADERB1
+ self.data = bytearray()
+ else:
+ self.index += 1
+
+
+class SimpleWebSocketServer(object):
+
+ def __init__(self, host, port, websocketclass):
+ self.websocketclass = websocketclass
+ self.serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.serversocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+ self.serversocket.bind((host, port))
+ self.serversocket.listen(5)
+ self.connections = {}
+ self.listeners = [self.serversocket]
+
+ def _decorateSocket(self, sock):
+ return sock
+
+ def _constructWebSocket(self, sock, address):
+ return self.websocketclass(self, sock, address)
+
+ def close(self):
+ self.serversocket.close()
+
+ for conn in self.connections.itervalues():
+ conn.close()
+ try:
+ conn.handleClose()
+ except:
+ pass
+
+ def serveforever(self):
+ while True:
+ writers = []
+ for fileno in self.listeners:
+ try:
+ client = self.connections[fileno]
+ if client.sendq:
+ writers.append(fileno)
+ except Exception as n:
+ pass
+
+ rList, wList, xList = select(
+ self.listeners, writers, self.listeners, 0.1)
+
+ for ready in wList:
+ client = None
+ try:
+ client = self.connections[ready]
+ while client.sendq:
+ opcode, payload = client.sendq.popleft()
+ remaining = client._sendBuffer(payload)
+ if remaining is not None:
+ client.sendq.appendleft((opcode, remaining))
+ break
+ else:
+ if opcode == CLOSE:
+ raise Exception("received client close")
+
+ except Exception as n:
+
+ if client:
+ client.client.close()
+
+ try:
+ if client:
+ client.handleClose()
+ except:
+ pass
+
+ try:
+ del self.connections[ready]
+ except:
+ pass
+
+ try:
+ self.listeners.remove(ready)
+ except:
+ pass
+
+ for ready in rList:
+ if ready == self.serversocket:
+ try:
+ sock, address = self.serversocket.accept()
+ newsock = self._decorateSocket(sock)
+ newsock.setblocking(0)
+ fileno = newsock.fileno()
+ self.listeners.append(fileno)
+ self.connections[fileno] = self._constructWebSocket(
+ newsock, address)
+ except Exception as n:
+ if sock is not None:
+ sock.close()
+ else:
+ client = None
+ try:
+ client = self.connections[ready]
+ client._handleData()
+ except Exception as n:
+
+ if client:
+ client.client.close()
+
+ try:
+ if client:
+ client.handleClose()
+ except:
+ pass
+
+ try:
+ del self.connections[ready]
+ except:
+ pass
+
+ try:
+ self.listeners.remove(ready)
+ except:
+ pass
+
+ for failed in xList:
+ if failed == self.serversocket:
+ self.close()
+ raise Exception("server socket failed")
+ else:
+ client = None
+ try:
+ client = self.connections[failed]
+ client.client.close()
+
+ try:
+ client.handleClose()
+ except:
+ pass
+
+ try:
+ self.listeners.remove(failed)
+ except:
+ pass
+
+ except:
+ pass
+
+ finally:
+ if client:
+ del self.connections[failed]
+
+
+class SimpleSSLWebSocketServer(SimpleWebSocketServer):
+
+ def __init__(self, host, port, websocketclass, certfile, keyfile, version=ssl.PROTOCOL_TLSv1):
+
+ SimpleWebSocketServer.__init__(self, host, port, websocketclass)
+
+ self.cerfile = certfile
+ self.keyfile = keyfile
+ self.version = version
+
+ def close(self):
+ super(SimpleSSLWebSocketServer, self).close()
+
+ def _decorateSocket(self, sock):
+ sslsock = ssl.wrap_socket(sock,
+ server_side=True,
+ certfile=self.cerfile,
+ keyfile=self.keyfile,
+ ssl_version=self.version)
+ return sslsock
+
+ def _constructWebSocket(self, sock, address):
+ ws = self.websocketclass(self, sock, address)
+ ws.usingssl = True
+ return ws
+
+ def serveforever(self):
+ super(SimpleSSLWebSocketServer, self).serveforever()
diff --git a/tools/import/osm/images/bicycle.png b/tools/import/osm/images/bicycle.png
new file mode 100644
index 0000000..22dd29d
Binary files /dev/null and b/tools/import/osm/images/bicycle.png differ
diff --git a/tools/import/osm/images/bus.png b/tools/import/osm/images/bus.png
new file mode 100644
index 0000000..19181f1
Binary files /dev/null and b/tools/import/osm/images/bus.png differ
diff --git a/tools/import/osm/images/generate.png b/tools/import/osm/images/generate.png
new file mode 100644
index 0000000..e3c1d70
Binary files /dev/null and b/tools/import/osm/images/generate.png differ
diff --git a/tools/import/osm/images/map.png b/tools/import/osm/images/map.png
new file mode 100644
index 0000000..818c60c
Binary files /dev/null and b/tools/import/osm/images/map.png differ
diff --git a/tools/import/osm/images/motorcycle.png b/tools/import/osm/images/motorcycle.png
new file mode 100644
index 0000000..a4a4270
Binary files /dev/null and b/tools/import/osm/images/motorcycle.png differ
diff --git a/tools/import/osm/images/passenger.png b/tools/import/osm/images/passenger.png
new file mode 100644
index 0000000..8e48134
Binary files /dev/null and b/tools/import/osm/images/passenger.png differ
diff --git a/tools/import/osm/images/pedestrian.png b/tools/import/osm/images/pedestrian.png
new file mode 100644
index 0000000..285fe16
Binary files /dev/null and b/tools/import/osm/images/pedestrian.png differ
diff --git a/tools/import/osm/images/rail.png b/tools/import/osm/images/rail.png
new file mode 100644
index 0000000..d72d31d
Binary files /dev/null and b/tools/import/osm/images/rail.png differ
diff --git a/tools/import/osm/images/rail_urban.png b/tools/import/osm/images/rail_urban.png
new file mode 100644
index 0000000..4e82d28
Binary files /dev/null and b/tools/import/osm/images/rail_urban.png differ
diff --git a/tools/import/osm/images/ship.png b/tools/import/osm/images/ship.png
new file mode 100644
index 0000000..492ec04
Binary files /dev/null and b/tools/import/osm/images/ship.png differ
diff --git a/tools/import/osm/images/tram.png b/tools/import/osm/images/tram.png
new file mode 100644
index 0000000..b88ed72
Binary files /dev/null and b/tools/import/osm/images/tram.png differ
diff --git a/tools/import/osm/images/truck.png b/tools/import/osm/images/truck.png
new file mode 100644
index 0000000..ba09cc5
Binary files /dev/null and b/tools/import/osm/images/truck.png differ
diff --git a/tools/import/osm/index.html b/tools/import/osm/index.html
index a2b346c..daf3c4b 100644
--- a/tools/import/osm/index.html
+++ b/tools/import/osm/index.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <title>sumo-websocket</title>
+ <title>OSM Importer for SUMO</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<script type="text/javascript" src="lib.js"></script>
@@ -11,21 +11,108 @@
<body>
<div id="map"></div>
<canvas style="display: none"></canvas>
- <div id="controls">
- <span id="position" class="container always">
- Position
- <div class="options">
- <label>Längengrad <input id="current-lon" /></label>
- <label>Breitengrad <input id="current-lat" /></label>
- <label id="set-position">aktueller Standort</label>
- </div>
- </span>
- <span class="container always">
- <span id="export-button">Exportieren</span>
- <div class="options">
- <label>Bereich auswählen<input type="checkbox" id="canvas-toogle" /></label>
- </div>
- </span>
+
+ <div id="side">
+ <div id="tabs">
+ <div class="tab" title="Map">
+ <img src="images/map.png" />
+ </div>
+ <div class="tab" title="Vehicles">
+ <img src="images/passenger.png" />
+ </div>
+ <div class="tab" title="Generate">
+ <img src="images/generate.png" />
+ </div>
+ <div class="tab" title="Copyright">©</div>
+ </div>
+
+ <div class="controls">
+ <div class="container">
+ <h4>Position</h4>
+
+ <div class="options open">
+ <label>Longitude <input id="current-lon" /></label>
+ <label>Latitude <input id="current-lat" /></label>
+ </div>
+ </div>
+
+ <button id="set-position">Set position to current location</button>
+
+ <div class="container">
+ <div class="options open">
+ <label>Select Area <input type="checkbox" id="canvas-toogle" /></label>
+ </div>
+ </div>
+ </div>
+
+ <div class="controls" id="vehicle-controls"></div>
+
+ <div class="controls">
+ <div class="container">
+ <h4>Options</h4>
+
+ <div class="options open">
+ <label>Add Polygons <input id="polygons" type="checkbox" checked /></label>
+ <label>Duration <input id="duration" type="number" value="3600" step="1" /></label>
+ </div>
+ </div>
+ </div>
+
+ <div class="controls">
+ <div class="container">
+ <h4>Icon Copyrights</h4>
+
+ <div class="images">
+ <img src="images/map.png" />
+ <img src="images/generate.png" />
+ <img src="images/passenger.png" />
+ <img src="images/truck.png" />
+ <img src="images/bicycle.png" />
+ </div>
+
+ <p>
+ Icons by <a href="http://google.com/design/">Google Design</a>,
+ licensed under <a href="http://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>
+ </p>
+
+ <div class="images">
+ <img src="images/bus.png" />
+ <img src="images/pedestrian.png" />
+ <img src="images/ship.png" />
+ <img src="images/rail.png" />
+ </div>
+
+ <p>
+ Icons by <a href="http://aiga.org/">AIGA</a>,
+ Open Domain
+ </p>
+
+ <div class="images">
+ <img src="images/tram.png" />
+ <img src="images/rail_urban.png" />
+ </div>
+
+ <p>
+ Icons by <a href="http://www.danilodemarco.com/">Pittogrammi</a>
+ </p>
+
+ <div class="images">
+ <img src="images/motorcycle.png" />
+ </div>
+
+ <p>
+ Icon by <a href="http://icons8.com/">Icons8</a>
+ </p>
+ </div>
+ </div>
+
+ <div id="fixed">
+ <button id="export-button">Generate Scenario</button>
+ <div id="status">
+ <span></span>
+ <div></div>
+ </div>
+ </div>
</div>
</body>
</html>
diff --git a/tools/import/osm/lib.js b/tools/import/osm/lib.js
index 5613dac..a21fe77 100644
--- a/tools/import/osm/lib.js
+++ b/tools/import/osm/lib.js
@@ -1,44 +1,62 @@
-function elem(r){
- if(r[0] == "<"){
- var n = document.createElement(r.substring(1, r.length - 1));
- var s = arguments[1] || {};
- var i, j;
- for(i in s){
- if(i == "css") i = "style";
- if(s[i] instanceof Object){
- for(j in s[i])
- n[i][j] = s[i][j];
- } else
- n[i] = s[i];
- }
- s = arguments[2] || {};
- for(i in s)
- n.addEventListener(i, s[i]);
- return n;
- } else
- return document.querySelector(r);
+function elem(selector, attributes, events){
+ if(selector[0] == "<"){
+ selector = selector.substring(1, selector.length - 1);
+ var node = document.createElement(selector);
+
+ var i, j;
+ if(attributes){
+ for(i in attributes){
+ if(attributes[i] instanceof Object){
+ for(j in attributes[i])
+ node[i][j] = attributes[i][j];
+ } else
+ node[i] = attributes[i];
+ }
+ }
+
+ if(events){
+ for(i in events)
+ node.addEventListener(i, events[i]);
+ }
+
+ return node;
+ } else
+ return document.querySelector(selector);
+}
+
+function elems(selector){
+ return document.querySelectorAll(selector);
}
function on(type, callback){
- if(type == "ready") type = "DOMContentLoaded";
- addEventListener(type, callback);
+ if(type == "ready")
+ type = "DOMContentLoaded";
+
+ addEventListener(type, callback);
}
HTMLElement.prototype.on = function(type, callback){
- this.addEventListener(type, callback);
-}
+ this.addEventListener(type, callback);
+};
HTMLElement.prototype.elem = function(r){
- return this.querySelector(r);
-}
+ return this.querySelector(r);
+};
-HTMLElement.prototype.append = function(n){
- if(typeof n == "string") n = elem.apply(void 0, arguments);
- return this.appendChild(n);
-}
+HTMLElement.prototype.append = function(node){
+ if(typeof node == "string")
+ node = elem.apply(null, arguments);
+
+ return this.appendChild(node);
+};
+
+NodeList.prototype.forEach = Array.prototype.forEach;
function lequal(){
- for(var i = 1, l = arguments.length; i < l; ++i)
- if(arguments[i - 1] > arguments[i]) return false;
- return true;
+ for(var i = 1, l = arguments.length; i < l; ++i){
+ if(arguments[i - 1] > arguments[i])
+ return false;
+ }
+
+ return true;
}
diff --git a/tools/import/osm/osmBuild.py b/tools/import/osm/osmBuild.py
index ad044ad..ff7c07f 100755
--- a/tools/import/osm/osmBuild.py
+++ b/tools/import/osm/osmBuild.py
@@ -5,7 +5,7 @@
@author Jakob Erdmann
@author Michael Behrisch
@date 2009-08-01
- at version $Id: osmBuild.py 18125 2015-03-23 10:09:53Z namdre $
+ at version $Id: osmBuild.py 18461 2015-05-28 10:50:39Z behrisch $
Retrieves an area from OpenStreetMap.
@@ -35,7 +35,7 @@ vclassRemove = {"passenger": " --keep-edges.by-vclass passenger",
"all": ""}
possibleVClassOptions = '|'.join(vclassRemove.keys())
-DEFAULT_NETCONVERT_OPTS = "--geometry.remove,--remove-edges.isolated,--roundabouts.guess,--ramps.guess,-v,--junctions.join,--osm.railway.oneway-default,--tls.guess-signals,--tls.discard-simple,--tls.join"
+DEFAULT_NETCONVERT_OPTS = "--geometry.remove,--roundabouts.guess,--ramps.guess,-v,--junctions.join,--tls.guess-signals,--tls.discard-simple,--tls.join"
optParser = optparse.OptionParser()
diff --git a/tools/import/osm/script.js b/tools/import/osm/script.js
index 98646d7..7799393 100644
--- a/tools/import/osm/script.js
+++ b/tools/import/osm/script.js
@@ -1,94 +1,131 @@
on("ready", function(){
- elem("#export-button").on("click", function(){
- var cor = map.getExtent();
- cor.transform(
- map.getProjectionObject(), // from Spherical Mercator Projection
- new OpenLayers.Projection("EPSG:4326")
- );
-
- //calculates the coordinates of the rectangle if area-picking is active
- if(canvasActive){
- var width = cor.right - cor.left;
- var height = cor.bottom - cor.top;
- cor = [
- cor.top + height * canvasRect[3],
- cor.left + width * canvasRect[0],
- cor.top + height * canvasRect[1],
- cor.left + width * canvasRect[2]
- ];
- } else
- cor = [cor.bottom, cor.left, cor.top, cor.right];
-
- socket.send("coords: " + cor.join(","));
- });
+ var PORT = "8010";
/**
- * @param de: the display string
- * @param en: the internal string
+ * @class
+ * @param display: the display string
+ * @param internal: the internal string, like the VClass string in SUMO
+ * @param fringeFactor: initial fringe factor value
+ * @param count: initial count value
*/
- function Settings(de, en, fringeFactor){
- this._init(de, en, fringeFactor);
+ function Settings(){
+ this.init.apply(this, arguments);
}
+
Settings.prototype = {
- _init: function(de, en, fringeFactor){
- var node = elem("<span>", {className: "container", textContent: de});
- var checkbox = elem("<input>", {type: "checkbox"});
- checkbox.on("click", function(evt){
- socket.send(en + ": " + (evt.target.checked? "+" : ""));
- });
- node.append(checkbox);
+ init: function(display, internal, fringeFactor, count, enabled){
+ this.internal = internal;
- var options = elem("<div>", {className: "options"});
- var label = elem("<label>", {textContent: "Durchgangsverkehr"});
- var input = elem("<input>", {type: "number", min: .5, max: 100, step: .1, value: fringeFactor});
- input.on("input", function(evt){
- socket.send(en + "FringeFactor: " + evt.target.value);
- });
- label.append(input);
- options.append(label);
+ var node = elem("<div>", {className: "container"});
+ var header = elem("<h4>", {textContent: display});
+ header.append("<img>", {src: "images/" + internal + ".png"});
+ node.append(header);
+ this.enable = elem("<input>", {type: "checkbox", checked: enabled});
+ node.append(this.enable);
- label = elem("<label>", {textContent: "Frequenz"});
- input = elem("<input>", {type: "number", min: .2, max: 100, step: .1, value: 10});
- input.on("input", function(evt){
- socket.send(en + "Period: " + evt.target.value);
- });
- label.append(input);
+ var options = elem("<div>", {className: "options"});
+ var label = elem("<label>", {textContent: "Through Traffic Factor"});
+ this.fringeFactor = elem("<input>", {type: "number", min: .5, max: 100, step: .1, value: fringeFactor});
+ label.append(this.fringeFactor);
options.append(label);
- label = elem("<label>", {textContent: "Dauer"});
- input = elem("<input>", {type: "number", min: 60, max: 36000, step: 60, value: 3600});
- input.on("input", function(evt){
- socket.send(en + "Time: " + evt.target.value);
- });
- label.append(input);
+ label = elem("<label>", {textContent: "Count", title: "Count per hour per kilometer"});
+ this.count = elem("<input>", {type: "number", min: .2, max: 100, step: .1, value: count});
+ label.append(this.count);
options.append(label);
node.append(options);
- elem("#controls").append(node);
+ elem("#vehicle-controls").append(node);
+ },
+
+ toJSON: function(){
+ if(this.enable.checked){
+ return {
+ fringeFactor: parseFloat(this.fringeFactor.value),
+ count: parseFloat(this.count.value)
+ };
+ }
+
+ return null;
}
};
- new Settings("Fahrzeuge", "vehicles", 5);
- new Settings("Fahrradfahrer", "bicycles", 2);
- new Settings("Fußgänger", "pedestrians", 1);
- new Settings("Züge", "rails", 40);
+ var vehicleClasses = [
+ new Settings("Cars", "passenger", 5, 12, true),
+ new Settings("Trucks", "truck", 5, 8),
+ new Settings("Bus", "bus", 5, 4),
+ new Settings("Motorcycles", "motorcycle", 2, 4),
+ new Settings("Bicycles", "bicycle", 2, 6),
+ new Settings("Pedestrians", "pedestrian", 1, 10),
+ new Settings("Trams", "tram", 20, 2),
+ new Settings("Urban trains", "rail_urban", 40, 2),
+ new Settings("Trains", "rail", 40, 2),
+ new Settings("Ships", "ship", 40, 2)
+ ];
+
+ var activeTab = null;
+
+ /**
+ * @function
+ * @param id: the id of the tab to open
+ */
+ function openTab(id){
+ var tab = elems(".tab")[id];
+ var side = elem("#side");
+ var control = elems(".controls")[id];
+
+ // clicked on the open tab, close everything
+ if(activeTab === id){
+ side.classList.remove("open");
+ control.classList.remove("open");
+ tab.classList.remove("open");
+ activeTab = null;
+ } else {
+ // open the side and control
+ side.classList.add("open");
+ control.classList.add("open");
+ tab.classList.add("open");
+
+ // close the other tab, if there is one
+ if(activeTab !== null){
+ elems(".controls")[activeTab].classList.remove("open");
+ elems(".tab")[activeTab].classList.remove("open");
+ }
+
+ activeTab = id;
+ }
+ }
+
+ elems(".tab").forEach(function(tab, index){
+ tab.dataset.symbol = tab.textContent;
+ tab.on("click", function(){
+ openTab(index);
+ });
+ });
+
+ openTab(0);
var canvas = elem("canvas");
- var canvasActive = false,
- canvasRect = [.1, .1, .9, .9];
+ var canvasActive = false;
+ var canvasRect = [.1, .1, .9, .9];
var ctx = canvas.getContext("2d");
- //to set canvas fullpage
+ /**
+ * @function
+ * sets the canvas to full page size
+ */
function setCanvasSize(){
canvas.width = innerWidth;
canvas.height = innerHeight;
draw();
}
+
setCanvasSize();
on("resize", setCanvasSize);
/**
- * @function draw: draws the rect on the canvas.
+ * @function
+ * draws the rect on the canvas, to select an area
**/
function draw(){
var x0 = canvas.width * canvasRect[0],
@@ -98,20 +135,17 @@ on("ready", function(){
ctx.clearRect(0, 0, canvas.width, canvas.height);
- ctx.fillStyle = "#A5E5FF";
- ctx.strokeStyle = "#61C4F6";
- ctx.lineWidth = 5;
- ctx.globalAlpha = .4;
- ctx.beginPath();
- ctx.rect(x0, y0, x1 - x0, y1 - y0);
- ctx.fill();
- ctx.stroke();
+ ctx.fillStyle = "#808080";
+ ctx.globalAlpha = .5;
+
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
+ ctx.clearRect(x0, y0, x1 - x0, y1 - y0);
}
var mouse = {
- x: 0, //last x coordinate
- y: 0, //last y coordinates
- area: null //if mouse button is down, and in which function; move or resize
+ x: 0, // last x coordinate
+ y: 0, // last y coordinates
+ area: null // if mouse button is down, and in which function; move or resize
}
canvas.on("mousedown", function(evt){
@@ -179,7 +213,8 @@ on("ready", function(){
});
/**
- * @function toogleCanvas: checks if the checkbox is checked and displays the canvas in this case, else not
+ * @function
+ * checks if the checkbox is checked and displays the canvas in this case, else not
**/
function toogleCanvas(){
if(canvasToogle.checked){
@@ -196,37 +231,35 @@ on("ready", function(){
canvasToogle.on("click", toogleCanvas);
toogleCanvas();
- //initiales the WebSocket. If you change the port (9999) here, change it also in the python file
- socket = new WebSocket("ws://localhost:9999");
-
- socket.addEventListener("open", function(){
- elem("#controls").style.removeProperty("display");
- });
-
- //OSM map
- map = new OpenLayers.Map("map");
- map.addLayer(new OpenLayers.Layer.OSM());
+ // OSM map
+ var map = new OpenLayers.Map("map");
+ map.addLayer(new OpenLayers.Layer.OSM);
function setPosition(lon, lat){
if(!lon || !lat){
lon = parseFloat(elem("#current-lon").value);
lat = parseFloat(elem("#current-lat").value);
} else {
- elem("#current-lon").value = lon;
- elem("#current-lat").value = lat;
+ elem("#current-lon").value = lon.toFixed(6);
+ elem("#current-lat").value = lat.toFixed(6);
}
- var lonLat = new OpenLayers.LonLat(lon, lat)
- .transform(
- new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
- map.getProjectionObject() // to Spherical Mercator Projection
- );
+ var lonLat = new OpenLayers.LonLat(lon, lat);
+ lonLat.transform(
+ new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
+ map.getProjectionObject() // to Spherical Mercator Projection
+ );
map.setCenter(lonLat, 16);
}
+ // set default position to center Berlin
setPosition(13.4, 52.52);
+ /**
+ * @listener
+ * set the coordinates of the map to current coordinates (got from browser)
+ */
elem("#set-position").on("click", function(){
if(!navigator.geolocation) return;
@@ -235,17 +268,147 @@ on("ready", function(){
});
});
+ /**
+ * @listener
+ * whenever the input boxes changes, update the map coordinates
+ */
elem("#current-lon").on("input", setPosition);
elem("#current-lat").on("input", setPosition);
- elem("#position").on("mouseenter", function(){
+ /**
+ * @listener
+ * whenever the map coordinates changes, update the input boxes
+ */
+ map.events.register("move", map, function(){
var cor = map.getExtent();
cor.transform(
map.getProjectionObject(), // from Spherical Mercator Projection
new OpenLayers.Projection("EPSG:4326")
);
- elem("#current-lon").value = cor.left + (cor.right - cor.left) / 2;
- elem("#current-lat").value = cor.top + (cor.bottom - cor.top) / 2;
+ elem("#current-lon").value = (cor.left + (cor.right - cor.left) / 2).toFixed(6);
+ elem("#current-lat").value = (cor.top + (cor.bottom - cor.top) / 2).toFixed(6);
});
+
+ var socket;
+ var totalSteps;
+ var currentStep;
+
+ /**
+ * @function
+ * connects to the socket, when it fails it tries it again after five seconds
+ */
+ function connectSocket(){
+ var address = location.hostname;
+ // when accessing via file, location.hostname is an empty string, so guess that the server is on localhost
+ if(!address)
+ address = "localhost";
+
+ try {
+ socket = new WebSocket("ws://" + address + ":" + PORT);
+ } catch(e){
+ // connection failed, wait five seconds, then try again
+ setTimeout(connectSocket, 5000);
+ return;
+ }
+
+ // whenever the socket closes (e.g. restart) try to reconnect
+ socket.addEventListener("close", connectSocket);
+ socket.addEventListener("message", function(evt){
+ var message = evt.data;
+ // get the first space
+ var index = message.indexOf(" ");
+ // split the message type from the message
+ var type = message.substr(0, index);
+ message = message.substr(index + 1);
+
+ if(type === "zip"){
+ showZip(message);
+ } else if(type === "report"){
+ currentStep++;
+ elem("#status > span").textContent = message;
+ elem("#status > div").style.width = (100 * currentStep / totalSteps) + "%";
+
+ if(currentStep === totalSteps){
+ setTimeout(function(){
+ elem("#status").style.display = "none";
+ elem("#export-button").style.display = "block";
+ }, 2000);
+ }
+ } else if(type === "steps"){
+ totalSteps = parseInt(message);
+ currentStep = 0;
+ }
+ });
+ }
+
+ connectSocket();
+
+ /**
+ * @function
+ * generate and send the data to the websocket
+ */
+ function startBuild(){
+ var cor = map.getExtent();
+ cor.transform(
+ map.getProjectionObject(), // from Spherical Mercator Projection
+ new OpenLayers.Projection("EPSG:4326")
+ );
+
+ var data = {
+ poly: elem("#polygons").checked,
+ duration: parseInt(elem("#duration").value),
+ vehicles: {}
+ };
+
+ // calculates the coordinates of the rectangle if area-picking is active
+ if(canvasActive){
+ var width = cor.right - cor.left;
+ var height = cor.bottom - cor.top;
+ data.coords = [
+ cor.top + height * canvasRect[3],
+ cor.left + width * canvasRect[0],
+ cor.top + height * canvasRect[1],
+ cor.left + width * canvasRect[2]
+ ];
+ } else
+ data.coords = [cor.bottom, cor.left, cor.top, cor.right];
+
+ vehicleClasses.forEach(function(vehicleClass){
+ var result = vehicleClass.toJSON();
+ if(result)
+ data.vehicles[vehicleClass.internal] = result;
+ });
+
+ try {
+ socket.send(JSON.stringify(data));
+ } catch(e){
+ return;
+ }
+
+ elem("#status").style.display = "block";
+ elem("#export-button").style.display = "none";
+ }
+
+ elem("#export-button").on("click", startBuild);
+
+ /**
+ * @function
+ * @param uri: a base64-encoded string for a zip file
+ * shows a download dialog to save the zip file
+ */
+ function showZip(uri){
+ var url = "data:application/zip;base64," + uri;
+
+ // using a temporarily link to trigger the download dialog
+ var link = elem("<a>", {
+ download: "osm.zip",
+ href: url,
+ target: "_blank"
+ });
+
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ }
});
diff --git a/tools/import/osm/server.py b/tools/import/osm/server.py
index 75b080b..2213d6d 100755
--- a/tools/import/osm/server.py
+++ b/tools/import/osm/server.py
@@ -3,7 +3,7 @@
@file server.py
@author Jakob Stigloher
@date 2014-14-10
- at version $Id: server.py 18125 2015-03-23 10:09:53Z namdre $
+ at version $Id: server.py 18756 2015-08-31 19:16:33Z behrisch $
Browser GUI for OSMget, OSMbuild, optionally randomTrips and SUMO GUI
@@ -17,29 +17,61 @@ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
"""
-import struct
-import SocketServer
-import webbrowser
import os
import sys
+import stat
+import traceback
+import webbrowser
import datetime
-from base64 import b64encode
-from hashlib import sha1
-from mimetools import Message
-from StringIO import StringIO
+from argparse import ArgumentParser
+from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
+import json
+import threading
import subprocess
+import tempfile
+import shutil
+from zipfile import ZipFile
+import base64
SUMO_HOME = os.environ.get("SUMO_HOME", os.path.join(
os.path.dirname(os.path.abspath(__file__)), "..", "..", ".."))
-sys.path.append(os.path.join(SUMO_HOME, "tools", "trip"))
sys.path.append(os.path.join(SUMO_HOME, "tools"))
-polyfile = os.path.join(SUMO_HOME, "data", "typemap", "osmPolyconvert.typ.xml")
-typefile = os.path.join(SUMO_HOME, "data", "typemap", "osmNetconvert.typ.xml")
-pedestrianstypefile = os.path.join(
- SUMO_HOME, "data", "typemap", "osmNetconvertPedestrians.typ.xml")
-shipstypefile = os.path.join(
- SUMO_HOME, "data", "typemap", "osmNetconvertShips.typ.xml")
+typemapdir = os.path.join(SUMO_HOME, "data", "typemap")
+typemaps = {
+ "net": os.path.join(typemapdir, "osmNetconvert.typ.xml"),
+ "poly": os.path.join(typemapdir, "osmPolyconvert.typ.xml"),
+ "urban": os.path.join(typemapdir, "osmNetconvertUrbanDe.typ.xml"),
+ "pedestrians": os.path.join(typemapdir, "osmNetconvertPedestrians.typ.xml"),
+ "ships": os.path.join(typemapdir, "osmNetconvertShips.typ.xml"),
+ "bicycles": os.path.join(typemapdir, "osmNetconvertBicycle.typ.xml"),
+}
+
+vehicleParameters = {
+ "passenger": ["--vehicle-class", "passenger", "--vclass", "passenger", "--prefix", "veh", "--min-distance", "300", "--trip-attributes", 'departLane="best"'],
+ "truck": ["--vehicle-class", "truck", "--vclass", "truck", "--prefix", "truck", "--min-distance", "600", "--trip-attributes", 'departLane="best"'],
+ "bus": ["--vehicle-class", "bus", "--vclass", "bus", "--prefix", "bus", "--min-distance", "600", "--trip-attributes", 'departLane="best"'],
+ "motorcycle": ["--vehicle-class", "motorcycle", "--vclass", "motorcycle", "--prefix", "moto", "--max-distance", "1200", "--trip-attributes", 'departLane="best"'],
+ "bicycle": ["--vehicle-class", "bicycle", "--vclass", "bicycle", "--prefix", "bike", "--max-distance", "8000", "--trip-attributes", 'departLane="best"'],
+ "tram": ["--vehicle-class", "tram", "--vclass", "tram", "--prefix", "tram", "--min-distance", "1200", "--trip-attributes", 'departLane="best"'],
+ "rail_urban": ["--vehicle-class", "rail_urban", "--vclass", "rail_urban", "--prefix", "urban", "--min-distance", "1800", "--trip-attributes", 'departLane="best"'],
+ "rail": ["--vehicle-class", "rail", "--vclass", "rail", "--prefix", "rail", "--min-distance", "2400", "--trip-attributes", 'departLane="best"'],
+ "ship": ["--vehicle-class", "ship", "--vclass", "ship", "--prefix", "ship"],
+ "pedestrian": ["--pedestrians", "--prefix", "ped", "--max-distance", "2000"]
+}
+
+vehicleNames = {
+ "passenger": "Cars",
+ "truck": "Trucks",
+ "bus": "Bus",
+ "motorcycle": "Motorcycles",
+ "bicycle": "Bicycles",
+ "pedestrian": "Pedestrians",
+ "tram": "Trams",
+ "rail_urban": "Urban Trains",
+ "rail": "Trains",
+ "ship": "Ships"
+}
import osmGet
import osmBuild
@@ -49,306 +81,295 @@ import route2trips
RANDOMSEED = "42"
+# all can read and execute, only user can read batch files
+BATCH_MODE = stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH
+BATCH_MODE |= stat.S_IWUSR
+BATCH_MODE |= stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
-def build(handler, prefix, bbox=False):
- sumo = sumolib.checkBinary('sumo')
- if bbox:
- sumogui = sumolib.checkBinary('sumo-gui')
+def quoted_str(s):
+ if type(s) != str:
+ return str(s)
+ elif '"' in s:
+ return "'%s'" % s
else:
- # offline test mode
- sumogui = sumo
+ return s
+
+
+class Builder(object):
+ prefix = "osm"
+
+ def __init__(self, data, local):
+ self.files = {}
+ self.data = data
+
+ if local:
+ self.tmp = os.path.abspath(
+ datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S"))
+ os.mkdir(self.tmp)
+ else:
+ self.tmp = tempfile.mkdtemp()
+
+ os.chdir(self.tmp)
+
+ def report(self, message):
+ pass
+
+ def filename(self, use, name):
+ self.files[use] = self.prefix + name
+
+ def build(self):
+ # output name for the osm file, will be used by osmBuild, can be after the
+ # process deleted
+ self.filename("osm", "_bbox.osm.xml")
+ # output name for the net file, will be used by osmBuild, randomTrips and
+ # sumo-gui
+ self.filename("net", ".net.xml")
+
+ if 'osm' in self.data:
+ # testing mode
+ shutil.copy(data['osm'], self.files["osm"])
+ else:
+ self.report("Downloading map data")
+ osmGet.get(
+ ["-b", ",".join(map(str, self.data["coords"])), "-p", self.prefix])
+
+ options = ["-f", self.files["osm"], "-p", self.prefix, "-d", self.tmp]
+
+ if self.data["poly"]:
+ # output name for the poly file, will be used by osmBuild and
+ # sumo-gui
+ self.filename("poly", ".poly.xml")
+ options += ["-m", typemaps["poly"]]
+
+ typefiles = [typemaps["net"]]
+ netconvertOptions = osmBuild.DEFAULT_NETCONVERT_OPTS + \
+ ",--junctions.corner-detail,5,--output.street-names"
+ if "pedestrian" in self.data["vehicles"]:
+ # sidewalks are already included via typefile
+ netconvertOptions += ",--crossings.guess"
+ typefiles.append(typemaps["urban"])
+ typefiles.append(typemaps["pedestrians"])
+ if "ship" in self.data["vehicles"]:
+ typefiles.append(typemaps["ships"])
+ if "bicycle" in self.data["vehicles"]:
+ typefiles.append(typemaps["bicycles"])
+ options += ["--netconvert-typemap", ','.join(typefiles)]
+ options += ["--netconvert-options", netconvertOptions]
+
+ self.report("Converting map data")
+ osmBuild.build(options)
+
+ if self.data["vehicles"]:
+ # routenames stores all routefiles and will join the items later, will
+ # be used by sumo-gui
+ self.routenames = []
+ randomTripsCalls = []
+ route2TripsCalls = []
+
+ self.edges = sumolib.net.readNet(self.files["net"]).getEdges()
+
+ for vehicle, options in self.data["vehicles"].items():
+ self.report("Processing %s" % vehicleNames[vehicle])
+
+ self.filename("route", ".%s.rou.xml" % vehicle)
+
+ try:
+ options = self.parseTripOpts(vehicle, options)
+ except ZeroDivisionError:
+ continue
+
+ randomTrips.main(randomTrips.get_options(options))
+ randomTripsCalls.append(options)
+
+ # route2trips is not called for pedestrians
+ if vehicle == "pedestrian":
+ self.routenames.append(self.files["route"])
+ else:
+ self.filename("trips", ".%s.trips.xml" % vehicle)
+ self.routenames.append(self.files["trips"])
+ route2trips.main(
+ [self.files["route"]], outfile=self.files["trips"])
+ route2TripsCalls.append(
+ [self.files["route"], self.files["trips"]])
+
+ # create a batch file for reproducing calls to randomTrips.py and
+ # route2trips
+ randomTripsPath = os.path.join(
+ SUMO_HOME, "tools", "randomTrips.py")
+ route2TripsPath = os.path.join(
+ SUMO_HOME, "tools", "route2trips.py")
+ batchFile = "build.bat"
+ with open(batchFile, 'w') as f:
+ for opts in randomTripsCalls:
+ f.write("python %s %s\n" %
+ (randomTripsPath, " ".join(map(quoted_str, opts))))
+ for route, trips in route2TripsCalls:
+ f.write("python %s %s > %s\n" %
+ (route2TripsPath, route, trips))
+
+ def parseTripOpts(self, vehicle, options):
+ "Return an option list for randomTrips.py for a given vehicle"
+
+ # calculate the total length of the available lanes
+ length = 0.
+ for edge in self.edges:
+ if edge.allows(vehicle):
+ length += edge.getLaneNumber() * edge.getLength()
+
+ period = 3600 / (length / 1000) / options["count"]
+
+ opts = ["-n", self.files["net"], "--seed", RANDOMSEED, "--fringe-factor", options["fringeFactor"],
+ "-p", period, "-r", self.files["route"], "-e", self.data["duration"]]
+ opts += vehicleParameters[vehicle]
+ return opts
+
+ def makeConfigFile(self):
+ "Save the configuration for SUMO in a file"
- def callSumo(extraopts):
- guisettingsname = prefix + ".view.xml"
- print "Writing gui settings file:", guisettingsname
- with open(guisettingsname, 'w') as f:
+ self.report("Generating configuration file")
+
+ self.filename("guisettings", ".view.xml")
+ with open(self.files["guisettings"], 'w') as f:
f.write("""
<viewsettings>
<scheme name="real world"/>
<delay value="20"/>
</viewsettings>
""")
- configname = prefix + ".sumocfg"
- print "Writing config file:", configname
- opts = [sumo, "-n", netname, "-a", polyname, "--gui-settings-file",
- guisettingsname, "-v", "--no-step-log", "--save-configuration", configname]
- opts += extraopts
+ sumo = sumolib.checkBinary("sumo")
+
+ self.filename("config", ".sumocfg")
+ opts = [sumo, "-n", self.files["net"], "--gui-settings-file", self.files["guisettings"],
+ "-v", "--no-step-log", "--save-configuration", self.files["config"], "--ignore-route-errors"]
+
+ if self.data["vehicles"]:
+ opts += ["-r", ",".join(self.routenames)]
+
+ if self.data["poly"]:
+ opts += ["-a", self.files["poly"]]
+
subprocess.call(opts)
- print "Calling SUMO GUI"
+ def createBatch(self):
+ "Create a batch / bash file "
+
+ # use bat as extension, as only Windows needs the extension .bat
+ self.files["batch"] = "run.bat"
+
+ with open(self.files["batch"], "w") as batchfile:
+ batchfile.write("sumo-gui -c " + self.files["config"])
+
+ os.chmod(self.files["batch"], BATCH_MODE)
+
+ def openSUMO(self):
+ self.report("Calling SUMO")
+ sumogui = sumolib.checkBinary("sumo-gui")
+
+ subprocess.call([sumogui, "-c", self.files["config"]])
+
+ def createZip(self):
+ "Create a zip file with everything inside which SUMO GUI needs, returns it base64 encoded"
+
+ self.report("Building zip file")
+
+ self.filename("zip", ".zip")
+
+ with ZipFile(self.files["zip"], "w") as zipfile:
+ files = ["net", "guisettings", "config", "batch"]
+
+ if self.data["poly"]:
+ files += ["poly"]
+
+ # translate the pseudo file names to real file names
+ files = map(lambda name: self.files[name], files)
+
+ if self.data["vehicles"]:
+ files += self.routenames
+
+ # add the files to the zip
+ for name in files:
+ zipfile.write(name)
+
+ # now open the zip file as raw
+ with open(self.files["zip"], "rb") as zipfile:
+ content = zipfile.read()
+
+ return base64.b64encode(content)
+
+ def finalize(self):
try:
- subprocess.call([sumogui, "-c", configname])
+ shutil.rmtree(self.tmp)
except:
- print "SUMO GUI canceled"
-
- if bbox:
- # get the coordinates and cast them to float
- size = map(float, bbox.split(","))
- # calculates the area
- size = (size[0] - size[2]) * (size[3] - size[1])
- areaFactor = abs(size) * 5000
- # to adjust period by the area
- print "Calling osmGet"
- osmGet.get(["-b", bbox, "-p", prefix])
- else:
- # offline test mode
- areaFactor = 1
-
- print "Calling osmBuild"
- # output name for the osm file, will be used by osmBuild, can be after the
- # process deleted
- osmname = prefix + "_bbox.osm.xml"
- # output name for the net file, will be used by osmBuild, randomTrips and
- # sumo-gui
- netname = prefix + ".net.xml"
- # output name for the poly file, will be used by osmBuild and sumo-gui
- polyname = prefix + ".poly.xml"
- options = ["-f", osmname, "-p", prefix, "-m", polyfile]
- typefiles = []
- netconvertOptions = osmBuild.DEFAULT_NETCONVERT_OPTS + ",--junctions.corner-detail,5"
- if handler.pedestrians.enable: # drop?
- # sidewalks are already included via typefile
- netconvertOptions += ",--crossings.guess"
- typefiles.append(pedestrianstypefile)
- else:
- typefiles.append(typefile)
- if handler.ships.enable:
- typefiles.append(shipstypefile)
- options += ["--netconvert-typemap", ','.join(typefiles)]
- options += ["--netconvert-options", netconvertOptions]
- osmBuild.build(options)
-
- if handler.vehicles.enable or handler.bicycles.enable or handler.pedestrians.enable or handler.rails.enable or handler.ships.enable:
- print "Calling randomTrips"
- # routenames stores all routefiles and will join the items later, will
- # be used by sumo-gui
- routenames = []
-
- if handler.vehicles.enable:
- routename = prefix + ".vehicles.rou.xml"
- tripname = prefix + ".vehicles.trips.xml"
- routenames.append(tripname)
- randomTrips.main(randomTrips.get_options(
- handler.vehicles.parseTripOpts(netname, routename, areaFactor)))
- route2trips.main([routename], outfile=tripname)
-
- if handler.bicycles.enable:
- routename = prefix + ".bicycles.rou.xml"
- tripname = prefix + ".bicycles.trips.xml"
- routenames.append(tripname)
- randomTrips.main(randomTrips.get_options(
- handler.bicycles.parseTripOpts(netname, routename, areaFactor)))
- route2trips.main([routename], outfile=tripname)
-
- if handler.pedestrians.enable:
- routename = prefix + ".pedestrians.rou.xml"
- routenames.append(routename)
- randomTrips.main(randomTrips.get_options(
- handler.pedestrians.parseTripOpts(netname, routename, areaFactor)))
-
- if handler.rails.enable:
- routename = prefix + ".rails.rou.xml"
- tripname = prefix + ".rails.trips.xml"
- routenames.append(tripname)
- randomTrips.main(randomTrips.get_options(
- handler.rails.parseTripOpts(netname, routename, areaFactor)))
- route2trips.main([routename], outfile=tripname)
-
- if handler.ships.enable:
- routename = prefix + ".ships.rou.xml"
- tripname = prefix + ".ships.trips.xml"
- routenames.append(tripname)
- randomTrips.main(randomTrips.get_options(
- handler.ships.parseTripOpts(netname, routename, areaFactor)))
- route2trips.main([routename], outfile=tripname)
-
- callSumo(["-r", ",".join(routenames), "--ignore-route-errors"])
+ pass
- else:
- callSumo([])
- print "Done."
+class OSMImporterWebSocket(WebSocket):
+ local = False
-class Settings:
- enable = False
- # randomTrips options
- fringeFactor = 1.0
- period = 10.0
- time = 3600
- # param: additional parameters, should be defined later
+ def report(self, message):
+ print message
+ self.sendMessage(unicode("report " + message))
- def __init__(self, param):
- self.param = param
+ def handleMessage(self):
+ data = json.loads(self.data)
- # this method will be called to return an options array for randomTrips.py
- def parseTripOpts(self, netname, routename, areaFactor):
- opts = ["-n", netname, "--seed", RANDOMSEED, "--fringe-factor", self.fringeFactor,
- "-p", self.period / areaFactor, "-r", routename, "-e", self.time]
- opts += self.param
- return opts
+ thread = threading.Thread(target=self.build, args=(data,))
+ thread.start()
+ def build(self, data):
+ builder = Builder(data, self.local)
+ builder.report = self.report
-def initSettings(handler):
- handler.vehicles = Settings(
- ["--vehicle-class", "passenger", "--vclass", "passenger", "--prefix", "veh", "--min-distance", "300"])
- handler.vehicles.fringeFactor = 5
- handler.bicycles = Settings(
- ["--vehicle-class", "bicycle", "--vclass", "bicycle", "--prefix", "bike", "--max-distance", "8000"])
- handler.bicycles.fringeFactor = 2
- handler.pedestrians = Settings(
- ["--pedestrians", "--prefix", "ped", "--max-distance", "2000"])
- handler.rails = Settings(
- ["--vehicle-class", "rail_urban", "--vclass", "rail_urban", "--prefix", "train"])
- handler.rails.fringeFactor = 40
- handler.ships = Settings(
- ["--vehicle-class", "ship", "--vclass", "ship", "--prefix", "ship"])
- handler.ships.fringeFactor = 40
- handler.ships.period = 100
-
-
-class WebSocketsHandler(SocketServer.StreamRequestHandler):
- magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
-
- def setup(self):
- SocketServer.StreamRequestHandler.setup(self)
- print "connection established", self.client_address
- self.handshake_done = False
- # initialises settings objects
- initSettings(self)
-
- def handle(self):
- while True:
- if not self.handshake_done:
- self.handshake()
- else:
- self.read_next_message()
-
- def read_next_message(self):
- length = ord(self.rfile.read(2)[1]) & 127
- if length == 126:
- length = struct.unpack(">H", self.rfile.read(2))[0]
- elif length == 127:
- length = struct.unpack(">Q", self.rfile.read(8))[0]
- masks = [ord(byte) for byte in self.rfile.read(4)]
- decoded = ""
- for char in self.rfile.read(length):
- decoded += chr(ord(char) ^ masks[len(decoded) % 4])
- self.on_message(decoded)
-
- def send_message(self, message):
- self.request.send(chr(129))
- length = len(message)
- if length <= 125:
- self.request.send(chr(length))
- elif length >= 126 and length <= 65535:
- self.request.send(126)
- self.request.send(struct.pack(">H", length))
+ steps = len(data["vehicles"]) + 4
+ self.sendMessage(unicode("steps " + str(steps)))
+
+ builder.build()
+ builder.makeConfigFile()
+ builder.createBatch()
+
+ if self.local:
+ builder.openSUMO()
else:
- self.request.send(127)
- self.request.send(struct.pack(">Q", length))
- self.request.send(message)
-
- # Handshake method, needed to be a WebSocketServer
- def handshake(self):
- data = self.request.recv(1024).strip()
- headers = Message(StringIO(data.split('\r\n', 1)[1]))
- if headers.get("Upgrade", None) != "websocket":
- return
- print 'Handshaking...'
- key = headers['Sec-WebSocket-Key']
- digest = b64encode(sha1(key + self.magic).hexdigest().decode('hex'))
- response = 'HTTP/1.1 101 Switching Protocols\r\n'
- response += 'Upgrade: websocket\r\n'
- response += 'Connection: Upgrade\r\n'
- response += 'Sec-WebSocket-Accept: %s\r\n\r\n' % digest
- self.handshake_done = self.request.send(response)
-
- def on_message(self, message):
- print message
- if message[0:8] == "coords: ":
- # build with coordinates provided by JavaScript
- #bottom, left, top, right
- # as prefix is currently used a timestamp
- # try:
- build(self, datetime.datetime.now().strftime(
- "%Y-%m-%d-%H-%M"), message[8:])
- # except:
- # print "Build failed."
-
- # settings handler, they have the syntax <target><setting>?: <value>
- # target can be vehicles or pedestrians
- elif message[:10] == "vehicles: ":
- self.vehicles.enable = bool(message[10:])
- elif message[:10] == "bicycles: ":
- self.bicycles.enable = bool(message[10:])
- elif message[:13] == "pedestrians: ":
- self.pedestrians.enable = bool(message[13:])
- elif message[:7] == "rails: ":
- self.rails.enable = bool(message[7:])
-
- elif message[:22] == "vehiclesFringeFactor: " and message[22:] != "":
- self.vehicles.fringeFactor = float(message[22:])
- elif message[:22] == "bicyclesFringeFactor: " and message[22:] != "":
- self.bicycles.fringeFactor = float(message[22:])
- elif message[:25] == "pedestriansFringeFactor: " and message[25:] != "":
- self.pedestrians.fringeFactor = float(message[25:])
- elif message[:19] == "railsFringeFactor: " and message[19:] != "":
- self.rails.fringeFactor = float(message[19:])
-
- elif message[:16] == "vehiclesPeriod: " and message[16:] != "":
- self.vehicles.period = float(message[16:])
- elif message[:16] == "bicyclesPeriod: " and message[16:] != "":
- self.bicycles.period = float(message[16:])
- elif message[:19] == "pedestriansPeriod: " and message[19:] != "":
- self.pedestrians.period = float(message[19:])
- elif message[:13] == "railsPeriod: " and message[13:] != "":
- self.pedestrians.period = float(message[13:])
-
- elif message[:14] == "vehiclesTime: " and message[14:] != "":
- self.vehicles.time = float(message[14:])
- elif message[:14] == "bicyclesTime: " and message[14:] != "":
- self.bicycles.time = float(message[14:])
- elif message[:17] == "pedestriansTime: " and message[17:] != "":
- self.pedestrians.time = float(message[17:])
- elif message[:11] == "railsTime: " and message[11:] != "":
- self.rails.time = float(message[11:])
-
- # else an invalid message
-
-
-def main():
- # initializes a WebSocketServer at port 9999 -- if you change the port
- # here, change it in script.js also!
- server = SocketServer.TCPServer(("localhost", 9999), WebSocketsHandler)
- # to automatically open the webpage in a browser
- webbrowser.open(
- os.path.join(os.path.dirname(os.path.realpath(__file__)), "index.html"))
- try:
- server.serve_forever()
- except:
- server.shutdown()
+ data = builder.createZip()
+ builder.finalize()
+ self.sendMessage(unicode("zip " + data))
+
+parser = ArgumentParser(description="OSM Importer for SUMO - Websocket Server")
+parser.add_argument("--remote", action="store_true",
+ help="In remote mode, SUMO GUI will not be automatically opened instead a zip file will be generated.")
+parser.add_argument("--testing", action="store_true",
+ help="Only a pre-defined scenario will be generated for testing purposes.")
+parser.add_argument("--address", default="", help="Address for the Websocket.")
+parser.add_argument("--port", type=int, default=8010,
+ help="Port for the Websocket. Please edit script.js when using an other port than 8010.")
if __name__ == "__main__":
- if len(sys.argv) > 1:
- # debug mode: run with the given prefix
- class DummyHandler:
- pass
- dh = DummyHandler()
- initSettings(dh)
- dh.vehicles.enable = True
- dh.bicycles.enable = True
- dh.pedestrians.enable = True
- dh.rails.enable = True
- dh.ships.enable = True
-
- dh.vehicles.period = 4
- dh.pedestrians.period = 4
- dh.rails.period = 10
- dh.ships.period = 200
- build(dh, *sys.argv[1:])
+ args = parser.parse_args()
+ OSMImporterWebSocket.local = args.testing or not args.remote
+ if args.testing:
+ data = {u'duration': 900,
+ u'vehicles': {u'passenger': {u'count': 6, u'fringeFactor': 5},
+ u'bicycle': {u'count': 2, u'fringeFactor': 2},
+ u'pedestrian': {u'count': 4, u'fringeFactor': 1},
+ u'rail_urban': {u'count': 8, u'fringeFactor': 40},
+ u'ship': {u'count': 1, u'fringeFactor': 40}},
+ u'osm': os.path.abspath('osm_bbox.osm.xml'),
+ u'poly': True}
+ builder = Builder(data, True)
+ builder.build()
+ builder.makeConfigFile()
+ builder.createBatch()
+ subprocess.call(
+ [sumolib.checkBinary("sumo"), "-c", builder.files["config"]])
else:
- main()
+ if not args.remote:
+ webbrowser.open(
+ os.path.join(os.path.dirname(os.path.abspath(__file__)), "index.html"))
+
+ server = SimpleWebSocketServer(
+ args.address, args.port, OSMImporterWebSocket)
+ server.serveforever()
diff --git a/tools/import/osm/style.css b/tools/import/osm/style.css
index b862009..e240088 100644
--- a/tools/import/osm/style.css
+++ b/tools/import/osm/style.css
@@ -1,4 +1,10 @@
-#map{
+body {
+ font-size: 18px;
+ font-family: Futura, Verdena, Arial, sans-serif;
+ overflow: hidden;
+}
+
+#map {
width: 100%;
height: 100%;
position: absolute;
@@ -6,62 +12,153 @@
left: 0;
}
-canvas{
+canvas {
position: absolute;
top: 0;
left: 0;
}
-body{
- font-size: 18px;
- font-family: Futura, Verdena, Arial, sans-serif;
+#side {
+ position: absolute;
+ top: 0;
+ right: -250px;
+ width: 250px;
+ height: 100%;
+ transition: 0.2s right;
+ border-radius: 4px 0 0 4px;
+ background: #005ACC;
+ color: #FFF;
+}
+
+#side.open {
+ right: 0;
+}
+
+.tab {
+ width: 40px;
+ height: 40px;
+ margin: 25px 0 25px -40px;
+ font-size: 32px;
+ line-height: 40px;
+ text-align: center;
+ cursor: pointer;
+ border-radius: 4px 0 0 4px;
+ background: #005ACC;
+}
+
+.tab img {
+ width: 32px;
+ margin: 4px;
}
-#controls{
+.tab.open {
+ border-left: 4px solid #00449B;
+}
+
+.controls {
+ width: 0;
+ height: calc(100% - 55px);
position: absolute;
- left: 40%;
- bottom: 5px;
+ top: 55px;
+ right: 0;
+ overflow-x: hidden;
+ overflow-y: auto;
+ transition: 0.2s width;
+ visibility: hidden;
+}
+
+.controls.open {
+ width: 250px;
+ visibility: visible;
+}
+
+.controls img {
+ float: left;
+ height: 1.25em;
+ margin-right: 0.5em;
+}
+
+.controls a {
+ color: #FFF;
+}
+
+.images {
+ overflow: hidden;
}
-.container, .options{
- background: rgba(0, 60, 136, 0.5);
- transition: 1s background;
+.container, button, #status {
+ background: #00449B;
border-radius: 4px;
- border: none;
+ font-size: 0.8em;
+ margin: 5px;
+ padding: 5px;
+}
+
+button {
color: #FFF;
- padding: 2px;
+ border: none;
cursor: pointer;
- position: relative;
- margin: 0 5px;
+ display: block;
}
-.container:hover, .options:hover{
- background: rgba(0, 60, 136, 0.7);
+.container h4 {
+ margin: 0;
+ text-align: center;
+ font-size: 1.25em;
+ display: inline;
}
-.options{
- display: none;
- position: absolute;
- left: -5px;
- bottom: 25px;
- width: 240px;
+
+.container input[type=checkbox] {
+ float: right;
+}
+
+.options {
+ max-height: 0;
+ overflow: hidden;
+ transition: 0.2s max-height;
+}
+
+.container > :checked + .options, .options.open {
+ max-height: 200px;
+}
+
+.container > :checked + .options, h4 + .options.open {
+ margin-top: 5px;
}
-.options label{
+.options label {
display: block;
+ overflow: hidden;
+ height: 20px;
+ line-height: 20px;
}
-.options input{
+.options input {
float: right;
- width: 60px;
border-radius: 2px;
border: none;
}
-.container:hover > :checked + .options, .container.always:hover .options{
- display: block;
+input[type=number] {
+ width: 60px;
+}
+
+#fixed {
+ position: absolute;
+ width: 100%;
+ top: 0;
+ left: 0;
}
-input[type=number]{
- width: 50px;
+#status {
+ display: none;
+}
+
+#status > div {
+ width: 0;
+ height: 20px;
+ background: #005ACC;
+ border-radius: 2px;
+ transition: 0.5s width;
}
diff --git a/tools/import/osm/typemap_example.xml b/tools/import/osm/typemap_example.xml
deleted file mode 100644
index 63f452c..0000000
--- a/tools/import/osm/typemap_example.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<!-- This is an exampled typemap. The "official" typemap used by the SUMO team can be found in
-$SUMO_HOME/tests/polyconvert/typemap/osm/typemap.xml.
--->
-<polygonTypes>
- <polygonType id="waterway" name="water" color=".71,.82,.82" layer="-4"/>
- <polygonType id="natural" name="natural" color=".55,.77,.42" layer="-4"/>
- <polygonType id="natural.water" name="water" color=".71,.82,.82" layer="-4"/>
- <polygonType id="natural.wetland" name="water" color=".71,.82,.82" layer="-4"/>
- <polygonType id="natural.wood" name="forest" color=".55,.77,.42" layer="-4"/>
- <polygonType id="natural.land" name="land" color=".98,.87,.46" layer="-4"/>
-
- <polygonType id="landuse" name="landuse" color=".76,.76,.51" layer="-3"/>
- <polygonType id="landuse.forest" name="forest" color=".55,.77,.42" layer="-3"/>
- <polygonType id="landuse.park" name="park" color=".81,.96,.79" layer="-3"/>
- <polygonType id="landuse.residential" name="residential" color=".92,.92,.89" layer="-3"/>
- <polygonType id="landuse.commercial" name="commercial" color=".82,.82,.80" layer="-3"/>
- <polygonType id="landuse.industrial" name="industrial" color=".82,.82,.80" layer="-3"/>
- <polygonType id="landuse.military" name="military" color=".60,.60,.36" layer="-3"/>
- <polygonType id="landuse.farm" name="farm" color=".95,.95,.80" layer="-3"/>
- <polygonType id="landuse.greenfield" name="farm" color=".95,.95,.80" layer="-3"/>
- <polygonType id="landuse.village_green" name="farm" color=".95,.95,.80" layer="-3"/>
-
- <polygonType id="tourism" name="tourism" color=".81,.96,.79" layer="-2"/>
- <polygonType id="military" name="military" color=".60,.60,.36" layer="-2"/>
- <polygonType id="sport" name="sport" color=".31,.90,.49" layer="-2"/>
- <polygonType id="leisure" name="leisure" color=".81,.96,.79" layer="-2"/>
- <polygonType id="leisure.park" name="tourism" color=".81,.96,.79" layer="-2"/>
- <polygonType id="aeroway" name="aeroway" color=".50,.50,.50" layer="-2"/>
- <polygonType id="aerialway" name="aerialway" color=".20,.20,.20" layer="-2"/>
-
- <polygonType id="shop" name="shop" color=".93,.78,1.0" layer="-1"/>
- <polygonType id="historic" name="historic" color=".50,1.0,.50" layer="-1"/>
- <polygonType id="man_made" name="building" color="1.0,.90,.90" layer="-1"/>
- <polygonType id="building" name="building" color="1.0,.90,.90" layer="-1"/>
- <polygonType id="amenity" name="amenity" color=".93,.78,.78" layer="-1"/>
- <polygonType id="amenity.parking" name="parking" color=".72,.72,.70" layer="-1"/>
- <polygonType id="power" name="power" color=".10,.10,.30" layer="-1" discard="true"/>
-
- <polygonType id="boundary" name="boundary" color="1.0,.33,.33" layer="0" fill="false" discard="true"/>
-</polygonTypes>
diff --git a/tools/import/vissim/convert_detectors2SUMO.py b/tools/import/vissim/convert_detectors2SUMO.py
new file mode 100644
index 0000000..8cdc0c3
--- /dev/null
+++ b/tools/import/vissim/convert_detectors2SUMO.py
@@ -0,0 +1,331 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+"""
+ at file convert_detectors2SUMO.py
+ at author Lukas Grohmann <Lukas.Grohmann at ait.ac.at>
+ at date Aug 14 2015
+ at version $Id: convert_detectors2SUMO.py 18763 2015-09-01 18:46:39Z behrisch $
+
+Parses induction loops and travel time measurements from a VISSIM .inpx file
+and writes converted information to a given .add.xml file.
+see documentation
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+
+import argparse
+from xml.dom import minidom
+from xml.dom.minidom import Document
+
+# want the sumolib tools
+import sys
+import os
+THIS_PATH = os.path.abspath(__file__)
+addpath = os.path.abspath(THIS_PATH + '/../../../sumolib')
+if addpath not in sys.path:
+ sys.path.append(addpath)
+import geomhelper
+
+import numpy as np
+
+
+def dict_from_node_attributes(node):
+ """takes a xml node and returns a dictionary with its attributes"""
+ return dict((attn, node.getAttribute(attn)) for attn in
+ node.attributes.keys())
+
+
+def nparr_from_dict_list(dicl_tab, col_ns, col_ts):
+ """converts a dictionary into an np array table structure"""
+ return np.array([tuple(rd.get(cn, '-1') for cn in col_ns) for rd in
+ dicl_tab], dtype=np.dtype(list(zip(col_ns, col_ts))))
+
+
+def get_induction_loops(inpx_doc):
+ induction_tab = [dict_from_node_attributes(nd) for nd in
+ inpx_doc.getElementsByTagName('dataCollectionPoint')]
+ return induction_tab
+
+
+def get_travel_time_detectors(inpx_doc):
+ travel_time_tab = []
+ for detector in \
+ inpx_doc.getElementsByTagName('vehicleTravelTimeMeasurement'):
+ travel_time_d = dict_from_node_attributes(detector)
+ start = detector.getElementsByTagName('start')[0]
+ travel_time_d['startLink'] = start.getAttribute('link')
+ travel_time_d['startPos'] = start.getAttribute('pos')
+ end = detector.getElementsByTagName('end')[0]
+ travel_time_d['endLink'] = end.getAttribute('link')
+ travel_time_d['endPos'] = end.getAttribute('pos')
+ travel_time_tab.append(travel_time_d)
+ return travel_time_tab
+
+
+def get_detector_coords_from_link(link_id, link_tab, pathlen):
+ link = [li for li in link_tab if li["no"] == link_id]
+ if len(link) > 0:
+ points = link[0]["points"]
+ return get_point_on_polyline(points, float(pathlen))
+ else:
+ print("link not found")
+
+
+def convert_vissim_to_sumo_coords(vissim_point, net_offset):
+ sumo_loop_coords = [vissim_point[0] + float(net_offset[0]),
+ vissim_point[1] + float(net_offset[1])]
+ return sumo_loop_coords
+
+
+def create_measurement_file(induction_tab, travel_time_tab,
+ edge_tab, link_tab, net_offset):
+ result_doc = Document()
+ root = result_doc.createElement("additional")
+ result_doc.appendChild(root)
+
+ for loop in induction_tab:
+ ind_loop = result_doc.createElement("inductionLoop")
+ ind_loop.setAttribute("id", "_".join([loop["no"], loop["name"]]))
+ sumo_lane = "_".join([loop["lane"].split(" ")[0],
+ str(int(loop["lane"].split(" ")[1]) - 1)])
+ ind_loop.setAttribute("lane", sumo_lane)
+
+ pathlen = loop["pos"]
+ link_id = loop["lane"].split(" ")[0]
+ lane_index = str(int(loop["lane"].split(" ")[1]) - 1)
+ vissim_loop_coords = get_detector_coords_from_link(link_id,
+ link_tab,
+ pathlen)
+ sumo_loop_coords = convert_vissim_to_sumo_coords(vissim_loop_coords,
+ net_offset)
+ polyline = [lane for lane in
+ [edge for edge in edge_tab if edge["id"] == link_id][
+ 0]["lanes"]
+ if lane["index"] == lane_index][0]["shape"].split(" ")
+ shape = []
+ for point in polyline:
+ shape.append(point.split(","))
+ edge_offset = geomhelper.polygonOffsetWithMinimumDistanceToPoint(
+ sumo_loop_coords,
+ [[float(coord) for coord in point] for point in shape])
+ ind_loop.setAttribute("pos", str(edge_offset))
+ ind_loop.setAttribute("file", "ind_out.xml")
+ ind_loop.setAttribute("freq", "900")
+ root.appendChild(ind_loop)
+
+ for det in travel_time_tab:
+ travel_time = result_doc.createElement("entryExitDetector")
+ travel_time.setAttribute("id", det["no"])
+ travel_time.setAttribute("freq", "900")
+ travel_time.setAttribute("file", "time_out.xml")
+
+ start_edge = [edge for edge in edge_tab if
+ edge["id"] == det["startLink"]]
+ if len(start_edge) > 0:
+ start_point = get_detector_coords_from_link(start_edge[0]["id"],
+ link_tab,
+ det["startPos"])
+ sumo_point = convert_vissim_to_sumo_coords(start_point, net_offset)
+ for lane in start_edge[0]["lanes"]:
+ det_entry = result_doc.createElement("detEntry")
+ polyline = lane["shape"].split(" ")
+ shape = []
+ for point in polyline:
+ shape.append(point.split(","))
+ start_offset = geomhelper.polygonOffsetWithMinimumDistanceToPoint(
+ sumo_point,
+ [[float(coord) for coord in point] for point in shape])
+ det_entry.setAttribute("lane", lane["id"])
+ if start_offset < float(lane["length"]):
+ det_entry.setAttribute("pos", str(start_offset))
+ else:
+ det_entry.setAttribute("pos", lane["length"])
+ travel_time.appendChild(det_entry)
+ end_edge = [edge for edge in edge_tab if
+ edge["id"] == det["endLink"]]
+ if len(end_edge) > 0:
+ end_point = get_detector_coords_from_link(end_edge[0]["id"],
+ link_tab,
+ det["endPos"])
+ sumo_point = convert_vissim_to_sumo_coords(end_point, net_offset)
+ for lane in end_edge[0]["lanes"]:
+ det_exit = result_doc.createElement("detExit")
+ polyline = lane["shape"].split(" ")
+ shape = []
+ for point in polyline:
+ shape.append(point.split(","))
+ end_offset = geomhelper.polygonOffsetWithMinimumDistanceToPoint(
+ sumo_point,
+ [[float(coord) for coord in point] for point in shape])
+ det_exit.setAttribute("lane", lane["id"])
+ if end_offset < float(lane["length"]):
+ det_exit.setAttribute("pos", str(end_offset))
+ else:
+ det_exit.setAttribute("pos", lane["length"])
+ travel_time.appendChild(det_exit)
+ root.appendChild(travel_time)
+ return result_doc
+
+
+def get_point_on_polyline(points, pathlen):
+ points = np.array(points, dtype=float)
+ index, rem_len = get_segment_of_polyline(points, pathlen)
+ # check if index is reasonable value
+ if index <= 0:
+ print("WARNING: got invalid point on polyline")
+ return None
+ P = np.array(points[index - 1])
+ # if the remaining length is within tolerance, snap to initial point
+ if rem_len <= 1.0e-3:
+ return P
+ Q = np.array(points[index])
+ PQ = Q - P # Vektior PQ
+ vn = PQ / np.linalg.norm(PQ) # normierter Richtungsvektor
+ return P + vn * rem_len
+
+
+def get_segment_of_polyline(points, pathlen):
+ """take a polyline and return the segment index where pathlen along the polyline lies
+ """
+ # check if pathlen is < 0
+ if pathlen < 0:
+ return 0, None
+ seg_lens = get_segment_lengths(points)
+ # check if pathlen is longer than polyline
+ # with a tolerance of 1e-4
+ if pathlen > sum(seg_lens) + 1e-3:
+ return -1, pathlen - sum(seg_lens)
+ lm_segG = np.r_[0., np.cumsum(seg_lens)]
+ index = np.digitize([pathlen], lm_segG).item()
+ return (index, pathlen - lm_segG[index - 1])
+
+
+def get_segment_lengths(points):
+ dxyz = np.diff(points, axis=0)
+ return np.linalg.norm(dxyz, axis=1)
+
+
+def get_vissim_data(inpxdoc):
+ link_tab = []
+ for link in inpx_doc.getElementsByTagName('link'):
+ link_d = {}
+ link_d['no'] = link.getAttribute('no')
+ link_d['lanes'] = []
+ link_d['points'] = []
+ for lane in link.getElementsByTagName('lane'):
+ link_d['lanes'].append({'width': lane.getAttribute('width')})
+ link_tab.append(link_d)
+ for point in link.getElementsByTagName('point3D'):
+ link_d['points'].append([point.getAttribute('x'),
+ point.getAttribute('y')])
+
+ from_to_tab = []
+ for lin in inpxdoc.getElementsByTagName('link'):
+ if lin.hasChildNodes():
+ lep_d = {} # link end point dict
+ for ept in ('fromLinkEndPt', 'toLinkEndPt'):
+ lep_nd = lin.getElementsByTagName(ept)
+ ch0 = ept[0] # identifier 'f'rom / 't'o
+ if len(lep_nd) > 0:
+ dic = dict_from_node_attributes(lep_nd.item(0))
+ dic['link'], dic['lane'] = dic['lane'].split(' ')
+ lep_d.update(dict((ch0 + '_' + key, value)
+ for key, value in dic.items()))
+ lep_d.update({'_link': link_d['no'], })
+ from_to_tab.append(lep_d)
+ # which columns to pick ?
+ from_to_tab = nparr_from_dict_list(
+ from_to_tab,
+ '_link f_link f_lane t_link t_lane'.split(),
+ 'O O i O i'.split())
+ return link_tab, from_to_tab
+
+
+def get_sumo_data(sumodoc):
+ """parse the SUMO data"""
+ junc_tab = []
+ conn_tab = []
+ edge_tab = []
+ for edge in sumo_doc.getElementsByTagName('edge'):
+ edge_d = dict_from_node_attributes(edge)
+ edge_d['lanes'] = []
+ for lane in edge.getElementsByTagName('lane'):
+ edge_d['lanes'].append(dict_from_node_attributes(lane))
+ edge_tab.append(edge_d)
+ junc_tab = [dict_from_node_attributes(nd) for
+ nd in sumodoc.getElementsByTagName('junction')]
+ col_n = ('id', 'type', 'x', 'y', 'incLanes', 'intLanes')
+ col_t = ('O', ) * 6
+ junc_tab = nparr_from_dict_list(junc_tab, col_n, col_t)
+ conn_tab = [dict_from_node_attributes(nd) for
+ nd in sumodoc.getElementsByTagName('connection')]
+ col_n = ('from', 'to', 'fromLane', 'toLane', 'via')
+ col_t = ('O', ) * 5
+ conn_tab = nparr_from_dict_list(conn_tab, col_n, col_t)
+ return junc_tab, conn_tab, edge_tab
+
+
+def get_conn_verb_rel(conn_tab, from_to_tab):
+ """returns 2 dictionaries, which contains the relation between connections
+ and verbinder"""
+
+ conn_link_d = {} # key = verbinder.id, value = list<connection.id>
+ link_conn_d = {} # key = connection.id, value = verbinder.id
+ for conn in conn_tab:
+ #
+ if ':' not in conn['from']:
+ link = from_to_tab[
+ (from_to_tab['f_link'] == conn['from'].split("[")[0]) & (
+ from_to_tab['t_link'] == conn['to'].split("[")[0])]
+ if len(link) > 0:
+ # dictionary to get the connection id for a given verbinder id
+ link_conn_d[conn['via']] = link['_link'][0]
+ if link["_link"][0] in conn_link_d:
+ conn_link_d[link["_link"][0]].append(conn['via'])
+ else:
+ conn_link_d[link["_link"][0]] = [conn['via']]
+ else:
+ print ("from: " + conn['from'] + "to: " + conn['to'])
+ return link_conn_d, conn_link_d
+
+
+# MAIN
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser(
+ description='detector conversion utility (VISSIM.inpx to SUMO)')
+ parser.add_argument('--vissim-input', '-V', type=str,
+ help='VISSIM inpx file path')
+ parser.add_argument('--output-file', '-o', type=str,
+ help='output file name')
+ parser.add_argument('--SUMO-net', '-S', type=str,
+ help='SUMO net file path')
+ args = parser.parse_args()
+ print("\n", args, "\n")
+ print('\n---\n\n* loading VISSIM net:\n\t', args.vissim_input)
+ sumo_doc = minidom.parse(args.SUMO_net)
+ inpx_doc = minidom.parse(args.vissim_input)
+ net_offset = sumo_doc.getElementsByTagName('location')[0].getAttribute(
+ 'netOffset').split(',')
+ link_tab, from_to_tab = get_vissim_data(inpx_doc)
+ junc_tab, conn_tab, edge_tab = get_sumo_data(sumo_doc)
+
+ conn_link_d = get_conn_verb_rel(conn_tab, from_to_tab)
+ induction_tab = get_induction_loops(inpx_doc)
+ travel_time_tab = get_travel_time_detectors(inpx_doc)
+
+ result_doc = create_measurement_file(induction_tab,
+ travel_time_tab,
+ edge_tab,
+ link_tab,
+ net_offset)
+
+ with open("%s.add.xml" % args.output_file, "w") as ofh:
+ result_doc.writexml(ofh, addindent=' ', newl='\n')
+ ofh.close()
diff --git a/tools/import/vissim/convert_vissimXML_flows_statRoutes.py b/tools/import/vissim/convert_vissimXML_flows_statRoutes.py
new file mode 100755
index 0000000..a345907
--- /dev/null
+++ b/tools/import/vissim/convert_vissimXML_flows_statRoutes.py
@@ -0,0 +1,399 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+"""
+ at file convert_vissimXML_flows_statRoutes.py
+ at author Lukas Grohmann <Lukas.Grohmann at ait.ac.at>
+ at date Jun 09 2015
+ at version $Id: convert_vissimXML_flows_statRoutes.py 18763 2015-09-01 18:46:39Z behrisch $
+
+Parses flows and static routes from a VISSIM .inpx file
+and writes converted information to a given .rou.xml file.
+see documentation (TODO ref.)
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+# TODO: usage doc.ref
+# FIXME: better split in 2 ?
+
+import argparse
+from xml.dom import minidom
+import numpy as np
+from xml.dom.minidom import Document
+
+
+def dict_from_node_attributes(node):
+ """takes a xml node and returns a dictionary with its attributes"""
+ return dict((attn, node.getAttribute(attn)) for attn in
+ node.attributes.keys())
+
+
+# FUNKTIONEN
+def parse_flows(xmldoc):
+ """parses the vehicle inputs from the VISSIM data"""
+ flow_d = dict()
+ for v_input in xmldoc.getElementsByTagName('vehicleInput'):
+ v_input_d = dict_from_node_attributes(v_input)
+ v_input_d["vehComp"] = []
+ v_input_d["volType"] = []
+ v_input_d["flow"] = []
+ for volume in v_input.getElementsByTagName('timeIntervalVehVolume'):
+ v_input_d["vehComp"].append(volume.getAttribute('vehComp'))
+ v_input_d["volType"].append(volume.getAttribute('volType'))
+ v_input_d["flow"].append(
+ [float(volume.getAttribute('timeInt').split(" ")[1]) / 1000,
+ float(volume.getAttribute('volume')),
+ float(volume.getAttribute('vehComp'))])
+ v_input_d["flow"] = np.array(v_input_d["flow"])
+ flow_d[v_input_d["link"]] = v_input_d
+ return flow_d
+
+
+def parse_max_acc(xmldoc):
+ """parses the vehicle acceleration distributions from the VISSIM data"""
+ acc_d = dict()
+ for max_acc in xmldoc.getElementsByTagName('maxAccelerationFunction'):
+ acc_d[max_acc.getAttribute('no')] = max_acc.getElementsByTagName(
+ 'accelerationFunctionDataPoint')[0].getAttribute('y')
+ return acc_d
+
+
+def parse_max_speed(xmldoc):
+ """parses the vehicle speed distribution from the VISSIM data"""
+ speed_d = dict()
+ for max_speed in xmldoc.getElementsByTagName('desSpeedDistribution'):
+ # get mean speed
+ num = 0.
+ sum_val = 0.
+ data_points = max_speed.getElementsByTagName(
+ 'speedDistributionDataPoint')
+ for point in data_points:
+ num += 1
+ sum_val += float(point.getAttribute('x'))
+ speed_d[max_speed.getAttribute('no')] = str((sum_val / num) / 3.6)
+ return speed_d
+
+
+def parse_length(xmldoc):
+ """parses the vehicle length from the VISSIM data"""
+ len_d = dict()
+ model_d = dict()
+ # get model data
+ for model in xmldoc.getElementsByTagName('model2D3D'):
+ model_d[model.getAttribute('no')] = model.getElementsByTagName(
+ 'model2D3DSegment')[0].getAttribute('length')
+ # calculate length data
+ for model_dist in xmldoc.getElementsByTagName('model2D3DDistribution'):
+ elements = model_dist.getElementsByTagName(
+ 'model2D3DDistributionElement')
+ length = 0
+ total_probability = 0
+ for element in elements:
+ total_probability += float(element.getAttribute('share'))
+ for element in elements:
+ length += (
+ float(element.getAttribute('share')) / total_probability) * \
+ float(model_d[element.getAttribute('model2D3D')])
+ len_d[model_dist.getAttribute('no')] = str(length)
+ return len_d
+
+
+def parse_veh_comp(xmldoc):
+ """parses the vehicle composition from the VISSIM data"""
+ veh_comp_d = dict()
+ for vehicle_comp in xmldoc.getElementsByTagName('vehicleComposition'):
+ rel_flows = vehicle_comp.getElementsByTagName(
+ 'vehicleCompositionRelativeFlow')
+ flow_l = []
+ for flow in rel_flows:
+ flow_d = {}
+ flow_d['desSpeedDistr'] = flow.getAttribute('desSpeedDistr')
+ flow_d['rel_flow'] = flow.getAttribute('relFlow')
+ flow_d['vehType'] = flow.getAttribute('vehType')
+ flow_l.append(flow_d)
+ # list of dictionaries
+ veh_comp_d[vehicle_comp.getAttribute('no')] = flow_l
+ return veh_comp_d
+
+
+def parse_vehicle_types(xmldoc, acc_d, length_d):
+ """parses the vehicle types from the VISSIM data"""
+ veh_type_d = dict()
+ for veh_type in xmldoc.getElementsByTagName('vehicleType'):
+ type_d = {}
+ type_d['id'] = veh_type.getAttribute('no')
+ type_d['length'] = length_d[veh_type.getAttribute('model2D3DDistr')]
+ type_d['acc'] = acc_d[veh_type.getAttribute('maxAccelFunc')]
+ veh_type_d[veh_type.getAttribute('no')] = type_d
+ return veh_type_d
+
+
+# FIXME: not necessarily nicely done
+# name doesn't fit functionality
+def is_verbinder(xmldoc):
+ """checks if a given link is a verbinder"""
+ # simple implementation of static variable
+ # if not hasattr(is_verbinder, "v_dic"):
+ # is_verbinder.v_dic = dict() # doesn't exist yet, so initialize
+ # FIXME: xmldoc is in the way
+ is_verbinder_d = dict()
+ for link in xmldoc.getElementsByTagName("link"):
+ if len(link.getElementsByTagName("fromLinkEndPt")) > 0:
+ is_verbinder_d[link.getAttribute("no")] = True
+ else:
+ is_verbinder_d[link.getAttribute("no")] = False
+ # returning a dict...
+ return is_verbinder_d
+
+
+# FIXME: just for static routes
+def parse_routes(xmldoc, edge_list, is_verbinder_d):
+ """parses the VISSIM .inpx route information
+ of statically defined routes ONLY"""
+ routes_by_start_d = dict() # dictionary[start_link] = list(<Route>)
+ for decision in xmldoc.getElementsByTagName('vehicleRoutingDecisionStatic'):
+ start_link = decision.getAttribute('link')
+ routes_by_start_d[start_link] = []
+ for statistic in decision.getElementsByTagName('vehicleRouteStatic'):
+ route_d = {}
+ route_d["start_link"] = start_link
+ route_d["dest_link"] = statistic.getAttribute('destLink')
+ route_d["r_id"] = statistic.getAttribute('no')
+ i = 1
+ route_d["rel_flow"] = []
+ temp = statistic.getAttribute('relFlow').split(" ")
+ while i < len(temp):
+ var = temp[i].split(":")
+ var[0] = float(var[0]) / 1000
+ var[1] = float(var[1].replace(",", ""))
+ route_d["rel_flow"].append(var)
+ i = i + 2
+ route_d["rel_flow"] = np.array(route_d["rel_flow"])
+ route_d["links"] = [route_d["start_link"]]
+ for link in statistic.getElementsByTagName('intObjectRef'):
+ # exclude VISSIM connectors (usually id > 10k)
+ if not is_verbinder_d[link.getAttribute('key')]:
+ if link.getAttribute('key') in edge_list:
+ route_d["links"].append(link.getAttribute('key'))
+ else:
+ split_edge_list = [
+ e for e in edge_list if e[-1] == ']']
+ check = 1
+ i = 0
+ while check == 1:
+ if link.getAttribute(
+ 'key') + "[" + str(i) + "]" \
+ in split_edge_list:
+ route_d["links"].append(
+ link.getAttribute('key') +
+ "[" + str(i) + "]")
+ i = i + 1
+ else:
+ check = 0
+
+ route_d["links"].append(route_d["dest_link"])
+ # add route object to dictionary
+ routes_by_start_d[route_d["start_link"]].append(route_d)
+ return routes_by_start_d
+
+
+def set_probability(routes_by_start_d, flow_d):
+ """computes the route probabilies"""
+ for start_link in routes_by_start_d.keys():
+ absolute_flow = flow_d[start_link]["flow"][:, 1]
+ cumulated_flow = np.zeros_like(absolute_flow)
+ veh_comp = flow_d[start_link]["vehComp"]
+ for route in routes_by_start_d[start_link]:
+ cumulated_flow = cumulated_flow + route["rel_flow"][:, 1]
+ # set the vehicle type for each route
+ route["type"] = veh_comp
+ for route in routes_by_start_d[start_link]:
+ route["probability"] = np.zeros_like(absolute_flow)
+ zero_comp_flow_sel = cumulated_flow == 0.
+ route["probability"][~zero_comp_flow_sel] = \
+ (route["rel_flow"][~zero_comp_flow_sel, 1]
+ / cumulated_flow[~zero_comp_flow_sel])
+
+# VISSIM BUG!!: Relative Zuflüsse mit dem Wert 1.0 gehen bei der
+# Konversion von .inp zu .inpx verloren
+
+
+def validate_rel_flow(routes_by_start_d):
+ """checks if a relative flow is missing and completes it if necessary"""
+ # compare alle rel_flows with the reference flow
+ for start_link in routes_by_start_d.keys():
+ reference_time = flow_d[start_link]["flow"][:, 0]
+ for route in routes_by_start_d[start_link]:
+ if np.array_equal(reference_time,
+ route["rel_flow"][:, 0]) == False:
+ i = 0
+ while i < len(route["rel_flow"]):
+ if reference_time[i] != route["rel_flow"][i, 0]:
+ # add missing time interval with relative flow 1.0
+ route["rel_flow"] = np.insert(
+ route["rel_flow"], i, np.array(
+ (reference_time[i], 1.0)), 0)
+ i = i + 1
+
+
+def set_v_types(veh_comp_d, route_doc, root, speed_d):
+ """writes the vehicle distribution data into the given dom document"""
+ for c_id, comps in veh_comp_d.items():
+ v_type_dist = route_doc.createElement("vTypeDistribution")
+ v_type_dist.setAttribute("id", c_id)
+ root.appendChild(v_type_dist)
+ for comp in comps:
+ v_type = route_doc.createElement("vType")
+ v_type.setAttribute(
+ "id",
+ "t{}_D{}".format(
+ veh_type_d[comp["vehType"]]["id"],
+ c_id))
+ v_type.setAttribute("accel", veh_type_d[comp["vehType"]]["acc"])
+ v_type.setAttribute("length",
+ veh_type_d[comp["vehType"]]["length"])
+ v_type.setAttribute("probability", comp["rel_flow"])
+ v_type.setAttribute("maxSpeed", speed_d[comp["desSpeedDistr"]])
+ v_type_dist.appendChild(v_type)
+ return route_doc
+
+
+def set_route_distributions(route_doc, routes_by_start_d, root):
+ """writes the route distribution data into the given dom document"""
+ for start_id in routes_by_start_d:
+ i = 0
+ if len(routes_by_start_d[start_id]) > 0:
+ ref_time = flow_d[start_id]["flow"][:, 0]
+ for time in ref_time:
+ route_dist = route_doc.createElement("routeDistribution")
+ route_dist.setAttribute("id", "_".join([start_id,
+ str(time)]))
+ root.appendChild(route_dist)
+ for route in routes_by_start_d[start_id]:
+ if np.abs(route["probability"][i]) != 0:
+ route_node = route_doc.createElement("route")
+ route_node.setAttribute("id", route["r_id"])
+ route_node.setAttribute("edges",
+ " ".join(route["links"]))
+ route_node.setAttribute("probability",
+ str(np.abs(
+ route["probability"][i])))
+ route_dist.appendChild(route_node)
+ if not route_dist.hasChildNodes():
+ root.removeChild(route_dist)
+ i += 1
+ return route_doc
+
+
+def set_flows(routes_by_start_d, flow_d, route_doc, root):
+ """writes the flow data into the given dom document"""
+ sim_end = XMLDOC.getElementsByTagName(
+ "simulation")[0].getAttribute("simPeriod")
+ dom_flow_l = []
+ for start_id in routes_by_start_d:
+ ref_time = flow_d[start_id]["flow"][:, 0]
+ for index, time in enumerate(ref_time):
+ if len(routes_by_start_d[start_id]) > 0:
+ in_flow = [fl for fl in flow_d[start_id]["flow"] if
+ fl[0] == time][0]
+ if in_flow[1] > 0:
+ flow = route_doc.createElement("flow")
+ flow.setAttribute("id", "fl{}_st{}".format(start_id,
+ time))
+ flow.setAttribute("color", "1,1,0")
+ flow.setAttribute("begin", str(time))
+ if index < len(ref_time) - 1 and len(ref_time) > 1:
+ flow.setAttribute("end",
+ str(time + ref_time[index + 1]))
+ else:
+ flow.setAttribute("end", sim_end)
+ flow.setAttribute("vehsPerHour", str(in_flow[1]))
+ flow.setAttribute("type", str(int(in_flow[2])))
+ flow.setAttribute('route', "_".join([start_id,
+ str(time)]))
+ dom_flow_l.append(flow)
+ dom_flow_l = sorted(dom_flow_l,
+ key=lambda dom: float(dom.getAttribute("begin")))
+ for dom_obj in dom_flow_l:
+ root.appendChild(dom_obj)
+ return route_doc
+
+
+# MAIN
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser(
+ description='road network conversion utility '
+ ' (VISSIM.inpx to SUMO)')
+ parser.add_argument('--vissim-input', '-V', type=str,
+ help='VISSIM inpx file path')
+ parser.add_argument('--SUMO-net', '-S', type=str,
+ help='SUMO net file path')
+ parser.add_argument('--output-file', '-o', type=str,
+ help='output file name')
+ args = parser.parse_args()
+ print("\n", args, "\n")
+ print('\n---\n\n* loading VISSIM net:\n\t', args.vissim_input)
+ XMLDOC = minidom.parse(args.vissim_input)
+ print('\n---\n\n* loading SUMO net:\n\t', args.SUMO_net,)
+ SUMODOC = minidom.parse(args.SUMO_net)
+
+ edge_list = []
+ ed_list = SUMODOC.getElementsByTagName('edge')
+ for edge in ed_list:
+ # is it a normal edge ?
+ if not edge.hasAttribute("function"):
+ edge_list.append(edge.getAttribute("id"))
+
+ # to check if a link is a verbinder
+ is_verbinder_d = is_verbinder(XMLDOC)
+
+ #
+ # Vehicle Types #########
+ #
+
+ # parse vehicle type data
+ speed_d = parse_max_speed(XMLDOC)
+ # get the vehicle distribution
+ veh_comp_d = parse_veh_comp(XMLDOC)
+ # parse vehTypes and combine the information with the acceleration and
+ # length data
+ veh_type_d = parse_vehicle_types(XMLDOC,
+ parse_max_acc(XMLDOC),
+ parse_length(XMLDOC))
+
+ #
+ # Flows and Routes ########
+ #
+
+ # TODO: can we make flows and routes conversion switchable by option ?
+ # parse flows
+ flow_d = parse_flows(XMLDOC)
+ # parse routes
+ routes_by_start_d = parse_routes(XMLDOC, edge_list, is_verbinder_d)
+ # validate relative flows
+ validate_rel_flow(routes_by_start_d)
+ # computes the probability for each route
+ set_probability(routes_by_start_d, flow_d)
+
+ #
+ # XML Handling ##########
+ #
+
+ # create dom document and define routes + flows
+ result_doc = Document()
+ root = result_doc.createElement("routes")
+ result_doc.appendChild(root)
+
+ result_doc = set_v_types(veh_comp_d, result_doc, root, speed_d)
+ result_doc = set_route_distributions(result_doc, routes_by_start_d, root)
+ result_doc = set_flows(routes_by_start_d, flow_d, result_doc, root)
+ # write the data into a .rou.xml file
+ with open("%s.rou.xml" % args.output_file, "w") as ofh:
+ result_doc.writexml(ofh, addindent=' ', newl='\n')
+ ofh.close()
diff --git a/tools/import/vissim/tls_vissimXML2SUMOnet_update.py b/tools/import/vissim/tls_vissimXML2SUMOnet_update.py
new file mode 100755
index 0000000..4987ac2
--- /dev/null
+++ b/tools/import/vissim/tls_vissimXML2SUMOnet_update.py
@@ -0,0 +1,609 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+ at file tls_vissimXML2SUMOnet_update.py
+ at author Lukas Grohmann <Lukas.Grohmann at ait.ac.at>
+ at author Gerald Richter <Gerald.Richter at ait.ac.at>
+ at date Jun 11 2015
+ at version $Id: tls_vissimXML2SUMOnet_update.py 18763 2015-09-01 18:46:39Z behrisch $
+
+Converts a VISSIM-tls-description into a SUMO-tls-description and writes
+the appended information to a copy of the given sumo.net file
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+# TODO: usage doc.ref
+
+from __future__ import print_function
+
+import os
+import argparse
+from xml.dom import minidom
+from copy import deepcopy
+
+import numpy as np
+
+
+def dict_from_node_attributes(node):
+ """takes a xml node and returns a dictionary with its attributes"""
+ return dict((attn, node.getAttribute(attn)) for attn in
+ node.attributes.keys())
+
+
+def nparr_from_dict_list(dicl_tab, col_ns, col_ts):
+ """converts a dictionary into an np array table structure"""
+ return np.array([tuple(rd.get(cn, '0') for cn in col_ns) for rd in
+ dicl_tab], dtype=np.dtype(list(zip(col_ns, col_ts))))
+
+
+def get_conn_verb_rel(conn_tab, from_to_tab):
+ """
+ returns a dictionary to get the connection id for a
+ given verbinder id and vice versa
+ """
+ conn_link_d = {} # key = verbinder.id, value = list<connection.id>
+ for conn in conn_tab:
+ if ':' not in conn['from']:
+ link = from_to_tab[
+ (from_to_tab['f_link'] == conn['from'].split("[")[0])
+ & (from_to_tab['t_link'] == conn['to'].split("[")[0])]
+ if len(link) > 0:
+ if link["_link"][0] in conn_link_d:
+ conn_link_d[link["_link"][0]].append(conn['via'])
+ else:
+ conn_link_d[link["_link"][0]] = [conn['via']]
+ else:
+ print("from: " + conn['from'] + "to: " + conn['to'])
+ return conn_link_d
+
+
+def parse_vissim_net_data(inpxdoc):
+ link_tab = []
+ from_to_tab = []
+ for lin in inpxdoc.getElementsByTagName('link'):
+ link_d = dict_from_node_attributes(lin)
+ link_tab.append(link_d)
+ if lin.hasChildNodes():
+ lep_d = {} # link end point dict
+ for ept in ('fromLinkEndPt', 'toLinkEndPt'):
+ lep_nd = lin.getElementsByTagName(ept)
+ ch0 = ept[0] # identifier 'f'rom / 't'o
+ if len(lep_nd) > 0:
+ dic = dict_from_node_attributes(lep_nd.item(0))
+ dic['link'], dic['lane'] = dic['lane'].split(' ')
+ lep_d.update(dict((ch0 + '_' + key, value)
+ for key, value in dic.items()))
+ lep_d.update({'_link': link_d['no'], })
+ from_to_tab.append(lep_d)
+ # which columns to pick ?
+ link_tab = nparr_from_dict_list(link_tab, 'no name'.split(), ('O',) * 2)
+ # lane_tab = just the number of lanes and width
+ from_to_tab = nparr_from_dict_list(
+ from_to_tab,
+ '_link f_link f_lane t_link t_lane'.split(),
+ 'O O i O i'.split())
+ return link_tab, from_to_tab
+
+
+def parse_sumo_net_data(sumodoc):
+ junc_tab = []
+ conn_tab = []
+ junc_tab = [dict_from_node_attributes(nd) for
+ nd in sumodoc.getElementsByTagName('junction')]
+ col_n = ('id', 'type', 'x', 'y', 'incLanes', 'intLanes')
+ col_t = ('O', ) * 6
+ junc_tab = nparr_from_dict_list(junc_tab, col_n, col_t)
+ conn_tab = [dict_from_node_attributes(nd) for
+ nd in sumodoc.getElementsByTagName('connection')]
+ col_n = ('from', 'to', 'fromLane', 'toLane', 'via')
+ col_t = ('O', ) * 5
+ conn_tab = nparr_from_dict_list(conn_tab, col_n, col_t)
+ return junc_tab, conn_tab
+
+
+def compute_signal_tables(disp_name_id_d, signal_state_d, prog_list):
+ """
+ completes the signal tables with all duration and beginning times
+ (in the VISSIm .sig files are only the beginning times of the red and
+ green phases as well as the durations of the other phases given )
+ """
+ for key, program in signal_state_d.items():
+ cycletime = int([prog for prog in prog_list
+ if prog["id"] == key][0]["cycletime"])
+ for sig_group in program.values():
+ sig_seq = sig_group["signal_sequence"]
+ sig_tab = deepcopy(disp_name_id_d[sig_seq])
+ # durations füllen
+ for state in sig_group["durations"]:
+ itemindex = np.where(sig_tab == int(state["display"]))
+ sig_tab[itemindex[0][0]][itemindex[1][0] + 2] \
+ = int(state["duration"])
+ # begins füllen
+ for cmd in sig_group["begins"]:
+ itemindex = np.where(sig_tab == int(cmd["display"]))
+ sig_tab[itemindex[0][0]][itemindex[1][0] + 1] \
+ = int(cmd["begin"])
+ # begin Zeiten berechnen
+ # bei zufälligem begin Eintrag starten
+ i = itemindex[0][0]
+ check = 0
+ while check != len(sig_tab):
+ if sig_tab[i - 1][1] == -1: # duration bekannt
+ # überlauf cycletime
+ if (sig_tab[i][1] - sig_tab[i - 1][2]) < 0:
+ sig_tab[i - 1][1] = cycletime - \
+ (sig_tab[i - 1][2] - sig_tab[i][1])
+ else:
+ sig_tab[i - 1][1] = sig_tab[i][1] - sig_tab[i - 1][2]
+ elif sig_tab[i - 1][2] == -1: # begin bekannt
+ if sig_tab[i - 1][1] > sig_tab[i][1]: # überlauf cycletime
+ sig_tab[i - 1][2] = \
+ (cycletime - sig_tab[i - 1][1]) + sig_tab[i][1]
+ else:
+ sig_tab[i - 1][2] = sig_tab[i][1] - sig_tab[i - 1][1]
+ i -= 1
+ check += 1
+ i = 0
+ while i < len(sig_tab):
+ if (sig_tab[i][1] + sig_tab[i][2]) > cycletime:
+ diff = cycletime - sig_tab[i][1]
+ dur = sig_tab[i][2]
+ sig_tab[i][2] = diff
+ sig_tab = np.insert(
+ sig_tab, i, np.array(
+ (sig_tab[i][0], 0, dur - diff)), 0)
+ break
+ i += 1
+ sig_tab = sig_tab[np.argsort(sig_tab[:, 1])]
+ sig_group["signal_table"] = sig_tab
+
+
+def sigtable_split_time(signal_state_d, prog_list):
+ # FIXME: doc
+ reference_time_d = {}
+ for key, program in signal_state_d.items():
+ cycletime = int([prog for prog in prog_list
+ if prog["id"] == key][0]["cycletime"])
+ reference_time = np.array([], dtype="int")
+ reference_duration = np.array([], dtype="int")
+ for sg in program.values():
+ reference_time = np.append(
+ reference_time, sg["signal_table"][:, 1])
+ reference_time = np.unique(reference_time)
+ i = 0
+ while i < len(reference_time):
+ if i == len(reference_time) - 1:
+ ele = cycletime - reference_time[i]
+ else:
+ ele = reference_time[i + 1] - reference_time[i]
+ reference_duration = np.append(reference_duration, ele)
+ i += 1
+ reference_time_d[key] = {}
+ reference_time_d[key]["begin"] = reference_time
+ reference_time_d[key]["duration"] = reference_duration
+ return reference_time_d
+
+
+def compute_sumo_signal_tables(reference_time_d,
+ signal_state_d,
+ sig_disp_list,
+ tls_state_vissim2SUMO):
+ # FIXME: doc
+ for key, program in signal_state_d.items():
+ for sg in program.values():
+ state = sg["signal_table"]
+ ref_time = reference_time_d[key]["begin"]
+ sumo_tab = ""
+ for time in ref_time:
+ i = 0
+ while i < len(state):
+ if state[i][1] <= time < state[i][1] + state[i][2]:
+ sumo_state = tls_state_vissim2SUMO[
+ [sig for sig in sig_disp_list if
+ sig["id"] == str(state[i][0])][0]["state"]]
+ sumo_tab = "".join([sumo_tab, sumo_state])
+ break
+ i += 1
+ sg["sumo_signal_table"] = sumo_tab
+
+
+def get_sigcon_junc_relation(sig_con_tab, sig_group_conn_d, junc_tab):
+ """
+ allocates the VISSIM signalcontrollers to SUMO junctions
+ """
+ sigCon_junc_d = {}
+ for sig_con in sig_con_tab:
+ conn_l = []
+ for sg in sig_con["_sgs"]:
+ if sg["_sg"] in sig_group_conn_d:
+ conn_l += sig_group_conn_d[sg["_sg"]]
+ else:
+ continue
+ # intersection
+ junction = [
+ junc for junc in junc_tab if len(
+ set(conn_l).intersection(
+ junc['intLanes'].split(" "))) > 0]
+ if len(junction) > 0:
+ junction = junction[0]
+ else:
+ continue
+ sigCon_junc_d[sig_con["no"]] = junction["id"]
+ return sigCon_junc_d
+
+
+def get_sigseq_id_list(sig_seq_tab, sig_disp_list):
+ # FIXME: doc
+ disp_name_id_d = {}
+ for seq in sig_seq_tab:
+ id_list = []
+ names = seq["name"].split("-")
+ for name in names:
+ id_list.append([[disp for disp in sig_disp_list
+ if disp["name"] == name][0]["id"], -1, -1])
+ disp_name_id_d[seq["id"]] = np.array(id_list, dtype="int")
+ return disp_name_id_d
+
+
+def get_sg_connection_data(
+ conn_tab,
+ sig_con_tab,
+ sig_head_d,
+ edge_list,
+ conn_link_d):
+ # FIXME: doc
+ sig_group_conn_d = {} # dic [sigCon ID] = List <[conn via]>
+ for con in sig_con_tab:
+ for sg in con['_sgs']:
+ # check if a signalHead exists for the given signalGroup
+ if sg['_sg'] in sig_head_d:
+ for signal in sig_head_d[sg['_sg']]:
+ link = signal['link']
+ lane = str(int(signal['lane']) - 1)
+ # tls on normal edge or verbinder?
+ if is_verbinder_d[link] == False:
+ if link in edge_list:
+ connection = conn_tab[
+ (conn_tab["from"] == link) & (
+ conn_tab["fromLane"] == lane)]
+ else:
+ check = True
+ split_len = 0
+ while check:
+ if "".join(
+ [link, "[", str(split_len), "]"]) \
+ in edge_list:
+ split_len += 1
+ else:
+ check = False
+ print("".join([link, "[", str(split_len), "]"]))
+ connection = conn_tab[(conn_tab["from"] == "".join(
+ [link, "[", str(split_len), "]"]))
+ & (conn_tab["fromLane"] == lane)][0]
+ else:
+ connection = conn_tab[
+ (conn_tab["via"] ==
+ [conn for conn in
+ conn_link_d[link] if conn[-1] == lane])]
+ if sg['_sg'] in sig_group_conn_d:
+ for conn in connection:
+ sig_group_conn_d[sg['_sg']].append(conn["via"])
+ else:
+ sig_group_conn_d[sg['_sg']] = []
+ for conn in connection:
+ sig_group_conn_d[sg['_sg']].append(conn["via"])
+ else:
+ print(sg['_sg'])
+ return sig_group_conn_d
+
+
+def parse_sig_file(sig_file):
+ xmldoc = minidom.parse(sig_file)
+ print('\n---\n\n* loading signal file:\n\t', sig_file)
+
+ # just getting single head node
+ sc_node = xmldoc.getElementsByTagName('sc').item(0)
+ sc_id = sc_node.getAttribute('id')
+
+ # get the signal displays; should be just 1 node
+ sig_disp_nodes = sc_node.getElementsByTagName('signaldisplays')
+ display_nodes = sig_disp_nodes.item(0).getElementsByTagName('display')
+ # build for single current signal
+ sig_disp_list = [dict_from_node_attributes(disp) for disp in display_nodes]
+ [sd.update({'_sc_id': sc_id}) for sd in sig_disp_list]
+
+ # signalsequences
+ sig_seq_tab = []
+ # sigStat_tab needed for default program
+ sigStat_tab = []
+ for sig_seq in sc_node.getElementsByTagName('signalsequence'):
+ sig_seq_d = dict_from_node_attributes(sig_seq)
+ sig_seq_tab.append(sig_seq_d)
+ sig_state_l = [dict_from_node_attributes(sst) for
+ sst in sig_seq.getElementsByTagName('state')]
+ [sst.update({'_sigSeq_id': sig_seq_d['id']}) for sst in sig_state_l]
+ sigStat_tab.extend(sig_state_l)
+ sgroup_list = []
+ # holds defaultDurations, fixedstates, cmds
+ prog_list = []
+ # dict[prog_id][signal_id]
+ # <signal_sequence>
+ # <begins>
+ # <durations>
+ signal_state_d = {}
+
+ # reading default program; should be just 1 node
+ sgs_list = sc_node.getElementsByTagName('sgs')
+ prog_id = '0' # unsaved
+ prog_d = dict((('id', prog_id), ))
+ prog_list.append(prog_d)
+
+ # default sg einlesen
+ for sg in sgs_list.item(0).getElementsByTagName('sg'):
+ sg_d = dict_from_node_attributes(sg)
+ sg_d.update({'_prog_id': prog_id, })
+ sgroup_list.append(sg_d)
+
+ # other sg reading
+ progs_node = sc_node.getElementsByTagName('progs').item(0)
+ for prog_node in progs_node.getElementsByTagName('prog'):
+ prog_d = dict_from_node_attributes(prog_node)
+ prog_list.append(prog_d)
+ prog_id = prog_d['id']
+ signal_state_d[prog_id] = {}
+ sg_nl = prog_node.getElementsByTagName(
+ 'sgs').item(0).getElementsByTagName('sg')
+ for sg in sg_nl:
+ sg_d = dict_from_node_attributes(sg)
+ signal_state_d[prog_id][sg_d["sg_id"]] = {}
+ signal_state_d[prog_id][sg_d["sg_id"]][
+ "signal_sequence"] = sg_d["signal_sequence"]
+ signal_state_d[prog_id][sg_d["sg_id"]]["begins"] = []
+ signal_state_d[prog_id][sg_d["sg_id"]]["durations"] = []
+ sg_d.update({'_prog_id': prog_id, })
+ sgroup_list.append(sg_d)
+ # fixedstates
+ for fixStat in sg.getElementsByTagName('fixedstates').item(0).\
+ getElementsByTagName('fixedstate'):
+ fixst = dict_from_node_attributes(fixStat)
+ signal_state_d[prog_id][sg_d["sg_id"]][
+ "durations"].append(fixst)
+ # cmds
+ for cmd_node in sg.getElementsByTagName('cmds').item(0).\
+ getElementsByTagName('cmd'):
+ cmd_d = dict_from_node_attributes(cmd_node)
+ signal_state_d[prog_id][sg_d["sg_id"]]["begins"].append(cmd_d)
+
+ return sig_seq_tab, signal_state_d, sig_disp_list, prog_list
+
+
+def parse_inpx_sig_data(xmldoc):
+ """parses the signal data from the .inpx file"""
+ sig_controller_tab = []
+ sig_head_d = dict()
+
+ for controller in xmldoc.getElementsByTagName('signalController'):
+ controller_d = dict_from_node_attributes(controller)
+ sgs_l = [dict_from_node_attributes(sgn) for
+ sgn in controller.getElementsByTagName('signalGroup')]
+ for sg in sgs_l:
+ sg['_sg'] = " ".join([controller.getAttribute('no'), sg['no']])
+ controller_d['_sgs'] = sgs_l
+ sig_controller_tab.append(controller_d)
+
+ # parse signalHeads
+ for s_head_item in xmldoc.getElementsByTagName('signalHead'):
+ sig_head = dict_from_node_attributes(s_head_item)
+ sig_head['link'], sig_head['lane'] = sig_head['lane'].split(" ")
+ # temp = sHead.getAttribute('lane').split(" ") # "link lane"
+ if sig_head['sg'] in sig_head_d:
+ sig_head_d[sig_head['sg']].append(sig_head)
+ else:
+ sig_head_d[sig_head['sg']] = [sig_head]
+ return sig_controller_tab, sig_head_d
+
+
+def edit_connections(conn_l, sumodoc, junc_id):
+ i = 0
+ while i < len(conn_l):
+ for via in conn_l[i]:
+ connection = [conn for conn in
+ sumodoc.getElementsByTagName("connection")
+ if conn.getAttribute("via") == via][0]
+ connection.setAttribute("state", "o") # CHECK
+ connection.setAttribute("linkIndex", str(i))
+ connection.setAttribute("tl", junc_id)
+ i += 1
+
+
+def is_verbinder(xmldoc):
+ """checks if a given link is a verbinder"""
+ is_verbinder_d = dict()
+ for link in xmldoc.getElementsByTagName("link"):
+ if len(link.getElementsByTagName("fromLinkEndPt")) > 0:
+ is_verbinder_d[link.getAttribute("no")] = True
+ else:
+ is_verbinder_d[link.getAttribute("no")] = False
+ return is_verbinder_d
+
+
+def generate_xml_doc(
+ sumo_tls_d, sigCon_junc_d,
+ sig_con_tab, reference_time_d,
+ sumodoc, prog_list_d, sig_group_conn_d):
+ for tls_id, programs in sumo_tls_d.items():
+ junc_id = sigCon_junc_d[tls_id]
+ default_prog_id = [
+ sig for sig in sig_con_tab if sig["no"] == tls_id][0]["progNo"]
+ for prog_id, program in programs.items():
+ signal_table = []
+ for sg_id, sg in program.items():
+ if " ".join([tls_id, sg_id]) in sig_group_conn_d:
+ signal_table.append([sg_id, sg["sumo_signal_table"]])
+ signal_table = np.array(signal_table)
+ signal_table = signal_table[
+ signal_table[:, 0].astype("int").argsort()]
+ sg_id_l = signal_table[:, 0]
+ conn_l = []
+ for s_id in sg_id_l:
+ conn_l.append(sig_group_conn_d[" ".join([tls_id, s_id])])
+ signal_table = np.delete(signal_table, 0, 1)
+ signal_table = np.ravel(signal_table)
+ state_l = []
+ i = 0
+ while i < len(signal_table[0]):
+ j = 0
+ duration = []
+ while j < len(signal_table):
+ duration.append(signal_table[j][i])
+ j += 1
+ state_l.append("".join(duration))
+ i += 1
+ duration_l = reference_time_d[tls_id][
+ prog_id]["duration"]
+ # edit net file
+ junction = [junc for junc in sumodoc.getElementsByTagName(
+ "junction") if junc.getAttribute("id") == junc_id][0]
+ junction.setAttribute("type", "traffic_light")
+ net = sumodoc.getElementsByTagName("net")[0]
+
+ edit_connections(conn_l, sumodoc, junc_id)
+ tl_logic = sumodoc.createElement("tlLogic")
+ tl_logic.setAttribute("id", junc_id)
+ tl_logic.setAttribute("type", "static")
+ tl_logic.setAttribute("programID",
+ [prog for prog in prog_list_d[tls_id]
+ if prog["id"] == prog_id][0]["name"])
+ tl_logic.setAttribute("offset", "0.00")
+ net.insertBefore(tl_logic, junction)
+ for state, duration in zip(state_l, duration_l):
+ phase = sumodoc.createElement("phase")
+ phase.setAttribute("duration", str(duration / 1000))
+ phase.setAttribute("state", state)
+ tl_logic.appendChild(phase)
+
+ # create WAUT
+ waut = sumodoc.createElement("WAUT")
+ waut.setAttribute("startProg",
+ [prog for prog in prog_list_d[tls_id]
+ if prog["id"] == default_prog_id][0]["name"])
+ waut.setAttribute("refTime", "100")
+ waut.setAttribute("id", "".join(["w", tls_id]))
+ # root.appendChild(WAUT)
+ net.insertBefore(waut, junction)
+
+ # create waut junction
+ waut_junc = sumodoc.createElement("wautJunction")
+ waut_junc.setAttribute("junctionID", junc_id)
+ waut_junc.setAttribute("wautID", "".join(["w", tls_id]))
+ # root.appendChild(wautJunction)
+ net.insertBefore(waut_junc, junction)
+
+
+# global signal color translation definition
+tls_state_vissim2SUMO = {'RED': 'r',
+ 'REDAMBER': 'u',
+ 'GREEN': 'g',
+ 'AMBER': 'y',
+ # this should be different: like in SUMO 'o', 'O'
+ 'FLASHING_GREEN': 'g',
+ 'OFF': 'O'}
+
+# MAIN
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser(
+ description='TLS conversion utility (VISSIM.inpx to SUMO)')
+ parser.add_argument('--vissim-input',
+ '-V', type=str,
+ help='VISSIM inpx file path')
+ parser.add_argument('--SUMO-net', '-S', type=str,
+ help='SUMO net file path')
+ parser.add_argument('--output-file', '-o', type=str,
+ help='output file name')
+ args = parser.parse_args()
+ print("\n", args, "\n")
+ print('\n---\n\n* loading VISSIM net:\n\t', args.vissim_input)
+ xmldoc = minidom.parse(args.vissim_input)
+ print('\n---\n\n* loading SUMO net:\n\t', args.SUMO_net,)
+ sumodoc = minidom.parse(args.SUMO_net)
+
+ edge_list = []
+ for edge in sumodoc.getElementsByTagName('edge'):
+ # is it a normal edge ?
+ if not edge.hasAttribute("function"):
+ edge_list.append(edge.getAttribute("id"))
+
+ # INPX read
+ sig_con_tab, sig_head_d = parse_inpx_sig_data(xmldoc)
+ link_tab, from_to_tab = parse_vissim_net_data(xmldoc)
+ is_verbinder_d = is_verbinder(xmldoc)
+
+ # SUMO NET read
+ junc_tab, conn_tab = parse_sumo_net_data(sumodoc)
+ conn_link_d = get_conn_verb_rel(conn_tab, from_to_tab)
+
+ # get the connections for every signal group
+ sig_group_conn_d = get_sg_connection_data(conn_tab,
+ sig_con_tab,
+ sig_head_d,
+ edge_list,
+ conn_link_d)
+ # related junction id for a given Signal Controller
+ sigCon_junc_d = get_sigcon_junc_relation(sig_con_tab,
+ sig_group_conn_d,
+ junc_tab)
+
+ # pick all the .sig files from the signalControllers
+ sig_files = set(sc[att] for sc in sig_con_tab for att in
+ sc.keys() if 'supplyFile' in att and '.sig' in sc[att])
+ # sig_files = ['TestsiteGraz_v01301.sig'] # DEBUG, just 1 file
+
+ reference_time_d = {}
+ sumo_tls_d = {}
+ prog_list_d = {}
+
+ for sig_file in sig_files:
+ sig_file = os.path.join(os.path.dirname(args.vissim_input), sig_file)
+ sig_seq_tab = []
+ signal_state_d = {}
+ sig_disp_list = []
+ disp_name_id_d = {}
+
+ # parse .sig files
+ sig_seq_tab, signal_state_d, sig_disp_list, \
+ prog_list_d[sig_disp_list[0]["_sc_id"]] = parse_sig_file(sig_file)
+ tls_id = sig_disp_list[0]["_sc_id"]
+ # returns a numpy array with the reference signal Sequence table
+ # format: display_id || begin_time || duration
+ disp_name_id_d = get_sigseq_id_list(sig_seq_tab, sig_disp_list)
+
+ compute_signal_tables(
+ disp_name_id_d, signal_state_d, prog_list_d[tls_id])
+
+ # reference time and duration for every signal program
+ # times need to be split, to convert the sig table from VISSIM to SUMO
+ reference_time_d[tls_id] = sigtable_split_time(
+ signal_state_d, prog_list_d[tls_id])
+
+ compute_sumo_signal_tables(reference_time_d[tls_id],
+ signal_state_d,
+ sig_disp_list,
+ tls_state_vissim2SUMO)
+
+ # Format: [tls id][signal program id][signal group index]
+ sumo_tls_d[tls_id] = signal_state_d
+
+ generate_xml_doc(
+ sumo_tls_d, sigCon_junc_d, sig_con_tab,
+ reference_time_d, sumodoc, prog_list_d, sig_group_conn_d)
+
+ with open("%s.net.xml" % args.output_file, "w") as ofh:
+ sumodoc.writexml(ofh, addindent=' ', newl='\n')
+ ofh.close()
diff --git a/tools/import/vissim/vissim_parseRoutes.py b/tools/import/vissim/vissim_parseRoutes.py
index c84dd26..91337ce 100755
--- a/tools/import/vissim/vissim_parseRoutes.py
+++ b/tools/import/vissim/vissim_parseRoutes.py
@@ -4,7 +4,7 @@
@author Daniel Krajzewicz
@author Michael Behrisch
@date 2009-05-27
- at version $Id: vissim_parseRoutes.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: vissim_parseRoutes.py 18596 2015-08-04 11:33:00Z ait-mob-dts $
Parses routes given in the Vissim file (first parameter) as (in-)flows and
@@ -31,7 +31,7 @@ the Free Software Foundation; either version 3 of the License, or
"""
edgemap = {}
-edgemap["203"] = "203[0]"
+#edgemap["203"] = "203[0]"
SEED = 42
diff --git a/tools/net/netcheck.py b/tools/net/netcheck.py
index 993e98c..5705770 100755
--- a/tools/net/netcheck.py
+++ b/tools/net/netcheck.py
@@ -5,8 +5,9 @@
@author Daniel Krajzewicz
@author Laura Bieker
@author Jakob Erdmann
+ at author Greg Albiston
@date 2007-03-20
- at version $Id: netcheck.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: netcheck.py 18756 2015-08-31 19:16:33Z behrisch $
This script does simple check for the network.
It tests whether the network is (weakly) connected.
@@ -33,8 +34,16 @@ def parse_args():
optParser = OptionParser()
optParser.add_option("-s", "--source",
default=False, help="List edges reachable from the source")
- optParser.add_option("--selection-output",
- help="When used with --source, write output to file as a loadable selection")
+ optParser.add_option("-d", "--destination",
+ default=False, help="List edges which can reach the destination")
+ optParser.add_option("-o", "--selection-output",
+ help="Write output to file(s) as a loadable selection")
+ optParser.add_option(
+ "-l", "--vclass", help="Include only edges allowing VCLASS")
+ optParser.add_option("-c", "--component-output",
+ default=None, help="Write components of disconnected network to file - not compatible with --source or --destination options")
+ optParser.add_option("-r", "--results-output",
+ default=None, help="Write results summary of disconnected network to file - not compatible with --source or --destination options")
options, args = optParser.parse_args()
if len(args) != 1:
@@ -43,7 +52,7 @@ def parse_args():
return options
-def getWeaklyConnected(net):
+def getWeaklyConnected(net, vclass=None):
components = []
edgesLeft = set(net.getEdges())
queue = list()
@@ -52,44 +61,53 @@ def getWeaklyConnected(net):
queue.append(edgesLeft.pop())
while not len(queue) == 0:
edge = queue.pop(0)
- component.add(edge.getID())
- for n in edge.getOutgoing().iterkeys():
- if n in edgesLeft:
- queue.append(n)
- edgesLeft.remove(n)
- for n in edge.getIncoming().iterkeys():
- if n in edgesLeft:
- queue.append(n)
- edgesLeft.remove(n)
- components.append(component)
+ if vclass is None or edge.allows(vclass):
+ component.add(edge.getID())
+ for n in edge.getOutgoing().iterkeys():
+ if n in edgesLeft:
+ queue.append(n)
+ edgesLeft.remove(n)
+ for n in edge.getIncoming().iterkeys():
+ if n in edgesLeft:
+ queue.append(n)
+ edgesLeft.remove(n)
+ if component:
+ components.append(component)
return components
-def getReachable(net, source_id, options):
+def getReachable(net, source_id, options, useIncoming=False):
if not net.hasEdge(source_id):
- sys.exit("'%s' is not a valid edge id" % source_id)
+ sys.exit("'{}' is not a valid edge id".format(source_id))
source = net.getEdge(source_id)
+ if options.vclass is not None and not source.allows(options.vclass):
+ sys.exit("'{}' does not allow {}".format(source_id, options.vclass))
fringe = [source]
found = set()
found.add(source)
while len(fringe) > 0:
new_fringe = []
for edge in fringe:
- for reachable in edge.getOutgoing().iterkeys():
- if not reachable in found:
- found.add(reachable)
- new_fringe.append(reachable)
+ cands = edge.getIncoming() if useIncoming else edge.getOutgoing()
+ for reachable in cands.iterkeys():
+ if options.vclass is None or reachable.allows(options.vclass):
+ if not reachable in found:
+ found.add(reachable)
+ new_fringe.append(reachable)
fringe = new_fringe
- print "%s of %s edges are reachable from edge '%s':" % (
- len(found), len(net.getEdges()), source_id)
+ if useIncoming:
+ print "{} of {} edges can reach edge '{}':".format(len(found), len(net.getEdges()), source_id)
+ else:
+ print "{} of {} edges are reachable from edge '{}':".format(len(found), len(net.getEdges()), source_id)
+ ids = sorted([e.getID() for e in found])
if options.selection_output:
with open(options.selection_output, 'w') as f:
- for e in found:
- f.write("edge:%s\n" % e.getID())
+ for e in ids:
+ f.write("edge:{}\n".format(e))
else:
- print [e.getID() for e in found]
+ print ids
if __name__ == "__main__":
@@ -98,11 +116,70 @@ if __name__ == "__main__":
net = sumolib.net.readNet(options.net)
if options.source:
getReachable(net, options.source, options)
+ elif options.destination:
+ getReachable(net, options.destination, options, True)
else:
- components = getWeaklyConnected(net)
+ components = getWeaklyConnected(net, options.vclass)
if len(components) != 1:
print "Warning! Net is not connected."
- for idx, comp in enumerate(sorted(components, key=lambda c: iter(c).next())):
- print "Component", idx
- print " ".join(comp)
- print
+
+ total = 0
+ max = 0
+ max_idx = ""
+ # Stores the distribution of components by edge counts - key: edge
+ # counts - value: number found
+ edge_count_dist = {}
+ output_str_list = []
+ dist_str_list = []
+
+ # Iterate through components to output and summarise
+ for idx, comp in enumerate(sorted(components, key=lambda c: iter(c).next())):
+ if options.selection_output:
+ with open("{}comp{}.txt".format(options.selection_output, idx), 'w') as f:
+ for e in comp:
+ f.write("edge:{}\n".format(e))
+
+ edge_count = len(comp)
+ total += edge_count
+ if edge_count > max:
+ max = edge_count
+ max_idx = idx
+
+ if edge_count not in edge_count_dist:
+ edge_count_dist[edge_count] = 0
+ edge_count_dist[edge_count] += 1
+ output_str = "Component: #{} Edge Count: {}\n {}\n".format(
+ idx, edge_count, " ".join(comp))
+ print output_str
+ output_str_list.append(output_str)
+
+ # Output the summary of all edges checked and largest component
+ # To avoid divide by zero error if total is 0 for some reason.
+ coverage = 0.0
+ if total > 0:
+ coverage = round(max * 100.0 / total, 2)
+ summary_str = "Total Edges: {}\nLargest Component: #{} Edge Count: {} Coverage: {}%\n".format(
+ total, max_idx, max, coverage)
+ print summary_str
+ dist_str = "Edges\tIncidence"
+ print dist_str
+ dist_str_list.append(dist_str)
+
+ # Output the distribution of components by edge counts
+ for key, value in sorted(edge_count_dist.iteritems()):
+ dist_str = "{}\t{}".format(key, value)
+ print dist_str
+ dist_str_list.append(dist_str)
+
+ # Check for output of components to file
+ if options.component_output is not None:
+ print "Writing component output to: {}".format(options.component_output)
+ with open(options.component_output, 'w') as f:
+ f.write("\n".join(output_str_list))
+
+ # Check for output of results summary to file
+ if options.results_output is not None:
+ print "Writing results output to: {}".format(options.results_output)
+ with open(options.results_output, 'w') as r:
+ r.write(summary_str)
+ r.write("\n".join(dist_str_list))
diff --git a/tools/output/edgeDataDiff.py b/tools/output/edgeDataDiff.py
new file mode 100644
index 0000000..733d81a
--- /dev/null
+++ b/tools/output/edgeDataDiff.py
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+ at file edgeDataDiff.py
+ at author Jakob Erdmann
+ at date 2015-08-14
+ at version $Id: edgeDataDiff.py 18756 2015-08-31 19:16:33Z behrisch $
+
+Compute differences between two edgeData-output files
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+import os
+import sys
+from collections import defaultdict
+sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '..'))
+from sumolib.output import parse
+from sumolib.miscutils import uMax, Statistics
+
+
+def write_diff(orig, new, out):
+
+ diffStats = defaultdict(Statistics)
+
+ with open(out, 'w') as f:
+ f.write("<meandata>\n")
+ for interval_old, interval_new in zip(parse(orig, 'interval'), parse(new, 'interval')):
+ f.write(' <interval begin="%s" end="%s">\n' %
+ (interval_old.begin, interval_old.end))
+ for edge_old, edge_new in zip(interval_old.edge, interval_new.edge):
+ assert(edge_old.id == edge_new.id)
+ f.write(' <edge id="%s"' % edge_old.id)
+ for attr in edge_old._fields:
+ if attr == 'id':
+ continue
+ try:
+ delta = float(getattr(edge_new, attr)) - \
+ float(getattr(edge_old, attr))
+ diffStats[attr].add(delta, edge_old.id)
+ f.write(' %s="%s"' % (attr, delta))
+ except:
+ pass
+ f.write("/>\n")
+ f.write("</interval>\n")
+
+ f.write("</meandata>\n")
+ for attr, stats in diffStats.items():
+ stats.label = attr
+ print stats
+
+
+if __name__ == "__main__":
+ try:
+ orig, new, out = sys.argv[1:]
+ except ValueError:
+ print("USAGE: %s <edgedata1.xml> <edgedata2.xml> <output_diff.xml>")
+ sys.exit()
+ write_diff(orig, new, out)
diff --git a/tools/pedestrianFlow.py b/tools/pedestrianFlow.py
new file mode 100644
index 0000000..76b693b
--- /dev/null
+++ b/tools/pedestrianFlow.py
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+"""
+A script for generating a flow of pedestrians (a long list of person-walks)
+
+ at file pedestrianFlow.py
+ at author Jakob Erdmann
+ at date 2014-01-16
+ at version $Id: pedestrianFlow.py 18756 2015-08-31 19:16:33Z behrisch $
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2014-2014 DLR (http://www.dlr.de/) and contributors
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+import os
+import sys
+import random
+from optparse import OptionParser
+
+if 'SUMO_HOME' in os.environ:
+ tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
+ sys.path.append(tools)
+ from sumolib.miscutils import Colorgen
+else:
+ sys.exit("please declare environment variable 'SUMO_HOME'")
+
+
+def get_options():
+ optParser = OptionParser()
+ optParser.add_option(
+ "-w", "--width", type="float", default=0.7, help="pedestrian width")
+ optParser.add_option(
+ "-l", "--length", type="float", default=0.35, help="pedestrian length")
+ optParser.add_option(
+ "--departPos", type="float", default=0, help="depart position")
+ optParser.add_option(
+ "--arrivalPos", type="float", default=-1, help="arrival position")
+ optParser.add_option(
+ "--prob", type="float", default=0.1, help="depart probability per second")
+ optParser.add_option("-r", "--route", help="edge list")
+ optParser.add_option("-c", "--color", help="the color to use or 'random'")
+ optParser.add_option(
+ "-b", "--begin", type="int", default=0, help="begin time")
+ optParser.add_option(
+ "-e", "--end", type="int", default=600, help="end time")
+ optParser.add_option("-i", "--index", type="int",
+ default=0, help="starting index for naming pedestrians")
+ optParser.add_option(
+ "-n", "--name", default="p", help="base name for pedestrians")
+ (options, args) = optParser.parse_args()
+
+ options.output = args[0]
+ return options
+
+
+def write_ped(f, index, options, depart, edges):
+ if options.color == None:
+ color = ''
+ elif options.color == "random":
+ color = ' color="%s"' % Colorgen(("random", 1, 1))()
+ else:
+ color = ' color="%s"' % options.color
+
+ f.write(' <vType id="%s%s" vClass="pedestrian" width="%s" length="%s" minGap="%s" maxSpeed="%s" guiShape="pedestrian"%s/>\n' % (
+ options.name, index,
+ options.width, options.length,
+ random.uniform(0.1, 0.5),
+ random.uniform(0.7, 1.5), color))
+ f.write(' <person id="%s%s" type="%s%s" depart="%s">\n' %
+ (options.name, index, options.name, index, depart))
+ f.write(' <walk edges="%s" departPos="%s" arrivalPos="%s"/>\n' %
+ (edges, options.departPos, options.arrivalPos))
+ f.write(' </person>\n')
+
+
+def main():
+ options = get_options()
+ with open(options.output, 'w') as f:
+ f.write('<routes>\n')
+ index = options.index
+ for depart in range(options.begin, options.end):
+ if random.random() < options.prob:
+ write_ped(
+ f, index, options, depart, ' '.join(options.route.split(',')))
+ index += 1
+ f.write('</routes>')
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/purgatory/generateTripsXml.py b/tools/purgatory/generateTripsXml.py
new file mode 100755
index 0000000..9f74276
--- /dev/null
+++ b/tools/purgatory/generateTripsXml.py
@@ -0,0 +1,410 @@
+#!/usr/bin/env python
+"""
+ at file generateTripsXml.py
+ at author Daniel Krajzewicz
+ at author Yun-Pang Floetteroed
+ at author Eric Melde
+ at author Michael Behrisch
+ at date 2009-02-09
+ at version $Id: generateTripsXml.py 18190 2015-04-14 07:27:10Z namdre $
+
+This script generate a trip file as input data in sumo
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+import os
+import string
+import sys
+import operator
+import math
+import datetime
+import random
+import bz2
+import StringIO
+from xml.sax import saxutils, make_parser, handler
+from optparse import OptionParser
+
+sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), "..", "assign"))
+from dijkstra import dijkstraPlain
+from inputs import getMatrix
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+import sumolib.net
+
+# This class is used to build the nodes in the investigated network and
+# includes the update-function for searching the k shortest paths.
+
+
+class Net(sumolib.net.Net):
+
+ def __init__(self):
+ sumolib.net.Net.__init__(self)
+ self._endVertices = []
+ self._startVertices = []
+
+ def addNode(self, id, type=None, coord=None, incLanes=None):
+ if id not in self._id2node:
+ node = Vertex(id, coord, incLanes)
+ self._nodes.append(node)
+ self._id2node[id] = node
+ self.setAdditionalNodeInfo(self._id2node[id], type, coord, incLanes)
+ return self._id2node[id]
+
+ def getEdge(self, edgeLabel):
+ return self._id2edge[edgeLabel]
+
+ def addSourceTargetEdge(self, edgeObj):
+ edgeObj.source.addOutgoing(edgeObj)
+ edgeObj.target.addIncoming(edgeObj)
+ self._edges[edgeObj._id] = edgeObj
+
+ def getstartVertices(self):
+ return self._startVertices
+
+ def getendVertices(self):
+ return self._endVertices
+
+ def getstartCounts(self):
+ return len(self._startVertices)
+
+ def getendCounts(self):
+ return len(self._endVertices)
+
+ def getTargets(self):
+ target = set()
+ for end in self._endVertices:
+ for sink in end.sinkConnNodes:
+ if sink not in target:
+ target.add(end)
+ return target
+
+ def checkRoute(self, startVertex, endVertex, start, end, P, odConnTable, source, options):
+ for node in endVertex.sinkConnNodes:
+ length = 0.
+ vertex = node
+ if node in P:
+ link = P[node]
+ if options.limitlength:
+ while vertex != source:
+ # if P[vertex].kind == "real":
+ length += P[vertex].length
+ vertex = P[vertex].source
+ odConnTable[startVertex._id][endVertex._id].append(
+ [source.getOutgoing()[0]._id, link._id, length])
+
+ if options.limitlength and len(odConnTable[startVertex._id][endVertex._id]) > 0:
+ for count, item in enumerate(odConnTable[startVertex._id][endVertex._id]):
+ if count == 0:
+ minLength = item[2]
+ else:
+ if item[2] < minLength:
+ minLength = item[2]
+ minLength *= 1.6
+ for item in odConnTable[startVertex._id][endVertex._id]:
+ if item[2] > minLength:
+ odConnTable[startVertex._id][endVertex._id].remove(item)
+
+
+class Vertex(sumolib.net.Node):
+
+ """
+ This class is to store node attributes and the respective incoming/outgoing links.
+ """
+
+ def __init__(self, id, type=None, coord=None, incLanes=None):
+ sumolib.net.Node.__init__(self, id, type, coord, incLanes)
+ self.sourceConnNodes = []
+ self.sinkConnNodes = []
+
+ def __repr__(self):
+ return self._id
+
+# This class is uesed to store link information and estimate
+# as well as flow and capacity for the flow computation and some parameters
+# read from the net.
+
+
+class Edge(sumolib.net.Edge):
+
+ """
+ This class is to record link attributes
+ """
+
+ def __init__(self, id, source, target, prio, function, name):
+ sumolib.net.Edge.__init__(
+ self, id, source, target, prio, function, name)
+ self.capacity = sys.maxint
+ self.freeflowtime = 0.0
+ self.helpacttime = 0.0
+ self.weight = 0.
+ self.connection = 0.
+
+ def addLane(self, lane):
+ sumolib.net.Edge.addLane(self, lane)
+ if self._from._id == self._to._id:
+ self.freeflowtime = 0.0
+ else:
+ self.freeflowtime = self._length / self._speed
+ self.actualtime = self.freeflowtime
+ self.helpacttime = self.freeflowtime
+
+ def __repr__(self):
+ cap = str(self.capacity)
+ if self.capacity == sys.maxint or self.connection != 0:
+ cap = "inf"
+ return "%s_%s_%s_%s<%s|%s|%s|%s|%s|%s|%s|%s|%s>" % (self._function, self._id, self._from, self._to, self._speed)
+
+
+class Trip:
+
+ """
+ This class is to store trip attributes.
+ """
+
+ def __init__(self, num, depart, source, sink, sourceD, sinkD):
+ self.label = "%s" % num
+ self.depart = depart
+ self.sourceEdge = source
+ self.sinkEdge = sink
+ self.sourceDistrict = sourceD
+ self.sinkDistrict = sinkD
+
+ def __repr__(self):
+ return self.label
+
+# The class is for parsing the XML input file (districts). The data parsed
+# is written into the net.
+
+
+class DistrictsReader(handler.ContentHandler):
+
+ def __init__(self, net):
+ self._net = net
+ self._district = None
+ self.I = 100
+
+ def startElement(self, name, attrs):
+ if name == 'taz':
+ self._districtSource = self._net.addNode(attrs['id'])
+ self._net._startVertices.append(self._districtSource)
+ self._districtSink = self._net.addNode(attrs['id'])
+ self._net._endVertices.append(self._districtSink)
+ elif name == 'tazSink':
+ sinklink = self._net.getEdge(attrs['id'])
+ self.I += 1
+ conlink = self._districtSink._id + str(self.I)
+ newEdge = self._net.addEdge(
+ conlink, sinklink._to._id, self._districtSink._id, "-1", "virtual", "")
+ speed = sinklink.getSpeed()
+ length = sinklink.getLength()
+
+ for i in range(0, sinklink.getLaneNumber()):
+ newLane = self._net.addLane(newEdge, speed, length)
+ newEdge.addLane(newLane)
+ fromlane = sinklink.getLane(i)
+ self._net.addConnection(
+ sinklink, newEdge, fromlane, newLane, "s", "", -1)
+ newEdge.weight = attrs['weight']
+ self._districtSink.sinkConnNodes.append(sinklink._to)
+ newEdge.connection = 1
+ elif name == 'tazSource':
+ sourcelink = self._net.getEdge(attrs['id'])
+ self.I += 1
+ conlink = self._districtSource._id + str(self.I)
+ newEdge = self._net.addEdge(
+ conlink, self._districtSource._id, sourcelink._from._id, "-1", "virtual", "")
+ speed = sourcelink.getSpeed()
+ length = sourcelink.getLength()
+
+ for i in range(0, sourcelink.getLaneNumber()):
+ newLane = self._net.addLane(newEdge, speed, length)
+ newEdge.addLane(newLane)
+ tolane = sourcelink.getLane(i)
+ self._net.addConnection(
+ newEdge, sourcelink, newLane, tolane, "s", "", -1)
+
+ newEdge.weight = attrs['weight']
+ self._districtSource.sourceConnNodes.append(sourcelink._from)
+ newEdge.connection = 2
+
+ def endElement(self, name):
+ if name == 'taz':
+ self._district = ''
+
+
+def addVeh(counts, vehID, begin, period, odConnTable, startVertex, endVertex, tripList, vehIDtoODMap):
+ counts += 1.
+ vehID += 1
+ # The last half hour will not release any vehicles
+ endtime = int((float(begin + period) - 0.5) * 3600)
+ depart = random.randint(begin * 3600, endtime)
+ if len(odConnTable[startVertex._id][endVertex._id]) > 0:
+ connIndex = random.randint(
+ 0, len(odConnTable[startVertex._id][endVertex._id]) - 1)
+ connPair = odConnTable[startVertex._id][endVertex._id][connIndex]
+ veh = Trip(vehID, depart, connPair[0], connPair[
+ 1], startVertex._id, endVertex._id)
+ vehIDtoODMap[str(vehID)] = [startVertex._id, endVertex._id]
+ tripList.append(veh)
+
+ return counts, vehID, tripList, vehIDtoODMap
+
+
+def main(options):
+ parser = make_parser()
+ isBZ2 = False
+ dataDir = options.datadir
+ districts = os.path.join(dataDir, options.districtfile)
+ matrix = os.path.join(dataDir, options.mtxfile)
+ netfile = os.path.join(dataDir, options.netfile)
+ print 'generate Trip file for:', netfile
+
+ if "bz2" in netfile:
+ netfile = bz2.BZ2File(netfile)
+ isBZ2 = True
+
+ matrixSum = 0.
+ tripList = []
+ net = Net()
+ odConnTable = {}
+ vehIDtoODMap = {}
+
+ sumolib.net.readNet(options.netfile, net=net)
+
+ if isBZ2:
+ parser.parse(StringIO.StringIO(netfile.read()))
+ netfile.close()
+ else:
+ parser.parse(netfile)
+
+ parser.setContentHandler(DistrictsReader(net))
+ parser.parse(districts)
+
+ matrixPshort, startVertices, endVertices, currentMatrixSum, begin, period = getMatrix(
+ net, options.debug, matrix, matrixSum)[:6]
+
+ for edge in net.getEdges():
+ edge.helpacttime = 0.
+
+ if options.debug:
+ print len(net._edges), "edges read"
+ print len(net._startVertices), "start vertices read"
+ print len(net._endVertices), "target vertices read"
+ print 'currentMatrixSum:', currentMatrixSum
+
+ if options.getconns:
+ if options.debug:
+ print 'generate odConnTable'
+ for start, startVertex in enumerate(startVertices):
+ if startVertex._id not in odConnTable:
+ odConnTable[startVertex._id] = {}
+
+ for source in startVertex.sourceConnNodes:
+ targets = net.getTargets()
+ D, P = dijkstraPlain(source, targets)
+ for end, endVertex in enumerate(endVertices):
+ if startVertex._id != endVertex._id and matrixPshort[start][end] > 0.:
+ if endVertex._id not in odConnTable[startVertex._id]:
+ odConnTable[startVertex._id][endVertex._id] = []
+ net.checkRoute(
+ startVertex, endVertex, start, end, P, odConnTable, source, options)
+ else:
+ if options.debug:
+ print 'import and use the given odConnTable'
+ sys.path.append(options.datadir)
+ from odConnTables import odConnTable
+
+ # output trips
+ if options.verbose:
+ print 'output the trip file'
+ vehID = 0
+ subVehID = 0
+ random.seed(42)
+ matrixSum = 0.
+ fouttrips = file(options.tripfile, 'w')
+ fouttrips.write('<?xml version="1.0"?>\n')
+ print >> fouttrips, """<!-- generated on %s by $Id: generateTripsXml.py 18190 2015-04-14 07:27:10Z namdre $ -->
+ """ % datetime.datetime.now()
+ fouttrips.write("<tripdefs>\n")
+
+ if options.demandscale != 1.:
+ print 'demand scale %s is used.' % options.demandscale
+ for start in range(len(startVertices)):
+ for end in range(len(endVertices)):
+ matrixPshort[start][end] *= options.demandscale
+
+ for start, startVertex in enumerate(startVertices):
+ for end, endVertex in enumerate(endVertices):
+ if startVertex._id != endVertex._id and matrixPshort[start][end] > 0.:
+ counts = 0.
+ if options.odestimation:
+ if matrixPshort[start][end] < 1.:
+ counts, vehID, tripList, vehIDtoODMap = addVeh(
+ counts, vehID, begin, period, odConnTable, startVertex, endVertex, tripList, vehIDtoODMap)
+ else:
+ matrixSum += matrixPshort[start][end]
+ while (counts < float(math.ceil(matrixPshort[start][end])) and (matrixPshort[start][end] - counts) > 0.5 and float(subVehID) < matrixSum)or float(subVehID) < matrixSum:
+ counts, vehID, tripList, vehIDtoODMap = addVeh(
+ counts, vehID, begin, period, odConnTable, startVertex, endVertex, tripList, vehIDtoODMap)
+ subVehID += 1
+ else:
+ matrixSum += matrixPshort[start][end]
+ while (counts < float(math.ceil(matrixPshort[start][end])) and (matrixPshort[start][end] - counts) > 0.5 and float(vehID) < matrixSum) or float(vehID) < matrixSum:
+ counts, vehID, tripList, vehIDtoODMap = addVeh(
+ counts, vehID, begin, period, odConnTable, startVertex, endVertex, tripList, vehIDtoODMap)
+ if options.debug:
+ print 'total demand:', matrixSum
+ print vehID, 'trips generated'
+ tripList.sort(key=operator.attrgetter('depart'))
+
+ departpos = "free"
+ if __name__ == "__main__":
+ departpos = options.departpos
+ for trip in tripList:
+ fouttrips.write(' <trip id="%s" depart="%s" from="%s" to="%s" fromtaz="%s" totaz="%s" departlane="free" departpos="%s" departspeed="max"/>\n'
+ % (trip.label, trip.depart, trip.sourceEdge, trip.sinkEdge, trip.sourceDistrict, trip.sinkDistrict, departpos))
+ fouttrips.write("</tripdefs>")
+ fouttrips.close()
+
+ return odConnTable, vehIDtoODMap
+
+if __name__ == "__main__":
+ optParser = OptionParser()
+ optParser.add_option("-r", "--data-dir", dest="datadir",
+ default=os.getcwd(), help="give the data directory path")
+ optParser.add_option("-n", "--net-file", dest="netfile",
+ help="define the net file (mandatory)")
+ optParser.add_option("-m", "--matrix-file", dest="mtxfile",
+ help="define the matrix file (mandatory)")
+ optParser.add_option("-d", "--districts-file", dest="districtfile",
+ help="define the district file (mandatory)")
+ optParser.add_option("-l", "--limitlength", action="store_true", dest="limitlength",
+ default=False, help="the route length of possible connections of a given OD pair shall be less than 1.6 * min.length")
+ optParser.add_option("-t", "--trip-file", dest="tripfile",
+ default="trips.trips.xml", help="define the output trip filename")
+ optParser.add_option("-x", "--odestimation", action="store_true", dest="odestimation",
+ default=False, help="generate trips for OD estimation")
+ optParser.add_option("-b", "--debug", action="store_true",
+ default=False, help="debug the program")
+ optParser.add_option("-v", "--verbose", action="store_true",
+ default=False, help="tell me what you are doing")
+ optParser.add_option("-f", "--scale-factor", dest="demandscale",
+ type="float", default=1., help="scale demand by ")
+ optParser.add_option("-D", "--depart-pos", dest="departpos", type="choice",
+ choices=('random', 'free', 'random_free'),
+ default='free', help="choose departure position: random, free, random_free")
+ optParser.add_option("-C", "--get-connections", action="store_true", dest="getconns",
+ default=True, help="generate the OD connection directory, if set as False, a odConnTables.py should be available in the defined data directory")
+ (options, args) = optParser.parse_args()
+
+ if not options.netfile or not options.mtxfile or not options.districtfile:
+ optParser.print_help()
+ sys.exit()
+
+ main(options)
diff --git a/tools/trip/removeGeometryInTrips.pl b/tools/purgatory/removeGeometryInTrips.pl
similarity index 100%
rename from tools/trip/removeGeometryInTrips.pl
rename to tools/purgatory/removeGeometryInTrips.pl
diff --git a/tools/trip/removeTripsIfNotInInterval.pl b/tools/purgatory/removeTripsIfNotInInterval.pl
similarity index 100%
rename from tools/trip/removeTripsIfNotInInterval.pl
rename to tools/purgatory/removeTripsIfNotInInterval.pl
diff --git a/tools/trip/splitTripsByHours.pl b/tools/purgatory/splitTripsByHours.pl
similarity index 100%
rename from tools/trip/splitTripsByHours.pl
rename to tools/purgatory/splitTripsByHours.pl
diff --git a/tools/randomTrips.py b/tools/randomTrips.py
new file mode 100755
index 0000000..c33872e
--- /dev/null
+++ b/tools/randomTrips.py
@@ -0,0 +1,364 @@
+#!/usr/bin/env python
+"""
+ at file randomTrips.py
+ at author Daniel Krajzewicz
+ at author Jakob Erdmann
+ at author Michael Behrisch
+ at date 2010-03-06
+ at version $Id: randomTrips.py 18756 2015-08-31 19:16:33Z behrisch $
+
+Generates random trips for the given network.
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+
+from __future__ import print_function
+import os
+import sys
+import random
+import bisect
+import datetime
+import subprocess
+from collections import defaultdict
+import math
+import optparse
+
+SUMO_HOME = os.environ.get('SUMO_HOME',
+ os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..'))
+sys.path.append(os.path.join(SUMO_HOME, 'tools'))
+import sumolib
+import route2trips
+
+DUAROUTER = sumolib.checkBinary('duarouter')
+
+SOURCE_SUFFIX = ".src.xml"
+SINK_SUFFIX = ".dst.xml"
+VIA_SUFFIX = ".via.xml"
+
+
+def get_options(args=None):
+ optParser = optparse.OptionParser()
+ optParser.add_option("-n", "--net-file", dest="netfile",
+ help="define the net file (mandatory)")
+ optParser.add_option("-a", "--additional-files", dest="additional",
+ help="define additional files to be loaded by the router")
+ optParser.add_option("-o", "--output-trip-file", dest="tripfile",
+ default="trips.trips.xml", help="define the output trip filename")
+ optParser.add_option("-r", "--route-file", dest="routefile",
+ help="generates route file with duarouter")
+ optParser.add_option("--weights-prefix", dest="weightsprefix",
+ help="loads probabilities for being source, destination and via-edge from the files named <prefix>.src.xml, <prefix>.sink.xml and <prefix>.via.xml")
+ optParser.add_option("--weights-output-prefix", dest="weights_outprefix",
+ help="generates weights files for visualisation")
+ optParser.add_option("--pedestrians", action="store_true",
+ default=False, help="create a person file with pedestrian trips instead of vehicle trips")
+ optParser.add_option("--prefix", dest="tripprefix",
+ default="", help="prefix for the trip ids")
+ optParser.add_option("-t", "--trip-attributes", dest="tripattrs",
+ default="", help="additional trip attributes. When generating pedestrians, attributes for <person> and <walk> are supported.")
+ optParser.add_option(
+ "-b", "--begin", type="float", default=0, help="begin time")
+ optParser.add_option(
+ "-e", "--end", type="float", default=3600, help="end time (default 3600)")
+ optParser.add_option(
+ "-p", "--period", type="float", default=1, help="Generate vehicles with equidistant departure times and period=FLOAT (default 1.0). If option --binomial is used, the expected arrival rate is set to 1/period.")
+ optParser.add_option("-s", "--seed", type="int", help="random seed")
+ optParser.add_option("-l", "--length", action="store_true",
+ default=False, help="weight edge probability by length")
+ optParser.add_option("-L", "--lanes", action="store_true",
+ default=False, help="weight edge probability by number of lanes")
+ optParser.add_option("--speed-exponent", type="float", dest="speed_exponent",
+ default=0.0, help="weight edge probability by speed^<FLOAT> (default 0)")
+ optParser.add_option("--fringe-factor", type="float", dest="fringe_factor",
+ default=1.0, help="multiply weight of fringe edges by <FLOAT> (default 1")
+ optParser.add_option("--fringe-threshold", type="float", dest="fringe_threshold",
+ default=0.0, help="only consider edges with speed above <FLOAT> as fringe edges (default 0)")
+ optParser.add_option("--min-distance", type="float", dest="min_distance",
+ default=0.0, help="require start and end edges for each trip to be at least <FLOAT> m appart")
+ optParser.add_option("--max-distance", type="float", dest="max_distance",
+ default=None, help="require start and end edges for each trip to be at most <FLOAT> m appart (default 0 which disables any checks)")
+ optParser.add_option("-i", "--intermediate", type="int",
+ default=0, help="generates the given number of intermediate way points")
+ optParser.add_option("--maxtries", type="int",
+ default=100, help="number of attemps for finding a trip which meets the distance constraints")
+ optParser.add_option("--binomial", type="int", metavar="N",
+ help="If this is set, the number of departures per seconds will be drawn from a binomial distribution with n=N and p=PERIOD/N where PERIOD is the argument given to option --period. Tnumber of attemps for finding a trip which meets the distance constraints")
+ optParser.add_option(
+ "-c", "--vclass", help="only from and to edges which permit <vClass>")
+ optParser.add_option(
+ "--vehicle-class", help="The vehicle class assigned to the generated trips")
+ optParser.add_option("--validate", default=False, action="store_true",
+ help="Whether to produce trip output that is already checked for connectivity")
+ optParser.add_option("-v", "--verbose", action="store_true",
+ default=False, help="tell me what you are doing")
+ (options, args) = optParser.parse_args(args=args)
+ if not options.netfile:
+ optParser.print_help()
+ sys.exit()
+
+ if options.pedestrians:
+ options.vclass = 'pedestrian'
+
+ if options.validate and options.routefile is None:
+ options.routefile = "routes.rou.xml"
+ return options
+
+
+# euclidean distance between two coordinates in the plane
+def euclidean(a, b):
+ return math.sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)
+
+
+class InvalidGenerator(Exception):
+ pass
+
+# assigns a weight to each edge using weight_fun and then draws from a discrete
+# distribution with these weights
+
+
+class RandomEdgeGenerator:
+
+ def __init__(self, net, weight_fun):
+ self.net = net
+ self.weight_fun = weight_fun
+ self.cumulative_weights = []
+ self.total_weight = 0
+ for edge in self.net._edges:
+ # print edge.getID(), weight_fun(edge)
+ self.total_weight += weight_fun(edge)
+ self.cumulative_weights.append(self.total_weight)
+ if self.total_weight == 0:
+ raise InvalidGenerator()
+
+ def get(self):
+ r = random.random() * self.total_weight
+ index = bisect.bisect(self.cumulative_weights, r)
+ return self.net._edges[index]
+
+ def write_weights(self, fname):
+ # normalize to [0,100]
+ normalizer = 100.0 / max(1, max(map(self.weight_fun, self.net._edges)))
+ with open(fname, 'w+') as f:
+ f.write('<edgedata>\n')
+ f.write(' <interval begin="0" end="10">\n')
+ for i, edge in enumerate(self.net._edges):
+ f.write(' <edge id="%s" value="%0.2f"/>\n' %
+ (edge.getID(), self.weight_fun(edge) * normalizer))
+ f.write(' </interval>\n')
+ f.write('</edgedata>\n')
+
+
+class RandomTripGenerator:
+
+ def __init__(self, source_generator, sink_generator, via_generator, intermediate, pedestrians):
+ self.source_generator = source_generator
+ self.sink_generator = sink_generator
+ self.via_generator = via_generator
+ self.intermediate = intermediate
+ self.pedestrians = pedestrians
+
+ def get_trip(self, min_distance, max_distance, maxtries=100):
+ for i in range(maxtries):
+ source_edge = self.source_generator.get()
+ intermediate = [self.via_generator.get()
+ for i in range(self.intermediate)]
+ sink_edge = self.sink_generator.get()
+ if self.pedestrians:
+ destCoord = sink_edge.getFromNode().getCoord()
+ else:
+ destCoord = sink_edge.getToNode().getCoord()
+
+ coords = ([source_edge.getFromNode().getCoord()]
+ + [e.getFromNode().getCoord() for e in intermediate]
+ + [destCoord])
+ distance = sum([euclidean(p, q)
+ for p, q in zip(coords[:-1], coords[1:])])
+ if distance >= min_distance and (max_distance is None or distance < max_distance):
+ return source_edge, sink_edge, intermediate
+ raise Exception("no trip found after %s tries" % maxtries)
+
+
+def get_prob_fun(options, fringe_bonus, fringe_forbidden):
+ # fringe_bonus None generates intermediate way points
+ def edge_probability(edge):
+ if options.vclass and not edge.allows(options.vclass):
+ return 0 # not allowed
+ if fringe_bonus is None and edge.is_fringe() and not options.pedestrians:
+ return 0 # not suitable as intermediate way point
+ if fringe_forbidden is not None and edge.is_fringe(getattr(edge, fringe_forbidden)) and not options.pedestrians:
+ return 0 # the wrong kind of fringe
+ prob = 1
+ if options.length:
+ prob *= edge.getLength()
+ if options.lanes:
+ prob *= edge.getLaneNumber()
+ prob *= (edge.getSpeed() ** options.speed_exponent)
+ if (options.fringe_factor != 1.0
+ and not options.pedestrians
+ and fringe_bonus is not None
+ and edge.getSpeed() > options.fringe_threshold
+ and edge.is_fringe(getattr(edge, fringe_bonus))):
+ prob *= options.fringe_factor
+ return prob
+ return edge_probability
+
+
+class LoadedProps:
+
+ def __init__(self, fname):
+ self.weights = defaultdict(lambda: 0)
+ for edge in sumolib.output.parse_fast(fname, 'edge', ['id', 'value']):
+ self.weights[edge.id] = float(edge.value)
+
+ def __call__(self, edge):
+ return self.weights[edge.getID()]
+
+
+def buildTripGenerator(net, options):
+ try:
+ source_generator = RandomEdgeGenerator(
+ net, get_prob_fun(options, "_incoming", "_outgoing"))
+ sink_generator = RandomEdgeGenerator(
+ net, get_prob_fun(options, "_outgoing", "_incoming"))
+ if options.weightsprefix:
+ if os.path.isfile(options.weightsprefix + SOURCE_SUFFIX):
+ source_generator = RandomEdgeGenerator(
+ net, LoadedProps(options.weightsprefix + SOURCE_SUFFIX))
+ if os.path.isfile(options.weightsprefix + SINK_SUFFIX):
+ sink_generator = RandomEdgeGenerator(
+ net, LoadedProps(options.weightsprefix + SINK_SUFFIX))
+ except InvalidGenerator:
+ print(
+ "Error: no valid edges for generating source or destination", file=sys.stderr)
+ return None
+
+ try:
+ via_generator = RandomEdgeGenerator(
+ net, get_prob_fun(options, None, None))
+ if options.weightsprefix and os.path.isfile(options.weightsprefix + VIA_SUFFIX):
+ via_generator = RandomEdgeGenerator(
+ net, LoadedProps(options.weightsprefix + VIA_SUFFIX))
+ except InvalidGenerator:
+ if options.intermediate > 0:
+ print(
+ "Error: no valid edges for generating intermediate points", file=sys.stderr)
+ return None
+ else:
+ via_generator = None
+
+ return RandomTripGenerator(source_generator, sink_generator, via_generator, options.intermediate, options.pedestrians)
+
+
+def is_walk_attribute(attr):
+ for cand in ['departPos', 'arrivalPos', 'speed', 'duration', 'busStop']:
+ if cand in attr:
+ return True
+ return False
+
+
+def main(options):
+ if options.seed:
+ random.seed(options.seed)
+
+ net = sumolib.net.readNet(options.netfile)
+ if options.min_distance > net.getBBoxDiameter() * (options.intermediate + 1):
+ options.intermediate = int(
+ math.ceil(options.min_distance / net.getBBoxDiameter())) - 1
+ print("Warning: setting number of intermediate waypoints to %s to achieve a minimum trip length of %s in a network with diameter %s." % (
+ options.intermediate, options.min_distance, net.getBBoxDiameter()))
+
+ trip_generator = buildTripGenerator(net, options)
+ idx = 0
+
+ if options.pedestrians:
+ # figure out which of the tripattrs belong to the <person> and which
+ # belong to the <walk>
+ walkattrs = ' '.join(
+ [a for a in options.tripattrs.split() if is_walk_attribute(a)])
+ personattrs = ' '.join(
+ [a for a in options.tripattrs.split() if not is_walk_attribute(a)])
+
+ def generate_one(idx):
+ label = "%s%s" % (options.tripprefix, idx)
+ try:
+ source_edge, sink_edge, intermediate = trip_generator.get_trip(
+ options.min_distance, options.max_distance, options.maxtries)
+ via = ""
+ if len(intermediate) > 0:
+ via = 'via="%s" ' % ' '.join(
+ [e.getID() for e in intermediate])
+ if options.pedestrians:
+ fouttrips.write(
+ ' <person id="%s" depart="%.2f" %s>\n' % (label, depart, personattrs))
+ fouttrips.write(
+ ' <walk from="%s" to="%s" %s/>\n' % (source_edge.getID(), sink_edge.getID(), walkattrs))
+ fouttrips.write(' </person>\n')
+ else:
+ fouttrips.write(' <trip id="%s" depart="%.2f" from="%s" to="%s" %s%s/>\n' % (
+ label, depart, source_edge.getID(), sink_edge.getID(), via, options.tripattrs))
+ except Exception, exc:
+ print(exc, file=sys.stderr)
+ return idx + 1
+
+ with open(options.tripfile, 'w') as fouttrips:
+ fouttrips.write("""<?xml version="1.0"?>
+<!-- generated on %s by $Id: randomTrips.py 18756 2015-08-31 19:16:33Z behrisch $
+ options: %s
+-->
+<trips>
+""" % (datetime.datetime.now(),
+ (' '.join(sys.argv[1:]).replace('--', '<doubleminus>'))))
+ if options.vehicle_class:
+ fouttrips.write(' <vType id="%s" vClass="%s" />\n' %
+ (options.vehicle_class, options.vehicle_class))
+ options.tripattrs += ' type="%s"' % options.vehicle_class
+ depart = options.begin
+ if trip_generator:
+ while depart < options.end:
+ if options.binomial is None:
+ # generate with constant spacing
+ idx = generate_one(idx)
+ depart += options.period
+ else:
+ # draw n times from a bernouli distribution
+ # for an average arrival rate of 1 / period
+ prob = 1.0 / options.period / options.binomial
+ for i in range(options.binomial):
+ if random.random() < prob:
+ idx = generate_one(idx)
+ depart += 1
+ fouttrips.write("</trips>\n")
+
+ if options.routefile:
+ args = [DUAROUTER, '-n', options.netfile, '-t', options.tripfile, '-o', options.routefile, '--ignore-errors',
+ '--begin', str(options.begin), '--end', str(options.end), '--no-step-log']
+ if options.additional is not None:
+ args += ['--additional-files', options.additional]
+ print("calling ", " ".join(args))
+ subprocess.call(args)
+
+ if options.validate:
+ print("calling route2trips")
+ route2trips.main([options.routefile], outfile=options.tripfile)
+
+ if options.weights_outprefix:
+ trip_generator.source_generator.write_weights(
+ options.weights_outprefix + SOURCE_SUFFIX)
+ trip_generator.sink_generator.write_weights(
+ options.weights_outprefix + SINK_SUFFIX)
+ trip_generator.via_generator.write_weights(
+ options.weights_outprefix + VIA_SUFFIX)
+
+ # return wether trips could be genreated as requested
+ return trip_generator is not None
+
+if __name__ == "__main__":
+ if not main(get_options()):
+ sys.exit(1)
diff --git a/tools/route/cutRoutes.py b/tools/route/cutRoutes.py
index 78b4c72..d1a8024 100755
--- a/tools/route/cutRoutes.py
+++ b/tools/route/cutRoutes.py
@@ -4,7 +4,7 @@
@author Jakob Erdmann
@author Michael Behrisch
@date 2012-08-15
- at version $Id: cutRoutes.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: cutRoutes.py 18331 2015-05-04 06:23:09Z namdre $
Cut down routes from a large scenario to a sub-scenario optionally using exitTimes
Output can be a route file or a tripfile.
@@ -65,7 +65,7 @@ extrapolated based on edge-lengths and maximum speeds multiplied with --speed-fa
options.network = args[0]
options.routeFiles = args[1:]
except:
- sys.exit(USAGE)
+ sys.exit(USAGE.replace('%prog', os.path.basename(__file__)))
if ((options.trips_output is None and options.routes_output is None)
or (options.trips_output is not None and options.routes_output is not None)):
sys.exit(
diff --git a/tools/route/route2poly.py b/tools/route/route2poly.py
index 9cebcdd..7a4aca3 100755
--- a/tools/route/route2poly.py
+++ b/tools/route/route2poly.py
@@ -4,7 +4,7 @@
@author Jakob Erdmann
@author Michael Behrisch
@date 2012-11-15
- at version $Id: route2poly.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: route2poly.py 18584 2015-08-03 06:28:51Z namdre $
From a sumo network and a route file, this script generates a polygon (polyline) for every route
which can be loaded with sumo-gui for visualization
@@ -53,7 +53,7 @@ def parse_args():
def generate_poly(net, id, color, layer, edges, outf):
- shape = list(itertools.chain(*list(net.getEdge(e).getShape()
+ shape = list(itertools.chain(*list(net.getEdge(e).getLane(0).getShape()
for e in edges)))
shapeString = ' '.join('%s,%s' % (x, y) for x, y in shape)
outf.write('<poly id="%s" color="%s" layer="%s" type="route" shape="%s"/>\n' % (
diff --git a/tools/route/routeDiffStats.py b/tools/route/routeDiffStats.py
new file mode 100644
index 0000000..0bf1ff2
--- /dev/null
+++ b/tools/route/routeDiffStats.py
@@ -0,0 +1,90 @@
+#!/usr/bin/env python
+"""
+ at file routeStats.py
+ at author Jakob Erdmann
+ at date 2014-12-18
+ at version $Id: routeDiffStats.py 18756 2015-08-31 19:16:33Z behrisch $
+
+compute statistics for two sets of routes (for the same set of vehicles)
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2014-2014 DLR (http://www.dlr.de/) and contributors
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+
+import os
+import sys
+from optparse import OptionParser
+
+if 'SUMO_HOME' in os.environ:
+ tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
+ sys.path.append(os.path.join(tools))
+ from sumolib.output import parse, parse_fast
+ from sumolib.net import readNet
+ from sumolib.miscutils import Statistics
+else:
+ sys.exit("please declare environment variable 'SUMO_HOME'")
+
+
+def get_options():
+ USAGE = """Usage %prog [options] <net.xml> <rou1.xml> <rou2.xml>"""
+ optParser = OptionParser(usage=USAGE)
+ optParser.add_option("-v", "--verbose", action="store_true",
+ default=False, help="Give more output")
+ optParser.add_option("--binwidth", type="float",
+ default=100, help="binning width of route length difference histogram")
+ optParser.add_option("--hist-output", type="string",
+ default=None, help="output file for histogram (gnuplot compatible)")
+ optParser.add_option("--full-output", type="string",
+ default=None, help="output file for full data dump")
+ options, args = optParser.parse_args()
+ try:
+ options.network = args[0]
+ options.routeFile1 = args[1]
+ options.routeFile2 = args[2]
+ except:
+ sys.exit(USAGE)
+ return options
+
+
+def getRouteLength(net, vehicle):
+ return sum([net.getEdge(e).getLength() for e in vehicle.route[0].edges.split()])
+
+
+def main():
+ options = get_options()
+ net = readNet(options.network)
+ edges = set([e.getID() for e in net.getEdges()])
+
+ lengths1 = {}
+ lengths2 = {}
+ lengthDiffStats = Statistics(
+ "route length difference", histogram=True, scale=options.binwidth)
+ for vehicle in parse(options.routeFile1, 'vehicle'):
+ lengths1[vehicle.id] = getRouteLength(net, vehicle)
+ for vehicle in parse(options.routeFile2, 'vehicle'):
+ lengths2[vehicle.id] = getRouteLength(net, vehicle)
+ lengthDiffStats.add(
+ lengths2[vehicle.id] - lengths1[vehicle.id], vehicle.id)
+
+ print lengthDiffStats
+
+ if options.hist_output is not None:
+ with open(options.hist_output, 'w') as f:
+ for bin, count in lengthDiffStats.histogram():
+ f.write("%s %s\n" % (bin, count))
+
+ if options.full_output is not None:
+ with open(options.full_output, 'w') as f:
+ differences = sorted(
+ [(lengths2[id] - lengths1[id], id) for id in lengths1.keys()])
+ for diff, id in differences:
+ f.write("%s %s\n" % (diff, id))
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/route2sel.py b/tools/route2sel.py
new file mode 100644
index 0000000..048b002
--- /dev/null
+++ b/tools/route2sel.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python
+"""
+ at file route2trips.py
+ at author Jakob Erdmann
+ at date 2015-08-05
+ at version $Id: route2sel.py 18756 2015-08-31 19:16:33Z behrisch $
+
+This script converts SUMO routes into an edge selection
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+from __future__ import print_function
+import sys
+from optparse import OptionParser
+from sumolib.output import parse_fast
+
+
+def parse_args():
+ USAGE = "Usage: " + sys.argv[0] + " <routefile> [options]"
+ optParser = OptionParser()
+ optParser.add_option("-o", "--outfile", help="name of output file")
+ options, args = optParser.parse_args()
+ try:
+ options.routefile, = args
+ except:
+ sys.exit(USAGE)
+ if options.outfile is None:
+ options.outfile = options.routefile + ".sel.txt"
+ return options
+
+
+def main():
+ options = parse_args()
+ edges = set()
+ for route in parse_fast(options.routefile, 'route', ['edges']):
+ edges.update(route.edges.split())
+
+ with open(options.outfile, 'w') as outf:
+ for e in sorted(list(edges)):
+ outf.write('edge:%s\n' % e)
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/route2trips.py b/tools/route2trips.py
new file mode 100755
index 0000000..a5bd071
--- /dev/null
+++ b/tools/route2trips.py
@@ -0,0 +1,106 @@
+#!/usr/bin/env python
+"""
+ at file route2trips.py
+ at author Michael Behrisch
+ at author Daniel Krajzewicz
+ at date 2008-03-19
+ at version $Id: route2trips.py 18237 2015-04-20 10:43:52Z namdre $
+
+This script converts SUMO routes back into SUMO trips which serve
+as input to one of the routing applications.
+It reads the routes from a file given as first parameter
+and outputs the trips to stdout.
+
+SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
+Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors
+
+This file is part of SUMO.
+SUMO is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
+"""
+from __future__ import print_function
+import sys
+import datetime
+
+from xml.sax import parse, handler
+
+
+class RouteReader(handler.ContentHandler):
+
+ def __init__(self, attrList, outfile):
+ self._vType = ''
+ self._vID = ''
+ self._vDepart = 0
+ self._routeID = ''
+ self._routeString = ''
+ self._routes = {}
+ self._attrList = attrList
+ self._vehicleAttrs = None
+ self.outfile = outfile
+
+ def startElement(self, name, attrs):
+ if name == 'vehicle':
+ self._vehicleAttrs = dict(attrs)
+ self._vID = attrs['id']
+ if attrs.has_key('route'):
+ self._routeString = self._routes[attrs['route']]
+ del self._vehicleAttrs['route']
+ elif name == 'route':
+ if not self._vID:
+ self._routeID = attrs['id']
+ self._routeString = ''
+ if attrs.has_key('edges'):
+ self._routeString = attrs['edges']
+ elif name == 'vType':
+ # XXX does not handle child elements
+ print(' <vType %s/>' % (' '.join(['%s="%s"' % (key, value) for key, value in dict(attrs).items()])),
+ file=self.outfile)
+ elif name == 'routes':
+ print("""<?xml version="1.0"?>
+<!-- generated on %s by $Id: route2trips.py 18237 2015-04-20 10:43:52Z namdre $ -->
+<trips>""" % datetime.datetime.now(), file=self.outfile)
+
+ def endElement(self, name):
+ if name == 'route':
+ if not self._vID:
+ self._routes[self._routeID] = self._routeString
+ self._routeString = ''
+ self._routeID = ''
+ elif name == 'vehicle':
+ edges = self._routeString.split()
+ self._vehicleAttrs["from"] = edges[0]
+ self._vehicleAttrs["to"] = edges[-1]
+ if self._attrList:
+ print(' <trip %s/>' % (' '.join(['%s="%s"' % (key, self._vehicleAttrs[key]) for key in self._attrList])),
+ file=self.outfile)
+ else:
+ del self._vehicleAttrs['id']
+ items = sorted(['%s="%s"' % (key, val)
+ for key, val in self._vehicleAttrs.iteritems()])
+ print(' <trip id="%s" %s/>' % (self._vID, ' '.join(items)),
+ file=self.outfile)
+ self._vID = ''
+ self._routeString = ''
+ elif name == 'routes':
+ print("</trips>", file=self.outfile)
+
+ def characters(self, content):
+ self._routeString += content
+
+
+def main(argv, outfile=None):
+ routefile = argv[0]
+ attrList = argv[1:]
+ if outfile is None:
+ parse(routefile, RouteReader(attrList, sys.stdout))
+ else:
+ with open(outfile, 'w') as outf:
+ parse(routefile, RouteReader(attrList, outf))
+
+
+if __name__ == "__main__":
+ if len(sys.argv) < 2:
+ sys.exit("Usage: " + sys.argv[0] + " <routes> [<attribute>*]")
+ main(sys.argv[1:])
diff --git a/tools/sumolib/geomhelper.py b/tools/sumolib/geomhelper.py
index 3aaca31..e7608a8 100644
--- a/tools/sumolib/geomhelper.py
+++ b/tools/sumolib/geomhelper.py
@@ -4,7 +4,7 @@
@author Jakob Erdmann
@author Michael Behrisch
@date 2013-02-25
- at version $Id: geomhelper.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: geomhelper.py 18756 2015-08-31 19:16:33Z behrisch $
Some helper functions for geometrical computations.
@@ -28,6 +28,10 @@ def distance(p1, p2):
return math.sqrt(dx * dx + dy * dy)
+def polyLength(polygon):
+ return sum([distance(a, b) for a, b in zip(polygon[:-1], polygon[1:])])
+
+
def lineOffsetWithMinimumDistanceToPoint(point, line_start, line_end, perpendicular=False):
"""Return the offset from line (line_start, line_end) where the distance to
point is minimal"""
@@ -127,3 +131,27 @@ def positionAtShapeOffset(shape, offset):
seenLength += nextLength
curr = next
return shape[-1]
+
+
+def angle2D(p1, p2):
+ theta1 = math.atan2(p1[1], p1[0])
+ theta2 = math.atan2(p2[1], p2[0])
+ dtheta = theta2 - theta1
+ while dtheta > math.pi:
+ dtheta -= 2.0 * math.pi
+ while dtheta < -math.pi:
+ dtheta += 2.0 * math.pi
+ return dtheta
+
+
+def isWithin(pos, shape):
+ angle = 0.
+ for i in range(0, len(shape) - 1):
+ p1 = ((shape[i][0] - pos[0]), (shape[i][1] - pos[1]))
+ p2 = ((shape[i + 1][0] - pos[0]), (shape[i + 1][1] - pos[1]))
+ angle = angle + angle2D(p1, p2)
+ i = len(shape) - 1
+ p1 = ((shape[i][0] - pos[0]), (shape[i][1] - pos[1]))
+ p2 = ((shape[0][0] - pos[0]), (shape[0][1] - pos[1]))
+ angle = angle + angle2D(p1, p2)
+ return math.fabs(angle) >= math.pi
diff --git a/tools/sumolib/miscutils.py b/tools/sumolib/miscutils.py
index a08da69..9b899d2 100644
--- a/tools/sumolib/miscutils.py
+++ b/tools/sumolib/miscutils.py
@@ -3,7 +3,7 @@
@author Jakob Erdmann
@author Michael Behrisch
@date 2012-05-08
- at version $Id: miscutils.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: miscutils.py 18502 2015-06-24 12:23:42Z behrisch $
Common utility functions
@@ -128,8 +128,8 @@ class Statistics:
else:
return None
- def relStdDev(self, limit=None):
- """return the relative standard deviation optionally limited to the last limit values"""
+ def meanAndStdDev(self, limit=None):
+ """return the mean and the standard deviation optionally limited to the last limit values"""
if limit is None or len(self.values) < limit:
limit = len(self.values)
if limit > 0:
@@ -137,10 +137,17 @@ class Statistics:
sumSq = 0.
for v in self.values[-limit:]:
sumSq += (v - mean) * (v - mean)
- return math.sqrt(sumSq / limit) / mean
+ return mean, math.sqrt(sumSq / limit)
else:
return None
+ def relStdDev(self, limit=None):
+ """return the relative standard deviation optionally limited to the last limit values"""
+ moments = self.meanAndStdDev(limit)
+ if moments is None:
+ return None
+ return moments[1] / moments[0]
+
def mean(self):
"""return the median value"""
# XXX rename this method
@@ -203,7 +210,7 @@ class Statistics:
result += '\n histogram: %s' % self.histogram()
return result
else:
- return '"%s": no values' % self.label
+ return '%s: no values' % self.label
def geh(m, c):
diff --git a/tools/sumolib/net/__init__.py b/tools/sumolib/net/__init__.py
index 00f6004..350b47f 100644
--- a/tools/sumolib/net/__init__.py
+++ b/tools/sumolib/net/__init__.py
@@ -6,7 +6,7 @@
@author Michael Behrisch
@author Jakob Erdmann
@date 2008-03-27
- at version $Id: __init__.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: __init__.py 18490 2015-06-15 08:40:28Z behrisch $
This file contains a content handler for parsing sumo network xml files.
It uses other classes from this module to represent the road network.
@@ -129,6 +129,8 @@ class Net:
self._location["projParameter"] = projParameter
def addNode(self, id, type=None, coord=None, incLanes=None):
+ if id is None:
+ return None
if id not in self._id2node:
n = node.Node(id, type, coord, incLanes)
self._nodes.append(n)
@@ -194,7 +196,7 @@ class Net:
def getNeighboringEdges(self, x, y, r=0.1, includeJunctions=True):
edges = []
try:
- if self._rtree == None:
+ if self._rtree is None:
self._initRTree(self._edges, includeJunctions)
for i in self._rtree.intersection((x - r, y - r, x + r, y + r)):
e = self._edges[i]
@@ -213,7 +215,7 @@ class Net:
def getNeighboringLanes(self, x, y, r=0.1, includeJunctions=True):
lanes = []
try:
- if self._rtree == None:
+ if self._rtree is None:
if not self._allLanes:
for edge in self._edges:
self._allLanes += edge.getLanes()
@@ -359,6 +361,7 @@ class NetReader(handler.ContentHandler):
self._withPhases = others.get('withPrograms', False)
self._withConnections = others.get('withConnections', True)
self._withFoes = others.get('withFoes', True)
+ self._withInternal = others.get('withInternal', False)
def startElement(self, name, attrs):
if name == 'location':
@@ -366,7 +369,7 @@ class NetReader(handler.ContentHandler):
"origBoundary"], attrs["projParameter"])
if name == 'edge':
function = attrs.get('function', '')
- if function == '':
+ if function == '' or self._withInternal:
prio = -1
if attrs.has_key('priority'):
prio = int(attrs['priority'])
@@ -374,7 +377,7 @@ class NetReader(handler.ContentHandler):
if attrs.has_key('name'):
name = attrs['name']
self._currentEdge = self._net.addEdge(attrs['id'],
- attrs['from'], attrs['to'], prio, function, name)
+ attrs.get('from', None), attrs.get('to', None), prio, function, name)
if attrs.has_key('shape'):
self.processShape(self._currentEdge, attrs['shape'])
else:
diff --git a/tools/sumolib/net/edge.py b/tools/sumolib/net/edge.py
index e7cd974..6b0a722 100644
--- a/tools/sumolib/net/edge.py
+++ b/tools/sumolib/net/edge.py
@@ -6,7 +6,7 @@
@author Michael Behrisch
@author Jakob Erdmann
@date 2011-11-28
- at version $Id: edge.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: edge.py 18183 2015-04-01 10:38:53Z behrisch $
This file contains a Python-representation of a single edge.
@@ -31,8 +31,10 @@ class Edge:
self._from = fromN
self._to = toN
self._priority = prio
- fromN.addOutgoing(self)
- toN.addIncoming(self)
+ if fromN:
+ fromN.addOutgoing(self)
+ if toN:
+ toN.addIncoming(self)
self._lanes = []
self._speed = None
self._length = None
diff --git a/tools/sumolib/net/lane.py b/tools/sumolib/net/lane.py
index 0600641..0538ab8 100644
--- a/tools/sumolib/net/lane.py
+++ b/tools/sumolib/net/lane.py
@@ -6,7 +6,7 @@
@author Michael Behrisch
@author Jakob Erdmann
@date 2011-11-28
- at version $Id: lane.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: lane.py 18655 2015-08-18 15:37:28Z behrisch $
This file contains a Python-representation of a single lane.
@@ -54,6 +54,7 @@ SUMO_VEHICLE_CLASSES = (
"bicycle",
"pedestrian",
"evehicle",
+ "ship",
"custom1",
"custom2")
diff --git a/tools/sumolib/output/__init__.py b/tools/sumolib/output/__init__.py
index f4a1a5e..dec5807 100644
--- a/tools/sumolib/output/__init__.py
+++ b/tools/sumolib/output/__init__.py
@@ -4,7 +4,7 @@
@author Michael Behrisch
@author Jakob Erdmann
@date 2011-06-23
- at version $Id: __init__.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: __init__.py 18547 2015-07-08 09:17:17Z behrisch $
Python interface to SUMO especially for parsing output files.
@@ -48,6 +48,11 @@ def compound_object(element_name, attrnames):
def hasAttribute(self, name):
return name in self._fields
+ def setAttribute(self, name, value):
+ if name not in self._fields:
+ self._fields.append(name)
+ self.__dict__[name] = value
+
def hasChild(self, name):
return name in self._child_dict
@@ -66,7 +71,8 @@ def compound_object(element_name, attrnames):
if name in self._child_dict:
del self._child_dict[name]
else:
- del self.__dict__[name]
+ if name in self.__dict__:
+ del self.__dict__[name]
self._fields.remove(name)
def __getitem__(self, name):
diff --git a/tools/sumolib/output/convert/gpsdat.py b/tools/sumolib/output/convert/gpsdat.py
index a614d2c..81b903b 100644
--- a/tools/sumolib/output/convert/gpsdat.py
+++ b/tools/sumolib/output/convert/gpsdat.py
@@ -3,10 +3,10 @@
@author Daniel Krajzewicz
@author Michael Behrisch
@date 2013-01-15
- at version $Id: gpsdat.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: gpsdat.py 18333 2015-05-04 06:47:43Z namdre $
This module includes functions for converting SUMO's fcd-output into
-data files read by Shawn.
+csv data files used by dlr-fcd processing chain
SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors
diff --git a/tools/sumolib/shapes/polygon.py b/tools/sumolib/shapes/polygon.py
index f25c204..bc10221 100644
--- a/tools/sumolib/shapes/polygon.py
+++ b/tools/sumolib/shapes/polygon.py
@@ -4,7 +4,7 @@
@author Melanie Knocke
@author Michael Behrisch
@date 2012-12-04
- at version $Id: polygon.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: polygon.py 18756 2015-08-31 19:16:33Z behrisch $
Library for reading and storing polygons.
@@ -24,7 +24,7 @@ from .. import color
class Polygon:
- def __init__(self, id, type, color, layer, fill, shape):
+ def __init__(self, id, type=None, color=None, layer=None, fill=None, shape=None):
self.id = id
self.type = type
self.color = color
@@ -50,8 +50,17 @@ class Polygon:
s = []
for e in self.shape:
s.append("%s,%s" % (e[0], e[1]))
- ret = '<poly id="%s" type="%s" color="%s" layer="%s" fill="%s" shape="%s"' % (
- self.id, self.type, self.color.toXML(), self.layer, self.fill, " ".join(s))
+ ret = '<poly id="%s"' % self.id
+ if type is not None:
+ ret += ' type="%s"' % self.type
+ if color is not None:
+ ret += ' color="%s"' % self.color.toXML()
+ if layer is not None:
+ ret += ' layer="%s"' % self.layer
+ if fill is not None:
+ ret += ' fill="%s"' % self.fill
+ if shape is not None:
+ ret += ' shape="%s"' % (" ".join(s))
if len(self.attributes) == 0:
ret += '/>'
else:
@@ -64,21 +73,24 @@ class Polygon:
class PolygonReader(handler.ContentHandler):
- def __init__(self):
+ def __init__(self, includeTaz=False):
+ self._includeTaz = includeTaz
self._id2poly = {}
self._polys = []
self._lastPoly = None
def startElement(self, name, attrs):
- if name == 'poly':
- c = color.decodeXML(attrs['color'])
- s1 = attrs['shape'].strip().split(" ")
+ if name == 'poly' or (self._includeTaz and name == 'taz'):
cshape = []
- for e in s1:
+ for e in attrs['shape'].split():
p = e.split(",")
cshape.append((float(p[0]), float(p[1])))
- poly = Polygon(attrs['id'], attrs['type'], c, float(
- attrs['layer']), attrs['fill'], cshape)
+ if name == 'poly' and not self._includeTaz:
+ c = color.decodeXML(attrs['color'])
+ poly = Polygon(attrs['id'], attrs['type'], c, float(
+ attrs['layer']), attrs['fill'], cshape)
+ else:
+ poly = Polygon(attrs['id'], shape=cshape)
self._id2poly[poly.id] = poly
self._polys.append(poly)
self._lastPoly = poly
@@ -89,8 +101,11 @@ class PolygonReader(handler.ContentHandler):
if name == 'poly':
self._lastPoly = None
+ def getPolygons(self):
+ return self._polys
+
-def read(filename):
- polys = PolygonReader()
+def read(filename, includeTaz=False):
+ polys = PolygonReader(includeTaz)
parse(filename, polys)
- return polys._polys
+ return polys.getPolygons()
diff --git a/tools/tls/tls_csv2SUMO.py b/tools/tls/tls_csv2SUMO.py
index d811920..b9fc470 100755
--- a/tools/tls/tls_csv2SUMO.py
+++ b/tools/tls/tls_csv2SUMO.py
@@ -4,7 +4,7 @@
@author Daniel Krajzewicz
@author Michael Behrisch
@date 2009-08-01
- at version $Id: tls_csv2SUMO.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: tls_csv2SUMO.py 18728 2015-08-26 07:55:27Z namdre $
Converts a csv-tls-description into one SUMO can read as additional file.
Format of the csv-file:
@@ -57,24 +57,37 @@ allLink2Indices = []
for tlsFile in allTLS:
- minTimes = []
- maxTimes = []
- normTimes = []
- defs = []
- links = []
- params = []
- key = ""
- subkey = ""
- offset = 0
- links2index = {}
-
fd = open(tlsFile)
+ key = None
for l in fd:
l = l.strip()
if len(l) > 0 and l[0] == '#':
continue
v = l.split(";")
if v[0] == "key":
+ if key is not None:
+ allMinTimes.append(minTimes)
+ allMaxTimes.append(maxTimes)
+ allNormTimes.append(normTimes)
+ allDefs.append(defs)
+ allLinks.append(links)
+ allParams.append(params)
+ allKeys.append(key)
+ allSubkeys.append(subkey)
+ allOffsets.append(offset)
+ allLink2Indices.append(links2index)
+
+ minTimes = []
+ maxTimes = []
+ normTimes = []
+ defs = []
+ links = []
+ params = []
+ # key = ""
+ subkey = ""
+ offset = 0
+ links2index = {}
+
key = v[1]
elif v[0] == "subkey":
subkey = v[1]
@@ -98,18 +111,21 @@ for tlsFile in allTLS:
if len(v) > 1:
links2index[int(v[0])] = len(defs)
defs.append(v[1:])
- fd.close()
- allMinTimes.append(minTimes)
- allMaxTimes.append(maxTimes)
- allNormTimes.append(normTimes)
- allDefs.append(defs)
- allLinks.append(links)
- allParams.append(params)
- allKeys.append(key)
- allSubkeys.append(subkey)
- allOffsets.append(offset)
- allLink2Indices.append(links2index)
+ pass
+
+ if key is not None:
+ allMinTimes.append(minTimes)
+ allMaxTimes.append(maxTimes)
+ allNormTimes.append(normTimes)
+ allDefs.append(defs)
+ allLinks.append(links)
+ allParams.append(params)
+ allKeys.append(key)
+ allSubkeys.append(subkey)
+ allOffsets.append(offset)
+ allLink2Indices.append(links2index)
+ fd.close()
net1 = sumolib.net.readNet(sys.argv[2])
diff --git a/tools/traceExporter.py b/tools/traceExporter.py
index 8a654a3..d067cdd 100755
--- a/tools/traceExporter.py
+++ b/tools/traceExporter.py
@@ -7,7 +7,7 @@ A script for converting SUMO's fcd-output into files readable by PHEM and commun
@author Jakob Erdmann
@author Michael Behrisch
@date 2013-01-15
- at version $Id: traceExporter.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: traceExporter.py 18756 2015-08-31 19:16:33Z behrisch $
SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors
@@ -83,6 +83,9 @@ def procFCDStream(fcdstream, options):
ft = -1 # "first" time step
lastExported = -1
chosen = {}
+ if options.boundary:
+ xmin, ymin, xmax, ymax = [float(e)
+ for e in options.boundary.split(",")]
for i, q in enumerate(fcdstream):
pt = lt
lt = float(q.time.encode("latin1"))
@@ -107,8 +110,9 @@ def procFCDStream(fcdstream, options):
z = v.z
else:
z = 0
- e.vehicle.append(
- FCDVehicleEntry(v.id, x, y, z, v.speed, v.type, v.lane, v.slope))
+ if not options.boundary or (x >= xmin and x <= xmax and y >= ymin and y <= ymax):
+ e.vehicle.append(
+ FCDVehicleEntry(v.id, x, y, z, v.speed, v.type, v.lane, v.slope))
yield e
t = lt - pt + lt
yield FCDTimeEntry(t)
@@ -120,7 +124,8 @@ def runMethod(inputFile, outputFile, writer, options, further={}):
if options.base >= 0:
further["base-date"] = datetime.datetime.fromtimestamp(options.base)
else:
- further["base-date"] = datetime.datetime.now()
+ further["base-date"] = datetime.datetime.now().replace(hour=0,
+ minute=0, second=0, microsecond=0)
o = _getOutputStream(outputFile)
fcdStream = sumolib.output.parse(inputFile, "timestep")
ret = writer(procFCDStream(fcdStream, options), o, further)
@@ -131,8 +136,13 @@ def runMethod(inputFile, outputFile, writer, options, further={}):
def main(args=None):
"""The main function; parses options and converts..."""
# ---------- build and read options ----------
+ USAGE = """Usage %prog -i <FCDDATA> [options]
+Converts the given fcd file (generated by sumo --fcd-output) into the selected
+output format. Optionally the output can be sampled, filtered and distorted.
+"""
+
from optparse import OptionParser
- optParser = OptionParser()
+ optParser = OptionParser(usage=USAGE)
optParser.add_option("-i", "--fcd-input", dest="fcd", metavar="FILE",
help="Defines the FCD-output file to use as input")
optParser.add_option("-n", "--net-input", dest="net", metavar="FILE",
@@ -147,6 +157,8 @@ def main(args=None):
type="float", help="Defines the export step length")
optParser.add_option("--gps-blur", dest="blur", default=0,
type="float", help="Defines the GPS blur")
+ optParser.add_option(
+ "--boundary", help="Defines the bounding box as 'xmin,ymin,xmax,ymax'")
optParser.add_option("-s", "--seed", dest="seed", default=42,
type="float", help="Defines the randomizer seed")
optParser.add_option(
@@ -186,6 +198,8 @@ def main(args=None):
optParser.add_option("--poi-output", dest="poi", metavar="FILE",
help="Defines the name of the poi file to generate")
# parse
+ if len(args) == 1:
+ sys.exit(USAGE.replace('%prog', os.path.basename(__file__)))
options, remaining_args = optParser.parse_args(args=args)
if options.seed:
diff --git a/tools/traci/__init__.py b/tools/traci/__init__.py
index d51a5af..91f6f4f 100644
--- a/tools/traci/__init__.py
+++ b/tools/traci/__init__.py
@@ -7,7 +7,7 @@
@author Daniel Krajzewicz
@author Jakob Erdmann
@date 2008-10-09
- at version $Id: __init__.py 18106 2015-03-19 08:08:16Z behrisch $
+ at version $Id: __init__.py 18717 2015-08-25 12:39:40Z behrisch $
Python implementation of the TraCI interface.
@@ -471,7 +471,9 @@ def init(port=8813, numRetries=10, host="localhost", label="default"):
def simulationStep(step=0):
"""
- Make simulation step and simulate up to "step" second in sim time.
+ Make a simulation step and simulate up to the given millisecond in sim time.
+ If the given value is 0 or absent, exactly one step is performed.
+ Values smaller than or equal to the current sim time result in no action.
"""
_message.queue.append(constants.CMD_SIMSTEP2)
_message.string += struct.pack("!BBi", 1 +
diff --git a/tools/traci/areal.py b/tools/traci/areal.py
index f7b44a2..5c7a533 100644
--- a/tools/traci/areal.py
+++ b/tools/traci/areal.py
@@ -4,7 +4,7 @@
@author Mario Krumnow
@author Laura Bieker
@date 2011-03-16
- at version $Id: areal.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: areal.py 18756 2015-08-31 19:16:33Z behrisch $
Python implementation of the TraCI interface.
@@ -26,7 +26,11 @@ _RETURN_VALUE_FUNC = {tc.ID_LIST: traci.Storage.readStr
tc.JAM_LENGTH_METERS: traci.Storage.readDouble,
tc.JAM_LENGTH_VEHICLE: traci.Storage.readInt,
tc.LAST_STEP_MEAN_SPEED: traci.Storage.readDouble,
+ tc.VAR_POSITION: traci.Storage.readDouble,
+ tc.VAR_LENGTH: traci.Storage.readDouble,
+ tc.VAR_LANE_ID: traci.Storage.readString,
tc.LAST_STEP_VEHICLE_ID_LIST: traci.Storage.readStringList,
+ tc.LAST_STEP_VEHICLE_NUMBER: traci.Storage.readInt,
tc.LAST_STEP_OCCUPANCY: traci.Storage.readDouble}
subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC)
@@ -93,6 +97,38 @@ def getLastStepOccupancy(detID):
return _getUniversal(tc.LAST_STEP_OCCUPANCY, detID)
+def getPosition(detID):
+ """getPosition(string) -> double
+
+ Returns the starting position of the detector measured from the beginning of the lane in meters.
+ """
+ return _getUniversal(tc.VAR_POSITION, detID)
+
+
+def getLaneID(detID):
+ """getLaneID(string) -> string
+
+ Returns the id of the lane the detector is on.
+ """
+ return _getUniversal(tc.VAR_LANE_ID, detID)
+
+
+def getLength(detID):
+ """getLength(string) -> double
+
+ Returns the length of the detector
+ """
+ return _getUniversal(tc.VAR_LENGTH, detID)
+
+
+def getLastStepVehicleNumber(detID):
+ """getLastStepVehicleNumber(string) -> integer
+
+ Returns the number of vehicles that were on the named induction loop within the last simulation step.
+ """
+ return _getUniversal(tc.LAST_STEP_VEHICLE_NUMBER, detID)
+
+
def subscribe(detID, varIDs=(tc.LAST_STEP_VEHICLE_NUMBER,), begin=0, end=2**31 - 1):
"""subscribe(string, list(integer), double, double) -> None
diff --git a/tools/traci/constants.py b/tools/traci/constants.py
index 10068b3..0921756 100644
--- a/tools/traci/constants.py
+++ b/tools/traci/constants.py
@@ -1,8 +1,8 @@
"""
@file constants.py
@author generated by "rebuildConstants.py"
- at date 2015-03-19 08:53:01.423000
- at version $Id: constants.py 18106 2015-03-19 08:08:16Z behrisch $
+ at date 2015-08-25 14:51:52.386927
+ at version $Id: constants.py 18756 2015-08-31 19:16:33Z behrisch $
This script contains TraCI constant definitions from <SUMO_HOME>/src/traci-server/TraCIConstants.h.
@@ -17,11 +17,10 @@ the Free Software Foundation; either version 3 of the License, or
"""
-
# ****************************************
# VERSION
# ****************************************
-TRACI_VERSION = 9
+TRACI_VERSION = 10
# ****************************************
@@ -370,6 +369,16 @@ REMOVE_VAPORIZED = 0x03
# vehicle finished route during teleport
REMOVE_TELEPORT_ARRIVED = 0x04
+# ****************************************
+# PERSON/CONTAINER STAGES
+# ****************************************
+# person walking / container transhiping
+STAGE_WALKING = 0x00
+# person riding / container being transported
+STAGE_DRIVING = 0x01
+# person / container stopping
+STAGE_WAITING = 0x02
+
# ****************************************
# VARIABLE TYPES (for CMD_GET_*_VARIABLE)
@@ -386,19 +395,23 @@ OBJECT_VARIABLES_SUBSCRIPTION = 0x02
# subscribe context variables (get: all)
SURROUNDING_VARIABLES_SUBSCRIPTION = 0x03
-# last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges)
+# last step vehicle number (get: induction loops, multi-entry/multi-exit
+# detector, lanes, edges)
LAST_STEP_VEHICLE_NUMBER = 0x10
-# last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges)
+# last step vehicle number (get: induction loops, multi-entry/multi-exit
+# detector, lanes, edges)
LAST_STEP_MEAN_SPEED = 0x11
-# last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges)
+# last step vehicle list (get: induction loops, multi-entry/multi-exit
+# detector, lanes, edges)
LAST_STEP_VEHICLE_ID_LIST = 0x12
# last step occupancy (get: induction loops, lanes, edges)
LAST_STEP_OCCUPANCY = 0x13
-# last step vehicle halting number (get: multi-entry/multi-exit detector, lanes, edges)
+# last step vehicle halting number (get: multi-entry/multi-exit detector,
+# lanes, edges)
LAST_STEP_VEHICLE_HALTING_NUMBER = 0x14
# last step mean vehicle length (get: induction loops, lanes, edges)
@@ -416,6 +429,9 @@ JAM_LENGTH_VEHICLE = 0x18
# last step jam length in meters
JAM_LENGTH_METERS = 0x19
+# last step person list (get: edges)
+LAST_STEP_PERSON_ID_LIST = 0x1a
+
# traffic light states, encoded as rRgGyYoO tuple (get: traffic lights)
TL_RED_YELLOW_GREEN_STATE = 0x20
@@ -457,7 +473,6 @@ TL_NEXT_SWITCH = 0x2d
TL_EXTERNAL_STATE = 0x2e
-
# outgoing link number (get: lanes)
LANE_LINK_NUMBER = 0x30
@@ -480,7 +495,7 @@ VAR_SPEED = 0x40
# maximum allowed/possible speed (get: vehicle types, lanes, set: edges, lanes)
VAR_MAXSPEED = 0x41
-# position (2D) (get: vehicle, poi, set: poi)
+# position (2D) (get: vehicle, poi, inductionloop, areadetector; set: poi)
VAR_POSITION = 0x42
# position (3D) (get: vehicle, poi, set: poi)
@@ -489,7 +504,7 @@ VAR_POSITION3D = 0x39
# angle (get: vehicle)
VAR_ANGLE = 0x43
-# angle (get: vehicle types, lanes, set: lanes)
+# angle (get: vehicle types, lanes, arealdetector, set: lanes)
VAR_LENGTH = 0x44
# color (get: vehicles, vehicle types, polygons, pois)
@@ -528,7 +543,7 @@ VAR_TYPE = 0x4f
# road id (get: vehicles)
VAR_ROAD_ID = 0x50
-# lane id (get: vehicles)
+# lane id (get: vehicles, inductionloop, arealdetector)
VAR_LANE_ID = 0x51
# lane index (get: vehicles)
@@ -574,7 +589,6 @@ VAR_SPEED_FACTOR = 0x5e
VAR_SPEED_DEVIATION = 0x5f
-
# speed without TraCI influence (get: vehicle)
VAR_SPEED_WITHOUT_TRACI = 0xb1
@@ -594,7 +608,8 @@ VAR_STOPSTATE = 0xb5
# how lane changing is performed (set: vehicle)
VAR_LANECHANGE_MODE = 0xb6
-# maximum speed regarding max speed on the current lane and speed factor (get: vehicle)
+# maximum speed regarding max speed on the current lane and speed factor
+# (get: vehicle)
VAR_ALLOWED_SPEED = 0xb7
@@ -628,7 +643,10 @@ VAR_BUS_STOP_WAITING = 0x67
# current leader together with gap (get: vehicle)
VAR_LEADER = 0x68
-#current waiting time (get: vehicle, lane)
+# edge index in current route (get: vehicle)
+VAR_ROUTE_INDEX = 0x69
+
+# current waiting time (get: vehicle, lane)
VAR_WAITING_TIME = 0x7a
# current time step (get: simulation)
@@ -704,7 +722,6 @@ CMD_CLEAR_PENDING_VEHICLES = 0x94
VAR_PARAMETER = 0x7e
-
# add an instance (poi, polygon, vehicle, route)
ADD = 0x80
@@ -717,7 +734,7 @@ POSITION_CONVERSION = 0x82
# distance between points or vehicles
DISTANCE_REQUEST = 0x83
-#the current driving distance
+# the current driving distance
VAR_DISTANCE = 0x84
# add a fully specified instance (vehicle)
@@ -732,6 +749,15 @@ CMD_REROUTE_EFFORT = 0x91
# validates current route (vehicles)
VAR_ROUTE_VALID = 0x92
+# retrieve information regarding the current person/container stage
+VAR_STAGE = 0xc0
+
+# retrieve information regarding the next edge including crossings and
+# walkingAreas (pedestrians only)
+VAR_NEXT_EDGE = 0xc1
+
+# retrieve the number of stages (person, container)
+VAR_NUM_STAGES = 0xc2
# zoom
VAR_VIEW_ZOOM = 0xa0
@@ -750,5 +776,3 @@ VAR_SCREENSHOT = 0xa5
# track vehicle
VAR_TRACK_VEHICLE = 0xa6
-
-
diff --git a/tools/traci/edge.py b/tools/traci/edge.py
index 2b08334..4883e57 100644
--- a/tools/traci/edge.py
+++ b/tools/traci/edge.py
@@ -4,7 +4,7 @@
@author Michael Behrisch
@author Jakob Erdmann
@date 2011-03-17
- at version $Id: edge.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: edge.py 18202 2015-04-15 14:51:19Z namdre $
Python implementation of the TraCI interface.
@@ -39,7 +39,9 @@ _RETURN_VALUE_FUNC = {tc.ID_LIST: traci.Storage.readStringList
tc.VAR_CURRENT_TRAVELTIME: traci.Storage.readDouble,
tc.LAST_STEP_VEHICLE_NUMBER: traci.Storage.readInt,
tc.LAST_STEP_VEHICLE_HALTING_NUMBER: traci.Storage.readInt,
- tc.LAST_STEP_VEHICLE_ID_LIST: traci.Storage.readStringList}
+ tc.LAST_STEP_VEHICLE_ID_LIST: traci.Storage.readStringList,
+ tc.LAST_STEP_PERSON_ID_LIST: traci.Storage.readStringList,
+ }
subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC)
@@ -214,6 +216,14 @@ def getLastStepVehicleIDs(edgeID):
return _getUniversal(tc.LAST_STEP_VEHICLE_ID_LIST, edgeID)
+def getLastStepPersonIDs(edgeID):
+ """getLastStepPersonIDs(string) -> list(string)
+
+ Returns the ids of the persons on the given edge during the last time step.
+ """
+ return _getUniversal(tc.LAST_STEP_PERSON_ID_LIST, edgeID)
+
+
def subscribe(edgeID, varIDs=(tc.LAST_STEP_VEHICLE_NUMBER,), begin=0, end=2**31 - 1):
"""subscribe(string, list(integer), double, double) -> None
diff --git a/tools/traci/person.py b/tools/traci/person.py
index 7c61b9c..0dc7261 100644
--- a/tools/traci/person.py
+++ b/tools/traci/person.py
@@ -3,7 +3,7 @@
@file person.py
@author Jakob Erdmann
@date 2015-02-06
- at version $Id: person.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: person.py 18335 2015-05-04 14:43:47Z namdre $
Python implementation of the TraCI interface.
@@ -35,6 +35,7 @@ _RETURN_VALUE_FUNC = {tc.ID_LIST: traci.Storage.readStringList,
tc.VAR_WAITING_TIME: traci.Storage.readDouble,
tc.VAR_WIDTH: traci.Storage.readDouble,
tc.VAR_MINGAP: traci.Storage.readDouble,
+ tc.VAR_NEXT_EDGE: traci.Storage.readString,
}
subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC)
@@ -126,14 +127,6 @@ def getColor(personID):
return _getUniversal(tc.VAR_COLOR, personID)
-def getPersonNumber(personID):
- """getPersonNumber(string) -> integer
-
- .
- """
- return _getUniversal(tc.VAR_PERSON_NUMBER, personID)
-
-
def getLength(personID):
"""getLength(string) -> double
@@ -167,6 +160,15 @@ def getMinGap(personID):
return _getUniversal(tc.VAR_MINGAP, personID)
+def getNextEdge(personID):
+ """getNextEdge() -> string
+ If the person is walking, returns the next edge on the persons route
+ (including crossing and walkingareas). If there is no further edge or the
+ person is in another stage, returns the empty string.
+ """
+ return _getUniversal(tc.VAR_NEXT_EDGE, personID)
+
+
def subscribe(personID, varIDs=(tc.VAR_ROAD_ID, tc.VAR_LANEPOSITION), begin=0, end=2**31 - 1):
"""subscribe(string, list(integer), double, double) -> None
diff --git a/tools/traci/vehicle.py b/tools/traci/vehicle.py
index 08cdd3a..9dfcfed 100644
--- a/tools/traci/vehicle.py
+++ b/tools/traci/vehicle.py
@@ -9,7 +9,7 @@
@author Laura Bieker
@author Daniel Krajzewicz
@date 2011-03-09
- at version $Id: vehicle.py 18106 2015-03-19 08:08:16Z behrisch $
+ at version $Id: vehicle.py 18756 2015-08-31 19:16:33Z behrisch $
Python implementation of the TraCI interface.
@@ -27,12 +27,18 @@ import traci
import traci.constants as tc
DEPART_TRIGGERED = -1
-DEPART_NOW = -2
-DEPART_MAX = -3
+DEPART_CONTAINER_TRIGGERED = -2
+DEPART_NOW = -3
+
+DEPART_SPEED_RANDOM = -2
+DEPART_SPEED_MAX = -3
STOP_DEFAULT = 0
STOP_PARKING = 1
STOP_TRIGGERED = 2
+STOP_CONTAINER_TRIGGERED = 4
+STOP_BUS_STOP = 8
+STOP_CONTAINER_STOP = 16
def _readBestLanes(result):
@@ -74,6 +80,7 @@ _RETURN_VALUE_FUNC = {tc.ID_LIST: traci.Storage.readStringList,
tc.VAR_LANE_INDEX: traci.Storage.readInt,
tc.VAR_TYPE: traci.Storage.readString,
tc.VAR_ROUTE_ID: traci.Storage.readString,
+ tc.VAR_ROUTE_INDEX: traci.Storage.readInt,
tc.VAR_COLOR: lambda result: result.read("!BBBB"),
tc.VAR_LANEPOSITION: traci.Storage.readDouble,
tc.VAR_CO2EMISSION: traci.Storage.readDouble,
@@ -106,6 +113,7 @@ _RETURN_VALUE_FUNC = {tc.ID_LIST: traci.Storage.readStringList,
tc.VAR_BEST_LANES: _readBestLanes,
tc.VAR_LEADER: _readLeader,
tc.DISTANCE_REQUEST: traci.Storage.readDouble,
+ tc.VAR_STOPSTATE: lambda result: result.read("!B")[0],
tc.VAR_DISTANCE: traci.Storage.readDouble}
subscriptionResults = traci.SubscriptionResults(_RETURN_VALUE_FUNC)
@@ -205,6 +213,15 @@ def getRouteID(vehID):
return _getUniversal(tc.VAR_ROUTE_ID, vehID)
+def getRouteIndex(vehID):
+ """getRouteIndex(string) -> int
+
+ Returns the index of the current edge within the vehicles route or -1 if the
+ vehicle has not yet departed
+ """
+ return _getUniversal(tc.VAR_ROUTE_INDEX, vehID)
+
+
def getRoute(vehID):
"""getRoute(string) -> list(string)
@@ -514,6 +531,53 @@ def getDistance(vehID):
return _getUniversal(tc.VAR_DISTANCE, vehID)
+def getStopState(vehID):
+ """getStopState(string) -> integer
+
+ Returns information in regard to stopping:
+ The returned integer is defined as 1 * stopped + 2 * parking
+ + 4 * personTriggered + 8 * containerTriggered + 16 * isBusStop
+ + 32 * isContainerStop
+ with each of these flags defined as 0 or 1
+ """
+ return _getUniversal(tc.VAR_STOPSTATE, vehID)
+
+
+def isStopped(vehID):
+ """isStopped(string) -> bool
+ Return whether the vehicle is stopped
+ """
+ return (getStopState(vehID) & 1) == 1
+
+
+def isStoppedParking(vehID):
+ """isStoppedParking(string) -> bool
+ Return whether the vehicle is parking (implies stopped)
+ """
+ return (getStopState(vehID) & 2) == 2
+
+
+def isStoppedTriggered(vehID):
+ """isStoppedTriggered(string) -> bool
+ Return whether the vehicle is stopped and waiting for a person or container
+ """
+ return (getStopState(vehID) & 12) > 0
+
+
+def isAtBusStop(vehID):
+ """isAtBusStop(string) -> bool
+ Return whether the vehicle is stopped at a bus stop
+ """
+ return (getStopState(vehID) & 16) == 16
+
+
+def isAtContainerStop(vehID):
+ """isAtContainerStop(string) -> bool
+ Return whether the vehicle is stopped at a container stop
+ """
+ return (getStopState(vehID) & 32) == 32
+
+
def subscribe(vehID, varIDs=(tc.VAR_ROAD_ID, tc.VAR_LANEPOSITION), begin=0, end=2**31 - 1):
"""subscribe(string, list(integer), double, double) -> None
@@ -554,22 +618,44 @@ def setMaxSpeed(vehID, speed):
tc.CMD_SET_VEHICLE_VARIABLE, tc.VAR_MAXSPEED, vehID, speed)
-def setStop(vehID, edgeID, pos=1., laneIndex=0, duration=2**31 - 1, flags=STOP_DEFAULT):
- """setStop(string, string, double, integer, integer, integer) -> None
+def setStop(vehID, edgeID, pos=1., laneIndex=0, duration=2**31 - 1, flags=STOP_DEFAULT, startPos=tc.INVALID_DOUBLE_VALUE, until=-1):
+ """setStop(string, string, double, integer, integer, integer, double, integer) -> None
- Adds or modifies a stop with the given parameters. The duration attribute is
+ Adds or modifies a stop with the given parameters. The duration and the until attribute are
in milliseconds.
"""
traci._beginMessage(tc.CMD_SET_VEHICLE_VARIABLE, tc.CMD_STOP,
- vehID, 1 + 4 + 1 + 4 + len(edgeID) + 1 + 8 + 1 + 1 + 1 + 4 + 1 + 1)
- traci._message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 5)
+ vehID, 1 + 4 + 1 + 4 + len(edgeID) + 1 + 8 + 1 + 1 + 1 + 4 + 1 + 1 + 1 + 8 + 1 + 4)
+ traci._message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 7)
traci._message.string += struct.pack("!Bi",
tc.TYPE_STRING, len(edgeID)) + str(edgeID)
traci._message.string += struct.pack("!BdBBBiBB", tc.TYPE_DOUBLE, pos,
tc.TYPE_BYTE, laneIndex, tc.TYPE_INTEGER, duration, tc.TYPE_BYTE, flags)
+ traci._message.string += struct.pack("!BdBi",
+ tc.TYPE_DOUBLE, startPos, tc.TYPE_INTEGER, until)
traci._sendExact()
+def setBusStop(vehID, stopID, duration=2**31 - 1, until=-1, flags=STOP_DEFAULT):
+ """setBusStop(string, string, integer, integer, integer) -> None
+
+ Adds or modifies a bus stop with the given parameters. The duration and the until attribute are
+ in milliseconds.
+ """
+ setStop(vehID, stopID, duration=duration,
+ until=until, flags=flags | STOP_BUS_STOP)
+
+
+def setContainerStop(vehID, stopID, duration=2**31 - 1, until=-1, flags=STOP_DEFAULT):
+ """setContainerStop(string, string, integer, integer, integer) -> None
+
+ Adds or modifies a container stop with the given parameters. The duration and the until attribute are
+ in milliseconds.
+ """
+ setStop(vehID, stopID, duration=duration, until=until,
+ flags=flags | STOP_CONTAINER_STOP)
+
+
def resume(vehID):
"""resume(string) -> None
@@ -614,7 +700,7 @@ def setType(vehID, typeID):
def setRouteID(vehID, routeID):
"""setRouteID(string, string) -> None
- Sets the id of the route for the named vehicle.
+ Changes the vehicles route to the route with the given id.
"""
traci._sendStringCmd(
tc.CMD_SET_VEHICLE_VARIABLE, tc.VAR_ROUTE_ID, vehID, routeID)
@@ -884,7 +970,8 @@ def addFull(vehID, routeID, typeID="DEFAULT_VEHTYPE", depart=None,
depart = str(traci.simulation.getCurrentTime() / 1000.)
for val in (routeID, typeID, depart, departLane, departPos, departSpeed,
arrivalLane, arrivalPos, arrivalSpeed, fromTaz, toTaz, line):
- messageString += struct.pack("!Bi", tc.TYPE_STRING, len(val)) + str(val)
+ messageString += struct.pack("!Bi",
+ tc.TYPE_STRING, len(val)) + str(val)
messageString += struct.pack("!Bi", tc.TYPE_INTEGER, personCapacity)
messageString += struct.pack("!Bi", tc.TYPE_INTEGER, personNumber)
@@ -900,15 +987,16 @@ def remove(vehID, reason=tc.REMOVE_VAPORIZED):
traci._sendByteCmd(tc.CMD_SET_VEHICLE_VARIABLE, tc.REMOVE, vehID, reason)
-def moveToVTD(vehID, edgeID, lane, x, y):
+def moveToVTD(vehID, edgeID, lane, x, y, angle):
traci._beginMessage(tc.CMD_SET_VEHICLE_VARIABLE, tc.VAR_MOVE_TO_VTD,
- vehID, 1 + 4 + 1 + 4 + len(edgeID) + 1 + 4 + 1 + 8 + 1 + 8)
- traci._message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 4)
+ vehID, 1 + 4 + 1 + 4 + len(edgeID) + 1 + 4 + 1 + 8 + 1 + 8 + 1 + 8)
+ traci._message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 5)
traci._message.string += struct.pack("!Bi",
tc.TYPE_STRING, len(edgeID)) + str(edgeID)
traci._message.string += struct.pack("!Bi", tc.TYPE_INTEGER, lane)
traci._message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, x)
traci._message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, y)
+ traci._message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, angle)
traci._sendExact()
diff --git a/tools/trip/generateTripsXml.py b/tools/trip/generateTripsXml.py
deleted file mode 100755
index 4d76523..0000000
--- a/tools/trip/generateTripsXml.py
+++ /dev/null
@@ -1,410 +0,0 @@
-#!/usr/bin/env python
-"""
- at file generateTripsXml.py
- at author Daniel Krajzewicz
- at author Yun-Pang Floetteroed
- at author Eric Melde
- at author Michael Behrisch
- at date 2009-02-09
- at version $Id: generateTripsXml.py 18096 2015-03-17 09:50:59Z behrisch $
-
-This script generate a trip file as input data in sumo
-
-SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
-Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors
-
-This file is part of SUMO.
-SUMO is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3 of the License, or
-(at your option) any later version.
-"""
-import os
-import string
-import sys
-import operator
-import math
-import datetime
-import random
-import bz2
-import StringIO
-from xml.sax import saxutils, make_parser, handler
-from optparse import OptionParser
-
-sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), "..", "assign"))
-from dijkstra import dijkstraPlain
-from inputs import getMatrix
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-import sumolib.net
-
-# This class is used to build the nodes in the investigated network and
-# includes the update-function for searching the k shortest paths.
-
-
-class Net(sumolib.net.Net):
-
- def __init__(self):
- sumolib.net.Net.__init__(self)
- self._endVertices = []
- self._startVertices = []
-
- def addNode(self, id, type=None, coord=None, incLanes=None):
- if id not in self._id2node:
- node = Vertex(id, coord, incLanes)
- self._nodes.append(node)
- self._id2node[id] = node
- self.setAdditionalNodeInfo(self._id2node[id], type, coord, incLanes)
- return self._id2node[id]
-
- def getEdge(self, edgeLabel):
- return self._id2edge[edgeLabel]
-
- def addSourceTargetEdge(self, edgeObj):
- edgeObj.source.addOutgoing(edgeObj)
- edgeObj.target.addIncoming(edgeObj)
- self._edges[edgeObj._id] = edgeObj
-
- def getstartVertices(self):
- return self._startVertices
-
- def getendVertices(self):
- return self._endVertices
-
- def getstartCounts(self):
- return len(self._startVertices)
-
- def getendCounts(self):
- return len(self._endVertices)
-
- def getTargets(self):
- target = set()
- for end in self._endVertices:
- for sink in end.sinkConnNodes:
- if sink not in target:
- target.add(end)
- return target
-
- def checkRoute(self, startVertex, endVertex, start, end, P, odConnTable, source, options):
- for node in endVertex.sinkConnNodes:
- length = 0.
- vertex = node
- if node in P:
- link = P[node]
- if options.limitlength:
- while vertex != source:
- # if P[vertex].kind == "real":
- length += P[vertex].length
- vertex = P[vertex].source
- odConnTable[startVertex._id][endVertex._id].append(
- [source.getOutgoing()[0]._id, link._id, length])
-
- if options.limitlength and len(odConnTable[startVertex._id][endVertex._id]) > 0:
- for count, item in enumerate(odConnTable[startVertex._id][endVertex._id]):
- if count == 0:
- minLength = item[2]
- else:
- if item[2] < minLength:
- minLength = item[2]
- minLength *= 1.6
- for item in odConnTable[startVertex._id][endVertex._id]:
- if item[2] > minLength:
- odConnTable[startVertex._id][endVertex._id].remove(item)
-
-
-class Vertex(sumolib.net.Node):
-
- """
- This class is to store node attributes and the respective incoming/outgoing links.
- """
-
- def __init__(self, id, type=None, coord=None, incLanes=None):
- sumolib.net.Node.__init__(self, id, type, coord, incLanes)
- self.sourceConnNodes = []
- self.sinkConnNodes = []
-
- def __repr__(self):
- return self._id
-
-# This class is uesed to store link information and estimate
-# as well as flow and capacity for the flow computation and some parameters
-# read from the net.
-
-
-class Edge(sumolib.net.Edge):
-
- """
- This class is to record link attributes
- """
-
- def __init__(self, id, source, target, prio, function, name):
- sumolib.net.Edge.__init__(
- self, id, source, target, prio, function, name)
- self.capacity = sys.maxint
- self.freeflowtime = 0.0
- self.helpacttime = 0.0
- self.weight = 0.
- self.connection = 0.
-
- def addLane(self, lane):
- sumolib.net.Edge.addLane(self, lane)
- if self._from._id == self._to._id:
- self.freeflowtime = 0.0
- else:
- self.freeflowtime = self._length / self._speed
- self.actualtime = self.freeflowtime
- self.helpacttime = self.freeflowtime
-
- def __repr__(self):
- cap = str(self.capacity)
- if self.capacity == sys.maxint or self.connection != 0:
- cap = "inf"
- return "%s_%s_%s_%s<%s|%s|%s|%s|%s|%s|%s|%s|%s>" % (self._function, self._id, self._from, self._to, self._speed)
-
-
-class Trip:
-
- """
- This class is to store trip attributes.
- """
-
- def __init__(self, num, depart, source, sink, sourceD, sinkD):
- self.label = "%s" % num
- self.depart = depart
- self.sourceEdge = source
- self.sinkEdge = sink
- self.sourceDistrict = sourceD
- self.sinkDistrict = sinkD
-
- def __repr__(self):
- return self.label
-
-# The class is for parsing the XML input file (districts). The data parsed
-# is written into the net.
-
-
-class DistrictsReader(handler.ContentHandler):
-
- def __init__(self, net):
- self._net = net
- self._district = None
- self.I = 100
-
- def startElement(self, name, attrs):
- if name == 'taz':
- self._districtSource = self._net.addNode(attrs['id'])
- self._net._startVertices.append(self._districtSource)
- self._districtSink = self._net.addNode(attrs['id'])
- self._net._endVertices.append(self._districtSink)
- elif name == 'tazSink':
- sinklink = self._net.getEdge(attrs['id'])
- self.I += 1
- conlink = self._districtSink._id + str(self.I)
- newEdge = self._net.addEdge(
- conlink, sinklink._to._id, self._districtSink._id, "-1", "virtual", "")
- speed = sinklink.getSpeed()
- length = sinklink.getLength()
-
- for i in range(0, sinklink.getLaneNumber()):
- newLane = self._net.addLane(newEdge, speed, length)
- newEdge.addLane(newLane)
- fromlane = sinklink.getLane(i)
- self._net.addConnection(
- sinklink, newEdge, fromlane, newLane, "s", "", -1)
- newEdge.weight = attrs['weight']
- self._districtSink.sinkConnNodes.append(sinklink._to)
- newEdge.connection = 1
- elif name == 'tazSource':
- sourcelink = self._net.getEdge(attrs['id'])
- self.I += 1
- conlink = self._districtSource._id + str(self.I)
- newEdge = self._net.addEdge(
- conlink, self._districtSource._id, sourcelink._from._id, "-1", "virtual", "")
- speed = sourcelink.getSpeed()
- length = sourcelink.getLength()
-
- for i in range(0, sourcelink.getLaneNumber()):
- newLane = self._net.addLane(newEdge, speed, length)
- newEdge.addLane(newLane)
- tolane = sourcelink.getLane(i)
- self._net.addConnection(
- newEdge, sourcelink, newLane, tolane, "s", "", -1)
-
- newEdge.weight = attrs['weight']
- self._districtSource.sourceConnNodes.append(sourcelink._from)
- newEdge.connection = 2
-
- def endElement(self, name):
- if name == 'taz':
- self._district = ''
-
-
-def addVeh(counts, vehID, begin, period, odConnTable, startVertex, endVertex, tripList, vehIDtoODMap):
- counts += 1.
- vehID += 1
- # The last half hour will not release any vehicles
- endtime = int((float(begin + period) - 0.5) * 3600)
- depart = random.randint(begin * 3600, endtime)
- if len(odConnTable[startVertex._id][endVertex._id]) > 0:
- connIndex = random.randint(
- 0, len(odConnTable[startVertex._id][endVertex._id]) - 1)
- connPair = odConnTable[startVertex._id][endVertex._id][connIndex]
- veh = Trip(vehID, depart, connPair[0], connPair[
- 1], startVertex._id, endVertex._id)
- vehIDtoODMap[str(vehID)] = [startVertex._id, endVertex._id]
- tripList.append(veh)
-
- return counts, vehID, tripList, vehIDtoODMap
-
-
-def main(options):
- parser = make_parser()
- isBZ2 = False
- dataDir = options.datadir
- districts = os.path.join(dataDir, options.districtfile)
- matrix = os.path.join(dataDir, options.mtxfile)
- netfile = os.path.join(dataDir, options.netfile)
- print 'generate Trip file for:', netfile
-
- if "bz2" in netfile:
- netfile = bz2.BZ2File(netfile)
- isBZ2 = True
-
- matrixSum = 0.
- tripList = []
- net = Net()
- odConnTable = {}
- vehIDtoODMap = {}
-
- sumolib.net.readNet(options.netfile, net=net)
-
- if isBZ2:
- parser.parse(StringIO.StringIO(netfile.read()))
- netfile.close()
- else:
- parser.parse(netfile)
-
- parser.setContentHandler(DistrictsReader(net))
- parser.parse(districts)
-
- matrixPshort, startVertices, endVertices, currentMatrixSum, begin, period = getMatrix(
- net, options.debug, matrix, matrixSum)[:6]
-
- for edge in net.getEdges():
- edge.helpacttime = 0.
-
- if options.debug:
- print len(net._edges), "edges read"
- print len(net._startVertices), "start vertices read"
- print len(net._endVertices), "target vertices read"
- print 'currentMatrixSum:', currentMatrixSum
-
- if options.getconns:
- if options.debug:
- print 'generate odConnTable'
- for start, startVertex in enumerate(startVertices):
- if startVertex._id not in odConnTable:
- odConnTable[startVertex._id] = {}
-
- for source in startVertex.sourceConnNodes:
- targets = net.getTargets()
- D, P = dijkstraPlain(source, targets)
- for end, endVertex in enumerate(endVertices):
- if startVertex._id != endVertex._id and matrixPshort[start][end] > 0.:
- if endVertex._id not in odConnTable[startVertex._id]:
- odConnTable[startVertex._id][endVertex._id] = []
- net.checkRoute(
- startVertex, endVertex, start, end, P, odConnTable, source, options)
- else:
- if options.debug:
- print 'import and use the given odConnTable'
- sys.path.append(options.datadir)
- from odConnTables import odConnTable
-
- # output trips
- if options.verbose:
- print 'output the trip file'
- vehID = 0
- subVehID = 0
- random.seed(42)
- matrixSum = 0.
- fouttrips = file(options.tripfile, 'w')
- fouttrips.write('<?xml version="1.0"?>\n')
- print >> fouttrips, """<!-- generated on %s by $Id: generateTripsXml.py 18096 2015-03-17 09:50:59Z behrisch $ -->
- """ % datetime.datetime.now()
- fouttrips.write("<tripdefs>\n")
-
- if options.demandscale != 1.:
- print 'demand scale %s is used.' % options.demandscale
- for start in range(len(startVertices)):
- for end in range(len(endVertices)):
- matrixPshort[start][end] *= options.demandscale
-
- for start, startVertex in enumerate(startVertices):
- for end, endVertex in enumerate(endVertices):
- if startVertex._id != endVertex._id and matrixPshort[start][end] > 0.:
- counts = 0.
- if options.odestimation:
- if matrixPshort[start][end] < 1.:
- counts, vehID, tripList, vehIDtoODMap = addVeh(
- counts, vehID, begin, period, odConnTable, startVertex, endVertex, tripList, vehIDtoODMap)
- else:
- matrixSum += matrixPshort[start][end]
- while (counts < float(math.ceil(matrixPshort[start][end])) and (matrixPshort[start][end] - counts) > 0.5 and float(subVehID) < matrixSum)or float(subVehID) < matrixSum:
- counts, vehID, tripList, vehIDtoODMap = addVeh(
- counts, vehID, begin, period, odConnTable, startVertex, endVertex, tripList, vehIDtoODMap)
- subVehID += 1
- else:
- matrixSum += matrixPshort[start][end]
- while (counts < float(math.ceil(matrixPshort[start][end])) and (matrixPshort[start][end] - counts) > 0.5 and float(vehID) < matrixSum) or float(vehID) < matrixSum:
- counts, vehID, tripList, vehIDtoODMap = addVeh(
- counts, vehID, begin, period, odConnTable, startVertex, endVertex, tripList, vehIDtoODMap)
- if options.debug:
- print 'total demand:', matrixSum
- print vehID, 'trips generated'
- tripList.sort(key=operator.attrgetter('depart'))
-
- departpos = "free"
- if __name__ == "__main__":
- departpos = options.departpos
- for trip in tripList:
- fouttrips.write(' <trip id="%s" depart="%s" from="%s" to="%s" fromtaz="%s" totaz="%s" departlane="free" departpos="%s" departspeed="max"/>\n'
- % (trip.label, trip.depart, trip.sourceEdge, trip.sinkEdge, trip.sourceDistrict, trip.sinkDistrict, departpos))
- fouttrips.write("</tripdefs>")
- fouttrips.close()
-
- return odConnTable, vehIDtoODMap
-
-if __name__ == "__main__":
- optParser = OptionParser()
- optParser.add_option("-r", "--data-dir", dest="datadir",
- default=os.getcwd(), help="give the data directory path")
- optParser.add_option("-n", "--net-file", dest="netfile",
- help="define the net file (mandatory)")
- optParser.add_option("-m", "--matrix-file", dest="mtxfile",
- help="define the matrix file (mandatory)")
- optParser.add_option("-d", "--districts-file", dest="districtfile",
- help="define the district file (mandatory)")
- optParser.add_option("-l", "--limitlength", action="store_true", dest="limitlength",
- default=False, help="the route length of possible connections of a given OD pair shall be less than 1.6 * min.length")
- optParser.add_option("-t", "--trip-file", dest="tripfile",
- default="trips.trips.xml", help="define the output trip filename")
- optParser.add_option("-x", "--odestimation", action="store_true", dest="odestimation",
- default=False, help="generate trips for OD estimation")
- optParser.add_option("-b", "--debug", action="store_true",
- default=False, help="debug the program")
- optParser.add_option("-v", "--verbose", action="store_true",
- default=False, help="tell me what you are doing")
- optParser.add_option("-f", "--scale-factor", dest="demandscale",
- type="float", default=1., help="scale demand by ")
- optParser.add_option("-D", "--depart-pos", dest="departpos", type="choice",
- choices=('random', 'free', 'random_free'),
- default='free', help="choose departure position: random, free, random_free")
- optParser.add_option("-C", "--get-connections", action="store_true", dest="getconns",
- default=True, help="generate the OD connection directory, if set as False, a odConnTables.py should be available in the defined data directory")
- (options, args) = optParser.parse_args()
-
- if not options.netfile or not options.mtxfile or not options.districtfile:
- optParser.print_help()
- sys.exit()
-
- main(options)
diff --git a/tools/trip/randomTrips.py b/tools/trip/randomTrips.py
deleted file mode 100755
index 495e0c1..0000000
--- a/tools/trip/randomTrips.py
+++ /dev/null
@@ -1,316 +0,0 @@
-#!/usr/bin/env python
-"""
- at file randomTrips.py
- at author Daniel Krajzewicz
- at author Jakob Erdmann
- at author Michael Behrisch
- at date 2010-03-06
- at version $Id: randomTrips.py 18096 2015-03-17 09:50:59Z behrisch $
-
-Generates random trips for the given network.
-
-SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
-Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors
-
-This file is part of SUMO.
-SUMO is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3 of the License, or
-(at your option) any later version.
-"""
-
-from __future__ import print_function
-import os
-import sys
-import random
-import bisect
-import datetime
-import subprocess
-from collections import defaultdict
-import math
-import optparse
-
-SUMO_HOME = os.environ.get('SUMO_HOME',
- os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..'))
-sys.path.append(os.path.join(SUMO_HOME, 'tools'))
-import sumolib
-
-DUAROUTER = sumolib.checkBinary('duarouter')
-
-SOURCE_SUFFIX = ".src.xml"
-SINK_SUFFIX = ".dst.xml"
-VIA_SUFFIX = ".via.xml"
-
-
-def get_options(args=None):
- optParser = optparse.OptionParser()
- optParser.add_option("-n", "--net-file", dest="netfile",
- help="define the net file (mandatory)")
- optParser.add_option("-a", "--additional-files", dest="additional",
- help="define additional files to be loaded by the router")
- optParser.add_option("-o", "--output-trip-file", dest="tripfile",
- default="trips.trips.xml", help="define the output trip filename")
- optParser.add_option("-r", "--route-file", dest="routefile",
- help="generates route file with duarouter")
- optParser.add_option("--weights-prefix", dest="weightsprefix",
- help="loads probabilities for being source, destination and via-edge from the files named <prefix>.src.xml, <prefix>.sink.xml and <prefix>.via.xml")
- optParser.add_option("--weights-output-prefix", dest="weights_outprefix",
- help="generates weights files for visualisation")
- optParser.add_option("--pedestrians", action="store_true",
- default=False, help="create a person file with pedestrian trips instead of vehicle trips")
- optParser.add_option("--prefix", dest="tripprefix",
- default="", help="prefix for the trip ids")
- optParser.add_option("-t", "--trip-attributes", dest="tripattrs",
- default="", help="additional trip attributes")
- optParser.add_option(
- "-b", "--begin", type="float", default=0, help="begin time")
- optParser.add_option(
- "-e", "--end", type="float", default=3600, help="end time (default 3600)")
- optParser.add_option(
- "-p", "--period", type="float", default=1, help="repetition period (default 1)")
- optParser.add_option("-s", "--seed", type="int", help="random seed")
- optParser.add_option("-l", "--length", action="store_true",
- default=False, help="weight edge probability by length")
- optParser.add_option("-L", "--lanes", action="store_true",
- default=False, help="weight edge probability by number of lanes")
- optParser.add_option("--speed-exponent", type="float", dest="speed_exponent",
- default=0.0, help="weight edge probability by speed^<FLOAT> (default 0)")
- optParser.add_option("--fringe-factor", type="float", dest="fringe_factor",
- default=1.0, help="multiply weight of fringe edges by <FLOAT> (default 1")
- optParser.add_option("--fringe-threshold", type="float", dest="fringe_threshold",
- default=0.0, help="only consider edges with speed above <FLOAT> as fringe edges (default 0)")
- optParser.add_option("--min-distance", type="float", dest="min_distance",
- default=0.0, help="require start and end edges for each trip to be at least <FLOAT> m appart")
- optParser.add_option("--max-distance", type="float", dest="max_distance",
- default=None, help="require start and end edges for each trip to be at most <FLOAT> m appart (default 0 which disables any checks)")
- optParser.add_option("-i", "--intermediate", type="int",
- default=0, help="generates the given number of intermediate way points")
- optParser.add_option("--maxtries", type="int",
- default=100, help="number of attemps for finding a trip which meets the distance constraints")
- optParser.add_option(
- "-c", "--vclass", help="only from and to edges which permit <vClass>")
- optParser.add_option(
- "--vehicle-class", help="The vehicle class assigned to the generated trips")
- optParser.add_option("-v", "--verbose", action="store_true",
- default=False, help="tell me what you are doing")
- (options, args) = optParser.parse_args(args=args)
- if not options.netfile:
- optParser.print_help()
- sys.exit()
-
- if options.pedestrians:
- options.vclass = 'pedestrian'
- return options
-
-
-# euclidean distance between two coordinates in the plane
-def euclidean(a, b):
- return math.sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)
-
-
-class InvalidGenerator(Exception):
- pass
-
-# assigns a weight to each edge using weight_fun and then draws from a discrete
-# distribution with these weights
-
-
-class RandomEdgeGenerator:
-
- def __init__(self, net, weight_fun):
- self.net = net
- self.weight_fun = weight_fun
- self.cumulative_weights = []
- self.total_weight = 0
- for edge in self.net._edges:
- # print edge.getID(), weight_fun(edge)
- self.total_weight += weight_fun(edge)
- self.cumulative_weights.append(self.total_weight)
- if self.total_weight == 0:
- raise InvalidGenerator()
-
- def get(self):
- r = random.random() * self.total_weight
- index = bisect.bisect(self.cumulative_weights, r)
- return self.net._edges[index]
-
- def write_weights(self, fname):
- # normalize to [0,100]
- normalizer = 100.0 / max(1, max(map(self.weight_fun, self.net._edges)))
- with open(fname, 'w+') as f:
- f.write('<edgedata>\n')
- f.write(' <interval begin="0" end="10">\n')
- for i, edge in enumerate(self.net._edges):
- f.write(' <edge id="%s" value="%0.2f"/>\n' %
- (edge.getID(), self.weight_fun(edge) * normalizer))
- f.write(' </interval>\n')
- f.write('</edgedata>\n')
-
-
-class RandomTripGenerator:
-
- def __init__(self, source_generator, sink_generator, via_generator, intermediate):
- self.source_generator = source_generator
- self.sink_generator = sink_generator
- self.via_generator = via_generator
- self.intermediate = intermediate
-
- def get_trip(self, min_distance, max_distance, maxtries=100):
- for i in range(maxtries):
- source_edge = self.source_generator.get()
- intermediate = [self.via_generator.get()
- for i in range(self.intermediate)]
- sink_edge = self.sink_generator.get()
- coords = ([source_edge.getFromNode().getCoord()]
- + [e.getFromNode().getCoord() for e in intermediate]
- + [sink_edge.getToNode().getCoord()])
- distance = sum([euclidean(p, q)
- for p, q in zip(coords[:-1], coords[1:])])
- if distance >= min_distance and (max_distance is None or distance < max_distance):
- return source_edge, sink_edge, intermediate
- raise Exception("no trip found after %s tries" % maxtries)
-
-
-def get_prob_fun(options, fringe_bonus, fringe_forbidden):
- # fringe_bonus None generates intermediate way points
- def edge_probability(edge):
- if options.vclass and not edge.allows(options.vclass):
- return 0
- if fringe_bonus is None and edge.is_fringe():
- return 0
- if fringe_forbidden is not None and edge.is_fringe(getattr(edge, fringe_forbidden)):
- return 0
- prob = 1
- if options.length:
- prob *= edge.getLength()
- if options.lanes:
- prob *= edge.getLaneNumber()
- prob *= (edge.getSpeed() ** options.speed_exponent)
- if (options.fringe_factor != 1.0
- and fringe_bonus is not None
- and edge.getSpeed() > options.fringe_threshold
- and edge.is_fringe(getattr(edge, fringe_bonus))):
- prob *= options.fringe_factor
- return prob
- return edge_probability
-
-
-class LoadedProps:
-
- def __init__(self, fname):
- self.weights = defaultdict(lambda: 0)
- for edge in sumolib.output.parse_fast(fname, 'edge', ['id', 'value']):
- self.weights[edge.id] = float(edge.value)
-
- def __call__(self, edge):
- return self.weights[edge.getID()]
-
-
-def buildTripGenerator(net, options):
- try:
- source_generator = RandomEdgeGenerator(
- net, get_prob_fun(options, "_incoming", "_outgoing"))
- sink_generator = RandomEdgeGenerator(
- net, get_prob_fun(options, "_outgoing", "_incoming"))
- if options.weightsprefix:
- if os.path.isfile(options.weightsprefix + SOURCE_SUFFIX):
- source_generator = RandomEdgeGenerator(
- net, LoadedProps(options.weightsprefix + SOURCE_SUFFIX))
- if os.path.isfile(options.weightsprefix + SINK_SUFFIX):
- sink_generator = RandomEdgeGenerator(
- net, LoadedProps(options.weightsprefix + SINK_SUFFIX))
- except InvalidGenerator:
- print(
- "Error: no valid edges for generating source or destination", file=sys.stderr)
- return None
-
- try:
- via_generator = RandomEdgeGenerator(
- net, get_prob_fun(options, None, None))
- if options.weightsprefix and os.path.isfile(options.weightsprefix + VIA_SUFFIX):
- via_generator = RandomEdgeGenerator(
- net, LoadedProps(options.weightsprefix + VIA_SUFFIX))
- except InvalidGenerator:
- if options.intermediate > 0:
- print(
- "Error: no valid edges for generating intermediate points", file=sys.stderr)
- return None
- else:
- via_generator = None
-
- return RandomTripGenerator(source_generator, sink_generator, via_generator, options.intermediate)
-
-
-def main(options):
- if options.seed:
- random.seed(options.seed)
-
- net = sumolib.net.readNet(options.netfile)
- if options.min_distance > net.getBBoxDiameter() * (options.intermediate + 1):
- options.intermediate = int(
- math.ceil(options.min_distance / net.getBBoxDiameter())) - 1
- print("Warning: setting number of intermediate waypoints to %s to achieve a minimum trip length of %s in a network with diameter %s." % (
- options.intermediate, options.min_distance, net.getBBoxDiameter()))
-
- trip_generator = buildTripGenerator(net, options)
- idx = 0
- with open(options.tripfile, 'w') as fouttrips:
- fouttrips.write("""<?xml version="1.0"?>
-<!-- generated on %s by $Id: randomTrips.py 18096 2015-03-17 09:50:59Z behrisch $
- options: %s
--->
-<trips>
-""" % (datetime.datetime.now(),
- (' '.join(sys.argv[1:]).replace('--', '<doubleminus>'))))
- if options.vehicle_class:
- fouttrips.write(' <vType id="%s" vClass="%s" />\n' %
- (options.vehicle_class, options.vehicle_class))
- options.tripattrs += ' type="%s"' % options.vehicle_class
- depart = options.begin
- if trip_generator:
- while depart < options.end:
- label = "%s%s" % (options.tripprefix, idx)
- try:
- source_edge, sink_edge, intermediate = trip_generator.get_trip(
- options.min_distance, options.max_distance, options.maxtries)
- via = ""
- if len(intermediate) > 0:
- via = 'via="%s" ' % ' '.join(
- [e.getID() for e in intermediate])
- if options.pedestrians:
- fouttrips.write(
- ' <person id="%s" depart="%.2f" %s>\n' % (label, depart, options.tripattrs))
- fouttrips.write(
- ' <walk from="%s" to="%s"/>\n' % (source_edge.getID(), sink_edge.getID()))
- fouttrips.write(' </person>\n')
- else:
- fouttrips.write(' <trip id="%s" depart="%.2f" from="%s" to="%s" %s%s/>\n' % (
- label, depart, source_edge.getID(), sink_edge.getID(), via, options.tripattrs))
- except Exception, exc:
- print(exc, file=sys.stderr)
- idx += 1
- depart += options.period
- fouttrips.write("</trips>\n")
-
- if options.routefile:
- args = [DUAROUTER, '-n', options.netfile, '-t', options.tripfile, '-o', options.routefile, '--ignore-errors',
- '--begin', str(options.begin), '--end', str(options.end), '--no-step-log']
- if options.additional is not None:
- args += ['--additional-files', options.additional]
- print("calling ", " ".join(args))
- subprocess.call(args)
-
- if options.weights_outprefix:
- trip_generator.source_generator.write_weights(
- options.weights_outprefix + SOURCE_SUFFIX)
- trip_generator.sink_generator.write_weights(
- options.weights_outprefix + SINK_SUFFIX)
- trip_generator.via_generator.write_weights(
- options.weights_outprefix + VIA_SUFFIX)
-
- # return wether trips could be genreated as requested
- return trip_generator is not None
-
-if __name__ == "__main__":
- if not main(get_options()):
- sys.exit(1)
diff --git a/tools/trip/route2trips.py b/tools/trip/route2trips.py
deleted file mode 100755
index 196a303..0000000
--- a/tools/trip/route2trips.py
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/env python
-"""
- at file route2trips.py
- at author Michael Behrisch
- at author Daniel Krajzewicz
- at date 2008-03-19
- at version $Id: route2trips.py 18096 2015-03-17 09:50:59Z behrisch $
-
-This script converts SUMO routes back into SUMO trips which serve
-as input to one of the routing applications.
-It reads the routes from a file given as first parameter
-and outputs the trips to stdout.
-
-SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
-Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors
-
-This file is part of SUMO.
-SUMO is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3 of the License, or
-(at your option) any later version.
-"""
-from __future__ import print_function
-import sys
-import datetime
-
-from xml.sax import parse, handler
-
-
-class RouteReader(handler.ContentHandler):
-
- def __init__(self, attrList, outfile):
- self._vType = ''
- self._vID = ''
- self._vDepart = 0
- self._routeID = ''
- self._routeString = ''
- self._routes = {}
- self._attrList = attrList
- self._vehicleAttrs = None
- self.outfile = outfile
-
- def startElement(self, name, attrs):
- if name == 'vehicle':
- self._vehicleAttrs = dict(attrs)
- self._vID = attrs['id']
- if attrs.has_key('route'):
- self._routeString = self._routes[attrs['route']]
- del self._vehicleAttrs['route']
- elif name == 'route':
- if not self._vID:
- self._routeID = attrs['id']
- self._routeString = ''
- if attrs.has_key('edges'):
- self._routeString = attrs['edges']
- elif name == 'vType':
- # XXX does not handle child elements
- print(' <vType %s/>' % (' '.join(['%s="%s"' % (key, value) for key, value in dict(attrs).items()])),
- file=self.outfile)
- elif name == 'routes':
- print("""<?xml version="1.0"?>
-<!-- generated on %s by $Id: route2trips.py 18096 2015-03-17 09:50:59Z behrisch $ -->
-<trips>""" % datetime.datetime.now(), file=self.outfile)
-
- def endElement(self, name):
- if name == 'route':
- if not self._vID:
- self._routes[self._routeID] = self._routeString
- self._routeString = ''
- self._routeID = ''
- elif name == 'vehicle':
- edges = self._routeString.split()
- self._vehicleAttrs["from"] = edges[0]
- self._vehicleAttrs["to"] = edges[-1]
- if self._attrList:
- print(' <trip %s/>' % (' '.join(['%s="%s"' % (key, self._vehicleAttrs[key]) for key in self._attrList])),
- file=self.outfile)
- else:
- del self._vehicleAttrs['id']
- items = sorted(['%s="%s"' % (key, val)
- for key, val in self._vehicleAttrs.iteritems()])
- print(' <trip id="%s" %s/>' % (self._vID, ' '.join(items)),
- file=self.outfile)
- self._vID = ''
- self._routeString = ''
- elif name == 'routes':
- print("</trips>", file=self.outfile)
-
- def characters(self, content):
- self._routeString += content
-
-
-def main(argv, outfile=None):
- routefile = argv[0]
- attrList = argv[1:]
- if outfile is None:
- parse(routefile, RouteReader(attrList, sys.stdout))
- else:
- with open(outfile, 'w') as outf:
- parse(routefile, RouteReader(attrList, outf))
-
-
-if __name__ == "__main__":
- if len(sys.argv) < 2:
- sys.exit("Usage: " + sys.argv[0] + " <routes> [<attribute>*]")
- main(sys.argv[1:])
diff --git a/tools/xml/schemaCheck.py b/tools/xml/schemaCheck.py
index 9508e56..0f309fb 100755
--- a/tools/xml/schemaCheck.py
+++ b/tools/xml/schemaCheck.py
@@ -5,7 +5,7 @@
@author Michael Behrisch
@author Jakob Erdmann
@date 03.12.2009
- at version $Id: schemaCheck.py 18096 2015-03-17 09:50:59Z behrisch $
+ at version $Id: schemaCheck.py 18578 2015-07-15 08:21:21Z behrisch $
Checks schema for files matching certain file names using either
lxml or SAX2Count.exe depending on availability.
@@ -37,6 +37,10 @@ except ImportError:
def validate(root, f):
root = os.path.abspath(root)
try:
+ if os.path.getsize(f) < 80:
+ # this is probably a texttest place holder file
+ # it is definitely too small to contain a schema
+ return
doc = etree.parse(f)
schemaLoc = doc.getroot().get(
'{http://www.w3.org/2001/XMLSchema-instance}noNamespaceSchemaLocation')
diff --git a/tools_filelist b/tools_filelist
index 717a1d6..149cfdd 100644
Binary files a/tools_filelist and b/tools_filelist differ
diff --git a/unittest/src/Makefile.am b/unittest/src/Makefile.am
index 12275ab..bb1dba7 100644
--- a/unittest/src/Makefile.am
+++ b/unittest/src/Makefile.am
@@ -40,11 +40,11 @@ $(GUI_TESTS) \
../../src/traci-server/libtraciserver.a \
../../src/microsim/libmicrosim.a \
../../src/traci-server/TraCIServer.o \
+../../src/microsim/devices/libmicrosimdevs.a \
../../src/microsim/trigger/libmicrosimtrigger.a \
../../src/microsim/cfmodels/libmicrosimcfmodels.a \
../../src/microsim/lcmodels/libmicrosimlcmodels.a \
../../src/microsim/pedestrians/libmicrosimpeds.a \
-../../src/microsim/devices/libmicrosimdevs.a \
../../src/microsim/output/libmicrosimoutput.a \
../../src/microsim/MSMoveReminder.o \
../../src/microsim/MSRouteHandler.o \
diff --git a/unittest/src/Makefile.in b/unittest/src/Makefile.in
index dfc7915..6c87617 100644
--- a/unittest/src/Makefile.in
+++ b/unittest/src/Makefile.in
@@ -116,11 +116,11 @@ am__DEPENDENCIES_1 =
@WITH_GTEST_TRUE@ ../../src/traci-server/libtraciserver.a \
@WITH_GTEST_TRUE@ ../../src/microsim/libmicrosim.a \
@WITH_GTEST_TRUE@ ../../src/traci-server/TraCIServer.o \
+ at WITH_GTEST_TRUE@ ../../src/microsim/devices/libmicrosimdevs.a \
@WITH_GTEST_TRUE@ ../../src/microsim/trigger/libmicrosimtrigger.a \
@WITH_GTEST_TRUE@ ../../src/microsim/cfmodels/libmicrosimcfmodels.a \
@WITH_GTEST_TRUE@ ../../src/microsim/lcmodels/libmicrosimlcmodels.a \
@WITH_GTEST_TRUE@ ../../src/microsim/pedestrians/libmicrosimpeds.a \
- at WITH_GTEST_TRUE@ ../../src/microsim/devices/libmicrosimdevs.a \
@WITH_GTEST_TRUE@ ../../src/microsim/output/libmicrosimoutput.a \
@WITH_GTEST_TRUE@ ../../src/microsim/MSMoveReminder.o \
@WITH_GTEST_TRUE@ ../../src/microsim/MSRouteHandler.o \
@@ -416,11 +416,11 @@ top_srcdir = @top_srcdir@
@WITH_GTEST_TRUE at ../../src/traci-server/libtraciserver.a \
@WITH_GTEST_TRUE at ../../src/microsim/libmicrosim.a \
@WITH_GTEST_TRUE at ../../src/traci-server/TraCIServer.o \
+ at WITH_GTEST_TRUE@../../src/microsim/devices/libmicrosimdevs.a \
@WITH_GTEST_TRUE at ../../src/microsim/trigger/libmicrosimtrigger.a \
@WITH_GTEST_TRUE at ../../src/microsim/cfmodels/libmicrosimcfmodels.a \
@WITH_GTEST_TRUE at ../../src/microsim/lcmodels/libmicrosimlcmodels.a \
@WITH_GTEST_TRUE at ../../src/microsim/pedestrians/libmicrosimpeds.a \
- at WITH_GTEST_TRUE@../../src/microsim/devices/libmicrosimdevs.a \
@WITH_GTEST_TRUE at ../../src/microsim/output/libmicrosimoutput.a \
@WITH_GTEST_TRUE at ../../src/microsim/MSMoveReminder.o \
@WITH_GTEST_TRUE at ../../src/microsim/MSRouteHandler.o \
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sumo.git
More information about the debian-science-commits
mailing list