Package org.opentrafficsim.core.geometry
Class Test
java.lang.Object
org.opentrafficsim.core.geometry.Test
Copyright (c) 2013-2024 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 Summary
FieldsModifier and TypeFieldDescription(package private) static boolean
Print detailed output. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
printCoordinates
(String prefix, List<org.djutils.draw.point.Point2d> points, int fromIndex, int toIndex, String separator) Built a string description from part of an array of coordinates.static String
printCoordinates
(String prefix, OtsLine2d line, String separator) Build a string description from an OtsLine2d.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).
-
Field Details
-
printDetails
static boolean printDetailsPrint detailed output.
-
-
Method Details
-
test1
public static void test1()Kink near end of design line. -
test2
public static void test2()Kink halfway (far from any endpoint). -
test3
public static void test3()Kink plus decreasing width. -
test4
public static void test4()Two kinks, (too) close together. -
test5
public static void test5()Two-segment design line with minimal change of direction. -
test6
public static void test6()Straight design line with some noise (sufficiently far from the end points). -
test7
public static void test7()Straight design line with more noise (sufficiently far from the end points). -
test8
public static void test8()Straight design line with more noise (close to the end points). -
printCoordinates
Build a string description from an OtsLine2d.- Parameters:
prefix
- text to put before the coordinatesline
- the line for which to print the pointsseparator
- prepended to each coordinate- Returns:
- description of the OtsLine2d
-
printCoordinates
public static String printCoordinates(String prefix, List<org.djutils.draw.point.Point2d> points, int fromIndex, int toIndex, String separator) Built a string description from part of an array of coordinates.- Parameters:
prefix
- text to put before the outputpoints
- the coordinates to printfromIndex
- index of the first coordinate to printtoIndex
- one higher than the index of the last coordinate to printseparator
- prepended to each coordinate- Returns:
- description of the selected part of the array of coordinates
-