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

public class RoadNetwork extends Network
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:
  • Constructor Details

    • RoadNetwork

      public RoadNetwork(String id, OtsSimulatorInterface simulator)
      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 returns null 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.