Examples of frontVehicle()


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

            // considered already in the upstream segment
            final LaneSegment exitLaneSegment = roadSegment.laneSegment(roadSegment.trafficLaneMax());
            if (exitLaneSegment != null && exitLaneSegment.type() == Lanes.Type.EXIT) {
                // this front vehicle could also result in negative net distances
                // but the deceleration is limited anyway
                Vehicle frontVehicle = exitLaneSegment.frontVehicle(this);
                double accToVehicleInExitLane = longitudinalModel.calcAcc(this, frontVehicle);
                final double decelLimit = 4.0;
                accToVehicleInExitLane = Math.max(accToVehicleInExitLane, -decelLimit);
                if (LOG.isDebugEnabled()) {
                    LOG.debug(String
View Full Code Here

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

        if (newLaneSegment.type() == Lanes.Type.ENTRANCE) {
            // never change lane into an entrance lane
            return prospectiveBalance;
        }

        final Vehicle newFront = newLaneSegment.frontVehicle(me);
        if (newFront != null) {
            if (newFront.inProcessOfLaneChange()) {
                return prospectiveBalance;
            }
            final double gapFront = me.getNetDistance(newFront);
View Full Code Here

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

            if (gapRear < param.getMinimumGap()) {
                return prospectiveBalance;
            }
        }
        final LaneSegment currentLaneSegment = roadSegment.laneSegment(currentLane);
        final Vehicle oldFront = currentLaneSegment.frontVehicle(me);
        if (oldFront != null) {
            if (oldFront.inProcessOfLaneChange()) {
                return prospectiveBalance;
            }
        }
View Full Code Here

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

            oldBackNewAcc = 0.0;
        } else {
            // cannot temporarily remove the current vehicle from the current lane, since we are in a loop
            // that iterates over the vehicles in the current lane. So calculate oldBackNewAcc based on just
            // the front vehicle.
            if (currentLaneSegment.frontVehicle(me) != null) { // TODO remove quickhack for avoiding nullpointer
                oldBackNewAcc = oldBack.getLongitudinalModel().calcAcc(oldBack, currentLaneSegment.frontVehicle(me));
            } else {
                oldBackNewAcc = 0.0;
            }
View Full Code Here

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

        } else {
            // cannot temporarily remove the current vehicle from the current lane, since we are in a loop
            // that iterates over the vehicles in the current lane. So calculate oldBackNewAcc based on just
            // the front vehicle.
            if (currentLaneSegment.frontVehicle(me) != null) { // TODO remove quickhack for avoiding nullpointer
                oldBackNewAcc = oldBack.getLongitudinalModel().calcAcc(oldBack, currentLaneSegment.frontVehicle(me));
            } else {
                oldBackNewAcc = 0.0;
            }

            // currentLaneSegment.removeVehicle(me);
View Full Code Here

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

            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;
            }
View Full Code Here

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

                                : LaneChangeDecision.MANDATORY_TO_RIGHT;
                    }
                    // evaluate additional motivation to leave entrance lane
                    double accInCurrentLane = me.getLongitudinalModel()
                            .calcAcc(me, currentLaneSegment.frontVehicle(me));
                    double accInNewLane = me.getLongitudinalModel().calcAcc(me, newLaneSegment.frontVehicle(me));
                    double bias = biasForMandatoryChange(distanceToRoadSegmentEnd);
                    if (accInNewLane + bias > accInCurrentLane) {
                        if (LOG.isDebugEnabled()) {
                            LOG.debug(String
                                    .format("change lane: veh.id=%d, distanceToRoadSegmentEnd=%.2f, accInCurrentLane=%.2f, accInNewLane=%.2f, bias=%.2f",
View Full Code Here

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

                if (newLaneSegment.type() == Lanes.Type.ENTRANCE) {
                    // never change lane into an entrance lane
                    return LaneChangeDecision.NONE;
                }
                final Vehicle newFront = newLaneSegment.frontVehicle(me);
                if (newFront != null) {
                    if (newFront.inProcessOfLaneChange()) {
                        return LaneChangeDecision.NONE;
                    }
                    final double gapFront = me.getNetDistance(newFront);
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.