Class TrafficSign<T>
java.lang.Object
org.eclipse.mosaic.lib.objects.trafficsign.TrafficSign<T>
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
TrafficSignLaneAssignment
,TrafficSignSpeed
The basics of any traffic sign.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTrafficSign
(String id, Position position, String connectionId) Creates a traffic sign with the minimum values: position and edge id. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getAngle()
Returns the angle of the traffic sign.Returns the edge of the traffic sign.Returns the geographic position of the traffic sign.getId()
Returns the id of the traffic sign.int
getLane()
Returns the lane of the traffic sign.Returns the positions of the traffic sign.Returns the contents of the sign.abstract String
Returns the type of the traffic sign.double
Returns the visibility of the traffic sign between 0 and 1.boolean
Tells whether the traffic sign is variable.setAngle
(double angle) Sets the angle of the traffic sign.setLane
(int lane) Sets the lane the traffic sign is valid for.setVariability
(boolean isVariable) Sets whether the variability of the traffic sign.setVisibility
(double visibility) Sets the visibility of the traffic sign (0-1).toString()
-
Constructor Details
-
TrafficSign
Creates a traffic sign with the minimum values: position and edge id.- Parameters:
id
- The traffic sign id.position
- The position of the sign.connectionId
- The corresponding edge of the sign.
-
-
Method Details
-
getSignContents
Returns the contents of the sign. Needs to be public, because it is accessed by the FileVisualizer using reflection.- Returns:
- a collection of contents of the sign
-
setLane
Sets the lane the traffic sign is valid for. -1 means traffic sign is valid for all lanes.- Parameters:
lane
- The lane index.
-
setVisibility
Sets the visibility of the traffic sign (0-1).- Parameters:
visibility
- The visibility of the sign.
-
setAngle
Sets the angle of the traffic sign. 0.0 is north, 90.0 is east- Parameters:
angle
- The angle of the sign.
-
setVariability
Sets whether the variability of the traffic sign.- Parameters:
isVariable
- Whether the sign is variable.
-
getId
Returns the id of the traffic sign. -
getPosition
Returns the positions of the traffic sign.- Returns:
- the positions of the traffic sign
-
getGeoPosition
Returns the geographic position of the traffic sign.- Returns:
- the geographic position of the traffic sign
-
getVisibility
public double getVisibility()Returns the visibility of the traffic sign between 0 and 1. 0 is not visible. 1 is very good visible. -
getAngle
public double getAngle()Returns the angle of the traffic sign. 0.0 is north, 90.0 is east -
getLane
public int getLane()Returns the lane of the traffic sign. -1 means the traffic sign is valid for every lane of the edge. -
getConnectionId
Returns the edge of the traffic sign. -
isVariable
public boolean isVariable()Tells whether the traffic sign is variable. -
getTypeId
Returns the type of the traffic sign. -
toString
-