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.

Am Fr., 11. Nov. 2022 um 03:49 Uhr schrieb Nine, Harmon S via sumo-user <
[email protected]>:

> 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
> [email protected]
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to