Package org.opentrafficsim.core.geometry
Class Test
- java.lang.Object
- 
- org.opentrafficsim.core.geometry.Test
 
- 
 public final class Test extends java.lang.ObjectCopyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Nov 9, 2015
 BSD-style license. See OpenTrafficSim License.- Author:
- Alexander Verbraeck, Peter Knoppers
 
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringcheckAll(OTSLine3D reference, double offset)Apply all offset methods and check the results.static booleancheckOffsetLine(OTSLine3D referenceLine, double offset, OTSLine3D.OffsetMethod offsetMethod)Check the offsetLine method.static voidmain(java.lang.String[] args)static voidtest1()Kink near end of design line.static voidtest2()Kink halfway (far from any endpoint).static voidtest3()Kink plus decreasing width.static voidtest4()Two kinks, (too) close together.static voidtest5()Two-segment design line with minimal change of direction.static voidtest6()Straight design line with some noise (sufficiently far from the end points).static voidtest7()Straight design line with more noise (sufficiently far from the end points).static voidtest8()Straight design line with more noise (close to the end points).static java.lang.StringtimeLimitedCheckOffsetLine(OTSLine3D reference, double offset, OTSLine3D.OffsetMethod offsetMethod, int timeLimitMillis)
 
- 
- 
- 
Method Detail- 
checkAllpublic static java.lang.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
 
 - 
timeLimitedCheckOffsetLinepublic static java.lang.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
 
 - 
mainpublic static void main(java.lang.String[] args) throws NetworkException, OTSGeometryException- Parameters:
- args- String[]; args
- Throws:
- NetworkException- on error
- OTSGeometryException- on error
 
 - 
checkOffsetLinepublic 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
 
 - 
test1public static void test1() throws OTSGeometryExceptionKink near end of design line.- Throws:
- OTSGeometryException- on error
 
 - 
test2public static void test2() throws OTSGeometryExceptionKink halfway (far from any endpoint).- Throws:
- OTSGeometryException- on error
 
 - 
test3public static void test3() throws OTSGeometryExceptionKink plus decreasing width.- Throws:
- OTSGeometryException- on error
 
 - 
test4public static void test4() throws OTSGeometryExceptionTwo kinks, (too) close together.- Throws:
- OTSGeometryException- on error
 
 - 
test5public static void test5() throws OTSGeometryExceptionTwo-segment design line with minimal change of direction.- Throws:
- OTSGeometryException- on error
 
 - 
test6public static void test6() throws OTSGeometryExceptionStraight design line with some noise (sufficiently far from the end points).- Throws:
- OTSGeometryException- on error
 
 - 
test7public static void test7() throws OTSGeometryExceptionStraight design line with more noise (sufficiently far from the end points).- Throws:
- OTSGeometryException- on error
 
 - 
test8public static void test8() throws OTSGeometryExceptionStraight design line with more noise (close to the end points).- Throws:
- OTSGeometryException- on error
 
 
- 
 
-