Package org.movsim.roadmappings

Examples of org.movsim.roadmappings.RoadMapping


                    roadSegment.removeVariableMessageSign(variableMessageSign);
                }
                trafficCanvas.repaint();
            }
            if (roadSegment.trafficLightLocations() != null) {
                final RoadMapping roadMapping = roadSegment.roadMapping();
                for (final TrafficLightLocation trafficLightLocation : roadSegment.trafficLightLocations()) {
                    final Rectangle2D trafficLightRect = TrafficCanvas.trafficLightRect(roadMapping, trafficLightLocation);
                    // check if the user has clicked on a traffic light, if they have then change the
                    // traffic light to the next color
                    final Point point = e.getPoint();
View Full Code Here


            }
            // iterate over all vehicles in all road segments, to see if the
            // mouse is over a vehicle
            final double simulationTime = trafficCanvas.simulationRunnable.simulationTime();
            for (final RoadSegment roadSegment : roadNetwork) {
                final RoadMapping roadMapping = roadSegment.roadMapping();
                for (final Vehicle vehicle : roadSegment) {
                    // TODO quick hack here,no correction for offsets
                    final RoadMapping.PolygonFloat polygon = roadMapping.mapFloat(vehicle, simulationTime);
                    path.reset();
                    path.moveTo(polygon.xPoints[0], polygon.yPoints[0]);
                    path.lineTo(polygon.xPoints[1], polygon.yPoints[1]);
                    path.lineTo(polygon.xPoints[2], polygon.yPoints[2]);
                    path.lineTo(polygon.xPoints[3], polygon.yPoints[3]);
View Full Code Here

    /**
     * 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) {
            laneSegment.assertInvariant();
        }
        return true;
View Full Code Here

TOP

Related Classes of org.movsim.roadmappings.RoadMapping

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.