View Javadoc
1   package org.opentrafficsim.core.gtu.plan.tactical;
2   
3   import org.djunits.value.vdouble.scalar.Time;
4   import org.opentrafficsim.core.gtu.GTU;
5   import org.opentrafficsim.core.gtu.GTUException;
6   import org.opentrafficsim.core.gtu.behavioralcharacteristics.ParameterException;
7   import org.opentrafficsim.core.gtu.perception.Perception;
8   import org.opentrafficsim.core.gtu.plan.operational.OperationalPlan;
9   import org.opentrafficsim.core.gtu.plan.operational.OperationalPlanException;
10  import org.opentrafficsim.core.network.NetworkException;
11  
12  import nl.tudelft.simulation.language.d3.DirectedPoint;
13  
14  /**
15   * Tactical planners generate operational plans that are in line with reaching the goals of the strategical plan. The modeler is
16   * totally free how the tactical planners are generated. Usually there is one tactical planner at work, but it is of course
17   * possible to have multiple parallel planners that assess the situation and an overarching tactical planner that acts as a
18   * tie-breaker. Alternatively, a single tactical planner is activated depending on the situation. Suppose we drive on a
19   * multi-lane stretch of road. The tactical planner can use the headway and lane change algorithms to generate the right
20   * operational plans (movements). When the GTU nears a crossing, another tactical planner can be activated that takes care of
21   * going left, straight or right (based on a consultation of the strategical plan) and for providing a safe passage of the
22   * crossing. After the crossing, the standard headway and lane-change tactical planner take over.<br>
23   * The operational plans that the tactical planners generate can have a very different duration. In case of a standard headway
24   * and lane change algorithm with a time step of 0.5 seconds, each operational plan can take 0.5 seconds. Alternatively,
25   * operational plans can have a very different duration, depending on the situation. When changing lanes, the complete movement
26   * to the other lane can be one operational plan. When it is not busy, and the GTU can move for 5 seconds without problems, the
27   * operational plan can take 5 seconds. Based on external stimuli (for which the Perception unit of the GTU is responsible),
28   * operational plans can always be interrupted.
29   * <p>
30   * Copyright (c) 2013-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
31   * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
32   * </p>
33   * $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $,
34   * initial version Nov 14, 2015 <br>
35   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
36   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
37   */
38  public interface TacticalPlanner
39  {
40  
41      /**
42       * Returns the GTU.
43       * @return GTU
44       */
45      GTU getGtu();
46  
47      /**
48       * generate an operational plan, for now or for in the future.
49       * @param startTime the time from which the new operational plan has to be operational
50       * @param locationAtStartTime the location of the GTU at the start time of the new plan
51       * @return a new operational plan
52       * @throws OperationalPlanException when there is a problem planning a path in the network
53       * @throws GTUException when there is a problem with the state of the GTU when planning a path
54       * @throws NetworkException when there is a problem with the network on which the GTU is driving
55       * @throws ParameterException when there is a problem with a parameter
56       */
57      OperationalPlan generateOperationalPlan(Time startTime, DirectedPoint locationAtStartTime)
58              throws OperationalPlanException, GTUException, NetworkException, ParameterException;
59  
60      /** @return the perception unit belonging to this tactical planner. */
61      Perception getPerception();
62  
63      // TODO InitialXVT generateInitialXVT(GTUState gtu, DirectedPoint initialLocation, Speed desiredSpeed, GenerationPolicy
64      // generationPolicy)
65  }