Class LanesUtils

    • Method Detail

      • createAndAddLane

        public static void createAndAddLane​(LanesToLinkAssignment l2l,
                                            LanesFactory factory,
                                            Id<Lane> laneId,
                                            double capacity,
                                            double startsAtMeterFromLinkEnd,
                                            int alignment,
                                            int numberOfRepresentedLanes,
                                            List<Id<Link>> toLinkIds,
                                            List<Id<Lane>> toLaneIds)
        Convenience method to create a lane with the given Id, the given length, the given capacity, the given number of represented lanes, the given alignment and the given Ids of the downstream links or lanes, respectively, the lane leads to. The lane is added to the LanesToLinkAssignment given as parameter.
        Parameters:
        l2l - the LanesToLinkAssignment to that the created lane is added
        factory - a LaneDefinitionsFactory to create the lane
        laneId -
        capacity -
        startsAtMeterFromLinkEnd -
        alignment -
        numberOfRepresentedLanes -
        toLinkIds -
        toLaneIds -
      • createOriginalLanesAndSetLaneCapacities

        public static void createOriginalLanesAndSetLaneCapacities​(Network network,
                                                                   Lanes lanes)
        Replaces the method that converted a lane from format 11 to format 20. Use this when you have not defined an original lane of the link and when you have not set lane capacities yet.
      • createLanes

        public static List<ModelLanecreateLanes​(Link link,
                                                  LanesToLinkAssignment lanesToLinkAssignment)
        Creates a sorted list of lanes for a link.
        Parameters:
        link -
        lanesToLinkAssignment -
        Returns:
        sorted list with the most upstream lane at the first position.
      • calculateAndSetCapacity

        public static void calculateAndSetCapacity​(Lane lane,
                                                   boolean isLaneAtLinkEnd,
                                                   Link link,
                                                   Network network)
        Calculate capacity by formular from Neumann2008DA: Flow of a Lane is given by the flow of the link divided by the number of lanes represented by the link. A Lane may represent one or more lanes in reality. This is given by the attribute numberOfRepresentedLanes of the Lane definition. The flow of a lane is scaled by this number.