public class CapacityOTSLink extends OTSLink implements Capacity
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
listeners
GTU_ADD_EVENT, GTU_REMOVE_EVENT
FIRST_POSITION, LAST_POSITION
Modifier | Constructor and Description |
---|---|
protected |
CapacityOTSLink(Network newNetwork,
OTSSimulatorInterface newSimulator,
CapacityOTSLink link)
Clone a link for a new network.
|
|
CapacityOTSLink(Network network,
String id,
Node startNode,
Node endNode,
LinkType linkType,
OTSLine3D designLine,
OTSSimulatorInterface simulator,
Frequency capacity)
Construct a new link.
|
Modifier and Type | Method and Description |
---|---|
CapacityOTSLink |
clone(Network newNetwork,
OTSSimulatorInterface newSimulator)
Clone the OTSLink for e.g., copying a network.
|
Frequency |
getCapacity() |
void |
setCapacity(Frequency capacity)
Set the link capacity.
|
String |
toString() |
addGTU, equals, getBounds, getDesignLine, getDirectionality, getEndNode, getGTUCount, getGTUs, getId, getLength, getLinkType, getLocation, getNetwork, getSimulator, getStartNode, hashCode, removeGTU
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, removeAllListeners, removeAllListeners, removeListener
public CapacityOTSLink(Network network, String id, Node startNode, Node endNode, LinkType linkType, OTSLine3D designLine, OTSSimulatorInterface simulator, Frequency capacity) throws NetworkException
network
- Network; the network.id
- String; the link idstartNode
- Node; start node (directional)endNode
- Node; end node (directional)linkType
- LinkType; Link type to indicate compatibility with GTU typesdesignLine
- OTSLine3D; the OTSLine3D design line of the Linksimulator
- OTSSimulatorInterface; the simulator on which events can be scheduledcapacity
- Frequency; link capacity in GTUs per hour // XXX per direction? which GTUType?NetworkException
- if link already exists in the network, if name of the link is not unique, or if the start node
or the end node of the link are not registered in the network.protected CapacityOTSLink(Network newNetwork, OTSSimulatorInterface newSimulator, CapacityOTSLink link) throws NetworkException
newNetwork
- Network; the new network to which the clone belongsnewSimulator
- OTSSimulatorInterface; the new simulator for this networklink
- CapacityOTSLink; the link to clone fromNetworkException
- if link already exists in the network, if name of the link is not unique, or if the start node
or the end node of the link are not registered in the network.public final Frequency getCapacity()
getCapacity
in interface Capacity
public final void setCapacity(Frequency capacity)
setCapacity
in interface Capacity
capacity
- Frequency; the new capacity of the link as a frequency in GTUs per time unit.public CapacityOTSLink clone(Network newNetwork, OTSSimulatorInterface newSimulator) throws NetworkException
clone
in class OTSLink
newNetwork
- Network; the new network to which the clone belongsnewSimulator
- OTSSimulatorInterface; the new simulator for this networkNetworkException
- in case the cloning failsCopyright © 2014–2019 Delft University of Technology. All rights reserved.