Package com.anylogic.engine.markup
- java.lang.Object
- com.anylogic.engine.markup.RoadLanesConnector
- All Implemented Interfaces:
ISignalable
,Serializable
public class RoadLanesConnector extends Object implements Serializable, ISignalable
Road lanes connector inside an intersection. Connects one lane of road incoming to the intersection with one lane of
the outgoing road.
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
Constructor | Description |
---|---|
RoadLanesConnector | |
RoadLanesConnector | |
RoadLanesConnector |
Modifier and Type | Method | Description |
---|---|---|
int | countCars() |
Returns total number of cars passed through the connector
|
Road | getEndRoad() |
Returns the road this connector ends at
|
int | getEndRoadLane() |
Returns the lane number on the road this connector ends at
|
List<MarkupSegment> | getGuideLine() |
Returns the guide line, in the form of segments list
|
TrafficLightSignal | getSignal() |
Returns current signal of road lanes connector
|
Road | getStartRoad() |
Returns the road this connector starts at
|
int | getStartRoadLane() |
Returns the lane number on the road this connector starts at
|
void | registerListener |
Allows to register a CarSettings instance as a listener of signal change events
|
void | resetStats() |
Resets total cars counter
|
void | setDataSource | |
void | setSignal |
Changes the current signal.
|
String | toString() | |
int | traffic() |
Returns the traffic of car flow through the connector, measured in cars per hour.
|
public RoadLanesConnector(Road startRoad, int startRoadLane, Road endRoad, int endRoadLane)
public RoadLanesConnector(Road startRoad, int startRoadLane, Road endRoad, int endRoadLane, MarkupSegment... guideLine)
public RoadLanesConnector(Road startRoad, int startRoadLane, Road endRoad, int endRoadLane, List<MarkupSegment> guideLine)
public Road getStartRoad()
Returns the road this connector starts at
- Returns:
- the reference to road this connector starts at
public int getStartRoadLane()
Returns the lane number on the road this connector starts at
- Returns:
- lane number, where 0 is lane at the road side
public Road getEndRoad()
Returns the road this connector ends at
- Returns:
- the reference to road this connector ends at
public int getEndRoadLane()
Returns the lane number on the road this connector ends at
- Returns:
- lane number, where 0 is lane at the road side
public List<MarkupSegment> getGuideLine()
Returns the guide line, in the form of segments list
- Returns:
- list of segments
public void setSignal(TrafficLightSignal signal)
Changes the current signal. Use when road lanes connector isn't controlled by traffic light.
- Specified by:
setSignal
in interfaceISignalable
- Parameters:
signal
- New signal
public TrafficLightSignal getSignal()
Returns current signal of road lanes connector
- Specified by:
getSignal
in interfaceISignalable
- Returns:
- Current signal of road lanes connector
public int traffic()
Returns the traffic of car flow through the connector, measured in cars per hour.
Note: the value calculated for last five-minute interval
Note: the value calculated for last five-minute interval
- Returns:
- the traffic from one specified road to another specified road, cars per hour
public int countCars()
Returns total number of cars passed through the connector
- Returns:
- total number of cars passed through the connector
- See Also:
public void resetStats()
Resets total cars counter
- See Also:
-
countCars()
@AnyLogicInternalAPI public void setDataSource(RoadLaneConnectorDataSource dataSource)
@AnyLogicInternalAPI public void registerListener(SignalChangeListener stateChangeListener)
Allows to register a CarSettings instance as a listener of signal change events
- Specified by:
registerListener
in interfaceISignalable
- Parameters:
listener
- Add instance of SignalChangeListener interface that will listen to the event.
public String toString()