Class Transformer


  • public final class Transformer
    extends java.lang.Object
    Transformer contains common transformations between intermediate classes created by the JAXB Adapters and OTS objects.

    Copyright (c) 2003-2018 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.
    Author:
    Alexander Verbraeck
    • 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 lane
        laneLength - 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​(java.lang.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​(java.lang.String v)
        Parameters:
        v - String; XML string value
        Returns:
        RoomChecker; parsed room checker
      • parseHeadwayDistribution

        public static ArrivalsHeadwayGenerator.HeadwayDistribution parseHeadwayDistribution​(java.lang.String v)
                                                                                     throws java.lang.NoSuchFieldException,
                                                                                            java.lang.IllegalAccessException
        Parameters:
        v - String; XML string value
        Returns:
        RoomChecker; parsed room checker
        Throws:
        java.lang.NoSuchFieldException - if HeadwayDistribution does not have specified field
        java.lang.IllegalAccessException - if the field is not accessible