org.opentrafficsim.road.gtu.lane.control.DelayedActuation 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.control;
import org.djunits.value.vdouble.scalar.Acceleration;
import org.djunits.value.vdouble.scalar.Duration;
import org.opentrafficsim.base.parameters.ParameterTypeDuration;
import org.opentrafficsim.base.parameters.constraint.NumericConstraint;
import org.opentrafficsim.road.gtu.lane.LaneBasedGtu;
/**
* Delays the actuation of acceleration. This is not part of the vehicle model as that is used for both human and automated
* control, which follow different vehicle capability semantics.
*
* 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
*/
public interface DelayedActuation
{
/** No delayed actuation. */
DelayedActuation NONE = new DelayedActuation()
{
/** {@inheritDoc} */
@Override
public Acceleration delayActuation(final Acceleration desiredAcceleration, final LaneBasedGtu gtu)
{
return desiredAcceleration;
}
};
/** Parameter for actuation delay. */
ParameterTypeDuration TAU = new ParameterTypeDuration("tau_actuation", "Actuation delay", Duration.instantiateSI(0.1),
NumericConstraint.POSITIVE);
/** Tau delayed actuation. */
DelayedActuation TAUDELAYED = new DelayedActuation()
{
/** {@inheritDoc} */
@Override
public Acceleration delayActuation(final Acceleration desiredAcceleration, final LaneBasedGtu gtu)
{
// TODO: numerical implementation of tau rule
return desiredAcceleration.minus(gtu.getAcceleration());
}
};
/**
* Delays the actuation of acceleration.
* @param desiredAcceleration Acceleration; desired acceleration
* @param gtu LaneBasedGtu; gtu
* @return Acceleration; delayed acceleration
*/
Acceleration delayActuation(Acceleration desiredAcceleration, LaneBasedGtu gtu);
}