-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: added documentation for stress detection module, bugfix: depend…
…ency issue
- Loading branch information
1 parent
4193754
commit 18a6827
Showing
10 changed files
with
84 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import trafficinterventions | ||
|
||
# Initialiasing the object | ||
sj = trafficinterventions.StressJunction.StressJunction( | ||
maxTimeSteps=1000, # Number of time steps, could be overridden by the system | ||
weightsArray=[1,1,1,1,1], # Weights for the parameters - in the order of [haltingNumber, CO2Emissions, StepOccupancy, vehicleLength, waitingTime] | ||
pathCFG="map.sumocfg", # .sumocfg file path | ||
outPath="Outputs/", # Output path for screenshots | ||
pathNET="osm.net.xml", # .net.xml file path | ||
pathSummaryFile="stressed_junctions.txt", # File path for summary of the simulation | ||
numLocs = 5 # Number of stressed junctions to be printed | ||
) | ||
|
||
# Run the simulation and get outputs | ||
sj.runSimulation() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=42", | ||
"wheel" | ||
"wheel", | ||
"numpy", | ||
"traci", | ||
"sumolib", | ||
"pandas" | ||
] | ||
build-backend = "setuptools.build_meta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
[metadata] | ||
name = trafficinterventions | ||
version = 1.0.1 | ||
version = 1.0.3 | ||
author = WSL, IIITB | ||
author_email = [email protected] | ||
description = Python Package to perform simple Traffic Interventions. | ||
description = Python Package to perform simple Traffic Interventions and run traffic simulations. | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
url = https://github.com/WSL-IIITB/Traffic-Interventions | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Metadata-Version: 2.1 | ||
Name: trafficinterventions | ||
Version: 1.0.1 | ||
Summary: Python Package to perform simple Traffic Interventions. | ||
Version: 1.0.3 | ||
Summary: Python Package to perform simple Traffic Interventions and run traffic simulations. | ||
Home-page: https://github.com/WSL-IIITB/Traffic-Interventions | ||
Author: WSL, IIITB | ||
Author-email: [email protected] | ||
|
@@ -19,14 +19,16 @@ License-File: LICENSE | |
|
||
## Installation | ||
- `python -m pip install --upgrade pip` | ||
- `pip install trafficinterventions xml` | ||
- `pip install --upgrade trafficinterventions` | ||
|
||
--- | ||
## Documentation | ||
All relevant files can be found [here](https://github.com/WSL-IIITB/Traffic-Interventions/tree/main/docs) | ||
|
||
--- | ||
|
||
## Interventions | ||
|
||
### Sample Usage : Edge Manipulation | ||
```py | ||
import trafficinterventions | ||
|
@@ -49,5 +51,41 @@ cl = trafficinterventions.ChangeLanes.ChangeLanes(fileName="sample.xml") | |
ce.changePriorityLanes(["highway.cycleway"], 100, "new_file.xml") | ||
|
||
``` | ||
## Simulations | ||
|
||
### Sample Usage: Speed Camera Placement | ||
```py | ||
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 | ||
```py | ||
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() | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from . import ChangeEdges | ||
from . import ChangeLanes | ||
from . import SpeedCamera | ||
from . import SpeedCamera | ||
from . import StressJunction |