I need some general help with queues. I am able to conceptualize with no problem what my queue should be doing, but implementationis rough for me.
I am trying to make a program with queues representing a 4way intersection. Vehicles approach the intersecion and are queued up until the light turns green. I understand how to add objects to my queue and how/when to remove them correctly. I don't understand how to create the vehicle objects without defining each one individually.
Since the vehicles arrive with a random probability, which means I wont know how many there will be, is there a way to create objects as necessary rather than declaring them in the beginning, then push them into my queue?
This is probably really basic, but I missed this if it is.