Final Project
We encourage simulate a lift system with the stops (floors). We assume every customer takes 1 second to enter the lift and 1 second to leave. The lift ' s occupation space is a people with no weight limit. It takes seconds for the lift to travel between, nearby floors without discrimination for going up or going Down. An input file is given to which simulates the coming customer randomly. Here is a DEMO inputs:
|
Customer ID |
Coming time |
Age |
Source floor |
Destination floor |
Leaving time |
|
|
123 |
+ |
2 |
9 |
|
|
2 |
|
"
|
+ |
5 |
|
|
4 |
382 |
+ |
1 |
|
|
The customer coming time isn't sorted, so you need to sort themfirst. Also one rule need to being noted is this for those customer whose ' age ' larger than, they'll get the highest privilege To enter and leave the lift without waiting in the queue. We encourage different data structures at different floors. The sorting algorithm is appointed to use during the free time. The output would be is a file similar to the input file with calculated/simulated leaving time filled in (to the last column).
Req:
@ Weeks later delivery operation (until 4.21)
@ using Java ' s encapsulation,inheritance and polymorphism technique
@ according with "Open and close" principle
@ maybe using ArrayList, LinkedList and Stack etc. class and sort method,study them yourself
Java Fifth time job