MATLAB代做  | MATLAB代写  | MATLAB有偿编程
首 页
当前位置:MATLAB代做|MATLAB代写|MATLAB有偿编程matlab源码算法设计
眼科病床程序源码        [↓跳到下载地址]
官方主页:源码共享网站:www.buycode.cn

联系方式:客服QQ:1747812398 买代码源码软件站,欢迎咨询

运行环境:Win9X/2000/XP/2003/

源码语言:简体中文

源码类型:源码程序 - 算法设计

推荐星级:

更新时间:2013-12-29 21:43:25

源码简介

%安排住院仿真

%fangzhen12.m

% global tate_wai  tate_b1 tate_b2 tate_qing tate_shi

n=36;  %天数

menzhen=load('menzhen.txt');

tate_b1=zeros(1,49);tate_b2=zeros(1,49);tate_qing=zeros(1,49);tate_shi=zeros(1,49);tate_wai=zeros(1,49);

%当天出院人数初始化 79

tate_b1(1)=3;tate_b2(1)=5;tate_qing(1)=1;tate_shi(1)=5;tate_wai(1)=1;  %tate为当日出院人数

tate_b1(2)=4;tate_b2(2)=12;tate_qing(2)=2;tate_wai(2)=2;  %9

tate_b1(3)=2;tate_b2(3)=2;tate_shi(3)=4;tate_wai(3)=1;

tate_qing(4)=1;tate_wai(4)=1;tate_shi(4)=4;

tate_shi(5)=1;tate_wai(5)=1;

tate_b1(6)=3;tate_shi(6)=2;

tate_b1(7)=1;tate_wai(7)=1;

tate_qing(8)=5;tate_wai(8)=1;

tate_shi(9)=3;

tate_shi(10)=1;

tate_shi(11)=3;

tate_shi(12)=4;

% tate_shi(13)=4;

% tate_shi(14)=4;   %21

churen=zeros(1,36);    %出院人数初始化

%88号之前包括88号等待入院人数初始化

duiwu_b1=21;

duiwu_b2=29;

duiwu_qing=19;

duiwu_shi=44;

duiwu_wai=3;

%循环天数

