View Javadoc
1   package org.opentrafficsim.road.gtu.lane.perception.mental.channel;
2   
3   import org.djunits.value.vdouble.scalar.Duration;
4   import org.djunits.value.vdouble.scalar.Length;
5   import org.opentrafficsim.base.parameters.ParameterTypeLength;
6   import org.opentrafficsim.base.parameters.constraint.NumericConstraint;
7   import org.opentrafficsim.road.gtu.lane.perception.mental.Mental;
8   
9   /**
10   * Interface for mental modules that implement perception channels.
11   * <p>
12   * Copyright (c) 2024-2025 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
13   * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
14   * </p>
15   * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
16   */
17  public interface ChannelMental extends Mental
18  {
19  
20      /** Distance discount. */
21      ParameterTypeLength X0_D =
22              new ParameterTypeLength("x0_d", "Distance discount range", Length.ofSI(119.98), NumericConstraint.POSITIVEZERO);
23  
24      /**
25       * Returns the perception delay belonging to a perception channel.
26       * @param obj object that is a channel key, or that is mapped to a channel key.
27       * @return perception delay belonging to a perception channel.
28       */
29      Duration getPerceptionDelay(Object obj);
30  
31      /**
32       * Returns the level of attention of a perception channel.
33       * @param obj object that is a channel key, or that is mapped to a channel key.
34       * @return level of attention of a perception channel.
35       */
36      double getAttention(Object obj);
37  
38      /**
39       * Maps an object to a channel key.
40       * @param obj object.
41       * @param channel channel key.
42       */
43      void mapToChannel(Object obj, Object channel);
44  
45  }