現(xiàn)代軟件工程 結(jié)對(duì)編程 (II) 電梯調(diào)度
創(chuàng)新互聯(lián)公司是一家專注于網(wǎng)站設(shè)計(jì)制作、網(wǎng)站制作與策劃設(shè)計(jì),秦皇島網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)公司做網(wǎng)站,專注于網(wǎng)站建設(shè)10余年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:秦皇島等地區(qū)。秦皇島做網(wǎng)站價(jià)格咨詢:18982081108Pair Project II: Elevator Scheduler
<現(xiàn)代軟件工程> 的結(jié)對(duì)編程作業(yè), 作者: 鄒欣
怎樣設(shè)計(jì)API? 怎樣從不同角度考慮需求? 怎樣對(duì)不同的設(shè)計(jì)進(jìn)行評(píng)估?
怎樣做設(shè)計(jì)一個(gè)測(cè)試框架來(lái)測(cè)試眾多解決方案? 如何驅(qū)動(dòng)這樣的測(cè)試框架?
怎樣和伙伴合作, 快速有效地完成這些挑戰(zhàn)?
這就是我們這次小項(xiàng)目要練習(xí)的。
Design and implement an Elevator Scheduler to aim for both correctness and performance, in managed code.
Skills to practice:
a) Requirement Analysis
需求分析
b) High level design (interface, information hiding, loose coupling)
程序API 設(shè)計(jì), 信息隱藏, 耦合
c) Test Framework Design
設(shè)計(jì)測(cè)試框架, 模擬測(cè)試數(shù)據(jù)
d) Implementation skills
設(shè)計(jì)的實(shí)現(xiàn)
e) Algorithm design
算法設(shè)計(jì)
Imagine we’re building a tall office building,configuration about elevators:
The Building has 21 floors, 4 elevators, many passengers use these elevators everyday (passenger weight: average 70kg. max 120kg, min 40g).
Other constant data: Elevator speed, door open/close time, passenger time for going in/out of the elevator. We can make reasonable assumptions about these.
The building has 21 floors, from floor 0, 1, ... to 20. Floor 0 is the underground parking level, floor 1 is the lobby level. Most people come in/out the building via these 2 floors.
Elevator name | Service floor list | Passenger limit | Weight limit |
1 | All floors | 10 | 800 kg |
2 | floor 1..10 | 10 | 800 kg |
3 | floor 0,1,2..10 | 20 | 1600 kg |
4 | floor 0,1, 11-20 | 20 | 2000 kg |
*note: in our test program, the configuration of elevators can be changed, the scheduler need to read the configuraiton at the initialization time via the API.
2.1 Each pair of students will design a set of interface and class definition so that an algorithm provider can provide his/her implementation to the “elevator scheduler” class.
2.2
each pair will focus on the implementation of the “elevator scheduler” program.
consideration for the API:
a) how to keep it simple.
b) how to provide enough info for the scheduler to finish the scheduling work, without knowing too much info?
c) which component is actually driving the elevator?
d) how to regulate proper passenger behavor? (e.g. if a passenger needs to go to floor 3 from floor 20, but the current elevator can’t go there directly, what should the passenger do?)
consideration for the test framework:
a) how to make sure it generates the same result for the same test cases on a given scheduler?
b) how to check the correctness of the scheduler?
c) how to prevent “cheating” by the scheduler?
d) how to emulate the “real world” efficiently? (e.g. if 2 passengers are 30 minutes away, does the test framework need to wait for 30 minutes?)
TA will come up with a consistent testing model to test your program according to the “rush hour” scenario (see below), and record the total travel time of all passengers.
You (student pair) have:
2.5Explanation of BUS program:
We can have a worst case algorithm called “bus”.This algorithm treats an elevator as a bus,it goes from bottom to top,stops at every floor, open the door, to let people in and out,then close the door and move on.After it reaches the top floor, it will go down.This algorithm can serve all requests, but it’s apparently not the fastest algorithm.
Your code is required to be managed code (C#, managed C++, etc).
It has to generate 0 (zero) Code Analysis warnings and errors. ( link for Code Analysis in Visual Studio)
It has to be correct, all passengers can reach their destinations
It should be as fast as possible.
It should not have randomness in scheduling (this is to avoid randomness in testing).
Score guideline:TA will evaluate the “average total travel time” for all passengers in the same test case, the lower, the better. If your performance is lower than “bus” solution, you get 0 points; if your program can’t deliver any passenger to the correct destination, you get 0 points.
One hint about elevator scheduling: When total weight is within 40 kg of the max limit, or the number of passengers is already at maximum, the elevator doesn’t need to stop for more external requests.
The elevator scheduler program doesn’t know how many passengers are waiting on each floor,it doesn’t know how many passengers will show up either.This is the same with the real world situation.
TA will simulate a “rush hour” test.The “rush hour” test is to simulate the come-to-work and leave-work scenario in a business building, which has the following 2 parts (they can be run next to each other).
20 people going thru random floors within 5 minutes.
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
新聞標(biāo)題:現(xiàn)代軟件工程結(jié)對(duì)編程(II)電梯調(diào)度-創(chuàng)新互聯(lián)
本文路徑:http://www.rwnh.cn/article20/dhhdco.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計(jì)公司、企業(yè)網(wǎng)站制作、用戶體驗(yàn)、響應(yīng)式網(wǎng)站、靜態(tài)網(wǎng)站、ChatGPT
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容