Class TrafficSignLaneAssignment
- java.lang.Object
-
- org.eclipse.mosaic.lib.objects.trafficsign.TrafficSign<LaneAssignment>
-
- org.eclipse.mosaic.lib.objects.trafficsign.TrafficSignLaneAssignment
-
- All Implemented Interfaces:
Serializable
public class TrafficSignLaneAssignment extends TrafficSign<LaneAssignment>
Represents a traffic sign that assignsVehicleClass
es to lanes.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TrafficSignLaneAssignment(String id, Position position, String connectionId, List<LaneAssignment> laneAssignments)
Constructs aTrafficSignLaneAssignment
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAllowedVehicleClass(int lane, VehicleClass vehicleClass)
Adds aVehicleClass
to the allowed list.void
block(int lane)
Blocks the lane(s) for everyVehicleClass
.LaneAssignment
getLaneAssignment(int lane)
Gets lane assignments.List<LaneAssignment>
getLaneAssignments()
Get lane assignments of all lanes.String
getTypeId()
Returns the type of the traffic sign.void
open(int lane)
Opens the lane(s) for everyVehicleClass
.boolean
removeAllowedVehicleClass(int lane, VehicleClass vehicleClass)
Removes aVehicleClass
of the allowed list.boolean
setAllowedVehicleClasses(int lane, List<VehicleClass> vehicleClasses)
Sets the list of allowedVehicleClass
es.boolean
setAllowedVehicleClasses(List<VehicleClass> vehicleClasses)
Sets one speed limit for all lanes.TrafficSignLaneAssignment
setAngle(double angle)
Sets the angle of a traffic sign.TrafficSignLaneAssignment
setLane(int lane)
Sets the lane the sign is valid for.LaneAssignment
setLaneAssignment(int lane, List<VehicleClass> allowedVehicleClasses)
Set a new lane assignment for a specific lane.TrafficSignLaneAssignment
setVariability(boolean isVariable)
Sets whether the traffic sign is variable.TrafficSignLaneAssignment
setVisibility(double visibility)
Sets the visibility of a traffic sign.String
toString()
-
Methods inherited from class org.eclipse.mosaic.lib.objects.trafficsign.TrafficSign
getAngle, getConnectionId, getGeoPosition, getId, getLane, getPosition, getSignContents, getVisibility, isVariable
-
-
-
-
Field Detail
-
TYPE_ID
public static final String TYPE_ID
-
-
Constructor Detail
-
TrafficSignLaneAssignment
public TrafficSignLaneAssignment(String id, Position position, String connectionId, List<LaneAssignment> laneAssignments)
Constructs aTrafficSignLaneAssignment
.- Parameters:
id
- The id of the lane assignment sign.position
- The position of the sign.connectionId
- The corresponding edge.laneAssignments
- The lane assignments for all lanes.
-
-
Method Detail
-
setLane
public TrafficSignLaneAssignment setLane(int lane)
Sets the lane the sign is valid for.- Overrides:
setLane
in classTrafficSign<LaneAssignment>
- Parameters:
lane
- The lane index.
-
setVisibility
public TrafficSignLaneAssignment setVisibility(double visibility)
Sets the visibility of a traffic sign. Range: [0: not visible, 1: very good visible]- Overrides:
setVisibility
in classTrafficSign<LaneAssignment>
- Parameters:
visibility
- The visibility of the sign.
-
setAngle
public TrafficSignLaneAssignment setAngle(double angle)
Sets the angle of a traffic sign. 0.0 is north, 90.0 is east- Overrides:
setAngle
in classTrafficSign<LaneAssignment>
- Parameters:
angle
- The angle of the sign.
-
setVariability
public TrafficSignLaneAssignment setVariability(boolean isVariable)
Sets whether the traffic sign is variable.- Overrides:
setVariability
in classTrafficSign<LaneAssignment>
- Parameters:
isVariable
- Whether the sign is variable.
-
setLaneAssignment
public LaneAssignment setLaneAssignment(int lane, List<VehicleClass> allowedVehicleClasses)
Set a new lane assignment for a specific lane.- Parameters:
lane
- The lane for which the new lane assignment shall be set.allowedVehicleClasses
- List of allowed vehicle classes.
-
getLaneAssignments
public List<LaneAssignment> getLaneAssignments()
Get lane assignments of all lanes.
-
getLaneAssignment
public LaneAssignment getLaneAssignment(int lane)
Gets lane assignments.
-
setAllowedVehicleClasses
public boolean setAllowedVehicleClasses(int lane, List<VehicleClass> vehicleClasses)
Sets the list of allowedVehicleClass
es.
-
setAllowedVehicleClasses
public boolean setAllowedVehicleClasses(List<VehicleClass> vehicleClasses)
Sets one speed limit for all lanes.
-
addAllowedVehicleClass
public boolean addAllowedVehicleClass(int lane, VehicleClass vehicleClass)
Adds aVehicleClass
to the allowed list.
-
removeAllowedVehicleClass
public boolean removeAllowedVehicleClass(int lane, VehicleClass vehicleClass)
Removes aVehicleClass
of the allowed list.
-
block
public void block(int lane)
Blocks the lane(s) for everyVehicleClass
.
-
open
public void open(int lane)
Opens the lane(s) for everyVehicleClass
.
-
getTypeId
public String getTypeId()
Returns the type of the traffic sign.- Specified by:
getTypeId
in classTrafficSign<LaneAssignment>
-
toString
public String toString()
- Overrides:
toString
in classTrafficSign<LaneAssignment>
-
-