View Javadoc
1   package org.opentrafficsim.road.gtu.lane.perception.mental.ar;
2   
3   import org.opentrafficsim.base.parameters.ParameterException;
4   import org.opentrafficsim.road.gtu.lane.perception.LanePerception;
5   
6   /**
7    * Class for constant demand.
8    * <p>
9    * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
10   * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
11   * </p>
12   * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
13   */
14  public class ArTaskConstant extends AbstractArTask
15  {
16  
17      /** Constant task demand level. */
18      private final double taskDemand;
19  
20      /**
21       * Constructor.
22       * @param id id
23       * @param taskDemand task demand
24       */
25      public ArTaskConstant(final String id, final double taskDemand)
26      {
27          super(id);
28          this.taskDemand = taskDemand;
29      }
30  
31      @Override
32      public double calculateTaskDemand(final LanePerception perception) throws ParameterException
33      {
34          return this.taskDemand;
35      }
36  
37  }