当前位置:首页 > 代码 > 正文

排队论代码(排队论分类)

admin 发布:2022-12-19 05:25 100


今天给各位分享排队论代码的知识,其中也会对排队论分类进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

急!请教matlab 排队论

M/M/m排队系统性能仿真代码matlab

function r=randexp(lambda) r = -lambda*log(rand);

说明同上

%mmm simulation in matlab

clc;clear;

ST_Idle=0;

ST_Busy=1;

EV_NULL=0;

EV_Arrive=1;

EV_Depart=2;

EV_LEN=3;

Q_LIMIT=1000;

% next_event_type=[];

% next_depart=[]

% num_custs_delayed=[];

% num_delays_required=[];

% num_events=[];

% num_in_q=[];

% server_status=[];

% area_num_in_q=[];

% area_server_status=[];

% mean_interarrival=[];

% mean_service=[];

% sim_time=[];

% time_last_event=[];

% total_of_delays=[];

%

time_arrival=[]; %到达时刻

time_next_event=zeros(1,EV_LEN);

%仿真参数

num_events=EV_LEN-1;

num_server=3; %M/M/m m=2

mean_interarrival=1;

mean_service=.5;

num_delays_required=2000; %

outfile=fopen('MM m.txt','w');

fprintf(outfile, 'Multiple-server queueing system\n\n');

fprintf(outfile, 'Mean interarrival time%11.3f minutes\n\n',mean_interarrival);

fprintf(outfile, 'Mean service time%16.3f minutes\n\n', mean_service);

fprintf(outfile, 'Number of servers%20d\n\n', num_server);

fprintf(outfile, 'Number of customers%14d\n\n', num_delays_required);

%part1 initialize

sim_time=0.0;

%/* Initialize the state variables. */

server_status =zeros(1,num_server); %idle

num_in_q = 0;

time_last_event = 0.0;

%/* Initialize the statistical counters. */

num_custs_delayed = 0;

total_of_delays = 0.0;

total_of_time = 0.0;

area_num_in_q = 0.0;

area_server_status = 0.0;

%/* Initialize event list. Since no customers are present, the departure

%(service completion) event is eliminated from consideration. */

time_next_event(EV_Arrive) = sim_time + randexp(mean_interarrival);

time_next_event(EV_Depart) = 1.0e+230;

time_depart=zeros(1,num_server);

next_depart=0;

%part2

while (num_custs_delayed num_delays_required)

%Run the simulation while more delays are still needed.

%/* Determine the next event. */

min_time_next_event = 1.0e+290;

next_event_type = 0;

% Determine m depart event

min_time_depart=1e290;

next_depart=-1;

for i=1:num_server

if(server_status(i)==1 time_depart(i)min_time_depart)

min_time_depart=time_depart(i);

next_depart=i;

end

end

time_next_event(2)=min_time_depart;

%

%/* Determine the event type of the next event to occur. */

for i = 1: num_events

if (time_next_event(i) min_time_next_event)

min_time_next_event = time_next_event(i);

next_event_type = i;

end

end

%/* Check to see whether the event list is empty. */

if (next_event_type == 0)

%/* The event list is empty, so stop the simulation. */

fprintf(outfile, '\nEvent list empty at time %f', sim_time);

exit(1);

end

%/* The event list is not empty, so advance the simulation clock. */

sim_time = min_time_next_event;

%/* Update time-average statistical accumulators. */

double time_since_last_event;

%/* Compute time since last event, and update last-event-time marker. */

time_since_last_event = sim_time - time_last_event;

time_last_event = sim_time;

%/* Update area under number-in-queue function. */

area_num_in_q=area_num_in_q + num_in_q * time_since_last_event;

%/* Update area under server-busy indicator function. */

for i=1:num_server

area_server_status =area_server_status + server_status(i) * time_since_last_event;

end

%/* Invoke the appropriate event function. */

%arrival

if(next_event_type==EV_Arrive)

double delay;

%/* Schedule next arrival. */

time_next_event(1) = sim_time + randexp(mean_interarrival);

%/* Check to see whether server is busy. */

s_idle=-1;

for i=1:num_server

