1 package org.opentrafficsim.road.gtu.lane.tactical.directedlanechange; 2 3 import java.io.Serializable; 4 5 import org.opentrafficsim.core.network.LateralDirectionality; 6 import org.opentrafficsim.road.gtu.lane.tactical.following.AccelerationStep; 7 8 /** 9 * Acceleration, lane change decision and time until when this movement is committed. 10 * <p> 11 * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br> 12 * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>. 13 * </p> 14 * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a> 15 * @author <a href="https://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a> 16 */ 17 public class DirectedLaneMovementStep implements Serializable 18 { 19 /** */ 20 private static final long serialVersionUID = 20160400L; 21 22 /** The resulting acceleration and duration of validity. */ 23 private final AccelerationStep accelerationStep; 24 25 /** 26 * Lane change. This has one of the following values: 27 * <table > 28 * <caption> </caption> 29 * <tr> 30 * <td>null:</td> 31 * <td>Stay in the current lane</td> 32 * </tr> 33 * <tr> 34 * <td>LateralDirectionality.LEFT:</td> 35 * <td>Move to the Left adjacent lane, as seen from the GTU in forward driving direction</td> 36 * </tr> 37 * <tr> 38 * <td>LateralDirectionality.RIGHT:</td> 39 * <td>Move to the Right adjacent lane, as seen from the GTU in forward driving direction</td> 40 * </tr> 41 * </table> 42 */ 43 private final LateralDirectionality direction; 44 45 /** 46 * Construct a new LaneChangeModelResult. 47 * @param accelerationStep AccelerationStep; the acceleration and duration of validity of this result. 48 * @param direction LateralDirectionality; this has one of the values: 49 * <table > 50 * <caption> </caption> 51 * <tr> 52 * <td>null:</td> 53 * <td>Stay in the current lane</td> 54 * </tr> 55 * <tr> 56 * <td>LateralDirectionality.LEFT:</td> 57 * <td>Move to the Left adjacent lane, as seen from the GTU in forward driving direction</td> 58 * </tr> 59 * <tr> 60 * <td>LateralDirectionality.RIGHT:</td> 61 * <td>Move to the Right adjacent lane, as seen from the GTU in forward driving direction</td> 62 * </tr> 63 * </table> 64 */ 65 public DirectedLaneMovementStep(final AccelerationStep accelerationStep, final LateralDirectionality direction) 66 { 67 this.accelerationStep = accelerationStep; 68 this.direction = direction; 69 } 70 71 /** 72 * @return the acceleration step. 73 */ 74 public final AccelerationStep getGfmr() 75 { 76 return this.accelerationStep; 77 } 78 79 /** 80 * @return laneChange. This has one of the values: 81 * <table > 82 * <caption> </caption> 83 * <tr> 84 * <td>null:</td> 85 * <td>Stay in the current lane</td> 86 * </tr> 87 * <tr> 88 * <td>LateralDirectionality.LEFT:</td> 89 * <td>Move to the Left adjacent lane, as seen from the GTU in forward driving direction</td> 90 * </tr> 91 * <tr> 92 * <td>LateralDirectionality.RIGHT:</td> 93 * <td>Move to the Right adjacent lane, as seen from the GTU in forward driving direction</td> 94 * </tr> 95 * </table> 96 */ 97 public final LateralDirectionality getLaneChange() 98 { 99 return this.direction; 100 } 101 102 /** {@inheritDoc} */ 103 @Override 104 public final String toString() 105 { 106 return this.accelerationStep.toString() + ", " 107 + (null == this.direction ? "no lane change" : this.direction.toString()); 108 } 109 110 }