public class OpenStepsClose {
public static void main(String[] args) {
BasicConfigurator.configure();
SumoTraciConnection conn = new SumoTraciConnection(
"test/sumo_maps/box1l/test.sumo.cfg", // config file
12345, // random seed
false // look for geolocalization info in the map
);
try {
conn.runServer();
System.out.println("Map bounds are: " + conn.queryBounds());
for (int i = 0; i < 10; i++) {
int time = conn.getCurrentSimStep();
Collection<Vehicle> vehicles = conn.getVehicleRepository().getAll().values();
System.out.println("At time step " + time + ", there are "
+ vehicles.size() + " vehicles: " + vehicles);
conn.nextSimStep();
}
conn.close();
}
catch(Exception e) {
e.printStackTrace();
}
}