builder.setLaneId(laneId); builder.setLength(lane.getLength()); builder.setEffectiveNumberOfLanes(lane.getLaneData().getNumberOfRepresentedLanes()); builder.setFlowCapacity_s(lane.getLaneData().getCapacityVehiclesPerHour() / 3600.); QLaneI queue = builder.createLane(this);
private VisLane createVisLane(ModelLane qlane, double linkLength, double linkScale, double linkLengthCorrectionFactor) { String id = qlane.getLaneData().getId().toString(); double startPosition = (linkLength - qlane.getLaneData().getStartsAtMeterFromLinkEnd()) * linkScale * linkLengthCorrectionFactor; double endPosition = startPosition + (qlane.getLength() * linkScale * linkLengthCorrectionFactor); // log.error("lane " + qlane.getId() + " starts at: " + startPosition + " and ends at : " +endPosition); int alignment = qlane.getLaneData().getAlignment(); VisLane lane = new VisLane(id); lane.setStartPosition(startPosition); lane.setEndPosition(endPosition); lane.setAlignment(alignment); lane.setNumberOfLanes(qlane.getLaneData().getNumberOfRepresentedLanes()); return lane; }
/** * 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. */ public static void calculateAndSetCapacity(Lane lane, boolean isLaneAtLinkEnd, Link link, Network network){ if (isLaneAtLinkEnd){ double noLanesLink = link.getNumberOfLanes(); double linkFlowCapPerSecondPerLane = link.getCapacity() / network.getCapacityPeriod() / noLanesLink; double laneFlowCapPerHour = lane.getNumberOfRepresentedLanes() * linkFlowCapPerSecondPerLane * 3600.0; lane.setCapacityVehiclesPerHour(laneFlowCapPerHour); } else { double capacity = link.getCapacity() / network.getCapacityPeriod() * 3600.0; lane.setCapacityVehiclesPerHour(capacity); } }
assertEquals(linkId1, lane.getToLinkIds().get(0)); assertEquals(45.0, lane.getStartsAtMeterFromLinkEnd(), EPSILON); assertEquals(1.0, lane.getNumberOfRepresentedLanes()); assertEquals(0.725, lane.getCapacityVehiclesPerHour(), EPSILON); lane = lanes.get(1); assertEquals(laneId5, lane.getId()); assertEquals(60.0, lane.getStartsAtMeterFromLinkEnd(), EPSILON); assertEquals(2.5, lane.getNumberOfRepresentedLanes()); assertEquals(2, lane.getCapacityVehiclesPerHour(), EPSILON); assertEquals(45.0, lane.getStartsAtMeterFromLinkEnd(), EPSILON); assertEquals(1900.0, lane.getCapacityVehiclesPerHour(), EPSILON); assertEquals(1.0, lane.getNumberOfRepresentedLanes());
lanes.setNumber(bl.getNumberOfRepresentedLanes()); xmllane.setRepresentedLanes(lanes);