資源簡介
排隊論的源代碼,c編寫的程序,數學建模中用到。

代碼片段和文件信息
#include?“smpl.h“
main?()
{
?float??Tav=3.125Tad=0.78125Ts=0.125te=200000.0spanv[200000]spand[30000]wsd=0.0?wsv=0.0;
?int?countd=0countv=0id=0iv=0i=0customercustomerv=1customerd=2eventserver;
?????smpl(1?“m/d/1?modle?fcfs“);
?server=facility(“server“?1);
?schedule(1?expntl(Tav)?customerv);
?schedule(1?expntl(Tad)?customerd);
?while?(time() ???{
?cause(&event?&customer);
?switch(event)
?{
??case?1:
??schedule(2?0.0?customer);
??if?(customer==customerv)
??{
??spanv[iv++]=time();
??schedule(1?expntl(Tav)?customer);
??}
??else
??{
??spand[id++]=time();
??schedule(1?expntl(Tad)?customer);
??}
??break;
??case?2:
??if?(request(server?customer?0)==0)
??{
??schedule(3?Ts?customer);
??}
??break;
??case?3:
??if?(customer==customerv)
??{
??spanv[countv]=time()-spanv[countv];
??????????countv++;
??}
??else
??{
??spand[countd]=time()-spand[countd];
??????????countd++;
??}
??release(server?customer);
??break;
??default:
??break;
??}
?}
report();
for(i=0;i<=countv-3;i++)
?{
?wsv=wsv+spanv[i];
?}
?
?printf(“\nVoice?Ws=%f\n\n“wsv/(countv-2));
?for(i=0;i<=countd-3;i++)
?{
?wsd=wsd+spand[i];
?}
?????
?printf(“Data?Ws=%f\n\n“wsd/(countd-2));
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄??????????0??2005-01-04?14:54??mm1
?????文件???????7021??2005-01-04?14:51??mm1\rand.c
?????文件??????21466??2005-01-03?18:36??mm1\smpl.c
?????文件????????862??2005-01-03?17:35??mm1\smpl.h
?????文件??????66560??2005-01-09?22:39??mm1\mm1.ncb
?????文件???????2303??2005-01-09?22:28??mm1\mm1.plg
?????文件????????531??2005-01-03?17:38??mm1\mm1.dsw
?????目錄??????????0??2005-01-04?14:54??mm1\Debug
?????文件???????1317??2005-01-09?21:02??mm1\pri.c
?????文件???????1613??2005-01-09?22:22??mm1\md1?pri.c
?????文件???????1532??2005-01-09?22:28??mm1\mm1.c
?????文件???????1419??2005-01-09?22:28??mm1\md1?fcfs.c
?????文件??????49664??2005-01-09?22:39??mm1\mm1.opt
?????文件???????3727??2005-01-09?22:39??mm1\mm1.dsp
-----------?---------??----------?-----??----
???????????????158233????????????????????15
- 上一篇:二階倒立擺滑膜變結構
- 下一篇:UC免費WiFI.exe
評論
共有 條評論