Examples of laneCount()


Examples of org.movsim.roadmappings.RoadMapping.laneCount()

    @Test
    public void testRoadMappingBaseInt() {
        final int LANE_COUNT = 3;
        final RoadMapping roadMapping = new RoadMappingConcrete(LANE_COUNT);
        assertEquals(LANE_COUNT, roadMapping.laneCount());
    }

    @Test
    public void testRoadMappingBaseIntDouble() {
        final int LANE_COUNT = 3;
View Full Code Here

Examples of org.movsim.roadmappings.RoadMapping.laneCount()

    @Test
    public void testRoadMappingBaseIntDouble() {
        final int LANE_COUNT = 3;
        final double roadLength = 56.4;
        final RoadMapping roadMapping = new RoadMappingConcrete(LANE_COUNT, roadLength);
        assertEquals(LANE_COUNT, roadMapping.laneCount());
        assertEquals(roadLength, roadMapping.roadLength(), delta);
    }

    @Test
    public void testMapDouble() {
View Full Code Here

Examples of org.movsim.roadmappings.RoadMapping.laneCount()

    public void testRoadWidth() {
        final int LANE_COUNT = 3;
        RoadMapping roadMapping = new RoadMappingConcrete(LANE_COUNT);
        assertEquals(roadMapping.laneWidth() * LANE_COUNT, roadMapping.roadWidth(), delta);
        roadMapping = new RoadMappingConcrete(LANE_COUNT + 1);
        assertEquals(roadMapping.laneWidth() * roadMapping.laneCount(), roadMapping.roadWidth(), delta);
    }

    /**
     * Test method for {@link org.movsim.simulator.roadnetwork.RoadMapping#laneWidth()}
     */
 
View Full Code Here

Examples of org.movsim.roadmappings.RoadMapping.laneCount()

     */
    @Test
    public void testLaneCount() {
        final int LANE_COUNT = 3;
        RoadMapping roadMapping = new RoadMappingConcrete(LANE_COUNT);
        assertEquals(LANE_COUNT, roadMapping.laneCount());
        final double roadLength = 56.4;
        roadMapping = new RoadMappingConcrete(LANE_COUNT, roadLength);
        assertEquals(LANE_COUNT, roadMapping.laneCount());
    }

View Full Code Here

Examples of org.movsim.roadmappings.RoadMapping.laneCount()

        final int LANE_COUNT = 3;
        RoadMapping roadMapping = new RoadMappingConcrete(LANE_COUNT);
        assertEquals(LANE_COUNT, roadMapping.laneCount());
        final double roadLength = 56.4;
        roadMapping = new RoadMappingConcrete(LANE_COUNT, roadLength);
        assertEquals(LANE_COUNT, roadMapping.laneCount());
    }

    /**
     * Test method for {@link org.movsim.roadmappings.RoadMapping#laneOffset(int)}
     */
 
View Full Code Here

Examples of org.movsim.roadmappings.RoadMapping.laneCount()

            return;
        }

        final RoadMapping roadMapping = roadSegment.roadMapping();
        assert roadMapping != null;
        final double offset = -(roadMapping.laneCount() / 2.0 + 1.5) * roadMapping.laneWidth();
        final int redRadius2 = (int) (2.5 * roadMapping.laneWidth()) / 2;
        final int whiteRadius2 = (int) (2.0 * roadMapping.laneWidth()) / 2;
        final int fontHeight = whiteRadius2;
        final int offsetY = (int) (0.4 * fontHeight);
        final Font font = new Font("SansSerif", Font.BOLD, fontHeight); //$NON-NLS-1$
View Full Code Here

Examples of org.movsim.roadmappings.RoadMapping.laneCount()

        }

        final RoadMapping roadMapping = roadSegment.roadMapping();
        assert roadMapping != null;
        final double laneWidth = 10; // ;
        final double offset = -(roadMapping.laneCount() / 2.0 + 1.5) * (roadMapping.laneWidth() + 1);
        final int redRadius2 = (int) (2.5 * laneWidth) / 2;
        final int whiteRadius2 = (int) (2.0 * laneWidth) / 2;
        final int fontHeight = whiteRadius2;
        final int offsetY = (int) (0.4 * fontHeight);
        final Font font = new Font("SansSerif", Font.BOLD, fontHeight); //$NON-NLS-1$
View Full Code Here

Examples of org.movsim.roadmappings.RoadMapping.laneCount()

     */
    private void drawSources(Graphics2D g) {
        for (final RoadSegment roadSegment : roadNetwork) {
            final RoadMapping roadMapping = roadSegment.roadMapping();
            assert roadMapping != null;
            final int radius = (int) ((roadMapping.laneCount() + 2) * roadMapping.laneWidth());
            final RoadMapping.PosTheta posTheta;

            // draw the road segment source, if there is one
            final AbstractTrafficSource trafficSource = roadSegment.trafficSource();
            if (trafficSource != null) {
View Full Code Here

Examples of org.movsim.roadmappings.RoadMapping.laneCount()

     */
    private void drawSinks(Graphics2D g) {
        for (final RoadSegment roadSegment : roadNetwork) {
            final RoadMapping roadMapping = roadSegment.roadMapping();
            assert roadMapping != null;
            final int radius = (int) ((roadMapping.laneCount() + 2) * roadMapping.laneWidth());
            final RoadMapping.PosTheta posTheta;

            // draw the road segment sink, if there is one
            final TrafficSink sink = roadSegment.sink();
            if (sink != null) {
View Full Code Here

Examples of org.movsim.roadmappings.RoadMapping.laneCount()

     * Asserts the road segment's class invariant. Used for debugging.
     */
    public boolean assertInvariant() {
        final RoadMapping roadMapping = roadMapping();
        if (roadMapping != null) {
            assert roadMapping.laneCount() == laneCount();
            assert roadMapping.trafficLaneMax() == trafficLaneMax();
            assert roadMapping.trafficLaneMin() == trafficLaneMin();
            assert Math.abs(roadMapping.roadLength() - roadLength()) < 0.1;
        }
        for (final LaneSegment laneSegment : laneSegments) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.