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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c89cc8047d255d3b595c64ebcad613e8af255a454958d99b09c60b288fbe1bc |
|
MD5 | 8aeaa4f2e2d996dcb458d073db7536e1 |
|
BLAKE2b-256 | a62736e8a1b1856f230ad0d3fb387e187a14819380046adc69a85ace3ab14669 |
Close
Hashes for trafficinterventions-2.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0113b29700c1a51a8e40f1d20da177f9ca1bd11d165105fb48bd4cffa9dad4af |
|
MD5 | d7daa20946301fcb87f502fd49f5d3bd |
|
BLAKE2b-256 | 0bcdb41b5fa0c1a9a4c46b4873fe19fab5546b1f6c0f301419692ea468a4fcd5 |