if (server_status(i) == ST_Idle)

s_idle=i;

break;

end

end

%/* all Server is busy, so increment number of customers in queue. */

if(s_idle== -1 )

num_in_q=1+num_in_q;

%/* Check to see whether an overflow condition exists. */

if (num_in_q Q_LIMIT)

%/* The queue has overflowed, so stop the simulation. */

fprintf(outfile, '\nOverflow of the array time_arrival at');

fprintf(outfile, ' time %f', sim_time);

exit(2);

end

%/* There is still room in the queue, so store the time of arrival of the arriving customer at the (new) end of time_arrival. */

time_arrival(length(time_arrival)+1)=sim_time;

else

%/* Server is idle, so arriving customer has a delay of zero. (The following two statements are for program clarity

%and do not affect the results of the simulation.) */

delay = 0.0;

total_of_delays =total_of_delays + delay;

%/* Increment the number of customers delayed, and make server busy. */

num_custs_delayed = 1 + num_custs_delayed;

server_status(s_idle) = ST_Busy;

%/* Schedule a departure (service completion). */

time_depart(s_idle) = sim_time + randexp(mean_service);

end % if (server_status == ST_Busy)

%depart

else

double delay;

%/* Check to see whether the queue is empty. */

if (num_in_q == 0)

% /* The queue is empty so make the server idle and eliminate the departure (service completion) event from consideration. */

server_status(next_depart) = ST_Idle;

time_depart(next_depart) = 1.0e+230;

%check_depart()

min_time_dapart=1e290;

next_depart=-1;

for i=1:num_server

if(server_status(i)==1 time_depart(i)min_time_depart)

min_time_depart=time_depart(i);

next_depart=i;

end

end

time_next_event(2)=min_time_depart;

else

%/* The queue is nonempty, so decrement the number of customers in queue. */

num_in_q=num_in_q-1;

%/* Compute the delay of the customer who is beginning service and update the total delay accumulator. */

delay = sim_time - time_arrival(1);

total_of_delays =total_of_delays + delay;

%/* Increment the number of customers delayed, and schedule departure. */

num_custs_delayed = 1 + num_custs_delayed;

serv_time=randexp(mean_service);

time_depart(next_depart) = sim_time + serv_time;

total_of_time = total_of_time + delay + serv_time;

%check_depart()

min_time_dapart=1e290;

next_depart=-1;

for i=1:num_server

if(server_status(i)==1 time_depart(i)min_time_depart)

min_time_depart=time_depart(i);

next_depart=i;

end

end

time_next_event(2)=min_time_depart;

%/* Move each customer in queue (if any) up one place. */

tempForPop=time_arrival(2:length(time_arrival));

time_arrival=tempForPop;

end %if (num_in_q == 0)

end %if(next_event_type==EV_Arrive)

end %while

%%%%%%%%%% part 3

%/* Invoke the report generator and end the simulation. */

fprintf(outfile, '\n\nAverage delay in queue%11.3f minutes\n\n',total_of_delays / num_custs_delayed);

fprintf(outfile, '\n\nAverage delay in system%11.3f minutes\n\n',total_of_time / num_custs_delayed);

fprintf(outfile, 'Average number in queue%10.3f\n\n',area_num_in_q / sim_time);

fprintf(outfile, 'Server utilization%15.3f\n\n',area_server_status / sim_time);

fprintf(outfile, 'Time simulation ended%12.3f minutes', sim_time);

fclose(outfile);

用lingo编程报错

model:

sets:

GC/1..3/:GZ; !i工厂所有物资的总产量;

WZ/1..10/:TJ,M; !j物资体积,存储费;

CC/1..5/:W; !k仓库容积,;

FD/1..8/:HZ; !h分店;

YJ1(GC,CC):B; !i工厂到k仓库的运价;

YJ2(CC,FD):F; !k仓库到h分店的运价;

CL(GC,WZ):G; !i工厂j物资的产量;

DJ(GC,WZ):P; !i工厂j物资的订价;

DGC(GC,WZ,CC):A; !i工厂生产的j物资到k仓库的订货量;

DCF(CC,WZ,FD):E; !k仓库运输的j物资到h分店的订货量;

