Package org.movsim.simulator.vehicles.lanechange

Examples of org.movsim.simulator.vehicles.lanechange.LaneChangeModel


    private Vehicle newObstacle(double rearPosition, int lane) {
        return new Vehicle(rearPosition, 0.0, lane, 5.0, 2.5);
    }

    private LaneChangeModel newLaneChangeModel(Vehicle vehicle) {
        return new LaneChangeModel(vehicle, createLaneChangeModelType());
    }
View Full Code Here


        // set up an obstacle directly in front of a vehicle, so the vehicle will change lanes
        // Obstacle(pos, lane, length, width, color) {
        final Vehicle obstacle = newObstacle(600.0, Lanes.LANE1);
        r0.addVehicle(obstacle);
        final Vehicle v0 = newVehicle(593.0, 5.0, Lanes.LANE1);
        final LaneChangeModel lcm = newLaneChangeModel(v0);
        v0.setLaneChangeModel(lcm);
        r0.addVehicle(v0);
        final double dt = 0.25;
        final double simulationTime = 0.0;
        final long iterationCount = 0;
View Full Code Here

    public Vehicle create(VehicleType vehicleType, @Nullable Route route) {
        VehiclePrototype prototype = getPrototype(vehicleType.getVehiclePrototypeLabel());
        LongitudinalModelBase accelerationModel = prototype.createAccelerationModel();
        accelerationModel.setRelativeRandomizationV0(vehicleType.getRelativeV0Randomization(),
                vehicleType.getV0DistributionType());
        LaneChangeModel laneChangeModel = prototype.createLaneChangeModel();

        Vehicle vehicle = new Vehicle(prototype.getLabel(), accelerationModel, prototype.getConfiguration(),
                laneChangeModel);

        vehicle.setRoute(route);
View Full Code Here

                simulationTimestep);
    }

    LaneChangeModel createLaneChangeModel() {
        return configuration.isSetLaneChangeModelType()
                && configuration.getLaneChangeModelType().isSetModelParameterMOBIL() ? new LaneChangeModel(
                configuration.getLaneChangeModelType()) : null;
    }
View Full Code Here

        // set up a vehicle in most inner lane (left lane)
        final Vehicle v1 = newVehicle(900.0, 0.0, Lanes.LANE1, lengthCar);
        final MOBIL m1 = new MOBIL(v1, createModelParameterMOBIL(minimumGap, safeDeceleration, politeness,
                thresholdAcceleration, rightBiasAcceleration));
        final LaneChangeModel lcm1 = new LaneChangeModel(v1, createLaneChangeModelType(m1.getParameter()));
        v1.setLaneChangeModel(lcm1);
        roadSegment.addVehicle(v1);

        // set up a vehicle in right lane
        final Vehicle v2 = newVehicle(900.0 - lengthCar - tooSmallGap, 0.0, Lanes.LANE2, lengthCar);
        final MOBIL m2 = new MOBIL(v2, createModelParameterMOBIL(minimumGap, safeDeceleration, politeness,
                thresholdAcceleration, rightBiasAcceleration));
        final LaneChangeModel lcm2 = new LaneChangeModel(v2, createLaneChangeModelType(m2.getParameter()));
        v2.setLaneChangeModel(lcm2);
        roadSegment.addVehicle(v2);

        // vehicles too close together, so acceleration balance should be large negative
        double balance = m1.calcAccelerationBalance(v1, Lanes.TO_RIGHT, roadSegment);
View Full Code Here

TOP

Related Classes of org.movsim.simulator.vehicles.lanechange.LaneChangeModel

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.