Class TrafficSignLaneAssignment
java.lang.Object
org.eclipse.mosaic.lib.objects.trafficsign.TrafficSign<LaneAssignment>
org.eclipse.mosaic.lib.objects.trafficsign.TrafficSignLaneAssignment
- All Implemented Interfaces:
Serializable
Represents a traffic sign that assigns
VehicleClass
es to lanes.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTrafficSignLaneAssignment
(String id, Position position, String connectionId, List<LaneAssignment> laneAssignments) Constructs aTrafficSignLaneAssignment
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addAllowedVehicleClass
(int lane, VehicleClass vehicleClass) Adds aVehicleClass
to the allowed list.void
block
(int lane) Blocks the lane(s) for everyVehicleClass
.getLaneAssignment
(int lane) Gets lane assignments.Get lane assignments of all lanes.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.setAngle
(double angle) Sets the angle of a traffic sign.setLane
(int lane) Sets the lane the sign is valid for.setLaneAssignment
(int lane, List<VehicleClass> allowedVehicleClasses) Set a new lane assignment for a specific lane.setVariability
(boolean isVariable) Sets whether the traffic sign is variable.setVisibility
(double visibility) Sets the visibility of a traffic sign.toString()
Methods inherited from class org.eclipse.mosaic.lib.objects.trafficsign.TrafficSign
getAngle, getConnectionId, getGeoPosition, getId, getLane, getPosition, getSignContents, getVisibility, isVariable
-
Field Details
-
TYPE_ID
-
-
Constructor Details
-
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 Details
-
setLane
Sets the lane the sign is valid for.- Overrides:
setLane
in classTrafficSign<LaneAssignment>
- Parameters:
lane
- The lane index.
-
setVisibility
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
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
Sets whether the traffic sign is variable.- Overrides:
setVariability
in classTrafficSign<LaneAssignment>
- Parameters:
isVariable
- Whether the sign is variable.
-
setLaneAssignment
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
Get lane assignments of all lanes. -
getLaneAssignment
Gets lane assignments. -
setAllowedVehicleClasses
Sets the list of allowedVehicleClass
es. -
setAllowedVehicleClasses
Sets one speed limit for all lanes. -
addAllowedVehicleClass
Adds aVehicleClass
to the allowed list. -
removeAllowedVehicleClass
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
Returns the type of the traffic sign.- Specified by:
getTypeId
in classTrafficSign<LaneAssignment>
-
toString
- Overrides:
toString
in classTrafficSign<LaneAssignment>
-