Package org.opentrafficsim.road.network
Class RoadNetwork
java.lang.Object
org.djutils.event.LocalEventProducer
org.opentrafficsim.core.network.Network
org.opentrafficsim.road.network.RoadNetwork
- All Implemented Interfaces:
Serializable
,Remote
,org.djutils.base.Identifiable
,org.djutils.event.EventProducer
,PerceivableContext
RoadNetwork adds the ability to retrieve lane change information.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Wouter Schakel
- See Also:
-
Field Summary
Fields inherited from class org.opentrafficsim.core.network.Network
EXTENT_MARGIN, GTU_ADD_EVENT, GTU_REMOVE_EVENT, LINK_ADD_EVENT, LINK_REMOVE_EVENT, NODE_ADD_EVENT, NODE_REMOVE_EVENT, NONLOCATED_OBJECT_ADD_EVENT, NONLOCATED_OBJECT_REMOVE_EVENT, OBJECT_ADD_EVENT, OBJECT_REMOVE_EVENT, ROUTE_ADD_EVENT, ROUTE_REMOVE_EVENT
Fields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITION
-
Constructor Summary
ConstructorDescriptionRoadNetwork
(String id, OtsSimulatorInterface simulator) Construction of an empty network. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears all lane change info graphs and cached sets.org.djutils.immutablecollections.ImmutableSortedSet<LaneChangeInfo>
getLaneChangeInfo
(Lane lane, Route route, GtuType gtuType, org.djunits.value.vdouble.scalar.Length range, LaneAccessLaw laneAccessLaw) Returns lane change info from the given lane.Methods inherited from class org.opentrafficsim.core.network.Network
addGTU, addLink, addNode, addNonLocatedObject, addObject, addRoute, containsGTU, containsGtuId, containsLink, containsLink, containsNode, containsNode, containsNonLocatedObject, containsNonLocatedObject, containsObject, containsObject, containsRoute, containsRoute, getDefinedRouteMap, getExtent, getGTU, getGTUs, getId, getLink, getLink, getLink, getLinkMap, getNode, getNodeMap, getNonLocatedObjectMap, getNonLocatedObjectMap, getObject, getObjectMap, getObjectMap, getRoute, getRoute, getRouteMap, getRoutesBetween, getShortestRouteBetween, getShortestRouteBetween, getShortestRouteBetween, getShortestRouteBetween, getSimulator, getUnbalancedCentroids, removeGTU, removeLink, removeNode, removeNonLocatedObject, removeObject, removeRoute, setRawRouteMap, toString
Methods inherited from class org.djutils.event.LocalEventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventListenerMap, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventListenerMap, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
-
Constructor Details
-
RoadNetwork
Construction of an empty network.- Parameters:
id
- String; the network id.simulator
- OtsSimulatorInterface; the DSOL simulator engine
-
-
Method Details
-
getLaneChangeInfo
public org.djutils.immutablecollections.ImmutableSortedSet<LaneChangeInfo> getLaneChangeInfo(Lane lane, Route route, GtuType gtuType, org.djunits.value.vdouble.scalar.Length range, LaneAccessLaw laneAccessLaw) Returns lane change info from the given lane. Distances are given from the start of the lane and will never exceed the given range. This method returnsnull
if no valid path exists. If there are no reasons to change lane within range, an empty set is returned.- Parameters:
lane
- Lane; from lane.route
- Route; route.gtuType
- GtuType; GTU Type.range
- Length; maximum range of info to consider, from the start of the given lane.laneAccessLaw
- LaneAccessLaw; lane access law.- Returns:
- ImmutableSortedSet<LaneChangeInfo>; lane change info from the given lane, or
null
if no path exists.
-
clearLaneChangeInfoCache
public void clearLaneChangeInfoCache()Clears all lane change info graphs and cached sets. This method should be invoked on every network change that affects lane changes and the distances within which they need to be performed.
-