Package org.movsim.simulator.roadnetwork.RoadSegment

Examples of org.movsim.simulator.roadnetwork.RoadSegment.TrafficLightLocationWithDistance


    }

    private void checkSpaceBeforePassingTrafficlight(Vehicle me, TrafficLight trafficLight,
            double distanceToTrafficlight) {
        // relative to position of first traffic light
        TrafficLightLocationWithDistance nextTrafficlight = trafficLight.roadSegment().getNextDownstreamTrafficLight(
                trafficLight.position(), me.lane(), MAX_LOOK_AHEAD_DISTANCE);
        if (nextTrafficlight != null) {
            double distanceBetweenTrafficlights = nextTrafficlight.distance;
            if (distanceBetweenTrafficlights < 0.5 * MAX_LOOK_AHEAD_DISTANCE) {
                double effectiveFrontVehicleLengths = calcEffectiveFrontVehicleLengths(me, trafficLight,
View Full Code Here


     *
     * @return acceleration considering traffic light
     */
    protected double accelerationConsideringTrafficLight(double acc, RoadSegment roadSegment) {
        double moderatedAcc = acc;
        TrafficLightLocationWithDistance location = roadSegment.getNextDownstreamTrafficLight(
                getFrontPosition(), lane(), TrafficLightApproaching.MAX_LOOK_AHEAD_DISTANCE);
        if (location != null) {
            LOG.debug("consider trafficlight={}", location.toString());
            updateTrafficLightApproaching(location.trafficLightLocation, location.distance);
            if (trafficLightApproaching.considerTrafficLight()) {
                moderatedAcc = Math.min(acc, trafficLightApproaching.accApproaching());
            }
        }
View Full Code Here

TOP

Related Classes of org.movsim.simulator.roadnetwork.RoadSegment.TrafficLightLocationWithDistance

Copyright © 2018 www.massapicom. 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.