Skip to content

Solution for the problem based on the Senate bus at Wellesley College

Notifications You must be signed in to change notification settings

bhanukad610/Senate-Bus-Problem

Repository files navigation

Senate Bus Problem

Problem

This problem was originally based on the Senate bus at Wellesley College. Riders come to a bus stop and wait for a bus. When the bus arrives, all the waiting riders invoke boardBus, but anyone who arrives while the bus is boarding has to wait for the next bus. The capacity of the bus is 50 people; if there are more than 50 people waiting, some will have to wait for the next bus. When all the waiting riders have boarded, the bus can invoke depart. If the bus arrives when there are no riders, it should depart immediately.

Note that busses and riders will continue to arrive throughout the day. Assume inter-arrival time of busses and riders are exponentially distributed with a mean of 20 min and 30 sec, respectively.

How to run the program

  1. Clone the repository.
  2. Open a command line/ terminal.
  3. Give following commands.
cd Senate-Bus-Problem
javac SenateBusProblem.java
java SenateBusProblem

About

Solution for the problem based on the Senate bus at Wellesley College

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages