Class TrafficSign<T>

java.lang.Object
org.eclipse.mosaic.lib.objects.trafficsign.TrafficSign<T>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
TrafficSignLaneAssignment, TrafficSignSpeed

public abstract class TrafficSign<T> extends Object implements Serializable
The basics of any traffic sign.
See Also:
  • Constructor Details

    • TrafficSign

      public TrafficSign(String id, Position position, String connectionId)
      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

      public List<T> 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

      public TrafficSign setLane(int lane)
      Sets the lane the traffic sign is valid for. -1 means traffic sign is valid for all lanes.
      Parameters:
      lane - The lane index.
    • setVisibility

      public TrafficSign setVisibility(double visibility)
      Sets the visibility of the traffic sign (0-1).
      Parameters:
      visibility - The visibility of the sign.
    • setAngle

      public TrafficSign setAngle(double angle)
      Sets the angle of the traffic sign. 0.0 is north, 90.0 is east
      Parameters:
      angle - The angle of the sign.
    • setVariability

      public TrafficSign setVariability(boolean isVariable)
      Sets whether the variability of the traffic sign.
      Parameters:
      isVariable - Whether the sign is variable.
    • getId

      public String getId()
      Returns the id of the traffic sign.
    • getPosition

      public CartesianPoint getPosition()
      Returns the positions of the traffic sign.
      Returns:
      the positions of the traffic sign
    • getGeoPosition

      public GeoPoint 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

      public String getConnectionId()
      Returns the edge of the traffic sign.
    • isVariable

      public boolean isVariable()
      Tells whether the traffic sign is variable.
    • getTypeId

      public abstract String getTypeId()
      Returns the type of the traffic sign.
    • toString

      public String toString()
      Overrides:
      toString in class Object