Package org.matsim.lanes
Class LanesUtils
- java.lang.Object
-
- org.matsim.lanes.LanesUtils
-
public final class LanesUtils extends Object
- Author:
- dgrether, tthunig
-
-
Constructor Summary
Constructors Constructor Description LanesUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.static void
calculateMissingCapacitiesForLanes20(String networkInputFilename, String lanes20InputFilename, String lanes20OutputFilename)
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.static List<ModelLane>
createLanes(Link link, LanesToLinkAssignment lanesToLinkAssignment)
Creates a sorted list of lanes for a link.static Lanes
createLanesContainer()
static void
createOriginalLanesAndSetLaneCapacities(Network network, Lanes lanes)
Replaces the method that converted a lane from format 11 to format 20.static void
overwriteLaneCapacitiesByNetworkCapacities(Network net, Lanes lanes)
-
-
-
Constructor Detail
-
LanesUtils
public LanesUtils()
-
-
Method Detail
-
createLanesContainer
public static Lanes createLanesContainer()
-
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 addedfactory
- a LaneDefinitionsFactory to create the lanelaneId
-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<ModelLane> createLanes(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.
-
calculateMissingCapacitiesForLanes20
public static void calculateMissingCapacitiesForLanes20(String networkInputFilename, String lanes20InputFilename, String lanes20OutputFilename)
-
overwriteLaneCapacitiesByNetworkCapacities
public static void overwriteLaneCapacitiesByNetworkCapacities(Network net, Lanes lanes)
-
-