RoadSegment extends DefaultWeightedEdge implements Iterable<Vehicle> { public final double roadLength() { return roadLength; } RoadSegment(double roadLength, int laneCount);  RoadSegment(RoadMapping roadMapping); static void resetNextId(); static int count(); final void addDefaultSink(); final int id(); final void setUserId(String userId); final String userId(); final RoadMapping roadMapping(); final void setRoadMapping(RoadMapping roadMapping); final AbstractTrafficSource trafficSource(); final void setTrafficSource(AbstractTrafficSource trafficSource); final TrafficSink sink(); final void setSink(TrafficSink sink); final double roadLength(); final double cumulativeRoadLength(); final int laneCount(); void setLaneType(int lane, Lanes.Type laneType); Lanes.Type laneType(int lane); int trafficLaneMin(); int trafficLaneMax(); final LaneSegment laneSegment(int lane); final void setSourceLaneSegmentForLane(LaneSegment sourceLaneSegment, int lane); final LaneSegment sourceLaneSegment(int lane); final RoadSegment sourceRoadSegment(int lane); final int sourceLane(int lane); final void setSinkLaneSegmentForLane(LaneSegment sinkLaneSegment, int lane); final LaneSegment sinkLaneSegment(int lane); final RoadSegment sinkRoadSegment(int lane); final int sinkLane(int lane); boolean exitsOnto(int exitRoadSegmentId); void clearVehicles(); int getVehicleCount(); int getStoppedVehicleCount(); int getObstacleCount(); int getVehicleCount(int lane); double meanSpeed(); double instantaneousTravelTime(); Vehicle getVehicle(int lane, int index); void removeFrontVehicleOnLane(int lane); int removeVehiclesPastEnd(); Iterable<Vehicle> getVehiclesPastEnd(); void addObstacle(Vehicle obstacle); void addVehicle(Vehicle vehicle); void appendVehicle(Vehicle vehicle); void updateRoadConditions(double dt, double simulationTime, long iterationCount); TrafficLightLocationWithDistance getNextDownstreamTrafficLight(double position, int lane,
            double maxLookAheadDistance); void addVariableMessageSign(VariableMessageSignBase variableMessageSign); void removeVariableMessageSign(VariableMessageSignBase variableMessageSign); void makeLaneChanges(double dt, double simulationTime, long iterationCount); void updateVehicleAccelerations(double dt, double simulationTime, long iterationCount); void updateVehiclePositionsAndSpeeds(double dt, double simulationTime, long iterationCount); void outFlow(double dt, double simulationTime, long iterationCount); void inFlow(double dt, double simulationTime, long iterationCount); void updateDetectors(double dt, double simulationTime, long iterationCount); Vehicle rearVehicleOnLane(int lane); Vehicle rearVehicle(int lane, double vehiclePos); Vehicle rearVehicleOnSinkLanePosAdjusted(int lane); Vehicle frontVehicleOnLane(int lane); Vehicle frontVehicleOnLane(Vehicle vehicle); Vehicle frontVehicle(int lane, double vehiclePos); void setSpeedLimits(List<Speed> list); Iterable<SpeedLimit> speedLimits(); void setElevationProfile(ElevationProfile elevationProfile); Iterable<Slope> slopes(); Iterable<TrafficLightLocation> trafficLightLocations(); boolean eachLaneIsSorted(); @Override final Iterator<Vehicle> iterator(); void checkForInconsistencies(double time, long iterationCount, boolean isWithCrashExit); final Iterator<LaneSegment> laneSegmentIterator(); Iterable<LaneSegment> laneSegments(); final LoopDetectors getLoopDetectors(); void setLoopDetectors(LoopDetectors loopDetectors); void setFlowConservingBottlenecks(FlowConservingBottlenecks flowConservingBottlenecks); boolean assertInvariant(); void setSimpleRamp(SimpleRamp simpleRamp); boolean isDownstreamLink(RoadSegment upstreamRoadSegment); void setUserRoadname(String name); void addTrafficLightLocation(TrafficLightLocation trafficLightLocation); Long getNode(NodeType nodeType); void setNode(NodeType nodeType, Long nodeId); @Override String toString(); String getUserId(); String getRoadName(); double getRoadLength(); org.movsim.network.autogen.opendrive.OpenDRIVE.Road getOdrRoad(); void setOdrRoad(org.movsim.network.autogen.opendrive.OpenDRIVE.Road road); void setRoadName(String roadName); LaneSegment[] getLaneSegments(); static final int ID_NOT_SET; static final int INITIAL_ID; }
@Test public final void testRoadLength() { final int laneCount = 1; RoadSegment r = new RoadSegment(1000.0, laneCount); assertEquals(1000.0, r.roadLength(), delta); r = new RoadSegment(1234.5, laneCount); assertEquals(1234.5, r.roadLength(), delta); }