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")
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
)
# 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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 614428d18e39d775361fd4adbc284617792177f14031cd8108a6d1c25e9bb217 |
|
MD5 | f616131b1e2042253fa682b1c6b2ce3a |
|
BLAKE2b-256 | cbb791b57316e95e5f89fe0c3fc7db1fafb14da532c02d90012b2cf57232ff00 |
Close
Hashes for trafficinterventions-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9adb1da2ff3c60af9a3fffbf55f7adc0b0be25c24ba0993dd231105ad59e8ce |
|
MD5 | 39d07a5c4f890fec621048b5627429a1 |
|
BLAKE2b-256 | c3e05e1d87fb8fca4797a9e32aefd44aab9bfd976f0a17197a5f220fedfa7999 |