Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/tests/complex/traci_java/multiclient/data/MultiClient2.java
169689 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2017-2025 German Aerospace Center (DLR) and others.
4
// TraaS module
5
// Copyright (C) 2013-2017 Dresden University of Technology
6
// This program and the accompanying materials are made available under the
7
// terms of the Eclipse Public License 2.0 which is available at
8
// https://www.eclipse.org/legal/epl-2.0/
9
// This Source Code may also be made available under the following Secondary
10
// Licenses when the conditions for such availability set forth in the Eclipse
11
// Public License 2.0 are satisfied: GNU General Public License, version 2
12
// or later which is available at
13
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
14
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
15
/****************************************************************************/
16
/// @file MultiClient2.java
17
/// @author Jakob Erdmann
18
/// @author Mirko Barthauer
19
/// @date 2019
20
///
21
//
22
/****************************************************************************/
23
24
import org.eclipse.sumo.libtraci.*;
25
26
public class MultiClient2 {
27
28
public static void main(String[] args) {
29
Simulation.preloadLibraries();
30
try {
31
Simulation.init(9999);
32
Simulation.setOrder(2);
33
34
35
for (int i = 0; i < 3600; i++) {
36
Simulation.step();
37
double timeSeconds = Simulation.getTime();
38
System.out.println(String.format("Step %s", timeSeconds));
39
}
40
41
Simulation.close();
42
43
} catch (Exception ex) {
44
ex.printStackTrace();
45
}
46
47
}
48
49
}
50
51