Pair operation--elevator dispatching

Source: Internet
Author: User

Pair programming

Pair member: Wang Chang (2011040101179) Coding:https://coding.net/u/smile-wang Gaoqingyang (2013040101173) Blog: http://www.cnblogs.com/ gaoqingyang1994/coding:https://coding.net/u/gaoqingyang1994

    • Advantages and disadvantages of pair programming

In pair programming mode, a pair of programmers can do development work on an equal and complementary basis; they analyze together, design together, write test cases together, code together, test together ... This can be a good complement in the work, play the advantages of each member, work more efficient: from the development level, pair programming can provide better design quality and code quality, two people to cooperate to solve problems more powerful, can be very good complementary; For developers, pairing work can bring more confidence, High-quality output can bring higher satisfaction, can solve problems more efficiently, and from the aspect of enterprise, pair programming is more efficient, can better exert each person's strengths and bring higher benefits. It has been a human activity since our scholars programmed: Analysis design, code writing, code testing, and so on; this is where each of us has our own code style. This pair of project, is for us to carry out the next team project or into the community to do the groundwork, after all, in the enterprise software development is a large-scale software, it is impossible to give a person to complete.

But because we are basically a person in programming, so in pair programming because the code style is different, it takes a certain time to familiarize each other's code style. At the same time pair programming requirements Two people must go hand in hand, otherwise it is easy to appear the situation of uneven division of labor, resulting in a slightly larger workload, easy to the psychological pressure on one side; there are pair programming requirements two people need to have a positive sense of responsibility, otherwise it is likely due to mutual delay resulting in reduced efficiency. Finally, if the division of labor is unclear or other reasons may lead to too much reliance on the other side, did not get a comprehensive exercise.

So in the process of pairing programming, it is necessary to engage in the initiative also requires the players to understand each other, mutual trust, mutual help, so as to progress together, exercise!

    • Ratings for teammates

For this pair programming, it is very happy to be divided into a group of Gaoqingyang classmates, because in my impression he has always been a trustworthy, enthusiastic partner; In this project, we learn from each other and work together to complete the project; Although I think my heart is relatively thin, but in the overall situation of the grasp of the lack of There are problems in the analysis of the steps of the project, which are solved in the mutual discussion with Gaoqingyang students. He has a thorough analysis of these issues and I have benefited greatly. The specific analysis is as follows:

    • Elevator Dispatch

Existing new office building, a total of 21 floors, a total of four elevators, all elevators basic parameters are shown in the following table:

Elevator number Service Floors available Maximum number of passengers (person) Maximum load capacity (kg)
1 All floors 10 800
2 Single layer 10 800
3 Double 20 1600
4 All floors 20 2000

The terms of use are as follows:

1, the floor number is 0~20, of which No. 0 is the basement layer;

2. Elevators with floor restrictions are not docked in the response floor, such as a single double layer;

3, all elevators with unified button control

Please design and implement an elevator control program according to the above requirements, if there is a graphical display is better.

    • Analysis of requirements and algorithms
    • Definition of the initial state of the elevator

(1) There are 21 floors of the building, a total of four elevators, two of which can serve all floors, the other two is a single double-decker elevator, numbering 1, 2, 3, 4, (2) No. 0 is the basement level, that is, our access is generally in 0 and 1th (underground and lobby). When designing a program, if the passenger chooses number No. 0, then when the passenger lifts the elevator, the elevator will automatically return to position 1th, facilitating the next wave of passengers, (3) 0 There are 23 buttons inside the elevator (only 13 buttons for a single double-deck elevator), including the opening, closing button and the buttons to reach each specific floor. ; There are two button up and down buttons on each floor of the elevator. According to the bottom of the elevator is the 0-storey only with the up button, the top and 20 floors only down button. (4) Elevators are numbered, there are floor restrictions, and there is an overweight alarm, (5) The elevator door completion time and to reach each level of the time set by the person.

    • Specific process

(1) The passenger presses the button up or down on a certain floor, and (2) when the passenger presses the down button on a certain floor, and the four elevators receive the command at the same time, the response of the passenger by controlling the operation of the corresponding elevator is made after the specific algorithm responds to the request. The elevator door is opened only when the reaction of the elevator conforms to the passenger's request; (3) when the condition is met, the elevator opens for the passengers, and after the passenger enters the elevator, it is necessary to judge whether the inside of the elevator is full, and if the overload pops up the warning, the passenger exits and waits. (5) The operation result of the elevator is the output result, the elevator door opens after reaching the floor.

Elevators in many cases will receive two or more than two requests, to enter the elevator more than one passenger, in order to reduce the waiting time for multiple requests, the system needs to be a priority for multiple requests to be judged. Each passenger is delivered to a designated floor according to priority, and when multiple passengers use the elevator, the system receives a request after receiving more than one request, the system compares the current first destination floor with the new request, and determines which request takes precedence based on the waiting time between requests to reduce the request. The priority request is updated to the new destination floor of the elevator, and if there are new cases in the middle, the same treatment will be done.

In this knot on the project by me to write specific code, Gaoqingyang classmate responsible for the relevant algorithm, although we did a very detailed analysis, because of limited capacity, a lot of features are not implemented, the previous time also learned HTML and CSS, just started to try to write a good point of the interface, some languages are just beginning to learn, To the end there are some problems, tried for a long time or did not find a good solution, finally can only give up, feel very sorry .... In this programming, I and Gaoqingyang classmate's code writing habit is not small, I write in the process of code comments more attention, Gaoqingyang students on the code review and improve the function of the more important, always say our code to write normative general, because the writing is a small program, so the algorithm benefits not how to value, The interface would like to make a little more beautiful, but insufficient capacity. In the future programming we will continue to improve our normative writing and code algorithm effectiveness and so on.

    • Experience and summary of programming process

Through two weeks of time, although the final rough finished the knot on the work, but the harvest is heavy, this programming brings me a kind of different experience, let me feel the importance of cooperation, in programming there are many times our opinion is not agreed to add each person's code style and norms are not the same, Fortunately, my teammates and I are relatively bcause, through the simple communication is a good solution to the problem, which reminds me, in the future, how can we work in a better cooperation with others? After all, the work will meet a variety of people, each other's temper does not necessarily come together, how to cooperate with people better, we need to think well.


Pair operation--elevator dispatching

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.