View Javadoc
1   package org.opentrafficsim.road.gtu.lane.tactical;
2   
3   import java.io.Serializable;
4   import java.util.Set;
5   
6   import org.opentrafficsim.core.network.LateralDirectionality;
7   import org.opentrafficsim.core.network.Node;
8   import org.opentrafficsim.road.network.lane.Lane;
9   
10  /**
11   * This class provides information for an operational plan about the next location where the network splits. if the networks
12   * splits, the node where it splits, and the current lanes that lead to the right node are calculated.
13   * <p>
14   * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
15   * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
16   * </p>
17   * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
18   * @author <a href="https://github.com/peter-knoppers">Peter Knoppers</a>
19   * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
20   * @param nextSplitNode the first subsequent node at which the route splits.
21   * @param correctCurrentLanes the lane(s) and/or adjacent lane(s) on which the reference point of the GTU is registered that
22   *            lead us in the direction of the route provided by the strategical planner.
23   * @param requiredDirection required direction for lane changes for this split, beyond lane on current link
24   */
25  public record NextSplitInfo(Node nextSplitNode, Set<Lane> correctCurrentLanes, LateralDirectionality requiredDirection)
26          implements Serializable
27  {
28  
29      /** */
30      private static final long serialVersionUID = 20151231L;
31  
32      /**
33       * @param nextSplitNode the first subsequent node at which the route splits.
34       * @param correctCurrentLanes the lane(s) and/or adjacent lane(s) on which the reference point of the GTU is registered that
35       *            lead us in the direction of the route provided by the strategical planner.
36       */
37      public NextSplitInfo(final Node nextSplitNode, final Set<Lane> correctCurrentLanes)
38      {
39          this(nextSplitNode, correctCurrentLanes, null);
40      }
41  
42      /**
43       * @return split indicates whether the route splits within the given distance.
44       */
45      public final boolean isSplit()
46      {
47          return this.nextSplitNode != null;
48      }
49  
50  }