View Javadoc
1   package org.opentrafficsim.road.network.speed;
2   
3   import org.djunits.value.vdouble.scalar.Speed;
4   
5   /**
6    * Speed limit information.
7    * <p>
8    * Copyright (c) 2026-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
9    * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
10   * </p>
11   * @author Wouter Schakel
12   * @param speed speed limit
13   * @param enforced whether the speed limit is enforced (e.g. speed camera)
14   */
15  public record SpeedLimit(Speed speed, boolean enforced)
16  {
17  
18      /**
19       * Returns a standard non-enforced speed limit.
20       * @param speed speed limit
21       * @return standard non-enforced speed limit
22       */
23      public static SpeedLimit of(final Speed speed)
24      {
25          return new SpeedLimit(speed, false);
26      }
27  
28  }