1 package org.opentrafficsim.road.gtu.lane.perception.mental;
2
3 import org.opentrafficsim.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-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
17 * BSD-style license. See <a href="http://opentrafficsim.org/node/13">OpenTrafficSim License</a>.
18 * <p>
19 * @version $Revision$, $LastChangedDate$, by $Author$, initial version 3 apr. 2018 <br>
20 * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
21 * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
22 * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
23 */
24 public interface Task extends Identifiable
25 {
26
27 /**
28 * Returns the gross task demand to be managed by a task manager.
29 * @param perception LanePerception; perception
30 * @param gtu LaneBasedGTU; gtu
31 * @param parameters Parameters; parameters
32 * @return double; gross task demand
33 * @throws ParameterException if a parameter is missing or out of bounds
34 * @throws GTUException exceptions pertaining to the GTU
35 */
36 double calculateTaskDemand(LanePerception perception, LaneBasedGTU gtu, Parameters parameters)
37 throws ParameterException, GTUException;
38
39 /**
40 * Sets (gross) task demand.
41 * @param taskDemand double; set task demand
42 */
43 void setTaskDemand(double taskDemand);
44
45 /**
46 * Returns the gross demand of this task, i.e without considering anticipation reliance.
47 * @return double; gross demand of this task, i.e. without considering anticipation reliance
48 */
49 double getTaskDemand();
50
51 /**
52 * Set anticipation reliance.
53 * @param anticipationReliance double; set anticipation reliance
54 */
55 void setAnticipationReliance(double anticipationReliance);
56
57 /**
58 * Returns the level of anticipation reliance.
59 * @return double; anticipation reliance
60 */
61 double getAnticipationReliance();
62
63 }