Class DualBoundConstraintsTest

java.lang.Object
org.opentrafficsim.base.parameters.DualBoundConstraintsTest

public final class DualBoundConstraintsTest extends Object
Test DualBound.

Copyright (c) 2013-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Method Details

    • testNumericalConstraints

      @Test public void testNumericalConstraints()
      Test the DoubleBound Constraints.
    • loopCases

      public <T extends Number> void loopCases(Function<Double,T> function, Class<T> clazz)
      Test cases for a type.
      Type Parameters:
      T - type
      Parameters:
      function - function from double to type
      clazz - class of value type
    • checkConstraint

      public <T extends Number> void checkConstraint(double low, double high, boolean includeLow, boolean includeHigh, Function<Double,T> function, Class<T> clazz)
      Create a DoubleBound for the given values and test it.
      Type Parameters:
      T - type
      Parameters:
      low - the low limit of the DoubleBound
      high - the high limit of the DoubleBound
      includeLow - does the DoubleBound include the low limit value
      includeHigh - does the DoubleBound include the high limit value
      clazz - class of value type
      function - function from double to type