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