View Javadoc
1   package org.opentrafficsim.road.gtu.strategical;
2   
3   import java.io.Serializable;
4   
5   import org.opentrafficsim.core.gtu.behavioralcharacteristics.BehavioralCharacteristics;
6   import org.opentrafficsim.road.gtu.lane.LaneBasedGTU;
7   
8   import nl.tudelft.simulation.language.Throw;
9   
10  /**
11   * <p>
12   * Copyright (c) 2013-2016 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/docs/license.html">OpenTrafficSim License</a>.
14   * </p>
15   * $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $,
16   * initial version Nov 26, 2015 <br>
17   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
18   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
19   */
20  public abstract class AbstractLaneBasedStrategicalPlanner implements LaneBasedStrategicalPlanner, Serializable
21  {
22      /** */
23      private static final long serialVersionUID = 20151126L;
24  
25      /** GTU. */
26      private final LaneBasedGTU gtu;
27  
28      /** The personal driving characteristics, which contain settings for the tactical planner. */
29      private BehavioralCharacteristics behavioralCharacteristics;
30  
31      /**
32       * @param behavioralCharacteristics the personal driving characteristics, which contain settings for the tactical planner
33       * @param gtu GTU
34       */
35      public AbstractLaneBasedStrategicalPlanner(final BehavioralCharacteristics behavioralCharacteristics,
36          final LaneBasedGTU gtu)
37      {
38          Throw.whenNull(behavioralCharacteristics, "Behavioral characteristics may not be null.");
39          Throw.whenNull(gtu, "GTU may not be null.");
40          this.behavioralCharacteristics = behavioralCharacteristics;
41          this.gtu = gtu;
42      }
43  
44      /** {@inheritDoc} */
45      @Override
46      public final BehavioralCharacteristics getBehavioralCharacteristics()
47      {
48          return this.behavioralCharacteristics;
49      }
50  
51      /** {@inheritDoc} */
52      @Override
53      public final void setBehavioralCharacteristics(final BehavioralCharacteristics behavioralCharacteristics)
54      {
55          this.behavioralCharacteristics = behavioralCharacteristics;
56      }
57  
58      /** {@inheritDoc} */
59      @Override
60      public final LaneBasedGTU getGtu()
61      {
62          return this.gtu;
63      }
64  
65  }