помогите написать программу симулятор лифта на python. программка должна предлагать пользователю ввести кол-во єтажей в здании, кол-во пассажиров. обязательно нужно сделать 3 класса
class Building(object):
people=0;
floors=0;
def setPeople(self):
“”“запрос- введите количество пассажиров”“”
def setFloors(self)
“”“запрос- введите количество єтажей в здании”“”
class Customer(object):
custUp=0;
custDown=0
departure=0
arrival=0
direction='UP' “”“направление лифта ‘UP’ или ‘DOWN’”“”
“”“ hint : you can create a list of elements of this class instead of several lists or tuples”“”
def setCustomers(self,peopleBuild)
“”“ This function has to iterate over the full amount of people(from Class building people variable) and each time
randomly assign a departing and arriving floor , you need to prevent same departure and arrival floor are assigned to
each, by evaluating with a inner while loop
:: list might looks like
customerList.append(customer(1,5,”UP“))
customerList.append(customer(6,2,”DOWN“))
class Elevator(object):
def ElevGoesUp(self,custUp):
”“” In this function you need to loop from floor 1 through the highest arrival floor, and in the way let people hop on and off using the customerList ,customers who only go up and print out the output of events“”“
def ElevGoesDown(self,custDown):
”“” In this function you need to do a reverse loop from highest floor going downwards to lowest arrival floor , and let passengers on and off, using the customerList customers who only go down, and in the way let people hop on and off and print out the output of events“”"
myB = Building()
myE = Elevator()
myC = Customer()
run()
myB.setPeople()
myB.setFloors()
myC.setCustomers(myB.people)
output()
myE.ElevGoesUp(myC.custUp)
myE.ElevGoesDown(myC.custDown)
if __name__ =='__main__':
run()
output()