Skip to main content

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()

Metadata

Release files for trafficinterventions 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trafficinterventions 2.1.0
File Size Uploaded Provenance Actions
trafficinterventions-2.1.0.tar.gz 9.2 kB Without provenance Details for trafficinterventions-2.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for trafficinterventions 2.1.0
File Interpreter ABI Platform Actions
trafficinterventions-2.1.0-py3-none-any.whl Python 3 none any Details for trafficinterventions-2.1.0-py3-none-any.whl

Total release size: 21.8 kB

Release files / trafficinterventions-2.1.0.tar.gz

Download URL trafficinterventions-2.1.0.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
da2109f59afd3e2e6a1dcb74604e616ff98bb2ee3b1cb04c41a0912b9aa226de
BLAKE2b-256 checksum
How to use checksums
05e115a4df3154ec6c0c99df1a2730100cd4f23b1bcbcdceddebac0aa1f16374
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.10

Release files / trafficinterventions-2.1.0-py3-none-any.whl

Download URL trafficinterventions-2.1.0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45e804019d63e58dcd9c1de3a329e066b5eaea9b667b2f56e822fb2c12c64805
BLAKE2b-256 checksum
How to use checksums
198824586e8a7ae71f3308b2af42292e5816c7b951f9bcb88f681f5273ef062d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.10

Security for trafficinterventions 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page