View Javadoc
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.core.gtu.GTUType;
7   import org.opentrafficsim.core.gtu.behavioralcharacteristics.BehavioralCharacteristics;
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-2017 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 headway
65       * @param speed speed
66       * @param 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 behavioral characteristics that are returned can be on a
85       * continuum between the actual behavioral characteristics of the observed GTU and the own behavioral characteristics of the
86       * observing GTU, not making any assumptions about the observed GTU. When successive observations of the GTU take place,
87       * parameters about its behavior can be estimated more accurately. Another interesting easy-to-implement solution is to
88       * return a set of behavioral characteristics per GTU type, where the behavioral characteristics of a truck can differ from
89       * that of a car.
90       * @return the behavioral characteristics that represent the expected behavior of the observed GTU
91       */
92      BehavioralCharacteristics getBehavioralCharacteristics();
93  
94      /**
95       * Many models that observe a GTU need to predict the imminent behavior of that GTU. Having a model of the speed info
96       * profile for the observed GTU can help with predicting its future behavior. The speed limit info that is returned can be
97       * on a continuum between the actual speed limit model of the observed GTU and the own speed limit model of the observing
98       * GTU, not making any assumptions about the observed GTU. When successive observations of the GTU take place, parameters
99       * about its behavior, such as the maximum speed it accepts, can be estimated more accurately. Another interesting
100      * easy-to-implement solution is to return a speed limit info object per GTU type, where the returned information of a truck
101      * -- with a maximum allowed speed on 80 km/h -- can differ from that of a car -- which can have a maximum allowed speed of
102      * 100 km/h on the same road.
103      * @return a speed limit model that helps in determining the expected behavior of the observed GTU
104      */
105     SpeedLimitInfo getSpeedLimitInfo();
106 
107     /**
108      * Models responding to other GTU may assume a route of the vehicle, for instance at intersections. The route may be short,
109      * i.e. only over the next intersection. Implementations may return anything from the actual route, a route based on
110      * indicators and other assumptions, or {@code null} if simply not known/estimated.
111      * @return route of gtu
112      */
113     Route getRoute();
114 
115 }