public class TrafficSignalPhase extends Object
Constructor and Description |
---|
TrafficSignalPhase(GridMap map,
List<String> strs)
Construct a traffic signal phases.
|
Modifier and Type | Method and Description |
---|---|
ApproxNPhasesTrafficSignalRequestHandler.CyclicSignalController |
calcCyclicSignalController(Road road)
Generate a signal controller for a road.
|
List<Road> |
getActiveRoads(int phaseId)
Get the list of the names of the roads that are active in the phase.
|
double |
getGreenDurations(int phaseId)
Get the duration of the green signals.
|
int |
getPhaseNum()
Get the number of phases.
|
double |
getRedDurations(int phaseId)
Get the duration of the red signals.
|
double |
getYellowDurations(int phaseId)
Get the duration of the yellow signals.
|
static TrafficSignalPhase |
makeFromFile(GridMap map,
String csvFileName)
Create a new traffic signal phase object from file
|
String |
toString()
Get a string description of the signal phases.
|
public static TrafficSignalPhase makeFromFile(GridMap map, String csvFileName)
map
- the mapcsvFileName
- the file name of the CSV filepublic int getPhaseNum()
public List<Road> getActiveRoads(int phaseId)
phaseId
- the phase IDpublic double getGreenDurations(int phaseId)
phaseId
- the phase IDpublic double getYellowDurations(int phaseId)
phaseId
- the phase IDpublic double getRedDurations(int phaseId)
phaseId
- the phase IDpublic ApproxNPhasesTrafficSignalRequestHandler.CyclicSignalController calcCyclicSignalController(Road road)
road
- the roadCopyright © 2013. All rights reserved.