Package org.movsim.simulator.trafficlights

Examples of org.movsim.simulator.trafficlights.TrafficLightLocation.position()


    // TODO profiling ... lookup done quite often even w/o any trafficlights
    public TrafficLightLocationWithDistance getNextDownstreamTrafficLight(double position, int lane,
            double maxLookAheadDistance) {
        TrafficLightLocation trafficLightLocation = getNextDownstreamTrafficLight(position);
        double distance = (trafficLightLocation != null) ? trafficLightLocation.position() - position : roadLength
                - position;
        RoadSegment segment = this;
        while (trafficLightLocation == null && distance < maxLookAheadDistance) {
            segment = segment.sinkRoadSegment(Math.min(lane, segment.laneCount));
            if (segment == null) {
View Full Code Here


            segment = segment.sinkRoadSegment(Math.min(lane, segment.laneCount));
            if (segment == null) {
                break;
            }
            trafficLightLocation = segment.getNextDownstreamTrafficLight(0);
            distance += (trafficLightLocation != null) ? trafficLightLocation.position() : segment.roadLength();
        }
        return trafficLightLocation == null ? null : new TrafficLightLocationWithDistance(trafficLightLocation,
                distance);
    }
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.