[很多同学完成了上一个结对编程项目后,  很想知道下一个项目是什么, 我们这次要练习如何设计 接口, 测试框架,  和算法. ]

[博客园的朋友们也可以试一试怎么高效地解决这个问题]

现代软件工程系列 结对编程 (II) 电梯调度程序

-------

Pair Project II Elevator Scheduler

Design and implement an Elevator Scheduler to aim for both correctness and performance, in managed code.

Skills to test:

a)       Requirement Analysis

b)       High level design (interface, information hiding, loose coupling)

c)       Design by contract,

d)       Implementation skills in C#

e)       Algorithm design

1.                 Background

Imagine we’re building a tall office building,  it has the following configuration about elevators:

Building has 21 floors, 4 elevators, many passengers use these elevators everyday (passenger weight: average 70kg. max 120kg, min 45kg).

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

All floors

10

800 kg

3

All floors

20

1600 kg

4

All floors

20

2000 kg

2.                 Requirement to Student pairs

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   After 2.1 is submitted,  TA will review all submission and give out scores,   based on the best design (either from students, or from TA),  each pair will focus on the implementation of the “elevator scheduler” program.

 

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:

1)      A set of API

2)      A simple solution (Bus program)

3)      A set of test cases to run

2.3  Explanation 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.

It has to be correct

It has to be fast

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 45 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.

3.                 Testing

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).

1)      Simple test.  20 passengers

20 people going thru random floors within 5 minutes.

2)      Come-to-work.  1000 total passengers

a)        80% of them goes from floor 0 and 1 to all other floors, the destination is distributed evenly.  The time each passenger arrives at the elevator can be emulated as a normal distribution.

b)        20% of them are going between any 2 floors of [2, 20],  Very few people travel between 2 adjacent floors (e.g. from floor 5 to 4).  Other than this, the distribution is also even.

3)      Leave-work.  1000 total passengers

a)        90% of them go from other floors to floor1 or floor0.

b)        10% of them travel between floors [2, 20], again, Very few people travel between 2 adjacent floors.

Deadline:

1) 11/30, Tuesday, noon.

students will submit design 1: if you were the TA, and in charge of the testing frame work, what is your design for the test framework, and what is the interface you want the students to implement?  You need to submit class definition,  and interface of the scheduler,  and pseudo code (伪代码) of your test framework.

2) 12/10/2010, Friday, noon.

Students will submit the implementation of the elevator scheduler.

3)  12/13/2010,  Monday, noon.

Students will post a blog to their team blog site, to describe the overall design of the scheduler.  Description of test framework is optional, but encouraged.

现代软件工程 结对编程 (II) 电梯调度 算法和测试框架相关推荐

  1. 现代软件工程 结对编程 (II) 电梯调度

    现代软件工程 结对编程 (II) 电梯调度 Pair Project II: Elevator Scheduler <现代软件工程> 的结对编程作业,  作者: 邹欣 怎样设计API?  ...

  2. 现代软件工程系列 结对编程 (II) 电梯调度程序

    [很多同学完成了上一个结对编程项目后,  很想知道下一个项目是什么, 我们这次要练习如何设计 接口, 测试框架,  和算法] 现代软件工程系列 结对编程 (II) 电梯调度程序 ------- Pai ...

  3. 现代软件工程系列 结对编程 (II) 电梯调度程序新需求

    原来布置的作业在这里: http://www.cnblogs.com/xinz/archive/2010/11/28/1890300.html 正如在现实生活中一样, 软件项目的需求也会经常发生变化. ...

  4. 结对项目开发-电梯调度

    结对项目开发-电梯调度 n设计和实现一个电梯调度瞄准两个正确性和性能,在托管代码. n技能训练: na)需求分析 nb)高层次设计(界面,信息隐藏,松耦合) nc)设计文档 nd)算法设计 n1 .背 ...

  5. 软件工程 结对编程1

    软件工程 结对编程1 四则运算题目生成程序(Gui) *这次博客的一个小目录 1.我和我的小伙伴的学号 2.项目开发的coding.net 地址 3.项目完成的五个部分: a.需求分析  b.程序设计 ...

  6. 结对编程作业---电梯调度程序

    这次的作业和以往不同,按照老师的要求,我们要进行结对编程的练习.所谓结对编程相信各位都不会陌生,这里不在赘述. 首先介绍下我的小伙伴,很幸运的是我的队友也是我的室友---樊西江,这为我们合作提供了很大 ...

  7. 结对项目开发电梯调度 - 整体设计

    一.系统介绍 1. 功能描述 本电梯系统用来控制一台运行于一个具有16层的大楼电梯,它具有上升.下降.开门.关门.载客的基本功能. 大楼的每一层都有: (1) 两个指示灯:  这两个指示灯分别用于指示 ...

  8. 【课程·研】软件工程 | 结对编程:建造金字塔(1157)

    本文专栏:研究生课程 点击查看系列文章 本文主要内容: 1.实验要求 2.待求解问题描述与数学模型 问题描述: 输入: 输出: 数据范围: 3.算法与数据结构设计 3.1 设计思路 3.2 算法流程图 ...

  9. 现代软件工程 结对编程 (I) 三维棋类游戏

    Pair Project I 3D Board Game Turn a usual 2D board game into 3D by transferring  board and game rule ...

最新文章

  1. mysql div 没有小数,mysql order by limit 的一个坑
  2. MySQL查看数据表
  3. 前端模板引擎Thymeleaf快速入门
  4. html模块化标签,jq load()方法实现html 模块化。
  5. windows脚本命令闪退_NCL2Python|windows系统安装Pyngl和Pynio
  6. AFNetworking 3.0迁移指南
  7. JBookManager v1.00.2008314 (编辑管理您的Jar电子书)
  8. [PyTorch] 记录一次PyTorch版本更新
  9. 顶级的CSS和Javascript动画框架
  10. PCalc for Mac(科学计算器)
  11. WIN7、WIN8 右键在目录当前打开命令行Cmd窗口(图文)
  12. 五金冲压模具设计分享pressCAD外挂使用小窍门
  13. Android正确使用Scheme协议打开App,兼容浏览器scheme的二次跳转
  14. c语言编写fac函数 计算阶乘,编写一个计算阶乘的函数fac
  15. 如何直观理解交叉熵及其优势?
  16. 【每日一趣】老王的烦恼
  17. 神经网络的严冬与复兴之路
  18. cmd 实用命令以及如何装逼
  19. MAC OS X 问题库
  20. SVN: an error occurred and the operation could not be completed

热门文章

  1. CentOS7完成mysql的安装和远程访问
  2. 洛谷 1341 无序字母对
  3. memcache中的add和set方法区别
  4. input框自动填充内容背景颜色为黄色解决方法
  5. 11. javacript高级程序设计-DOM扩展
  6. 开发过程中编写的一些批处理
  7. 用 WebClient 轻松实现文件下载上传、网页抓取
  8. 关于GPS 车辆定位导航中的投影变换
  9. plt.savefig 不保存边框_Matlab科研绘图 amp; 保存
  10. 一级计算机B理论知识和答案,计算机一级B基础知识选择题答案.doc