private void writeVehicles(String vehiclesOutFile) { VehiclesFactory vehFactory = this.veh.getFactory(); VehicleType vehType = vehFactory.createVehicleType(Id.create("defaultTransitVehicleType", VehicleType.class)); VehicleCapacity capacity = new VehicleCapacityImpl(); capacity.setSeats(Integer.valueOf(8)); capacity.setStandingRoom(Integer.valueOf(0)); vehType.setCapacity(capacity); this.veh.addVehicleType(vehType); for (TransitLine line : this.tS.getTransitLines().values()) { for (TransitRoute route : line.getRoutes().values()) { for (Departure departure : route.getDepartures().values()) { Vehicle vehicle = vehFactory.createVehicle(departure.getVehicleId(), vehType); this.veh.addVehicle(vehicle); } } } VehicleWriterV1 writer = new VehicleWriterV1(this.veh); writer.writeFile(vehiclesOutFile); }
public void writeVehicles(String name) { VehicleWriterV1 vwriter = new VehicleWriterV1(scenario.getTransitVehicles()); vwriter.writeFile("H:\\Matsim\\Stockholm Scenario\\teleportation\\input\\" + name); }