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.
listenersGTU_ADD_EVENT, GTU_REMOVE_EVENTFIRST_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, removeGTUaddListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, removeAllListeners, removeAllListeners, removeListenerpublic 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 Capacitypublic final void setCapacity(Frequency capacity)
setCapacity in interface Capacitycapacity - 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 OTSLinknewNetwork - 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.