Package org.opentrafficsim.core.network
Interface Link
-
- All Superinterfaces:
Drawable,Identifiable,Locatable,Serializable
- All Known Implementing Classes:
CapacityOTSLink,OTSLink
public interface Link extends Locatable, Serializable, Identifiable, Drawable
A Link is a connection between two Nodes.Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
$LastChangedDate: 2020-05-08 11:08:12 +0200 (Fri, 08 May 2020) $, @version $Revision: 6464 $, by $Author: pknoppers $, initial version Aug 19, 2014
BSD-style license. See OpenTrafficSim License.- Author:
- Alexander Verbraeck, Peter Knoppers
-
-
Field Summary
Fields Modifier and Type Field Description static TimedEventTypeGTU_ADD_EVENTDeprecated.static TimedEventTypeGTU_REMOVE_EVENTDeprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddGTU(Gtu gtu)Deprecated.Bounds3dgetBounds()PolyLine3dgetDesignLine()LongitudinalDirectionalitygetDirectionality(GtuType gtuType)This method returns the directionality of the link for a GTU type.NodegetEndNode()intgetGTUCount()Deprecated.Set<Gtu>getGTUs()Deprecated.StringgetId()LengthgetLength()LinkTypegetLinkType()OrientedPoint3dgetLocation()NetworkgetNetwork()Return the network in which this link is registered.SimulatorInterface.TimeDoubleUnitgetSimulator()NodegetStartNode()voidremoveGTU(Gtu gtu)Deprecated.
-
-
-
Field Detail
-
GTU_ADD_EVENT
@Deprecated static final TimedEventType GTU_ADD_EVENT
Deprecated.The timed event type for pub/sub indicating the addition of a GTU to the link.
Payload: Object[] {String gtuId, int count_after_addition}
-
GTU_REMOVE_EVENT
@Deprecated static final TimedEventType GTU_REMOVE_EVENT
Deprecated.The timed event type for pub/sub indicating the removal of a GTU from the link.
Payload: Object[] {String gtuId, int count_after_removal}
-
-
Method Detail
-
getNetwork
Network getNetwork()
Return the network in which this link is registered. Cannot be null.- Returns:
- Network; the network in which this link is registered
-
getId
String getId()
- Specified by:
getIdin interfaceIdentifiable- Returns:
- id.
-
getStartNode
Node getStartNode()
- Returns:
- start node.
-
getEndNode
Node getEndNode()
- Returns:
- end node.
-
getLinkType
LinkType getLinkType()
- Returns:
- the link type.
-
getDesignLine
PolyLine3d getDesignLine()
- Returns:
- the design line.
-
getSimulator
SimulatorInterface.TimeDoubleUnit getSimulator()
- Returns:
- the simulator.
-
getLength
Length getLength()
- Returns:
- length of the link.
-
getDirectionality
LongitudinalDirectionality getDirectionality(GtuType gtuType)
This method returns the directionality of the link for a GTU type. It might be that the link is FORWARD (from start node to end node) for the GTU type CAR, but BOTH for the GTU type BICYCLE (i.e., bicycles can also go from end node to start node). If there is no entry for the given GTU Type, the values of GTUType.ALL will be returned. If this entry is not present, LongitudinalDirectionality.NONE will be returned.- Parameters:
gtuType- GtuType; the GTU type to request the directionality for- Returns:
- the longitudinal directionality of the link (FORWARD, BACKWARD, BOTH or NONE) for the given GTU type. NONE will be returned if no directionality is given.
-
addGTU
@Deprecated void addGTU(Gtu gtu)
Deprecated.Add a GTU to this link (e.g., for statistical purposes, or for a model on macro level). It is safe to add a GTU again. No warning or error will be given. The GTU_ADD_EVENT will only be fired when the GTU was not already on the link.- Parameters:
gtu- Gtu; the GTU to add.
-
removeGTU
@Deprecated void removeGTU(Gtu gtu)
Deprecated.Remove a GTU from this link. It is safe to try to remove a GTU again. No warning or error will be given. The GTU_REMOVE_EVENT will only be fired when the GTU was on the link.- Parameters:
gtu- Gtu; the GTU to remove.
-
getGTUs
@Deprecated Set<Gtu> getGTUs()
Deprecated.Provide a safe copy of the set of GTUs.- Returns:
- Set<GTU>; a safe copy of the set of GTUs
-
getGTUCount
@Deprecated int getGTUCount()
Deprecated.Provide the number of GTUs on this link.- Returns:
- int; the number of GTUs on this link
-
getLocation
OrientedPoint3d getLocation()
- Specified by:
getLocationin interfaceLocatable
-
-