当前位置:网站首页>Elevator dispatching (pairing project) ①
Elevator dispatching (pairing project) ①
2022-07-04 10:52:00 【Painting and living~】
List of articles
Preface
In this project , Cuiwenguang and I choose to use Java Programming language to realize the simulation of elevator scheduling problem , And use JavaFX To make the graphical interface of the application .
One 、PSP form
PSP2.1 | Personal Software Process Stages | Estimated time ( minute ) | The actual time consuming ( minute ) |
---|---|---|---|
Planning | plan | ||
·Estimate | Estimated task time | 20d | 20d |
Development | Development | ||
·Design Spec | Generate design documents | 120 | 120 |
·Design Review | Design review | 60 | 80 |
·Coding Standard | Code specification | 30 | 30 |
·Design | Concrete design | 60 | 60 |
·Coding | Specific code | 1000 | 1200 |
·Code Review | Code review | 30 | 60 |
·Test | Code testing | 60 | 60 |
Reporting | The report | ||
·Test Report | Test report | 60 | 90 |
·Size Measurement | Calculate the workload | 30 | 30 |
·Postmortem & Process Improvement Plan | Post event summary , And propose process improvement plan | 30 | 30 |
· | total |
Two 、 utilize Information Hiding, Interface Design, Loose Coupling Knowledge design interface
“Information Hiding” For information hiding ,“Interface Design” Design for interface ,“Loose Coupling” Low coupling . This project adopts object-oriented design ideas , Lift 、 Entities such as passengers are abstracted into classes for encapsulation , And leave an interface for developers to call . At the same time, keep the modules of the project independent of each other , Reduce the connection between modules .
3、 ... and 、 Design and implementation of module interface
3.1 Passenger class
Passenger Class is used to abstract passengers , Including passenger weight 、 Starting floor 、 End floor and other attributes .
3.2 Elevator class
Elevator Class is used to abstract elevator , Including the maximum load of the elevator 、 The maximum number of people in the elevator 、 Elevator service floor 、 Opening and closing time 、 Upper and lower level running time and other attributes , At the same time, it defines how to make passengers enter GetPeopleIn()、 Make the passengers leave GetPeopleOut()、 The upside goUp()、 The downside goDown() Such as function .
3.3 EleController class
EleController Class is elevator group dispatcher , Four elevator objects in the problem are stored , And the request list of passengers who want to take the elevator , At the same time, it defines the request to add an elevator AddRequest()、 Find the nearest passenger in an elevator GetNearestPsg() Such as function , So that subsequent algorithm calls .
3.4 MainWindowController class
MainWindowController Class is the main interface controller . Because the three algorithms to be implemented in the future should provide services in the main interface , Therefore, this class contains functions that implement three scheduling algorithms respectively .
Four 、 Code specification and design specification
Before the project starts , Cuiwenguang and I have agreed on the code specification and design specification of the program , Such as the naming rules of member variables and member functions 、ui Interface control parent-child relationship rules 、 Which classes or variables must be mutually exclusive in multithreading , In order to improve the efficiency of subsequent development .
边栏推荐
- Day06 list job
- DCL statement of MySQL Foundation
- /*Rewrite the program, find the value of the element, and return the iterator 9.13: pointing to the found element. Make sure that the program works correctly when the element you are looking for does
- Snake (C language)
- Learning XML DOM -- a typical model for parsing XML documents
- Locust installation
- Canoe the second simulation engineering xvehicle 3 CAPL programming (operation)
- OSPF comprehensive experiment
- RHCE - day one
- On binary tree (C language)
猜你喜欢
Discussion | has large AI become autonomous? Lecun, chief scientist of openai
shell awk
Virtual machine configuration network
Collection of practical string functions
Si vous ne connaissez pas ces quatre modes de mise en cache, vous osez dire que vous connaissez la mise en cache?
Sword finger offer 05 (implemented in C language)
[machine] [server] Taishan 200
[Galaxy Kirin V10] [server] NFS setup
Seven examples to understand the storage rules of shaped data on each bit
MPLS: multi protocol label switching
随机推荐
OSPF summary
Rhsca day 11 operation
[Galaxy Kirin V10] [desktop] FTP common scene setup
[testing theory] thinking about testing profession
I What is security testing
Application and Optimization Practice of redis in vivo push platform
Linked list operation can never change without its roots
VI text editor and user rights management, group management and time management
[Galaxy Kirin V10] [server] soft RAID configuration
Using Lua to realize 99 multiplication table
Snake (C language)
RHCE - day one
Introduction to tree and binary tree
[test theory] test process management
Canoe - description of common database attributes
Quick sort (C language)
IPv6 comprehensive experiment
First article
[test theory] test the dimension of professional ability
Occasional pit compiled by idea