MATLAB代做  | MATLAB代寫  | MATLAB有償編程
首 頁
當前位置:MATLAB代做|MATLAB代寫|MATLAB有償編程matlab源碼算法設計
眼科病床程序源碼        [↓跳到下載地址]
官方主頁:源碼共享網站:www.kggbzb.tw

聯系方式:客服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.kggbzb.tw. All Rights Reserved.
頁面執行時間:375.00000 毫秒
安微25选5开奖号