AccelerationSpeedTransition.java
package org.opentrafficsim.road.gtu.tactical.lmrs;
import org.djunits.value.vdouble.scalar.Acceleration;
import org.djunits.value.vdouble.scalar.Length;
import org.opentrafficsim.base.parameters.ParameterException;
import org.opentrafficsim.core.gtu.Stateless;
import org.opentrafficsim.core.gtu.plan.operational.OperationalPlanException;
import org.opentrafficsim.road.gtu.perception.RelativeLane;
import org.opentrafficsim.road.gtu.tactical.TacticalContextEgo;
import org.opentrafficsim.road.gtu.tactical.util.SpeedLimitUtil;
/**
* Acceleration incentive for speed transitions (curvature and speed bumps).
* <p>
* Copyright (c) 2013-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
* BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
* </p>
* @author Alexander Verbraeck
* @author Peter Knoppers
* @author Wouter Schakel
*/
public final class AccelerationSpeedTransition
implements AccelerationIncentive, Stateless<AccelerationSpeedTransition>
{
/** Singleton instance. */
public static final AccelerationSpeedTransition SINGLETON = new AccelerationSpeedTransition();
@Override
public AccelerationSpeedTransition get()
{
return SINGLETON;
}
/**
* Constructor.
*/
private AccelerationSpeedTransition()
{
//
}
@Override
public Acceleration accelerate(final TacticalContextEgo context, final RelativeLane lane, final Length mergeDistance)
throws OperationalPlanException, ParameterException
{
return SpeedLimitUtil.considerSpeedLimitTransitions(context, lane);
}
@Override
public String toString()
{
return "AccelerationSpeedLimitTransition";
}
}