Follow up:

Here is a flow definition I am trying to imitate by TraCI insertions:

*<flow arrivalLane="current" arrivalPosLat="center" begin="0"
departLane="free" departPosLat="center" departSpeed="desired" id="flow_btt"
number="6000" route="bottom_to_top" type="veh" vehsPerHour="6000" />*

In TraCI:

for veh_id in range(1, 6000 + 1):
    agent_id = str(veh_id)
    traci.vehicle.add(
        agent_id,
        "bottom_to_top",
        "veh",
        depart=0,
        departLane="free",
        departPos="base",
        departSpeed="desired",
        arrivalLane="current",
        arrivalPos="max",
        arrivalSpeed="current",
    )

It's the exact same one, with all other configurations being the same. And
yet, somehow there are differences in these statistics:

Predefined flow finished at step 7660, departDelay="2025.31",
totalTravelTime="58439.00", totalDepartDelay="12151865.00".
TraCI imitation finished at step 8260, departDelay="4124.97",
totalTravelTime="58424.00", totalDepartDelay="24749795.00"

Does a predefined flow in a routes file do something additional that the
TraCI imitation by vehicle insertion is missing - I'm guessing it sets the
times of insertions for each vehicle differently. Is it possible to
equalize these behaviours or is this an impossible task?

Thank you,
Sincerely,
Hriday


On Sat, 6 Jan 2024 at 12:14, Hriday Sanghvi <[email protected]> wrote:

> Hello,
>
> I was trying to implement dynamic flows where I wanted to *change the
> vehsPerHour mid-simulation*.
>
> Example flow:
> <flow arrivalLane="current" arrivalPosLat="center" begin="0"
> departLane="random" departPosLat="center" departSpeed="max" id="flow_btt"
> number="100" route="bottom_to_top" type="veh" vehsPerHour="6000" />
>
> I couldn't find a way to *dynamically set/update flows using TraCI*, so I
> assume I have to add vehicles using TraCI to simulate a particular type of
> flow?
>
> 1. So *if I wanted to insert vehicles at a rate of 6000 vehs/Hour, I need
> to insert 6000 / (60 x 60) = 1.6667 vehs/Second or 2 vehs/Second? (assuming
> 1 second = 1 TraCI simulationStep()?*
>
> 2. There seem to be limitations to 1. For example, *if there is a road
> with only a single lane, then there is a maximum vehicle flow that it can
> tolerate, beyond which there is no effect. Is that correct? So I would have
> to have multiple lanes to increase the flow?*
>
> 3. Assuming 2 is correct, *since 1 lane cannot have a flow higher than 1
> vehs/Second, I will need as many lanes 'x' to accommodate the desired flow
> [x] vehs/Second? If not, then what are the other ways apart from increasing
> number of lanes that can increase the capacity of the road to tolerate more
> vehsPerHour or flow?*
>
> Please advise.
>
> Thank you,
> Sincerely,
> Hriday
>
_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to