VANET Simulator
 All Classes Functions Variables
Public Member Functions | List of all members
vanetsim.map.TrafficLight Class Reference

Public Member Functions

 TrafficLight (Junction junction)
 
 TrafficLight (double redPhaseLength, double yellowPhaseLength, double greenPhaseLength, Junction junction)
 
void changePhases (int timePerStep)
 
void calculateTrafficLightPosition (Street tmpStreet)
 
double getGreenPhaseLength ()
 
void setGreenPhaseLength (double greenPhaseLength)
 
void setYellowPhaseLength (double yellowPhaseLength)
 
double getYellowPhaseLength ()
 
void setRedPhaseLength (double redPhaseLength)
 
double getRedPhaseLength ()
 
void setState (int state)
 
int getState ()
 
Street[] getStreets_ ()
 
void setStreets_ (Street[] streets_)
 

Detailed Description

This class represents a traffic light at a junction.

Constructor & Destructor Documentation

vanetsim.map.TrafficLight.TrafficLight ( Junction  junction)
inline

Constructor.

vanetsim.map.TrafficLight.TrafficLight ( double  redPhaseLength,
double  yellowPhaseLength,
double  greenPhaseLength,
Junction  junction 
)
inline

Constructor.

Member Function Documentation

void vanetsim.map.TrafficLight.calculateTrafficLightPosition ( Street  tmpStreet)
inline

Calculates Traffic light position for drawing

void vanetsim.map.TrafficLight.changePhases ( int  timePerStep)
inline

This function should change the states of the traffic lights if necessary. Should be called after the first greenphase

double vanetsim.map.TrafficLight.getGreenPhaseLength ( )
inline

Gets the length of the green phase.

Returns
the length of the green phase
double vanetsim.map.TrafficLight.getRedPhaseLength ( )
inline

Gets the length of the red phase.

Returns
the length of the red phase
int vanetsim.map.TrafficLight.getState ( )
inline
Returns
the state
Street [] vanetsim.map.TrafficLight.getStreets_ ( )
inline
Returns
the streets_
double vanetsim.map.TrafficLight.getYellowPhaseLength ( )
inline

Gets the length of the yellow phase.

Returns
the length of the yellow phase
void vanetsim.map.TrafficLight.setGreenPhaseLength ( double  greenPhaseLength)
inline

Sets the length for the green Phase.

Parameters
greenPhaseLengththe length for the green phase
void vanetsim.map.TrafficLight.setRedPhaseLength ( double  redPhaseLength)
inline

Sets the length of the red phase.

Parameters
redPhaseLengththe length of the red phase
void vanetsim.map.TrafficLight.setState ( int  state)
inline
Parameters
statethe state to set
void vanetsim.map.TrafficLight.setStreets_ ( Street[]  streets_)
inline
Parameters
streets_the streets_ to set
void vanetsim.map.TrafficLight.setYellowPhaseLength ( double  yellowPhaseLength)
inline

Sets the length of the yellow phase.

Parameters
yellowPhaseLengththe length of the yellow phase

The documentation for this class was generated from the following file: