-
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 speed camera function calls
- Loading branch information
1 parent
a351fd9
commit e998efc
Showing
4 changed files
with
70 additions
and
30 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
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,31 @@ | ||
import trafficinterventions | ||
|
||
""" | ||
Note: If you wish to not rewrite the XML file, please add another parameter to the functions. | ||
""" | ||
|
||
""" | ||
Change Edges Functionality | ||
""" | ||
|
||
# Instantiating an object of the XML Parser for Lane Modification | ||
fileName = "sample.xml" # Change the path of your file accordingly. | ||
ce = trafficinterventions.ChangeEdges.ChangeEdges(fileName=fileName) | ||
|
||
# Get Root Tag | ||
print(ce.getRootElementTag()) | ||
|
||
# Get Unique Parent Tags | ||
print(ce.getUniqueParentTags()) | ||
|
||
# Get the first 10 Lane Type IDs | ||
print(ce.getUniqueEdgeIDs()[:10]) | ||
|
||
# Get Edge Inforation | ||
ce.getEdgeInformation(["-734354815#0"]) | ||
|
||
# # Selectively disallow vehicle types from edge | ||
ce.disallowAppendTypes(["truck", "bus"], ["-734354815#0"], None) | ||
|
||
# Selectively allow vehicle types from edge | ||
ce.allowAppendTypes(["e-scooter"], ["-777797681"], None) |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import trafficinterventions | ||
|
||
# Initialiasing the object | ||
sc = trafficinterventions.SpeedCamera.SpeedCamera( | ||
maxTimeSteps= 1000, # Number of simulation steps | ||
nearestNeighbourDisallow= 250.0, # Specifies how far detection points should be away from each other | ||
gridArray=[-10000,10000,10000,-10000], # Grid of interest : [left, right, up, down] | ||
pathCFG="map.sumocfg", # Input file path | ||
outPath="Outputs/", # Output file path (for screenshots) | ||
summaryFilePath="summary.txt", # File which contains the appropriate positions - populated after the simulation | ||
numLocs=5 # Number of locations you wish to retrieve | ||
) | ||
|
||
# Run the simulation and get outputs | ||
sc.runSimulation() |