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.
theinvincible 0 Newbie Poster
theinvincible 0 Newbie Poster
jwenting 1,889 duckman Team Colleague
theinvincible 0 Newbie Poster
NormR1 563 Posting Sage Team Colleague
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
NormR1 563 Posting Sage Team Colleague
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.