Path: blob/main/tests/complex/traas/multiclient/data/MultiClient2.java
169771 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2017-2025 German Aerospace Center (DLR) and others.3// TraaS module4// Copyright (C) 2013-2017 Dresden University of Technology5// This program and the accompanying materials are made available under the6// terms of the Eclipse Public License 2.0 which is available at7// https://www.eclipse.org/legal/epl-2.0/8// This Source Code may also be made available under the following Secondary9// Licenses when the conditions for such availability set forth in the Eclipse10// Public License 2.0 are satisfied: GNU General Public License, version 211// or later which is available at12// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html13// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later14/****************************************************************************/15/// @file MultiClient2.java16/// @author Jakob Erdmann17/// @date 201918///19//20/****************************************************************************/21import it.polito.appeal.traci.SumoTraciConnection;22import de.tudresden.sumo.cmd.Simulation;23import de.tudresden.sumo.cmd.Vehicle;24import de.tudresden.sumo.cmd.Inductionloop;25import de.tudresden.sumo.cmd.Trafficlight;26import de.tudresden.sumo.objects.SumoVehicleData;2728public class MultiClient2 {2930public static void main(String[] args) {313233try {3435SumoTraciConnection conn = new SumoTraciConnection(9998);36conn.setOrder(2);3738for (int i = 0; i < 3600; i++) {39conn.do_timestep();40double timeSeconds = (double)conn.do_job_get(Simulation.getTime());41System.out.println(String.format("Step %s", timeSeconds));42}4344conn.close();4546} catch (Exception ex) {47ex.printStackTrace();48}4950}5152}535455