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://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a>
19   * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
20   * @param nextSplitNode Node; the first subsequent node at which the route splits.
21   * @param correctCurrentLanes Set&lt;Lane&gt;; the lane(s) and/or adjacent lane(s) on which the reference point of the GTU is
22   *            registered that lead us in the direction of the route provided by the strategical planner.
23   * @param requiredDirection LateralDirectionality; required direction for lane changes for this split, beyond lane on current
24   *            link
25   */
26  public record NextSplitInfo(Node nextSplitNode, Set<Lane> correctCurrentLanes, LateralDirectionality requiredDirection)
27          implements Serializable
28  {
29  
30      /** */
31      private static final long serialVersionUID = 20151231L;
32  
33      /**
34       * @param nextSplitNode Node; the first subsequent node at which the route splits.
35       * @param correctCurrentLanes Set&lt;Lane&gt;; the lane(s) and/or adjacent lane(s) on which the reference point of the GTU
36       *            is registered that lead us in the direction of the route provided by the strategical planner.
37       */
38      public NextSplitInfo(final Node nextSplitNode, final Set<Lane> correctCurrentLanes)
39      {
40          this(nextSplitNode, correctCurrentLanes, null);
41      }
42  
43      /**
44       * @return split indicates whether the route splits within the given distance.
45       */
46      public final boolean isSplit()
47      {
48          return this.nextSplitNode != null;
49      }
50  
51  }