for i=1:36

    duiwu_b1=duiwu_b1+menzhen(i,1);

    duiwu_b2=duiwu_b2+menzhen(i,2);

    duiwu_qing=duiwu_qing+menzhen(i,3);

    duiwu_shi=duiwu_shi+menzhen(i,4);

    duiwu_wai=duiwu_wai+menzhen(i,5);

 

    flag=0;

    total(i)=tate_b1(i)+tate_b2(i)+tate_qing(i)+tate_shi(i)+tate_wai(i); %空位

   ruyuan_b1(i)=0;ruyuan_b2(i)=0;ruyuan_qing(i)=0;ruyuan_shi(i)=0;ruyuan_wai(i)=0;

  

   %根据星期给出当天病人的优先级安排入院

    switch menzhen(i,6)

        case {3 4 5}      %此时优先级为:外伤>青光>视网》双眼>单眼 3 4 5

           if total(i)>0 &flag==0

               if duiwu_wai<total(i)&flag==0&duiwu_wai>0

                   ruyuan_wai(i)=duiwu_wai;

                   duiwu_wai=0;

                   total(i)=total(i)-ruyuan_wai(i);

               elseif duiwu_wai>=total(i)&flag==0

                   ruyuan_wai(i)=total(i);

                   duiwu_wai=duiwu_wai-total(i);

                   flag=1;

               end

               if duiwu_qing<total(i)&flag==0&duiwu_qing>0

                   ruyuan_qing(i)=duiwu_qing;

                   duiwu_qing=0;

                   total(i)=total(i)-ruyuan_qing(i);

               elseif duiwu_qing>=total(i)&flag==0

                   ruyuan_qing(i)=total(i);

                   duiwu_qing=duiwu_qing-total(i);

                   flag=1;

               end

               if duiwu_shi<total(i)&flag==0&duiwu_shi>0

                   ruyuan_shi(i)=duiwu_shi ;

                   duiwu_shi =0;

                   total(i)=total(i)-ruyuan_shi(i);

               elseif duiwu_shi>=total(i)&flag==0

                       ruyuan_shi(i)=total(i);

                       duiwu_shi=duiwu_shi-total(i);

                       flag=1;

               end

               if duiwu_b2<total(i)&flag==0&duiwu_b2>0

                   ruyuan_b2(i) =duiwu_b2 ;

                   duiwu_b2 =0;

                   total(i)=total(i)-ruyuan_b2(i) ;

               elseif duiwu_b2>=total(i)&&flag==0

                   ruyuan_b2(i)=total(i);

                   duiwu_b2=duiwu_b2-total(i);

                   flag=1;

               end

               if duiwu_b1<total(i)&flag==0&duiwu_b1>0

                   ruyuan_b1(i) =duiwu_b1;

                   duiwu_b1 =0;

                   total(i)=total(i)-ruyuan_b1(i);

               elseif duiwu_b1>=total(i)&flag==0

                   ruyuan_b1(i)=total(i);

                   duiwu_b1=duiwu_b1-total(i);

                   flag=1;

               end

              

           %安排出院时间

            switch menzhen(i,6)        %menzhen矩阵第六列为改天对应的星期

                case 1   %星期一

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+5)=tate_b1(i+5)+ruyuan_b1(i);

                    tate_b2(i+12)=tate_b2(i+12)+ruyuan_b2(i);

                    tate_qing(i+11)=tate_qing(i+11)+ruyuan_qing(i);

                    tate_shi(i+13)=tate_shi(i+13)+ruyuan_shi(i);

                case 2

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+4)=tate_b1(i+4)+ruyuan_b1(i);

                    tate_b2(i+11)=tate_b2(i+11)+ruyuan_b2(i);

                    tate_qing(i+10)=tate_qing(i+10)+ruyuan_qing(i);

                    tate_shi(i+12)=tate_shi(i+12)+ruyuan_shi(i);

                case 3

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+8)=tate_b1(i+8)+ruyuan_b1(i);

                    tate_b2(i+10)=tate_b2(i+10)+ruyuan_b2(i);

                    tate_qing(i+10)=tate_qing(i+10)+ruyuan_qing(i);

                    tate_shi(i+12)=tate_shi(i+12)+ruyuan_shi(i);

                case 4

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+7)=tate_b1(i+7)+ruyuan_b1(i);

                    tate_b2(i+9)=tate_b2(i+9)+ruyuan_b2(i);

                    tate_qing(i+10)=tate_qing(i+10)+ruyuan_qing(i);

                    tate_shi(i+12)=tate_shi(i+12)+ruyuan_shi(i);

                case 5

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+6)=tate_b1(i+6)+ruyuan_b1(i);

                    tate_b2(i+8)=tate_b2(i+8)+ruyuan_b2(i);

                    tate_qing(i+10)=tate_qing(i+10)+ruyuan_qing(i);

                    tate_shi(i+12)=tate_shi(i+12)+ruyuan_shi(i);

                case 6

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+5)=tate_b1(i+5)+ruyuan_b1(i);

                    tate_b2(i+7)=tate_b2(i+7)+ruyuan_b2(i);

                    tate_qing(i+11)=tate_qing(i+11)+ruyuan_qing(i);

                    tate_shi(i+13)=tate_shi(i+13)+ruyuan_shi(i);

                case 7

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+4)=tate_b1(i+4)+ruyuan_b1(i);

                    tate_b2(i+6)=tate_b2(i+6)+ruyuan_b2(i);

                    tate_qing(i+10)=tate_qing(i+10)+ruyuan_qing(i);

                    tate_shi(i+12)=tate_shi(i+12)+ruyuan_shi(i);

            end

 

            %break;

           end

        case {6,7}

            if total(i)>0&flag==0

                if duiwu_wai<total(i)&flag==0&duiwu_wai>0

                   ruyuan_wai(i)=duiwu_wai;

                   duiwu_wai=0;

                   total(i)=total(i)-ruyuan_wai(i);

               elseif duiwu_wai>=total(i)&flag==0

                   ruyuan_wai(i)=total(i);

                   duiwu_wai=duiwu_wai-total(i);

                   flag=1;

                end

               if duiwu_b2<total(i)&flag==0&duiwu_b2>0

                   ruyuan_b2(i) =duiwu_b2 ;

                   duiwu_b2 =0;

                   total(i)= total(i)-ruyuan_b2(i) ;

               elseif duiwu_b2>=total(i)&&flag==0

                   ruyuan_b2(i)=total(i);

                   duiwu_b2=duiwu_b2-total(i);

                   flag=1;

               end

               if duiwu_b1<total(i)&flag==0&duiwu_b1>0

                   ruyuan_b1(i) =duiwu_b1  ;

                   duiwu_b1 =0;

                   total(i)=total(i)-ruyuan_b1(i) ;

               elseif duiwu_b1>=total(i)&flag==0

                   ruyuan_b1(i)=total(i);

                   duiwu_b1=duiwu_b1-total(i);

                   flag=1;

               end

               if duiwu_qing<total(i)&flag==0&duiwu_qing>0

                   ruyuan_qing(i)=duiwu_qing;

                   duiwu_qing=0;

                   total(i)=total(i)-ruyuan_qing(i);

               elseif duiwu_qing>=total(i)&flag==0

                   ruyuan_qing(i)=total(i);

                   duiwu_qing=duiwu_qing-total(i);

                   flag=1;

               end

               if duiwu_shi<total(i)&flag==0&duiwu_shi>0

                   ruyuan_shi(i)=duiwu_shi;

                   duiwu_shi =0;

                   total(i)=total(i)-ruyuan_shi(i);

               elseif duiwu_shi>=total(i)&flag==0

                       ruyuan_shi(i)=total(i);

                       duiwu_shi=duiwu_shi-total(i);

                       flag=1;

               end

              

               %安排出院时间

               switch menzhen(i,6)        %menzhen矩阵第六列为改天对应的星期

                case 1   %星期一

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+5)=tate_b1(i+5)+ruyuan_b1(i);

                    tate_b2(i+12)=tate_b2(i+12)+ruyuan_b2(i);

                    tate_qing(i+11)=tate_qing(i+11)+ruyuan_qing(i);

                    tate_shi(i+13)=tate_shi(i+13)+ruyuan_shi(i);

                case 2

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+4)=tate_b1(i+4)+ruyuan_b1(i);

                    tate_b2(i+11)=tate_b2(i+11)+ruyuan_b2(i);

                    tate_qing(i+10)=tate_qing(i+10)+ruyuan_qing(i);

                    tate_shi(i+12)=tate_shi(i+12)+ruyuan_shi(i);

                case 3

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+8)=tate_b1(i+8)+ruyuan_b1(i);

                    tate_b2(i+10)=tate_b2(i+10)+ruyuan_b2(i);

                    tate_qing(i+10)=tate_qing(i+10)+ruyuan_qing(i);

                    tate_shi(i+12)=tate_shi(i+12)+ruyuan_shi(i);

                case 4

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+7)=tate_b1(i+7)+ruyuan_b1(i);

                    tate_b2(i+9)=tate_b2(i+9)+ruyuan_b2(i);

                    tate_qing(i+10)=tate_qing(i+10)+ruyuan_qing(i);

                    tate_shi(i+12)=tate_shi(i+12)+ruyuan_shi(i);

                case 5

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+6)=tate_b1(i+6)+ruyuan_b1(i);

                    tate_b2(i+8)=tate_b2(i+8)+ruyuan_b2(i);

                    tate_qing(i+10)=tate_qing(i+10)+ruyuan_qing(i);

                    tate_shi(i+12)=tate_shi(i+12)+ruyuan_shi(i);

                case 6

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+5)=tate_b1(i+5)+ruyuan_b1(i);

                    tate_b2(i+7)=tate_b2(i+7)+ruyuan_b2(i);

                    tate_qing(i+11)=tate_qing(i+11)+ruyuan_qing(i);

                    tate_shi(i+13)=tate_shi(i+13)+ruyuan_shi(i);

                case 7

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+4)=tate_b1(i+4)+ruyuan_b1(i);

                    tate_b2(i+6)=tate_b2(i+6)+ruyuan_b2(i);

                    tate_qing(i+10)=tate_qing(i+10)+ruyuan_qing(i);

                    tate_shi(i+12)=tate_shi(i+12)+ruyuan_shi(i);

            end

               %break;

            end

        case {1,2}

            if total(i)>0 &flag==0

                if duiwu_wai<total(i)&flag==0&duiwu_wai>0

                   ruyuan_wai(i)=duiwu_wai;

                   duiwu_wai=0;

                   total(i)=total(i)-ruyuan_wai(i);

               elseif duiwu_wai>=total(i)&flag==0

                   ruyuan_wai(i)=total(i);

                   duiwu_wai= duiwu_wai-total(i);

                   flag=1;

                end

                if duiwu_b1<total(i)&flag==0&duiwu_b1>0

                   ruyuan_b1(i) =duiwu_b1;

                   duiwu_b1=0;

                   total(i)=total(i)-ruyuan_b1(i);

               elseif duiwu_b1>=total(i)&flag==0

                   ruyuan_b1(i)=total(i);

                   duiwu_b1=duiwu_b1-total(i);

                   flag=1;

                end

               if duiwu_qing<total(i)&flag==0&duiwu_qing>0

                   ruyuan_qing(i)=duiwu_qing;

                   duiwu_qing=0;

                   total(i)=total(i)-ruyuan_qing(i);

               elseif duiwu_qing>=total(i)&flag==0

                   ruyuan_qing(i)=total(i);

                   duiwu_qing=duiwu_qing-total(i);

                   flag=1;

               end

               if duiwu_shi<total(i)&flag==0&duiwu_shi>0

                   ruyuan_shi(i)=duiwu_shi ;

                   duiwu_shi =0;

                   total(i)=total(i)-ruyuan_shi(i);

               elseif duiwu_shi>=total(i)&flag==0

                       ruyuan_shi(i)=total(i);

                       duiwu_shi=duiwu_shi-total(i);

                       flag=1;

               end

               if duiwu_b2<total(i)&flag==0&duiwu_b2>0

                   ruyuan_b2(i) =duiwu_b2;

                   duiwu_b2 =0;

                   total(i)=total(i)-ruyuan_b2(i);

               elseif duiwu_b2>=total(i)&&flag==0

                   ruyuan_b2(i)=total(i);

                   duiwu_b2=duiwu_b2-total(i);

                   flag=1;

               end

              

               %安排出院时间

               switch menzhen(i,6)        %menzhen矩阵第六列为改天对应的星期

                case 1   %星期一

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+5)=tate_b1(i+5)+ruyuan_b1(i);

                    tate_b2(i+12)=tate_b2(i+12)+ruyuan_b2(i);

                    tate_qing(i+11)=tate_qing(i+11)+ruyuan_qing(i);

                    tate_shi(i+13)=tate_shi(i+13)+ruyuan_shi(i);

                case 2

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+4)=tate_b1(i+4)+ruyuan_b1(i);

                    tate_b2(i+11)=tate_b2(i+11)+ruyuan_b2(i);

                    tate_qing(i+10)=tate_qing(i+10)+ruyuan_qing(i);

                    tate_shi(i+12)=tate_shi(i+12)+ruyuan_shi(i);

                case 3

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+8)=tate_b1(i+8)+ruyuan_b1(i);

                    tate_b2(i+10)=tate_b2(i+10)+ruyuan_b2(i);

                    tate_qing(i+10)=tate_qing(i+10)+ruyuan_qing(i);

                    tate_shi(i+12)=tate_shi(i+12)+ruyuan_shi(i);

                case 4

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+7)=tate_b1(i+7)+ruyuan_b1(i);

                    tate_b2(i+9)=tate_b2(i+9)+ruyuan_b2(i);

                    tate_qing(i+10)=tate_qing(i+10)+ruyuan_qing(i);

                    tate_shi(i+12)=tate_shi(i+12)+ruyuan_shi(i);

                case 5

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+6)=tate_b1(i+6)+ruyuan_b1(i);

                    tate_b2(i+8)=tate_b2(i+8)+ruyuan_b2(i);

                    tate_qing(i+10)=tate_qing(i+10)+ruyuan_qing(i);

                    tate_shi(i+12)=tate_shi(i+12)+ruyuan_shi(i);

                case 6

                    state_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+5)=tate_b1(i+5)+ruyuan_b1(i);

                    tate_b2(i+7)=tate_b2(i+7)+ruyuan_b2(i);

                    tate_qing(i+11)=tate_qing(i+11)+ruyuan_qing(i);

                    tate_shi(i+13)=tate_shi(i+13)+ruyuan_shi(i);

                case 7

                    tate_wai(i+7)=tate_wai(i+7)+ruyuan_wai(i);

                    tate_b1(i+4)=tate_b1(i+4)+ruyuan_b1(i);

                    tate_b2(i+6)=tate_b2(i+6)+ruyuan_b2(i);

                    tate_qing(i+10)=tate_qing(i+10)+ruyuan_qing(i);

                    tate_shi(i+12)=tate_shi(i+12)+ruyuan_shi(i);

            end

               %break;

            end

    end

