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.base.parameters.ParameterSet;
7   import org.opentrafficsim.core.gtu.GTUException;
8   import org.opentrafficsim.road.gtu.lane.LaneBasedGTU;
9   
10  /**
11   * <p>
12   * Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
13   * BSD-style license. See <a href="http://opentrafficsim.org/node/13">OpenTrafficSim License</a>.
14   * <p>
15   * @version $Revision$, $LastChangedDate$, by $Author$, initial version 5 apr. 2018 <br>
16   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
17   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
18   * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
19   */
20  public class HeadwayGTUPerceived extends HeadwayGTURealCopy
21  {
22  
23      /** */
24      private static final long serialVersionUID = 20180405L;
25  
26      /**
27       * @param gtu LaneBasedGTU; gtu
28       * @param distance Length; distance
29       * @param speed Speed; speed
30       * @param acceleration Acceleration; acceleration
31       * @throws GTUException ...
32       */
33      public HeadwayGTUPerceived(final LaneBasedGTU gtu, final Length distance, final Speed speed,
34              final Acceleration acceleration) throws GTUException
35      {
36          super(gtu.getId(), gtu.getGTUType(), distance, gtu.getLength(), gtu.getWidth(), speed, acceleration,
37                  gtu.getTacticalPlanner().getCarFollowingModel(), new ParameterSet(gtu.getParameters()), getSpeedLimitInfo(gtu),
38                  gtu.getStrategicalPlanner().getRoute(), gtu.getDesiredSpeed(),
39                  getGTUStatuses(gtu, gtu.getSimulator().getSimulatorTime()));
40      }
41  
42      /**
43       * @param gtu LaneBasedGTU; gtu
44       * @param overlapFront Length; the overlap over the front of the GTU
45       * @param overlap Length; ???
46       * @param overlapRear Length; the overlap over the rear of the GTU
47       * @param speed Speed; speed
48       * @param acceleration Acceleration; acceleration
49       * @throws GTUException ...
50       */
51      public HeadwayGTUPerceived(final LaneBasedGTU gtu, final Length overlapFront, final Length overlap,
52              final Length overlapRear, final Speed speed, final Acceleration acceleration) throws GTUException
53      {
54          super(gtu.getId(), gtu.getGTUType(), overlapFront, overlap, overlapRear, gtu.getLength(), gtu.getWidth(), speed,
55                  acceleration, gtu.getTacticalPlanner().getCarFollowingModel(), new ParameterSet(gtu.getParameters()),
56                  getSpeedLimitInfo(gtu), gtu.getStrategicalPlanner().getRoute(), gtu.getDesiredSpeed(),
57                  getGTUStatuses(gtu, gtu.getSimulator().getSimulatorTime()));
58      }
59  
60  }