Python Package to perform simple Traffic Interventions and run traffic simulations.
Project description
Traffic-Interventions
Installation
python -m pip install --upgrade pip
pip install --upgrade trafficinterventions
Documentation
All relevant files can be found here
Interventions
Sample Usage : Edge Manipulation
import trafficinterventions
ce = trafficinterventions.ChangeEdges.ChangeEdges(fileName="sample.xml")
# Sample Intervention
ce.disallowAppendTypes(["bus"], ["-100"], "new_file.xml")
Sample Usage : Lane Manipulation
import trafficinterventions
cl = trafficinterventions.ChangeLanes.ChangeLanes(fileName="sample.xml")
# Sample Intervention
ce.changePriorityLanes(["highway.cycleway"], 100, "new_file.xml")
Sample Usage : Trip Manipulation
import trafficinterventions
ct = trafficinterventions.ChangeTrips.ChangeTrips(fileName="sample.xml")
# Sample Intervention
ct.changeTripStartTime([3], 1.00, "new_file.xml")
Simulations
Sample Usage: Speed Camera Placement
import trafficinterventions
sc = trafficinterventions.SpeedCamera.SpeedCamera(
maxTimeSteps= 1000,
nearestNeighbourDisallow= 250.0,
gridArray=[-10000,10000,10000,-10000],
pathCFG="map.sumocfg",
outPath="Outputs/",
summaryFilePath="summary.txt",
numLocs=5,
colour=(255,0,0)
)
# Run the simulation and get outputs
sc.runSimulation()
Sample Usage: Stressed Junctions Detection
import trafficinterventions
sj = trafficinterventions.StressJunction.StressJunction(
weightsArray=[1,1,1,1,1],
pathCFG="map.sumocfg",
outPath="Outputs/",
pathNET="osm.net.xml",
pathSummaryFile="stressed_junctions.txt",
numLocs = 5,
initialPoiLocation = (5064.74,3568.48)
)
# Run the simulation and get outputs
sj.runSimulation()
Sample Usage: Polluted Junctions Detection
import trafficinterventions
ej = trafficinterventions.EmissionJunction.EmissionJunction(
pathCFG="map.sumocfg",
outPath="Outputs/",
pathNET="osm.net.xml",
pathSummaryFile="polluted_junctions.txt",
numLocs = 5,
initialPoiLocation = (5064.74,3568.48)
)
# Run the simulation and get outputs
ej.runSimulation()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for trafficinterventions-2.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | da2109f59afd3e2e6a1dcb74604e616ff98bb2ee3b1cb04c41a0912b9aa226de |
|
MD5 | b8cb95892c29bd21fb8a5731b247b22c |
|
BLAKE2b-256 | 05e115a4df3154ec6c0c99df1a2730100cd4f23b1bcbcdceddebac0aa1f16374 |
Close
Hashes for trafficinterventions-2.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45e804019d63e58dcd9c1de3a329e066b5eaea9b667b2f56e822fb2c12c64805 |
|
MD5 | 695a5a8655f6b803d2fb73c925847d18 |
|
BLAKE2b-256 | 198824586e8a7ae71f3308b2af42292e5816c7b951f9bcb88f681f5273ef062d |