Ah, ok. Thank you!
Does that bug mean we need to use a very large radius to describe a circle that 
encloses the box, that in turn encloses the simulation?
________________________________
From: sumo-user <[email protected]> on behalf of Jakob Erdmann 
<[email protected]>
Sent: 16 December 2022 07:55
To: Sumo project User discussions <[email protected]>
Subject: Re: [sumo-user] Subscribing to simulation variables


---- THIS EMAIL HAS COME FROM AN EXTERNAL SOURCE ----



The first parameter is ignored when subscribing to simulation context.
Please also be aware of https://github.com/eclipse/sumo/issues/12306

Am Di., 13. Dez. 2022 um 13:09 Uhr schrieb Matthew Jones 
<[email protected]<mailto:[email protected]>>:
Hello,

I am trying to debug some simulation problems, from C++ code.
Our main class is
    class TrafficModel : public TraCIAPI
and in its constructor we have this, which works:
    mStartTime = simulation.getTime();
    mDeltaTime = simulation.getDeltaT();
however, if I call
    simulation.getIDCount();
or
    simulation.getIDList();
they block and the application freezes.

What I am actually trying to do is
    const std::vector<int> varsSimulation{
      libsumo::VAR_TELEPORT_STARTING_VEHICLES_NUMBER,
      libsumo::VAR_TELEPORT_STARTING_VEHICLES_IDS,
      libsumo::VAR_TELEPORT_ENDING_VEHICLES_NUMBER,
      libsumo::VAR_TELEPORT_ENDING_VEHICLES_IDS,
      libsumo::VAR_ARRIVED_VEHICLES_NUMBER,
      libsumo::VAR_ARRIVED_VEHICLES_IDS,
    };

    simulation.subscribeContext("", libsumo::CMD_GET_SIM_VARIABLE, 99999, 
varsSimulation, 0, 999999999);

but this also blocks, so I was trying to work out what to pass for the first 
parameter to subscribeContext.

Obviously I'm doing something wrong but I can't work out what it is!
I couldn't find anything in the documentation about what the first parameter 
for subscribeContext means when we are dealing with the simulation scope.
Are there restrictions on when any of these methods can be called?

Thanks,

Matthew.





Matthew Jones
Senior Software Engineer
rFpro Limited

E: [email protected]
W:  www.rFpro.com<http://www.rFpro.com>

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error please notify the system sender. This 
message may contain confidential information and is intended only for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail.

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

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error please notify the system sender. This 
message may contain confidential information and is intended only for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail.
_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to