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.

Recommended Answers

and what have you done yourself? We're not a homework service.

Jump to Post

Its hard to recommend coding changes without any code to look at.

Jump to Post

All 7 Replies

as an addendum, for exponential interarrival time, I am generating a uniform random number between 0 and 1 and then plugging it in as the value of 'u' in the above equation. is this correct? do i need to keep adding previous arrival times to get the new arrival time i.e. does Ti need to have Ti-1 in its equation?

jwenting...no reason to be obnoxious...u clearly did not read the post...or did not care to..

Its hard to recommend coding changes without any code to look at.

@theinvincible
1. We only give homework help to those who show effort
2. The importance of the task is obvious:

  • you returned 10 days latter
  • you complain about received answer
  • you provided zero activity report
  • you are to lazy to type full sentence English

Peter check your calendar, its May. 40 days

Peter check your calendar, its May. 40 days

Then it is even worst, coursework failed, module failed...

@theinvincible if you have something you want us to help you and you already have proof you started to work on it then by no means created new thread. In the meantime this thread is closed to avoid any flaming.

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.