org.opentrafficsim.road.gtu.lane.tactical.NextSplitInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ots-road Show documentation
Show all versions of ots-road Show documentation
OpenTrafficSim road classes
The newest version!
package org.opentrafficsim.road.gtu.lane.tactical;
import java.io.Serializable;
import java.util.Set;
import org.opentrafficsim.core.network.LateralDirectionality;
import org.opentrafficsim.core.network.Node;
import org.opentrafficsim.road.network.lane.Lane;
/**
* This class provides information for an operational plan about the next location where the network splits. if the networks
* splits, the node where it splits, and the current lanes that lead to the right node are calculated.
*
* 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
* @author Peter Knoppers
* @author Wouter Schakel
* @param nextSplitNode Node; the first subsequent node at which the route splits.
* @param correctCurrentLanes Set<Lane>; the lane(s) and/or adjacent lane(s) on which the reference point of the GTU is
* registered that lead us in the direction of the route provided by the strategical planner.
* @param requiredDirection LateralDirectionality; required direction for lane changes for this split, beyond lane on current
* link
*/
public record NextSplitInfo(Node nextSplitNode, Set correctCurrentLanes, LateralDirectionality requiredDirection)
implements Serializable
{
/** */
private static final long serialVersionUID = 20151231L;
/**
* @param nextSplitNode Node; the first subsequent node at which the route splits.
* @param correctCurrentLanes Set<Lane>; the lane(s) and/or adjacent lane(s) on which the reference point of the GTU
* is registered that lead us in the direction of the route provided by the strategical planner.
*/
public NextSplitInfo(final Node nextSplitNode, final Set correctCurrentLanes)
{
this(nextSplitNode, correctCurrentLanes, null);
}
/**
* @return split indicates whether the route splits within the given distance.
*/
public final boolean isSplit()
{
return this.nextSplitNode != null;
}
}