View Javadoc
1   package org.opentrafficsim.road.gtu.lane.perception;
2   
3   import org.opentrafficsim.core.gtu.GTUException;
4   import org.opentrafficsim.core.gtu.perception.Perception;
5   import org.opentrafficsim.core.network.NetworkException;
6   
7   /**
8    * The perception module of a GTU based on lanes. It is responsible for perceiving (sensing) the environment of the GTU, which
9    * includes the locations of other GTUs. Perception is done at a certain time, and the perceived information might have a
10   * limited validity. In that sense, Perception is stateful. Information can be requested as often as needed, but will only be
11   * recalculated when asked explicitly. This "Full" version of LanePerception will perceive all information at once when
12   * perceive() is called. <br>
13   * Perception for lane-based GTUs involves information about GTUs in front of the owner GTU on the same lane (the 'leader' GTU),
14   * parallel vehicles (important if we want to change lanes), distance to other vehicles on parallel lanes, as well in front as
15   * to the back (important if we want to change lanes), and information about obstacles, traffic lights, speed signs, and ending
16   * lanes.
17   * <p>
18   * Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
19   * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
20   * </p>
21   * $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $,
22   * initial version Nov 15, 2015 <br>
23   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
24   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
25   */
26  public class LanePerceptionFull extends AbstractLanePerception implements Perception
27  {
28      /** */
29      private static final long serialVersionUID = 20151128L;
30  
31      /**
32       * Create a new LanePerceptionFull module. Because the constructor is often called inside the constructor of a GTU, this
33       * constructor does not ask for the pointer to the GTU, as it is often impossible to provide at the time of construction.
34       * Use the setter of the GTU instead.
35       */
36      public LanePerceptionFull()
37      {
38          super();
39      }
40  
41      /** {@inheritDoc} */
42      @Override
43      public void perceive() throws GTUException, NetworkException
44      {
45          updateSpeedLimit();
46          updateForwardHeadwayGTU();
47          updateBackwardHeadwayGTU();
48          updateAccessibleAdjacentLanesLeft();
49          updateAccessibleAdjacentLanesRight();
50          updateParallelGTUsLeft();
51          updateParallelGTUsRight();
52          updateLaneTrafficLeft();
53          updateLaneTrafficRight();
54      }
55  
56  }