1. Improve the interface design of elevator scheduling so that it can better reflect the reality and help students practice algorithms to better implement information hiding and sharing.
- Add an array of target floors for each elevator to facilitate task allocation. In our elevator, this array is destinyfloors []
- In actual situations, everyone should have time to enter the elevator, instead of opening the door. Therefore, the elevator should have a button for opening and closing the door. When no one enters, the person in the elevator can press the button for closing the door. Similarly, if the person has not finished the door in five seconds, you can press the OPEN button. This is more in line with the actual situation.
- We think we can delete the limit on the maximum number of people. After all, the elevator does not monitor the number of people inside it. Instead, it uses the maximum load to determine whether it is safe. For example, it is acceptable for 10 or 100kg people to enter an elevator with a load of 1000kg. It is also feasible for 20 or 50kg people to enter the elevator. The number of students is too cumbersome.
2. Currently, this test program only has the command line interface. Please design a UI for it to show the movements of passengers/elevators and implement it.
The UI we designed is to provide elevator information from the whole building. The graphic interface is added to make the elevator status clearer and easy to observe the operation of the elevator.
3. Read the MVC and mvvm design patterns Article. Describes how the UI/algorithm/interface you wrote implements the MVC or mvvm algorithm.
The two terms are explained first:
- The full name of MVC is Model View Controller, short for Model-View-controller. It is a model of software design, organize Code by means of separation of business logic, data, and interface display, and integrate the business logic into a component to improve and personalize the custom interface and user interaction, you do not need to rewrite the business logic. MVC is uniquely developed to map traditional input, processing, and output functions in a logical graphical user interface structure.
- Mvvm is short for Model-View-viewmodel. The origin of the mvvm (Model-View-viewmodel) Framework is a new architecture framework that evolved from the combination of the Model-View-presenter model and WPF. It is based on the original MVP framework and integrates the new features of WPF to cope with the increasingly complex demands of customers.
- MVC is much embodied in our code. To put it bluntly, we try to separate modules as much as possible to achieve low coupling.
- In our program, M (model)
-- From Baidu encyclopedia
Peer programming project: 4 elevators schedors additional questions