[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [sumo-user] libsumo returning 0, empty lists for vehicle queries
|
Simulation.getLoadedNumber returns the number of vehicles loaded from file in the *current* step. It does not give an accumulated count of all vehicles loaded in previous steps.
Hello.
I have a java program (shown below). I can load and step through the model, and it even warns that some vehicles have to perform emergency braking.
However, vehicle queries like "Simulation.getLoadedNumber()" are returning 0 when this clearly should not be.
Anyone know what's wrong? I'm using sumo-1.8.0.
=========================
package sumotest;
import org.eclipse.sumo.libsumo.Simulation;
import org.eclipse.sumo.libsumo.StringVector;
public class App {
public static void main(String[] args) {
System.loadLibrary("libsumojni");
Simulation.load(new StringVector(new String[] {"-c", "SUMO/subway.sumo.cfg"}));
Simulation.subscribe();
for(int ix = 0 ; ix < 50000 ; ++ix) {
Simulation.step();
}
System.out.println("Loaded vehicles: " + Simulation.getLoadedNumber()); // prints "0"
Simulation.close();
}
}
==========================
-- Harmon
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user