Class Test

java.lang.Object
org.opentrafficsim.core.geometry.Test

public final class Test extends Object

Copyright (c) 2013-2023 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
  • Field Details

    • printDetails

      static boolean printDetails
      Print detailed output.
  • Method Details

    • checkAll

      public static String checkAll(OtsLine3d reference, double offset)
      Apply all offset methods and check the results.
      Parameters:
      reference - OtsLine3d; reference line
      offset - double; the offset
      Returns:
      int; the number of failures
    • timeLimitedCheckOffsetLine

      public static String timeLimitedCheckOffsetLine(OtsLine3d reference, double offset, OtsLine3d.OffsetMethod offsetMethod, int timeLimitMillis)
      Parameters:
      reference - OtsLine3d; the reference line
      offset - double; the offset
      offsetMethod - OtsLine3d.OffsetMethod; the offset method
      timeLimitMillis - int; maximum running time in milliseconds
      Returns:
      String; empty string on success, description of the result on failure
    • main

      public static void main(String[] args) throws NetworkException, OtsGeometryException
      Parameters:
      args - String[]; args
      Throws:
      NetworkException - on error
      OtsGeometryException - on error
    • checkOffsetLine

      public static boolean checkOffsetLine(OtsLine3d referenceLine, double offset, OtsLine3d.OffsetMethod offsetMethod)
      Check the offsetLine method.
      Parameters:
      referenceLine - OtsLine3d; the reference line
      offset - double; the offset
      offsetMethod - OtsLine3d.OffsetMethod; the offset method
      Returns:
      boolean; false if the result is obviously wrong; true if the result (appears to be) fine
    • test1

      public static void test1() throws OtsGeometryException
      Kink near end of design line.
      Throws:
      OtsGeometryException - on error
    • test2

      public static void test2() throws OtsGeometryException
      Kink halfway (far from any endpoint).
      Throws:
      OtsGeometryException - on error
    • test3

      public static void test3() throws OtsGeometryException
      Kink plus decreasing width.
      Throws:
      OtsGeometryException - on error
    • test4

      public static void test4() throws OtsGeometryException
      Two kinks, (too) close together.
      Throws:
      OtsGeometryException - on error
    • test5

      public static void test5() throws OtsGeometryException
      Two-segment design line with minimal change of direction.
      Throws:
      OtsGeometryException - on error
    • test6

      public static void test6() throws OtsGeometryException
      Straight design line with some noise (sufficiently far from the end points).
      Throws:
      OtsGeometryException - on error
    • test7

      public static void test7() throws OtsGeometryException
      Straight design line with more noise (sufficiently far from the end points).
      Throws:
      OtsGeometryException - on error
    • test8

      public static void test8() throws OtsGeometryException
      Straight design line with more noise (close to the end points).
      Throws:
      OtsGeometryException - on error