Class Transformer
- java.lang.Object
-
- org.opentrafficsim.road.network.factory.xml.utils.Transformer
-
public final class Transformer extends Object
Transformer contains common transformations between intermediate classes created by the JAXB Adapters and OTS objects.Copyright (c) 2003-2020 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ArrivalsHeadwayGenerator.HeadwayDistributionparseHeadwayDistribution(String v)static LaneKeepingPolicyparseLaneKeepingPolicy(String lkpStr)static LengthparseLengthBeginEnd(LengthBeginEnd lbe, Length laneLength)Parse LengthBeginEnd for a Lane.static LaneBasedGTUGenerator.RoomCheckerparseRoomChecker(String v)static RelativePosition.TYPEparseTriggerPosition(GTUPositionType positionType)
-
-
-
Method Detail
-
parseLengthBeginEnd
public static Length parseLengthBeginEnd(LengthBeginEnd lbe, Length laneLength)
Parse LengthBeginEnd for a Lane.- Parameters:
lbe- LengthBeginEnd; the begin, end, fraction, or offset from begin or end on the lanelaneLength- Length; the length of the lane- Returns:
- the offset on the lane
-
parseTriggerPosition
public static RelativePosition.TYPE parseTriggerPosition(GTUPositionType positionType)
- Parameters:
positionType- GTUPositionType; the JAXB position to parse- Returns:
- the corresponding OTS RelativePosition
-
parseLaneKeepingPolicy
public static LaneKeepingPolicy parseLaneKeepingPolicy(String lkpStr) throws NetworkException
- Parameters:
lkpStr- String; the lane keeping policy string.- Returns:
- the lane keeping policy.
- Throws:
NetworkException- in case of unknown policy.
-
parseRoomChecker
public static LaneBasedGTUGenerator.RoomChecker parseRoomChecker(String v)
- Parameters:
v- String; XML string value- Returns:
- RoomChecker; parsed room checker
-
parseHeadwayDistribution
public static ArrivalsHeadwayGenerator.HeadwayDistribution parseHeadwayDistribution(String v) throws NoSuchFieldException, IllegalAccessException
- Parameters:
v- String; XML string value- Returns:
- RoomChecker; parsed room checker
- Throws:
NoSuchFieldException- ifHeadwayDistributiondoes not have specified fieldIllegalAccessException- if the field is not accessible
-
-