Examples of rearVehicle()


Examples of org.movsim.simulator.roadnetwork.LaneSegment.rearVehicle()

            final double gapFront = me.getNetDistance(newFront);
            if (gapFront < param.getMinimumGap()) {
                return prospectiveBalance;
            }
        }
        final Vehicle newBack = newLaneSegment.rearVehicle(me);
        if (newBack != null) {
            if (newBack.inProcessOfLaneChange()) {
                return prospectiveBalance;
            }
            final double gapRear = newBack.getNetDistance(me);
View Full Code Here

Examples of org.movsim.simulator.roadnetwork.LaneSegment.rearVehicle()

        // old situation for me
        final double meOldAcc = me.calcAccModel(currentLaneSegment, null);

        // old situation for old back
        // in old situation same left lane as me
        final Vehicle oldBack = currentLaneSegment.rearVehicle(me);
        final double oldBackOldAcc = (oldBack != null) ? oldBack.calcAccModel(currentLaneSegment, null) : 0.0;

        // old situation for new back: just provides the actual left-lane situation
        final double newBackOldAcc = (newBack != null) ? newBack.calcAccModel(newLaneSegment, null) : 0.0;
View Full Code Here

Examples of org.movsim.simulator.roadnetwork.LaneSegment.rearVehicle()

            final LaneSegment laneSegmentPlus = roadSegment.laneSegment(lanePlus);
            final LaneSegment laneSegmentMinus = roadSegment.laneSegment(laneMinus);
            final Vehicle frontPlus = laneSegmentPlus.frontVehicle(me);
            final Vehicle rearPlus = laneSegmentPlus.rearVehicle(me);
            final Vehicle frontMinus = laneSegmentMinus.frontVehicle(me);
            final Vehicle rearMinus = laneSegmentMinus.rearVehicle(me);
            if ((frontPlus == null) || (frontMinus == null) || (rearPlus == null) || (rearMinus == null)) {
                return prospectiveBalance;
            }

            double vPlus = Math.min(frontPlus.getSpeed(), rearPlus.getSpeed());
View Full Code Here

Examples of org.movsim.simulator.roadnetwork.LaneSegment.rearVehicle()

                    final double gapFront = me.getNetDistance(newFront);
                    if (gapFront < lcModelMOBIL.getParameter().getMinimumGap()) {
                        return LaneChangeDecision.NONE;
                    }
                }
                final Vehicle newBack = newLaneSegment.rearVehicle(me);
                if (newBack != null) {
                    if (newBack.inProcessOfLaneChange()) {
                        return LaneChangeDecision.NONE;
                    }
                    final double gapRear = newBack.getNetDistance(me);
View Full Code Here

Examples of org.movsim.simulator.roadnetwork.RoadSegment.rearVehicle()

        final Vehicle v3 = newVehicle(25.0, 4.0, Lanes.LANE2, lengthCar);
        // final MOBIL m3 = new MOBIL(v3, minimumGap, safeDeceleration, politeness, thresholdAcceleration, rightBiasAcceleration);
        r1.addVehicle(v3);

        final Vehicle rV = r1.rearVehicle(Lanes.LANE1, v2.getRearPosition());
        assertEquals(v1.getId(), rV.getId());

        double balance = m2.calcAccelerationBalance(v2, Lanes.TO_LEFT, r1);
        assertTrue(balance < 0.0);
    }
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.