ENDSETS

!目标函数;

MIN=@sum( GC(i):@sum(wz(j):@sum( CC(k): A(i,j,k)*p(i,j))))+ ! i工厂运出货物的总价格;

@sum( GC(i):@sum(wz(j):@sum( CC(k): A(i,j,k)*B(i,k))))+ !i工厂到k仓库的运价:运价1;

@sum(wz(j):@sum(GC(i):@sum(CC(k):A(i,j,k)))*M(j))+ !总库存费;

@sum(CC(k):@sum(fd(h):@sum(wz(j):E(k,j,h))*F(k,h))); !k仓库到h分店的运价:运价2;

!产量约束;

@for(CL(i,j):

@sum(DGC(i,j,k): A(i,j,k))=G(i,j)); !i仓库运出量不大于生产量 !;

!k仓库的j物资运入量=运出量;

@for(WZ(j):@for(CC(k):

@sum(GC(i):A(i,j,k))=@sum(FD(h):E(k,j,h)))); !问题出在这里,其他的都可以运行;

DATA:

GZ=15200 10500 11200;

TJ=1.5 1 1.5 2 1.5 0.5 1.5 2 1 0.5;

M=40 70 90 100 120 120 150 160 180 200;

W=800 600 1000 700 800;

B=

1000 10 14 17 13

10 8 1000 9 16

15 16 9 15 1000;

F=

3 2 3 6 3 1 4 5

1000 3 3 1000 5 2 5 3

5 1000 2 5 1000 5 1000 4

4 1 4 4 2 1000 2 1000

2 2 5 3 5 2 5 2;

G=

0.2 0 0.3 0.1 0.32 0.1 0 0.2 0.15 0.15

0.2 0.13 0 0.1 0 0.15 0.2 0.15 0 0.12

0 0.25 0.08 0.15 0 0.1 0.14 0 0.25 0.15;

P=

100 1000 210 250 290 300 1000 430 450 500

90 180 1000 240 1000 305 380 435 1000 490

1000 170 210 245 1000 285 400 1000 450 480;

enddata

谁能告诉我数学的所有小分科?

根据《中华人民共和国学科分类与代码国家标准》数学(自然科学类一级学科)分为:

学科代码 学科名称

110.11 数学史

110.14 数理逻辑与数学基础

110.1410 演绎逻辑学(亦称符号逻辑学)

110.1420 证明论(亦称元数学)

110.1430 递归论

110.1440 模型论

110.1450 公理集合论

110.1460 数学基础

110.1499 数理逻辑与数学基础其他学科

110.17 数论

110.1710 初等数论

110.1720 解析数论

110.1730 代数数论

110.1740 超越数论

110.1750 丢番图逼近

110.1760 数的几何

110.1770 概率数论

110.1780 计算数论

110.1799 数论其他学科

110.21 代数学

110.2110 线性代数

110.2115 群论

110.2120 域论

110.2125 李群

110.2130 李代数

110.2135 Kac-Moody代数

110.2140 环论

110.2145 模论

110.2150 格论

110.2155 泛代数理论

110.2160 范畴论

110.2165 同调代数

110.2170 代数K理论

110.2175 微分代数

110.2180 代数编码理论

110.2199 代数学其他学科

110.24 代数几何学

110.27 几何学

110.2710 几何学基础

110.2715 欧氏几何学

110.2720 非欧几何学(包括黎曼几何学等)

110.2725 球面几何学

110.2730 向量和张量分析

110.2735 仿射几何学

110.2740 射影几何学

110.2745 微分几何学

110.2750 分数维几何

110.2755 计算几何学

110.2799 几何学其他学科

110.31 拓扑学

110.3110 点集拓扑学

110.3115 代数拓扑学

110.3120 同伦论

110.3125 低维拓扑学

110.3130 同调论

110.3135 维数论

110.3140 格上拓扑学

110.3145 纤维丛论

110.3150 几何拓扑学

110.3155 奇点理论

110.3160 微分拓扑学

110.3199 拓扑学其他学科

110.34 数学分析

110.3410 微分学

110.3420 积分学

