Programacion en C Ascensor usando threads/ Project elevators using threads in C Programming -- 2

Job ID: 33464772

Budget: €8 – €30 EUR

Hi I have to do a work in C.
The aim is to develop software that manages the operation of elevators in a building. In this case, the
Brotherhood has bought a new building with ten floors (identified with values ​​between 0 and 9), and two elevators (identified with values ​​between 0 and 1) for your new guild house. On each floor, there is a
single button to request a lift. If all the elevators are busy, the request is put on hold, creating a queue system. until one of the elevators is free and can go to pick up the person in question. Also, suppose there will never be any more of a request to an elevator simultaneously from the same floor.
Make a software using threads that intelligently manages the operation of this new sorority house
taking into account that there will be m people who want to request an elevator and that there are two elevators in this building. The number of people will be entered in a variable at the beginning of the program. The number of elevators in the building will be defined by a constant.
• If necessary, use semaphores to synchronize the multiple threads listed in this problem.
• The amount of time an elevator takes for each floor is 1 second. will not be taken into account
amount of time it takes for a person to enter or exit the elevator.
• Each person will take an elevator only once and only one person can be found in an elevator
at once.
• It is not necessary that the program ends when all the people have finished taking their elevator.
• The target plant for each person will be a random number. To generate this number you can use
the rand() function, and the number must be between the interval [1,10]. If the random number
matches the floor number the person is on, this value must be recalculated until
that this is different from the value of the plant where the person is.
• Each person is initially located on a random floor of the building. To do this, also use the
rand() function cited in the previous point.
• All elevators will initially depart from the first floor of the building.
An example of execution of the system where there are 5 people and 2 elevators is the following:
Person 2 is on floor 1.
Person 1 is on floor 4.
Person 4 is located on floor 3.
Person 0 is on floor 1.
Person 3 is on the 9th floor.
Person 4 requests an elevator from floor 3.
Elevator 0 is coming to pick up Person 4.
Person 0 requests an elevator from floor 1.
Elevator 1 is coming to pick up Person 0.
Person 3 requests an elevator from the 9th floor.
Person 0 has accessed Elevator 1 and requests to move to floor 8.
Elevator 1 is moving to floor 8.
Person 1 requests an elevator from floor 4.
Person 2 requests an elevator from floor 1.
Person 4 has accessed Elevator 0 and requests to move to floor 0.
Elevator 0 is moving to floor 0.
Elevator 0 has reached floor 0.
Person 4 exits the elevator and see you later.
Elevator 0 is coming to pick up Person 3.
Elevator 1 has reached floor 8.
Person 0 exits the elevator and see you later.
Elevator 1 is coming to pick up Person 1.
Person 1 has accessed Elevator 1 and requests to move to Floor 1.
Elevator 1 is moving to floor 1.
Person 3 has accessed Elevator 0 and requests to move to floor 0.
Elevator 0 is moving to floor 0
I have to do this before 18th