Κλειστη

Python - simple elevator simulator

Αυτό το πρότζεκτ έλαβε 17 προσφορές από ταλαντούχους freelancers με μέση τιμή προσφοράς €143 EUR.

Λάβετε δωρεάν αναφορές για ένα πρότζεκτ σαν αυτό
Εργασία Εργοδότη
Προϋπολογισμός Εργασίας
€30 - €250 EUR
Σύνολο Προσφορών
17
Περιγραφή Εργασίας

Task

Your task is to implement the simple elevator in Python using classes. The default strategy is the simple "start at the bottom, go to the top, then go to the bottom". You don't have to use this, you can take an alternative approach such as random start location for the elevator.

Project Description / Specification

Create three classes: Building, Elevator, and Customer.

Equip the building with an elevator. Ask user to customize the number of floors and the number of customers.

Program should have error checking to make sure the user inputs are valid. For example, if a user gives non-integer inputs, notify the user that the inputs are incorrect and prompt again.

Each customer starts from a random floor, and has a random destination floor.

Each customer will use the elevator only once, i.e., when a customer moves out of the elevator, he/she will never use it again.

When all customers have reached their destination floor, the simulation is finished.

All classes’ methods require a docstring for a general description of the method.

Don’t use any global variables.

Notes and Hints

In your main function, at the beginning ask the user for the number of floors and the number of customers which can be used to create an instance of Building. Then we only need to call a run method and an output (such as __str__ or __repr__) method repeatedly in a while loop.

Randomly select the floors (to and from) for each customer. Use the randint function from the random module. To estimate the efficiency of strategy, count the number of floors visited for your strategy. Make a demo to create usable output from your simulation.

Απαιτούμενες Δεξιότητες

Ψάχνετε τρόπους για να κερδίσετε μερικά χρήματα;

  • Ορίστε τον προϋπολογισμό σας και το χρονικό πλαίσιο
  • Περιγράψτε την πρότασή σας
  • Πληρωθείτε για τη δουλειά σας

Προσλάβετε Freelancers που ήδη έχουν υποβάλει προσφορά σε αυτή την εργασία

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online