View Javadoc
1   package org.opentrafficsim.road.gtu.lane.perception.mental;
2   
3   import org.djutils.base.Identifiable;
4   import org.opentrafficsim.base.parameters.ParameterException;
5   import org.opentrafficsim.base.parameters.Parameters;
6   import org.opentrafficsim.core.gtu.GtuException;
7   import org.opentrafficsim.road.gtu.lane.LaneBasedGtu;
8   import org.opentrafficsim.road.gtu.lane.perception.LanePerception;
9   
10  /**
11   * Interface for tasks, where each describes a fundamental relation between exogenous inputs causing a mental task demand. The
12   * concept of anticipation reliance can be included, which is a reduction of mental task demand by prioritizing a primary task
13   * and relying more on anticipation regarding secondary tasks. Control over the amount of anticipation reliance is
14   * implementation dependent, but is typically not part of the task itself.
15   * <p>
16   * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
17   * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
18   * </p>
19   * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
20   * @author <a href="https://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a>
21   * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
22   */
23  public interface Task extends Identifiable
24  {
25  
26      /**
27       * Returns the gross task demand to be managed by a task manager.
28       * @param perception LanePerception; perception
29       * @param gtu LaneBasedGtu; gtu
30       * @param parameters Parameters; parameters
31       * @return double; gross task demand
32       * @throws ParameterException if a parameter is missing or out of bounds
33       * @throws GtuException exceptions pertaining to the GTU
34       */
35      double calculateTaskDemand(LanePerception perception, LaneBasedGtu gtu, Parameters parameters)
36              throws ParameterException, GtuException;
37  
38      /**
39       * Sets (gross) task demand.
40       * @param taskDemand double; set task demand
41       */
42      void setTaskDemand(double taskDemand);
43  
44      /**
45       * Returns the gross demand of this task, i.e without considering anticipation reliance.
46       * @return double; gross demand of this task, i.e. without considering anticipation reliance
47       */
48      double getTaskDemand();
49  
50      /**
51       * Set anticipation reliance.
52       * @param anticipationReliance double; set anticipation reliance
53       */
54      void setAnticipationReliance(double anticipationReliance);
55  
56      /**
57       * Returns the level of anticipation reliance.
58       * @return double; anticipation reliance
59       */
60      double getAnticipationReliance();
61  
62  }