SimulationLength; cout>numTellers; cout>arrivalLow>>arrivalHigh; cout>serviceLow>>serviceHigh; for(int i=1;i<= numTellers;i++) //窗口信息初始化 { t[i].totalC"/> SimulationLength; cout>numTellers; cout>arrivalLow>>arrivalHigh; cout>serviceLow>>serviceHigh; for(int i=1;i<= numTellers;i++) //窗口信息初始化 { t[i].totalC"/>
首页 C++程序代码-事件驱动模拟

C++程序代码-事件驱动模拟

举报
开通vip

C++程序代码-事件驱动模拟C++程序代码-事件驱动模拟 #include //getch #include"simulation.h" Simulation::Simulation(void)//模拟过程初始化 { cout>SimulationLength; cout>numTellers; cout>arrivalLow>>arrivalHigh; cout>serviceLow>>serviceHigh; for(int i=1;i<= numTellers;i++) //窗口信息初始化 { t[i].totalC...

C++程序代码-事件驱动模拟
C++程序代码-事件驱动模拟 #include //getch #include"simulation.h" Simulation::Simulation(void)//模拟过程初始化 { cout<<"Enter the simulation time in minutes:";//从终端读取数据 cin>>SimulationLength; cout<<"Enter the number of tellers(2~10):"; cin>>numTellers; cout<<"Enter the range of arrival times in minutes:"; cin>>arrivalLow>>arrivalHigh; cout<<"Enter the range of service times in minutes:"; cin>>serviceLow>>serviceHigh; for(int i=1;i<= numTellers;i++) //窗口信息初始化 { t[i].totalCustomer=0; t[i].totalService=0; t[i].totalWait=0; } PQ.Push(Event(0,0)); //一个客户于0时到达 } Simulation::Simulation(int L,int nT,int aL,int aH,int sL,int sH) { SimulationLength=L; numTellers=nT; arrivalLow=aL; arrivalHigh=aH; serviceLow=sL; serviceHigh=sH; for(int i=1;i<=numTellers;i++) //窗口信息初始化 { t[i].totalCustomer=0; t[i].totalService=0; t[i].totalWait=0; } PQ.Push(Event(0,0)); //一个客户于0时到达 } int Simulation::GetNextTeller(void)//计算下一个可用窗口 { int i,size=Q[1].Size(),min=1; for(i=2;i<=numTellers;i++) if(Q[i].Size() 关于同志近三年现实表现材料材料类招标技术评分表图表与交易pdf视力表打印pdf用图表说话 pdf { s=Q[i].Front(); PQ.Push(Event(e.GetTime()+s.serviceTime,i)); } } void Simulation::PrintPQueue(void) //显示事件表 { int n=PQ.Size(); //记录事件表长度 int i=0; Event e,*p=new Event[n]; //建立动态数组 cout<<"*****EventQueue*****\n"; while(!PQ.Empty()) { e=PQ.Pop(); //取出事件表一元素输出 cout<<'('<
本文档为【C++程序代码-事件驱动模拟】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_005190
暂无简介~
格式:doc
大小:20KB
软件:Word
页数:7
分类:互联网
上传时间:2017-09-26
浏览量:36