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
)
# Run the simulation and get outputs
sc.runSimulation()
Sample Usage: Stressed Junctions Detection
import trafficinterventions
sj = trafficinterventions.StressJunction.StressJunction(
maxTimeSteps=1000,
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(
maxTimeSteps=1000,
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.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8529da753cff57d83c415c66f3a6243c3256e05c740af063111ef788fd64d0c2 |
|
MD5 | 919a00485e399c103968cb5ffeed8875 |
|
BLAKE2b-256 | bc3ee219a1af45a328507ffbc4f5d966b67de4695471041efe1dd595f48fdd95 |
Close
Hashes for trafficinterventions-2.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b3c45809bb2dab0f3f1a7927bb5c41fb9e0ee8ff175b85be74c7bb9c1f5cff1 |
|
MD5 | d4c452770fa4b7d7fd6088c016fc9d36 |
|
BLAKE2b-256 | 9f95642d5fad9747f7d4d2a47a58ab7b44bc8ad64b389d56b897254d4629d4fd |