1 package org.opentrafficsim.road.gtu.lane.tactical.following; 2 3 import org.djunits.value.vdouble.scalar.Acceleration; 4 import org.djunits.value.vdouble.scalar.Speed; 5 import org.opentrafficsim.base.parameters.ParameterException; 6 import org.opentrafficsim.base.parameters.ParameterTypeClass; 7 import org.opentrafficsim.base.parameters.Parameters; 8 import org.opentrafficsim.road.gtu.lane.LaneBasedGTU; 9 import org.opentrafficsim.road.gtu.lane.perception.PerceptionIterable; 10 import org.opentrafficsim.road.gtu.lane.perception.headway.Headway; 11 import org.opentrafficsim.road.network.speed.SpeedLimitInfo; 12 13 /** 14 * Methods that a car-following model has to implement. The parameters are supplied to obtain parameters. The phrase 15 * 'car-following model' is the commonly used and therefore intuitive name, but in actuality it is much more. 16 * <ul> 17 * <li>Following other vehicle types: van, bus, truck.</li> 18 * <li>Following other GTU's: bicycle, pedestrian.</li> 19 * <li>Free driving.</li> 20 * <li>Approaching (theoretically different from following, usually the same formula).</li> 21 * <li>Stopping for a traffic light, intersection conflict, etc,</li> 22 * </ul> 23 * <p> 24 * Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br> 25 * BSD-style license. See <a href="http://opentrafficsim.org/docs/current/license.html">OpenTrafficSim License</a>. 26 * <p> 27 * @version $Revision$, $LastChangedDate$, by $Author$, initial version Apr 22, 2016 <br> 28 * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a> 29 * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a> 30 */ 31 public interface CarFollowingModel extends DesiredHeadwayModel, DesiredSpeedModel, Initialisable 32 { 33 34 /** Parameter type for car-following model. */ 35 ParameterTypeClass<CarFollowingModel> CAR_FOLLOWING_MODEL = new ParameterTypeClass<>("cf.model", "car-following model", 36 ParameterTypeClass.getValueClass(CarFollowingModel.class)); 37 38 /** 39 * Determination of car-following acceleration, possibly based on multiple leaders. The implementation should be able to 40 * deal with:<br> 41 * <ul> 42 * <li>The current speed being higher than the desired speed.</li> 43 * <li>The headway being negative.</li> 44 * </ul> 45 * @param parameters parameters 46 * @param speed current speed 47 * @param speedLimitInfo info regarding the desired speed for car-following 48 * @param leaders set of leader headways and speeds, ordered by headway (closest first) 49 * @throws ParameterException if parameter exception occurs 50 * @return car-following acceleration 51 */ 52 Acceleration followingAcceleration(Parameters parameters, Speed speed, SpeedLimitInfo speedLimitInfo, 53 PerceptionIterable<? extends Headway> leaders) throws ParameterException; 54 55 /** 56 * Return the name of the car-following model. 57 * @return name of the car-following model 58 */ 59 String getName(); 60 61 /** 62 * Return the complete name of the car-following model. 63 * @return complete name of the car-following model 64 */ 65 String getLongName(); 66 67 /** {@inheritDoc} */ 68 @Override 69 default void init(LaneBasedGTU gtu) 70 { 71 // 72 } 73 74 }