1 package org.opentrafficsim.road.gtu.lane.perception.headway;
2
3 import org.djunits.value.vdouble.scalar.Acceleration;
4 import org.djunits.value.vdouble.scalar.Length;
5 import org.djunits.value.vdouble.scalar.Speed;
6 import org.opentrafficsim.base.parameters.Parameters;
7 import org.opentrafficsim.core.gtu.GTUType;
8 import org.opentrafficsim.core.network.route.Route;
9 import org.opentrafficsim.road.gtu.lane.tactical.following.CarFollowingModel;
10 import org.opentrafficsim.road.network.speed.SpeedLimitInfo;
11
12 /**
13 * Interface for perceived surrounding GTU's.
14 * <p>
15 * Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
16 * BSD-style license. See <a href="http://opentrafficsim.org/node/13">OpenTrafficSim License</a>.
17 * <p>
18 * @version $Revision$, $LastChangedDate$, by $Author$, initial version 24 mrt. 2017 <br>
19 * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
20 * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
21 * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
22 */
23 public interface HeadwayGTU extends Headway
24 {
25
26 /**
27 * @return gtuType
28 */
29 GTUType getGtuType();
30
31 /**
32 * @return facingSameDirection
33 */
34 boolean isFacingSameDirection();
35
36 /**
37 * @return were the braking lights on?
38 */
39 boolean isBrakingLightsOn();
40
41 /**
42 * @return was the left turn indicator on?
43 */
44 boolean isLeftTurnIndicatorOn();
45
46 /**
47 * @return was the right turn indicator on?
48 */
49 boolean isRightTurnIndicatorOn();
50
51 /**
52 * @return were the emergency lights on?
53 */
54 boolean isEmergencyLightsOn();
55
56 /**
57 * @return was the vehicle honking or ringing its bell when being observed for the headway?
58 */
59 boolean isHonking();
60
61 /**
62 * Creates a copy with different headway, speed and possibly acceleration. It may not be alongside. This method is used to
63 * anticipate movement of a neighboring GTU.
64 * @param headway Length; headway
65 * @param speed Speed; speed
66 * @param acceleration Acceleration; acceleration
67 * @return copy with different headway, speed and possibly acceleration
68 */
69 HeadwayGTU moved(Length headway, Speed speed, Acceleration acceleration);
70
71 /**
72 * Many models that observe a GTU need to predict the imminent behavior of that GTU. Having a car following model of the
73 * observed GTU can help with that. The car following model that is returned can be on a continuum between the actual car
74 * following model of the observed GTU and the own car following model of the observing GTU, not making any assumptions
75 * about the observed GTU. When successive observations of the GTU take place, parameters about its behavior can be
76 * estimated more accurately. Another interesting easy-to-implement solution is to return a car following model per GTU
77 * type, where the following model of a truck can differ from that of a car.
78 * @return a car following model that represents the expected behavior of the observed GTU
79 */
80 CarFollowingModel getCarFollowingModel();
81
82 /**
83 * Many models that observe a GTU need to predict the imminent behavior of that GTU. Having an estimate of the behavioral
84 * characteristics of the observed GTU can help with that. The parameters that are returned can be on a continuum between
85 * the actual parameters of the observed GTU and the own parameters of the observing GTU, not making any assumptions about
86 * the observed GTU. When successive observations of the GTU take place, parameters about its behavior can be estimated more
87 * accurately. Another interesting easy-to-implement solution is to return a set of parameters per GTU type, where the
88 * parameters of a truck can differ from that of a car.
89 * @return the parameters that represent the expected behavior of the observed GTU
90 */
91 Parameters getParameters();
92
93 /**
94 * Many models that observe a GTU need to predict the imminent behavior of that GTU. Having a model of the speed info
95 * profile for the observed GTU can help with predicting its future behavior. The speed limit info that is returned can be
96 * on a continuum between the actual speed limit model of the observed GTU and the own speed limit model of the observing
97 * GTU, not making any assumptions about the observed GTU. When successive observations of the GTU take place, parameters
98 * about its behavior, such as the maximum speed it accepts, can be estimated more accurately. Another interesting
99 * easy-to-implement solution is to return a speed limit info object per GTU type, where the returned information of a truck
100 * -- with a maximum allowed speed on 80 km/h -- can differ from that of a car -- which can have a maximum allowed speed of
101 * 100 km/h on the same road.
102 * @return a speed limit model that helps in determining the expected behavior of the observed GTU
103 */
104 SpeedLimitInfo getSpeedLimitInfo();
105
106 /**
107 * Models responding to other GTU may assume a route of the vehicle, for instance at intersections. The route may be short,
108 * i.e. only over the next intersection. Implementations may return anything from the actual route, a route based on
109 * indicators and other assumptions, or {@code null} if simply not known/estimated.
110 * @return route of gtu
111 */
112 Route getRoute();
113
114 /**
115 * Returns the perceived desired speed of the neighbor.
116 * @return Speed; perceived desired speed of the neighbor
117 */
118 Speed getDesiredSpeed();
119
120 /**
121 * Returns the width of the GTU.
122 * @return Length; width of the GTU
123 */
124 Length getWidth();
125
126 }