110.3430 级数论

110.3499 数学分析其他学科

110.37 非标准分析

110.41 函数论

110.4110 实变函数论

110.4120 单复变函数论

110.4130 多复变函数论

110.4140 函数逼近论

110.4150 调和分析

110.4160 复流形

110.4170 特殊函数论

110.4199 函数论其他学科

110.44 常微分方程

110.4410 定性理论

110.4420 稳定性理论

110.4430 解析理论

110.4499 常微分方程其他学科

110.47 偏微分方程

110.4710 椭圆型偏微分方程

110.4720 双曲型偏微分方程

110.4730 抛物型偏微分方程

110.4740 非线性偏微分方程

110.4799 偏微分方程其他学科

110.51 动力系统

110.5110 微分动力系统

110.5120 拓扑动力系统

110.5130 复动力系统

110.5199 动力系统其他学科

110.54 积分方程

110.57 泛函分析

110.5710 线性算子理论

110.5715 变分法

110.5720 拓扑线性空间

110.5725 希尔伯特空间

110.5730 函数空间

110.5735 巴拿赫空间

110.5740 算子代数

110.5745 测度与积分

110.5750 广义函数论

110.5755 非线性泛函分析

110.5799 泛函分析其他学科

110.61 计算数学

110.6110 插值法与逼近论

110.6120 常微分方程数值解

110.6130 偏微分方程数值解

110.6140 积分方程数值解

110.6150 数值代数

110.6160 连续问题离散化方法

110.6170 随机数值实验

110.6180 误差分析

110.6199 计算数学其他学科

110.64 概率论

110.6410 几何概率

110.6420 概率分布

110.6430 极限理论

110.6440 随机过程

110.6450 马尔可夫过程

110.6460 随机分析

110.6470 鞅论

110.6480 应用概率论

110.6499 概率论其他学科

110.67 数理统计学

110.6710 抽样理论

110.6715 假设检验

110.6720 非参数统计

110.6725 方差分析

110.6730 相关回归分析

110.6735 统计推断

110.6740 贝叶斯统计

110.6745 试验设计

110.6750 多元分析

110.6755 统计判决理论

110.6760 时间序列分析

110.6799 数理统计学其他学科

110.71 应用统计数学

110.7110 统计质量控制

110.7120 可靠性数学

110.7130 保险数学

110.7140 统计模拟

110.7199 应用统计数学其他学科

110.74 运筹学

110.7410 线性规划

110.7415 非线性规划

110.7420 动态规划

110.7425 组合最优化

110.7430 参数规划

110.7435 整数规划

110.7440 随机规划

110.7445 排队论

110.7450 对策论(亦称博奕论)

110.7455 库存论

110.7460 决策论

110.7465 搜索论

110.7470 图论

110.7475 统筹论

110.7480 最优化

110.7499 运筹学其他学科

110.77 组合数学

110.81 离散数学

110.84 模糊数学

110.87 应用数学

110.99 数学其他学科

以上为数学学科的二级学科(代码为110.xx),再往下分就是三级学科(代码为110.xxxx),希望能够帮到你

超市收银排队论的matlab仿真代码

你参考模仿一下吧。 clear clc %***************************************** %初始化顾客源 %***************************************** %总仿真时间 Total_time = 10; %队列最大长度 N = 10000000000; %到达率与服务率 lambda = 10; mu = 6; %...

数学分支有几大类

.. 数学史

2.. 数理逻辑与数学基础

a.. 演绎逻辑学 亦称符号逻辑学

b.. 证明论 亦称元数学

c.. 递归论

d.. 模型论

e.. 公理集合论

f.. 数学基础

g.. 数理逻辑与数学基础其他学科

3.. 数论

a.. 初等数论

b.. 解析数论

c.. 代数数论

d.. 超越数论

e.. 丢番图逼近

f.. 数的几何

g.. 概率数论

h.. 计算数论

i.. 数论其他学科

4.. 代数学

a.. 线性代数

b.. 群论

c.. 域论

d.. 李群

e.. 李代数

f.. Kac-Moody代数

g.. 环论 包括交换环与交换代数,结合环与结合代数,非结合环与非结

