I am having some problems with simulating POisson arrivals and departures in Java. I want to simulate 400 cars/hour as arrival rate and 20 cars/hour as departure rate. I have a parking capacity of 500 cars where these cars enter/exit. When I am checking occupancy values, even after a couple of hours I still see that at most there were about 30-35 cars at any single point. Shouldnt this have been 380 cars(considering the arrival and departure rates). I am using multithreading in Java and am simulating arrivals and departures using the sleep feature of threads where I sleep the thread for ((-ln(u)/arrival rate)*60*60*1000). this is the time between the arrivals of cars and it is same for departures except arrival rate is now departure rate in the previous equation. the 60*60 is used for time conversion since the arrival rate is in hours and the 1000 is for the milliseconds. Any help is highly appreciated.
Jump to Post
and what have you done yourself? We're not a homework service.
All 7 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.