1 package org.opentrafficsim.road.gtu.lane.perception.mental;
2
3 import org.opentrafficsim.base.parameters.ParameterException;
4 import org.opentrafficsim.base.parameters.Parameters;
5 import org.opentrafficsim.core.gtu.GTUException;
6 import org.opentrafficsim.road.gtu.lane.LaneBasedGTU;
7 import org.opentrafficsim.road.gtu.lane.perception.LanePerception;
8
9 /**
10 * Class for constant demand.
11 * <p>
12 * Copyright (c) 2013-2020 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 30 jan. 2019 <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 ConstantTask extends AbstractTask
21 {
22 /**
23 * Constructor.
24 * @param id String; id
25 * @param taskDemand double; task demand
26 */
27 public ConstantTask(final String id, final double taskDemand)
28 {
29 super(id);
30 setTaskDemand(taskDemand);
31 }
32
33 /** {@inheritDoc} */
34 @Override
35 public double calculateTaskDemand(final LanePerception perception, final LaneBasedGTU gtu, final Parameters parameters)
36 throws ParameterException, GTUException
37 {
38 return getTaskDemand();
39 }
40 }