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