合代数等

h.. 模论

i.. 格论

j.. 泛代数理论

k.. 范畴论

l.. 同调代数

m.. 代数K理论

n.. 微分代数

o.. 代数编码理论

p.. 代数学其他学科

5.. 代数几何学

6.. 几何学

a.. 几何学基础

b.. 欧氏几何学

c.. 非欧几何学 包括黎曼几何学等

d.. 球面几何学

e.. 向量和张量分析

f.. 仿射几何学

g.. 射影几何学

h.. 微分几何学

i.. 分数维几何

j.. 计算几何学

k.. 几何学其他学科

7.. 拓扑学

a.. 点集拓扑学

b.. 代数拓扑学

c.. 同伦论

d.. 低维拓扑学

e.. 同调论

f.. 维数论

g.. 格上拓扑学

h.. 纤维丛论

i.. 几何拓扑学

j.. 奇点理论

k.. 微分拓扑学

l.. 拓扑学其他学科

8.. 数学分析

a.. 微分学

b.. 积分学

c.. 级数论

d.. 数学分析其他学科

9.. 非标准分析

10.. 函数论

a.. 实变函数论

b.. 单复变函数论

c.. 多复变函数论

d.. 函数逼近论

e.. 调和分析

f.. 复流形

g.. 特殊函数论

h.. 函数论其他学科

11.. 常微分方程

a.. 定性理论

b.. 稳定性理论

c.. 解析理论

d.. 常微分方程其他学科

12.. 偏微分方程

a.. 椭圆型偏微分方程

b.. 双曲型偏微分方程

c.. 抛物型偏微分方程

d.. 非线性偏微分方程

e.. 偏微分方程其他学科

13.. 动力系统

a.. 微分动力系统

b.. 拓扑动力系统

c.. 复动力系统

d.. 动力系统其他学科

14.. 积分方程

15.. 泛函分析

a.. 线性算子理论

b.. 变分法

c.. 拓扑线性空间

d.. 希尔伯特空间

e.. 函数空间

f.. 巴拿赫空间

g.. 算子代数

h.. 测度与积分

i.. 广义函数论

j.. 非线性泛函分析

k.. 泛函分析其他学科

16.. 计算数学

a.. 插值法与逼近论

b.. 常微分方程数值解

c.. 偏微分方程数值解

d.. 积分方程数值解

e.. 数值代数

f.. 连续问题离散化方法

g.. 随机数值实验

h.. 误差分析

i.. 计算数学其他学科

17.. 概率论

a.. 几何概率

b.. 概率分布

c.. 极限理论

d.. 随机过程 包括正态过程与平稳过程、点过程等

e.. 马尔可夫过程

f.. 随机分析

g.. 鞅论

h.. 应用概率论 具体应用入有关学科

i.. 概率论其他学科

18.. 数理统计学

a.. 抽样理论 包括抽样分布、抽样调查等

b.. 假设检验

c.. 非参数统计

d.. 方差分析

e.. 相关回归分析

f.. 统计推断

g.. 贝叶斯统计 包括参数估计等

h.. 试验设计

i.. 多元分析

j.. 统计判决理论

k.. 时间序列分析

l.. 数理统计学其他学科

19.. 应用统计数学

a.. 统计质量控制

b.. 可靠性数学

c.. 保险数学

d.. 统计模拟

20.. 应用统计数学其他学科

21.. 运筹学

a.. 线性规划

b.. 非线性规划

c.. 动态规划

d.. 组合最优化

e.. 参数规划

f.. 整数规划

g.. 随机规划

h.. 排队论

i.. 对策论 亦称博弈论

j.. 库存论

k.. 决策论

l.. 搜索论

m.. 图论

n.. 统筹论

o.. 最优化

p.. 运筹学其他学科

22.. 组合数学

23.. 模糊数学

24.. 应用数学 具体应用入有关学科

25.. 数学其他学科

关于排队论代码和排队论分类的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;

本文地址:http://ahzz.com.cn/post/3069.html


取消回复欢迎 发表评论:

分享到

温馨提示

下载成功了么?或者链接失效了?

联系我们反馈

立即下载