iwant to implement an elevator simulator which will emulate the behavior of a
system with two working elevators.

The following rules govern the system behavior:
1- Initially, both elevators are at the ground floor with no passengers aboard.
2- For simplicity, assume that it takes 1 clock tick for passengers to enter or to leave an
elevator.
3- An elevator spends 2 ticks to travel from its current floor to its neighboring floor.
4- It takes 7 ticks for a passenger to go from one floor to the next floor using stairs.
5- The maximum load of each elevator is 8 passengers.
6- The building has 11 floors (a ground floor plus 10 floors).
7- Different passenger requests at different floors may happen at the same time.
8- An elevator does not stop at a floor unless it has a passenger to enter or leave. Otherwise,
the elevator passes by the floor without stopping at it.
9- The elevator stops only if the passenger's intended direction is the same as the elevator's
direction.
Your system (your program) will receive a list of passengers' requests as input. This list represents
the scenario to be simulated. For each request, the system will receive the following information:
− Time stamp: When the request was received.
− Source floor of the request.
− Destination floor.
For each request, your system should choose one of the elevators to serve this request. You
should choose one of the elevators so that the passenger's waiting time is minimized. Here are
some points to take into consideration when selecting the suitable elevator.
1- The distance between the elevator and the waiting passenger.
2- The direction of both the elevator and the passenger.
3- The number of vacant places in an elevator.
Note:
However an elevator stops only if the passenger's direction is the same as the elevator's
direction. If a passenger waits more than 60 clock ticks, he/she must be picked up by any of the
elevators regardless of the elevator's direction.
Taking all the above points and rules into consideration, define suitable data structures and
suitable criteria to select which passenger to be serviced by which elevator.
Data Structures and Algorithms Project Requirements
CMP 102 & CMP N102 3/6 Fall 2009
Simulation Approach & Assumptions
You will use incremental time simulation. You will divide the time into discrete time steps of 1 unit
time each (1 tick) and simulate the changes in the system in each time step.
Some Definitions
Valid Request
We define a Valid Request as a request whose time stamp is less than or equal to the current
time step in the simulation. That means this request is no longer in the future. At each time step,
you should choose the requests to serve from the valid requests.
Passenger Waiting Time
We define Passenger Waiting Time as the time a passenger had to wait until being picked by
one of the elevators. In other words, it is the time between the reception of the order and
starting the delivery of the order.
You are required to measuring the Average Passenger Waiting Time over all requests in the
scenario as this is a good estimation of the system performance.
File Formats
The Input File
The input file will contain N input lines of the format
P T S D
where P is the passenger sequence number that identifies the passenger, T is the request time
stamp, S is the source floor of the request and D is the destination floor. The input lines are
sorted by time stamp in ascending order. The last line in the input file will be
-1
which indicates the end of input file.
The input file name must be "input.txt"
The Output File
The output file you are required to produce should contain M output line of the format
T P E W
which means that the passenger identified by sequence number P will be serviced at time
stamp T by the elevator whose ID is E. And this request has to wait time W to be serviced. The
output lines should be sorted by time step in ascending order. If more than one request are
chosen in the same time step, they should be ordered by the passenger sequence number P.
The last two lines in the output file should contain
- The Average Passenger Waiting Time over the simulated scenario.
- The percentage of passengers who will take less time using stairs than using the
elevator.
The output file name must be "output.txt"
Data Structures and Algorithms Project Requirements
CMP 102 & CMP N102 4/6 Fall 2009
Program Interface:
The program should read an integer from standard input (cin). If this integer is 1, the program
runs in interactive mode, otherwise the program runs in silent mode.
Interactive mode allows you to monitor elevators and valid passenger requests as time goes on.
At each time step, the program should provide output similar to that in the following figure on
the screen and waits for a key press.
Use system(“cls”) to clear the screen (you have to include cstdlib).
Waiting Passengers
================
P# Time Src Floor Dst Floor
------------------------------------------------------------------------
13 22 4 2
14 22 3 9
15 23 0 7
16 23 1 3
17 23 6 10
18 25 4 0
*********************************************************************
Elevators
================
E# Current Floor Direction Load Passengers
----------------------------------------------------------------------------
E1 9 => 8 DN 2 7, 3
E2 7 UP 5 4, 8, 12, 2, 6
*********************************************************************
Last Actions:
E1: Moving
E2: STOP – floor 7 Passengers: 2, 6 E2 1, 5, 11
*********************************************************************

Please show us what you have so far.

He meant code. We must see that you put some work in this assignment.
Sorry, daniweb doesn't allow spoon-fedding. And it's a good thing.

Looks like a school assignment...
Can't believe you go to school if you don't want to learn anything, which is what comes out of this kinda stuff.. No learning.

hi,how would i make two panels coming from different directions like elevator closing
two doors.
have a look at this video Year 2 OOP and SE assignment 1: Elevator

i want to make an exact application elevator simulator,can you please tell me or provide me with a code that it can work.

i tried playing around with it but no luck
thanks

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.