Package com.anylogic.engine.markup
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.markup.AbstractDrawableMarkupAggregator
- Methods inherited from class com.anylogic.engine.markup.AbstractMarkupAggregator
- Methods inherited from class java.lang.Object
- Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement
- Constructor Details
- Method Details
- addAll
- add
- add
- add
- add
- add
- add
- getRoads
- getStopLines
- getIntersections
- getParkingLots
- getBusStops
- getTrafficLights
- getDrivingDirection
- setDrivingDirection
- getLaneWidth
- getLaneWidth
- setLaneWidth
- setLaneWidth
- setRoadBackgroundColor
- setRoadBackgroundColor
- getRoadBackgroundColor
- getRoadBackgroundTexture
- setLanesDelimitingLineColor
- setLanesDelimitingLineColor
- getLanesDelimitingLineColor
- getLanesDelimitingLineTexture
- setLanesDelimitingLineStyle
- getLanesDelimitingLineStyle
- setDirectionsDelimitingLineColor
- setDirectionsDelimitingLineColor
- getDirectionsDelimitingLineColor
- getDirectionsDelimitingLineTexture
- setDirectionsDelimitingLineStyle
- getDirectionsDelimitingLineStyle
- isSignalStateAnimationVisible
- setSignalStateAnimationVisible
- elementsInternal
- setDebugInfoVisible
- getLevel
- getDrawMode
- setLevel
- java.lang.Object
- com.anylogic.engine.markup.AbstractMarkupAggregator<Agent>
- com.anylogic.engine.markup.AbstractDrawableMarkupAggregator
- com.anylogic.engine.markup.RoadNetwork
- All Implemented Interfaces:
AggregatableAnimationElement
,HasLevel
,LevelElement
,LevelMarkup
,Serializable
public class RoadNetwork extends AbstractDrawableMarkupAggregator implements LevelMarkup, AggregatableAnimationElement
CarNetwork
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
Constructor | Description |
---|---|
RoadNetwork |
Creates empty RoadNetwork with all parameters set by default.
|
RoadNetwork |
Creates RoadNetwork but doesn't initialize it
|
RoadNetwork |
Creates RoadNetwork and initializes it
|
Modifier and Type | Method | Description |
---|---|---|
void | add |
Adds a specified bus stop to the network.
|
void | add |
Adds a specified intersection to the network.
|
void | add |
Adds a specified parking lot to the network.
|
void | add |
Adds a specified road to the network.
|
void | add |
Adds a specified StopLine to the network.
|
void | add |
Adds a specified traffic light to the network.
|
void | addAll |
Adds all arguments to the network
|
Stream<? extends AbstractRoadMarkup> | elementsInternal() |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
List<BusStop> | getBusStops() |
Returns all bus stops contained in this RoadNetwork
|
Color | getDirectionsDelimitingLineColor() |
Returns the color of the directions delimiting line color, or
null if directions delimiting line color has no
color or has textured (in this case #getFillTexture() should be used instead) |
RoadLineStyle | getDirectionsDelimitingLineStyle() |
Returns style of the directions delimiting line
|
Texture | getDirectionsDelimitingLineTexture() |
Returns the texture of the directions delimiting line color, if the directions delimiting line color has texture
|
ShapeDrawMode | getDrawMode() |
Returns the drawing mode of the shape (where to draw this shape: 2D, 3D or 2D+3D).
If the shape has been created with no-argument constructor, and has no specific limitations (like 2D-only), and drawing mode hasn't yet been set, then it is initialized to default (2D + 3D). |
RoadDrivingDirection | getDrivingDirection() |
Returns driving direction
|
List<Intersection> | getIntersections() |
Returns all intersections and lane mergings contained in this RoadNetwork
|
Color | getLanesDelimitingLineColor() |
Returns the color of the road lanes delimiting line color, or
null if road lanes delimiting line color has no
color or has textured (in this case #getFillTexture() should be used instead) |
RoadLineStyle | getLanesDelimitingLineStyle() |
Returns style of the road lanes delimiting line
|
Texture | getLanesDelimitingLineTexture() |
Returns the texture of the road lanes delimiting line color, if the road lanes delimiting line color has texture
|
double | getLaneWidth() |
Returns lane width
|
double | getLaneWidth |
Returns lane width
|
Level | getLevel() |
Returns level associated with this space markup element or
null
if this element has no level |
List<ParkingLot> | getParkingLots() |
Returns all parking lots contained in this RoadNetwork
|
Color | getRoadBackgroundColor() |
Returns the road background color, or
null if road has no
background color or has texture (in this case #getFillTexture() should be used instead) |
Texture | getRoadBackgroundTexture() |
Returns the texture of the road background, if the road has background texture
|
List<Road> | getRoads() |
Returns all roads contained in this RoadNetwork
|
List<StopLine> | getStopLines() |
Returns all stop lines contained in this RoadNetwork
|
List<TrafficLight<?>> | getTrafficLights() |
Returns all Traffic Lights contained in this RoadNetwork
|
boolean | isSignalStateAnimationVisible() |
Returns
true if configured to animate signal states of stop lines and lane connectors |
void | setDebugInfoVisible |
Deprecated.
TODO remove in release
|
void | setDirectionsDelimitingLineColor |
Sets the color of the directions delimiting line.
|
void | setDirectionsDelimitingLineColor |
Sets the color (or
Texture ) of the directions delimiting line. |
void | setDirectionsDelimitingLineStyle |
Sets style of the directions delimiting line
|
void | setDrivingDirection |
Sets driving direction
|
void | setLanesDelimitingLineColor |
Sets the color of the road lanes delimiting line color.
|
void | setLanesDelimitingLineColor |
Sets the color (or
Texture ) of the road lanes delimiting line color. |
void | setLanesDelimitingLineStyle |
Sets style of the road lanes delimiting line
|
void | setLaneWidth |
Sets lane width
|
void | setLaneWidth |
Sets lane width
|
void | setLevel | |
void | setRoadBackgroundColor |
Sets the color of the road background color.
|
void | setRoadBackgroundColor |
Sets the background color (or
Texture ) of the road. |
void | setSignalStateAnimationVisible |
Sets debug animation visibility.
|
public RoadNetwork(Agent owner, String name, ShapeDrawMode drawMode)
Creates empty RoadNetwork with all parameters set by default.
public RoadNetwork(Agent owner, String name, ShapeDrawMode drawMode, boolean isPublic, boolean visible, RoadDrivingDirection drivingDirection, double laneWidthInMeters, Paint roadBackgroundColor, Paint lanesDelimitingLineColor, RoadLineStyle lanesDelimitingLineStyle, Paint directionsDelimitingLineColor, RoadLineStyle directionsDelimitingLineStyle, boolean isSignalStateAnimationVisible)
Creates RoadNetwork but doesn't initialize it
- Parameters:
drivingDirection
- driving direction, one of the following constants: RIGHT_HAND or LEFT_HANDlaneWidthInMeters
- lane width, measured in metersroadBackgroundColor
- road background colorlanesDelimitingLineColor
- lanes delimiting line colorlanesDelimitingLineStyle
- line style, one of RoadConstants.RoadLineStyle constantsdirectionsDelimitingLineColor
- directions delimiting line colordirectionsDelimitingLineStyle
- line style, one of RoadConstants.RoadLineStyle constantsisSignalStateAnimationVisible
- animate signal states of stop lines and lane connectors
public RoadNetwork(Agent owner, String name, ShapeDrawMode drawMode, boolean isPublic, boolean visible, RoadDrivingDirection drivingDirection, double laneWidthInMeters, Paint roadBackgroundColor, Paint lanesDelimitingLineColor, RoadLineStyle lanesDelimitingLineStyle, Paint directionsDelimitingLineColor, RoadLineStyle directionsDelimitingLineStyle, boolean isSignalStateAnimationVisible, TrafficLight<?>[] trafficLights, AbstractRoadMarkup... markupElements)
Creates RoadNetwork and initializes it
- Parameters:
drivingDirection
- driving direction, one of the following constants: RIGHT_HAND or LEFT_HANDlaneWidthInMeters
- lane width, measured in metersroadBackgroundColor
- road background colorlanesDelimitingLineColor
- lanes delimiting line colorlanesDelimitingLineStyle
- line style, one of RoadConstants.RoadLineStyle constantsdirectionsDelimitingLineColor
- directions delimiting line colordirectionsDelimitingLineStyle
- line style, one of RoadConstants.RoadLineStyle constantsisSignalStateAnimationVisible
- animate signal states of stop lines and lane connectorsmarkupElements
- array of markup elements
public void addAll(AbstractRoadMarkup... contents)
Adds all arguments to the network
- Parameters:
contents
- - an instance of any of the following classes:Road
,Intersection
,StopLine
,ParkingLot
,BusStop
public void add(Road element)
Adds a specified road to the network.
The network should be uninitialized
- Parameters:
element
- element to be added
public void add(Intersection element)
Adds a specified intersection to the network.
The network should be uninitialized
- Parameters:
element
- element to be added
public void add(StopLine element)
Adds a specified StopLine to the network.
The network should be uninitialized
- Parameters:
element
- element to be added
public void add(ParkingLot element)
Adds a specified parking lot to the network.
The network should be uninitialized
- Parameters:
element
- element to be added
public void add(BusStop element)
Adds a specified bus stop to the network.
The network should be uninitialized
- Parameters:
element
- element to be added
public void add(TrafficLight<?> element)
Adds a specified traffic light to the network.
The network should be uninitialized
- Parameters:
element
- element to be added
public List<Road> getRoads()
Returns all roads contained in this RoadNetwork
- Returns:
- unmodifiable list of roads
public List<StopLine> getStopLines()
Returns all stop lines contained in this RoadNetwork
- Returns:
- unmodifiable list of stop lines (positions on roads)
public List<Intersection> getIntersections()
Returns all intersections and lane mergings contained in this RoadNetwork
- Returns:
- unmodifiable list of Intersection elements
public List<ParkingLot> getParkingLots()
Returns all parking lots contained in this RoadNetwork
- Returns:
- unmodifiable list of parking lots
public List<BusStop> getBusStops()
Returns all bus stops contained in this RoadNetwork
- Returns:
- unmodifiable list of bus stops
public List<TrafficLight<?>> getTrafficLights()
Returns all Traffic Lights contained in this RoadNetwork
- Returns:
- unmodifiable list of Traffic Lights contained in this RoadNetwork
public RoadDrivingDirection getDrivingDirection()
Returns driving direction
- Returns:
- driving direction,
RoadConstants.DrivingDirection.RIGHT_HAND
orRoadConstants.DrivingDirection.LEFT_HAND
public void setDrivingDirection(RoadDrivingDirection drivingDirection)
Sets driving direction
- Parameters:
drivingDirection
- driving direction,RoadConstants.DrivingDirection.RIGHT_HAND
orRoadConstants.DrivingDirection.LEFT_HAND
public double getLaneWidth()
Returns lane width
- Returns:
- lane width, measured in pixels
public double getLaneWidth(LengthUnits units)
Returns lane width
- Parameters:
units
- length units- Returns:
- lane width, measured in the given units
public void setLaneWidth(double laneWidthInPixels)
Sets lane width
- Parameters:
laneWidthInPixels
- lane width, measured in pixels
public void setLaneWidth(double laneWidth, LengthUnits units)
Sets lane width
- Parameters:
laneWidth
- lane width, measured in the given unitsunits
- length units
public void setRoadBackgroundColor(Color roadBackgroundColor)
Sets the color of the road background color.
- Parameters:
color
- the new color, null = do not draw the road background color
public void setRoadBackgroundColor(Paint roadBackgroundColor)
Sets the background color (or
Texture
) of the road.- Parameters:
color
- the new color,null
= do not draw the road background
public Color getRoadBackgroundColor()
Returns the road background color, or
null
if road has no
background color or has texture (in this case #getFillTexture()
should be used instead)- Returns:
- the road background color
public Texture getRoadBackgroundTexture()
Returns the texture of the road background, if the road has background texture
- Returns:
- the texture of the road background
public void setLanesDelimitingLineColor(Color lanesDelimitingLineColor)
Sets the color of the road lanes delimiting line color.
- Parameters:
color
- the new color, null = do not draw the road lanes delimiting line color
public void setLanesDelimitingLineColor(Paint lanesDelimitingLineColor)
Sets the color (or
Texture
) of the road lanes delimiting line color.- Parameters:
color
- the new color, null = do not draw the road lanes delimiting line color
public Color getLanesDelimitingLineColor()
Returns the color of the road lanes delimiting line color, or
null
if road lanes delimiting line color has no
color or has textured (in this case #getFillTexture()
should be used instead)- Returns:
- the color of the road lanes delimiting line color
public Texture getLanesDelimitingLineTexture()
Returns the texture of the road lanes delimiting line color, if the road lanes delimiting line color has texture
- Returns:
- the texture of the road lanes delimiting line color
public void setLanesDelimitingLineStyle(RoadLineStyle lanesDelimitingLineStyle)
Sets style of the road lanes delimiting line
- Parameters:
lanesDelimitingLineStyle
- line style, one of RoadConstants.RoadLineStyle constants
public RoadLineStyle getLanesDelimitingLineStyle()
Returns style of the road lanes delimiting line
- Returns:
- line style, one of RoadConstants.RoadLineStyle constants
public void setDirectionsDelimitingLineColor(Color directionsDelimitingLineColor)
Sets the color of the directions delimiting line.
- Parameters:
color
- the new color,null
= do not draw the directions delimiting line
public void setDirectionsDelimitingLineColor(Paint directionsDelimitingLineColor)
Sets the color (or
Texture
) of the directions delimiting line.- Parameters:
color
- the new color or texture,null
= do not draw the directions delimiting line
public Color getDirectionsDelimitingLineColor()
Returns the color of the directions delimiting line color, or
null
if directions delimiting line color has no
color or has textured (in this case #getFillTexture()
should be used instead)- Returns:
- the color of the directions delimiting line color
public Texture getDirectionsDelimitingLineTexture()
Returns the texture of the directions delimiting line color, if the directions delimiting line color has texture
- Returns:
- the texture of the directions delimiting line color
public void setDirectionsDelimitingLineStyle(RoadLineStyle directionsDelimitingLineStyle)
Sets style of the directions delimiting line
- Parameters:
directionsDelimitingLineStyle
- line style, one of RoadConstants.RoadLineStyle constants
public RoadLineStyle getDirectionsDelimitingLineStyle()
Returns style of the directions delimiting line
- Returns:
- line style, one of RoadConstants.RoadLineStyle constants
public boolean isSignalStateAnimationVisible()
Returns
true
if configured to animate signal states of stop lines and lane connectorspublic void setSignalStateAnimationVisible(boolean visible)
Sets debug animation visibility.
- Parameters:
visible
- to animate (true
) or not (false
) signal states of stop lines and lane connectors
@AnyLogicInternalAPI public Stream<? extends AbstractRoadMarkup> elementsInternal()
Description copied from class:
AbstractMarkupAggregator
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
it may be removed/renamed in future.
- Specified by:
elementsInternal
in classAbstractMarkupAggregator<Agent>
@Deprecated public void setDebugInfoVisible(boolean debugInfoVisible)
Deprecated.
TODO remove in release
public Level getLevel()
Description copied from interface:
HasLevel
Returns level associated with this space markup element or
null
if this element has no levelpublic ShapeDrawMode getDrawMode()
Description copied from class:
AbstractDrawableMarkupAggregator
Returns the drawing mode of the shape (where to draw this shape: 2D, 3D or 2D+3D).
If the shape has been created with no-argument constructor, and has no specific limitations (like 2D-only), and drawing mode hasn't yet been set, then it is initialized to default (2D + 3D).
If the shape has been created with no-argument constructor, and has no specific limitations (like 2D-only), and drawing mode hasn't yet been set, then it is initialized to default (2D + 3D).
- Overrides:
getDrawMode
in classAbstractDrawableMarkupAggregator
@AnyLogicInternalAPI public void setLevel(Level level)
- Specified by:
setLevel
in interfaceLevelElement