Facebook Sharer
选择您要替换的背景颜色:
【农历新年】背景图片:
个性化设定
 注册  找回密码
查看: 584|回复: 0
打印 上一主题 下一主题

这里有一个关于Queue 的题目.

[复制链接]

35

主题

0

好友

286

积分

支柱会员

Rank: 4Rank: 4Rank: 4Rank: 4

跳转到指定楼层
1#
发表于 2016-6-9 11:08 PM |只看该作者 |倒序浏览
这里有一个关于Queue 的题目.
我不是很明白这个的logic 和 source code 怎样写?请大家帮我解释解释谢谢.


Consider the case of an ATM center:
• It may have number of machines (servers) to serve customers
• If a customer arrives, the customer gets in line (queue)
• If the ATM is free and someone is waiting, then the first customer will use the machine.
• While a customer is using the machine, the time remaining for the customer to be served is decremented
• If there are customers in line, the additional minute that they have remained in the queue is recorded.
Develop a time-driven single server/single queue or multiple server/single queue system with following specifications:
• Jobs arrive at an average rate of 20 jobs per minute.
• When a job arrives (random jobID), the job is placed in a queue.
• The service time for a job varies from 3 seconds to 16 seconds (use random number and computer clock time)
• Jobs are served at a maximum of 7 seconds at once, if a job required service time more than 7 seconds, for the remaining service time the job is placed back on the queue (enqueue) again.

Run the simulator for 10 minute and report the following statistics:
1. The total number of jobs processed
2. Average number of jobs processed per minute.
3. The average arrival rate per minute
4. The number of jobs processed on the first attempt (one time).
5. The number of jobs had to be requeued once(require 2 times)
6. The number of jobs had to be requeued twice.(3 times)
For Multiple server/ Single queue system
1. Show sample jobs with assigned server ID,
2. Total number of jobs processed by each server




收藏收藏0
您需要登录后才可以回帖 登录 | 注册

JBTALKS.CC |联系我们 |隐私政策 |Share

GMT+8, 2024-12-26 02:52 PM , Processed in 0.109008 second(s), 22 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

Ultra High-performance Dedicated Server powered by iCore Technology Sdn. Bhd.
Domain Registration | Web Hosting | Email Hosting | Forum Hosting | ECShop Hosting | Dedicated Server | Colocation Services
本论坛言论纯属发表者个人意见,与本论坛立场无关
Copyright © 2003-2012 JBTALKS.CC All Rights Reserved
合作联盟网站:
JBTALKS 马来西亚中文论坛 | JBTALKS我的空间 | ICORE TECHNOLOGY SDN. BHD.
回顶部