end

ruyuan=[ruyuan_wai',ruyuan_b1',ruyuan_b2',ruyuan_qing',ruyuan_shi'];  %各种病人入院人数

tate=[tate_wai',tate_b1',tate_b2',tate_qing',tate_shi'];              %各种病人出院人数


提 示:本站所有源码只提供浏览,需要定制的朋友可以联系在线客服!
注意:价格根据项目的难易程度来定价格业务咨询

眼科病床程序源码 --下载地址

注意:为避免不必要的误会,本站项目里的源码只公开部分需要的联系在线客服

本站长期招聘程序代写高手,欢迎加入华南地区matlab团队

想创业却没有经验的人

无论你是否有过网上开店的经验,都可以随时联系在线客服,建立自己独立的网站
想开网店却不知道如何入手

淘宝创业成本低而且风险小,如果想开淘宝店的朋友可以联系在线客服。
想兼职创业,却不擅长交际与服务的人

在家创业月入5000元。网站程序+百套群发工具+网赚资料+域名+空间+本站终身代理资格,这样你网赚的条件全具备了。每天3小时管理、推广、收钱。
缺乏能快速赢利型产品的人

导入多种最新流行营销软件+网赚教程,让入驻者轻松加盟、复制有效成交技巧、快速赚钱。
·上一源码:插值危险水域图
·下一源码:眼科病床随机模拟算法

源码评论评论内容只代表网友观点,与本站立场无关!

   评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论

浏览说明

* 本站所有源码全部公开,随时随地浏览!
* MATLAB软件如用于商业用途,请购买正版!
* 如果您发现下载链接错误,请点击报告错误谢谢!
* 站内提供的所有软件包含破解及注册码均是由网上搜集,若侵犯了你的版权利益,敬请来信通知我们!
Copyright © 2008-2014 www.buycode.cn. All Rights Reserved.
页面执行时间:343.75000 毫秒