public class CrossSectionLink extends OTSLink implements Serializable
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-09-16 19:20:07 +0200 (Wed, 16 Sep 2015) $, @version $Revision: 1405 $, by $Author: averbraeck $,
initial version Aug 19, 2014
Modifier and Type | Class and Description |
---|---|
static class |
CrossSectionLink.Priority
Priority of a link.
|
Modifier and Type | Field and Description |
---|---|
static EventType |
LANE_ADD_EVENT
The (regular, not timed) event type for pub/sub indicating the addition of a Lane to a CrossSectionLink.
|
static EventType |
LANE_REMOVE_EVENT
The (regular, not timed) event type for pub/sub indicating the removal of a Lane from a CrossSectionLink.
|
listeners
GTU_ADD_EVENT, GTU_REMOVE_EVENT
FIRST_POSITION, LAST_POSITION
Modifier | Constructor and Description |
---|---|
protected |
CrossSectionLink(Network newNetwork,
SimulatorInterface.TimeDoubleUnit newSimulator,
boolean animation,
CrossSectionLink link)
Clone a CrossSectionLink for a new network.
|
|
CrossSectionLink(Network network,
String id,
Node startNode,
Node endNode,
LinkType linkType,
OTSLine3D designLine,
SimulatorInterface.TimeDoubleUnit simulator,
LaneKeepingPolicy laneKeepingPolicy)
Construction of a cross section link.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addCrossSectionElement(CrossSectionElement cse)
Add a cross section element at the end of the list.
|
void |
clearDemandWeight()
Clears the demand weight.
|
CrossSectionLink |
clone(Network newNetwork,
SimulatorInterface.TimeDoubleUnit newSimulator,
boolean animation) |
CrossSectionElement |
getCrossSectionElement(String id)
Find a cross section element with a specified id.
|
List<CrossSectionElement> |
getCrossSectionElementList()
Retrieve a safe copy of the cross section element list.
|
Double |
getDemandWeight()
Returns the demand weight.
|
LaneKeepingPolicy |
getLaneKeepingPolicy()
Retrieve the lane keeping policy.
|
List<Lane> |
getLanes()
Return a safe copy of the list of lanes of this CrossSectionLink.
|
CrossSectionLink.Priority |
getPriority() |
void |
setDemandWeight(double demandWeight)
Sets the demand weight.
|
void |
setPriority(CrossSectionLink.Priority priority) |
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 static final EventType LANE_ADD_EVENT
public static final EventType LANE_REMOVE_EVENT
public CrossSectionLink(Network network, String id, Node startNode, Node endNode, LinkType linkType, OTSLine3D designLine, SimulatorInterface.TimeDoubleUnit simulator, LaneKeepingPolicy laneKeepingPolicy) throws NetworkException
network
- Network; the networkid
- String; the link id.startNode
- OTSNode; the start node (directional).endNode
- OTSNode; the end node (directional).linkType
- LinkType; the link typedesignLine
- OTSLine3D; the design line of the Linksimulator
- the simulator on which events can be scheduledlaneKeepingPolicy
- LaneKeepingPolicy; the policy to generally keep left, keep right, or keep laneNetworkException
- 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 CrossSectionLink(Network newNetwork, SimulatorInterface.TimeDoubleUnit newSimulator, boolean animation, CrossSectionLink link) throws NetworkException
newNetwork
- the new network to which the clone belongsnewSimulator
- the new simulator for this networkanimation
- whether to (re)create animation or notlink
- 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.protected final void addCrossSectionElement(CrossSectionElement cse)
cse
- CrossSectionElement; the cross section element to add.public final List<CrossSectionElement> getCrossSectionElementList()
public final LaneKeepingPolicy getLaneKeepingPolicy()
public final CrossSectionElement getCrossSectionElement(String id)
id
- String; the id to search forpublic final List<Lane> getLanes()
public final CrossSectionLink.Priority getPriority()
public final void setPriority(CrossSectionLink.Priority priority)
priority
- set priority.public final void setDemandWeight(double demandWeight)
demandWeight
- double; demand weight, which is any positive valuepublic final void clearDemandWeight()
public final Double getDemandWeight()
null
public CrossSectionLink clone(Network newNetwork, SimulatorInterface.TimeDoubleUnit newSimulator, boolean animation) throws NetworkException
clone
in class OTSLink
NetworkException
Copyright © 2014–2018 Delft University of Technology. All rights reserved.