package org.opentrafficsim.road.gtu.lane; import org.djunits.value.vdouble.scalar.Acceleration; import org.djunits.value.vdouble.scalar.Mass; /** * Interface for vehicle models. *
* Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
* BSD-style license. See OpenTrafficSim License.
*
* Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
*
* BSD-style license. See OpenTrafficSim License.
*
* @version $Revision$, $LastChangedDate$, by $Author$, initial version 8 jan. 2019
* @author Alexander Verbraeck
* @author Peter Knoppers
* @author Wouter Schakel
*/
class MassBased implements VehicleModel
{
/** Mass. */
private final Mass mass;
/** Moment of inertia about z-axis. */
private final double momentOfInertiaAboutZ;
/**
* @param mass Mass; mass
* @param momentOfInertiaAboutZ double; moment of inertia about z-axis
*/
public MassBased(final Mass mass, final double momentOfInertiaAboutZ)
{
this.mass = mass;
this.momentOfInertiaAboutZ = momentOfInertiaAboutZ;
}
/** {@inheritDoc} */
@Override
public Acceleration boundAcceleration(final Acceleration acceleration, final LaneBasedGTU gtu)
{
return MINMAX.boundAcceleration(acceleration, gtu);
}
/** {@inheritDoc} */
@Override
public Mass getMass()
{
return this.mass;
}
/** {@inheritDoc} */
@Override
public double getMomentOfInertiaAboutZ()
{
return this.momentOfInertiaAboutZ;
}
}
}