Skip to main content

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trafficinterventions-1.0.3.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

trafficinterventions-1.0.3-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file trafficinterventions-1.0.3.tar.gz.

File metadata

  • Download URL: trafficinterventions-1.0.3.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for trafficinterventions-1.0.3.tar.gz
Algorithm Hash digest
SHA256 1d9b045afcf171fef5a92f436608835e232973b3772ea8ea4d930fa239a11bc8
MD5 536934210dc52757711c1fb8ae2da653
BLAKE2b-256 3903ff0dc92c2f9de0b45ae86b5c201de9c20d8c8f76ddd740faebd08d366213

See more details on using hashes here.

File details

Details for the file trafficinterventions-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for trafficinterventions-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d6e2cf04b59156affce4afa3ccba5f083132dddee6ef0b77943c6cd679446a36
MD5 b03a06e9281165e667f7d2d61b843c36
BLAKE2b-256 47a4e0e5037eb2b891ca57caa7c0dff445139f55eb147667d76f9c5a50f94bc0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page