Class Test

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

public final class Test
extends java.lang.Object

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

$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Nov 9, 2015
Author:
Alexander Verbraeck, Peter Knoppers
  • Method Summary

    Modifier and Type Method Description
    static java.lang.String checkAll​(org.opentrafficsim.core.geometry.OTSLine3D reference, double offset)
    Apply all offset methods and check the results.
    static boolean checkOffsetLine​(org.opentrafficsim.core.geometry.OTSLine3D referenceLine, double offset, org.opentrafficsim.core.geometry.OTSLine3D.OffsetMethod offsetMethod)
    Check the offsetLine method.
    static void main​(java.lang.String[] args)  
    static void test1()
    Kink near end of design line.
    static void test2()
    Kink halfway (far from any endpoint).
    static void test3()
    Kink plus decreasing width.
    static void test4()
    Two kinks, (too) close together.
    static void test5()
    Two-segment design line with minimal change of direction.
    static void test6()
    Straight design line with some noise (sufficiently far from the end points).
    static void test7()
    Straight design line with more noise (sufficiently far from the end points).
    static void test8()
    Straight design line with more noise (close to the end points).
    static java.lang.String timeLimitedCheckOffsetLine​(org.opentrafficsim.core.geometry.OTSLine3D reference, double offset, org.opentrafficsim.core.geometry.OTSLine3D.OffsetMethod offsetMethod, int timeLimitMillis)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • checkAll

      public static java.lang.String checkAll​(org.opentrafficsim.core.geometry.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 java.lang.String timeLimitedCheckOffsetLine​(org.opentrafficsim.core.geometry.OTSLine3D reference, double offset, org.opentrafficsim.core.geometry.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​(java.lang.String[] args) throws org.opentrafficsim.core.network.NetworkException, org.opentrafficsim.core.geometry.OTSGeometryException
      Parameters:
      args - String[]; args
      Throws:
      org.opentrafficsim.core.network.NetworkException - on error
      org.opentrafficsim.core.geometry.OTSGeometryException - on error
    • checkOffsetLine

      public static boolean checkOffsetLine​(org.opentrafficsim.core.geometry.OTSLine3D referenceLine, double offset, org.opentrafficsim.core.geometry.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 org.opentrafficsim.core.geometry.OTSGeometryException
      Kink near end of design line.
      Throws:
      org.opentrafficsim.core.geometry.OTSGeometryException - on error
    • test2

      public static void test2() throws org.opentrafficsim.core.geometry.OTSGeometryException
      Kink halfway (far from any endpoint).
      Throws:
      org.opentrafficsim.core.geometry.OTSGeometryException - on error
    • test3

      public static void test3() throws org.opentrafficsim.core.geometry.OTSGeometryException
      Kink plus decreasing width.
      Throws:
      org.opentrafficsim.core.geometry.OTSGeometryException - on error
    • test4

      public static void test4() throws org.opentrafficsim.core.geometry.OTSGeometryException
      Two kinks, (too) close together.
      Throws:
      org.opentrafficsim.core.geometry.OTSGeometryException - on error
    • test5

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

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

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

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