資源簡介
交通流NASch模型包括比較流行的單車道、雙車道、三車道等模型的模擬與仿真

代碼片段和文件信息
function?[new_matrix_cellsnew_v]=border_control(matrix_cellsabvvmax)
%邊界條件,開口邊界,控制車輛出入
%出口邊界若頭車在道路邊界,則以一定概率0.9離去
n=length(matrix_cells);
if?a==n
????rand(‘state‘sum(100*clock)*rand(1));%定義隨機種子
????p_1=rand(1);%產生隨機概率
????if?p_1<=1?%如果隨機概率小于0.9,則車輛離開路段,否則不離開
????matrix_cells(n)=0;
????v(n)=0;????
????end
end
%入口邊界泊松分布到達,1s內平均到達車輛數為q,t為1s
if?b>vmax
????t=1;
????q=0.25;
????x=1;
????p=(q*t)^x*exp(-q*t)/prod(x);%1s內有1輛車到達的概率
???rand(‘state‘sum(100*clock)*rand(1));
????p_2=rand(1);
????if?p_2<=p?
???????m=min(b-vmaxvmax);
???????matrix_cells(m)=1;
???????v(m)=m;????
????end
end
new_matrix_cells=matrix_cells;
new_v=v;?????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????763??2009-03-31?08:58??NaSch_open\border_control.m
?????文件?????187600??2017-06-27?08:15??NaSch_open\data.txt
?????文件????????201??2009-03-30?13:49??NaSch_open\leadcarupdate.m
?????文件???????3633??2008-06-17?17:58??NaSch_open\NaSch_3.m
?????文件??????92672??2009-12-15?21:02??NaSch_open\NS.doc
?????文件????????174??2008-06-10?23:25??NaSch_open\randslow.m
?????文件????????337??2009-03-29?22:47??NaSch_open\roadstart.m
?????文件????????345??2017-06-29?14:29??NaSch_open\searchfrontcar.m
?????文件????????281??2009-03-29?22:15??NaSch_open\searchlastcar.m
?????文件????????242??2009-03-29?18:32??NaSch_open\searchleadcar.m
?????文件????????264??2009-03-29?21:39??NaSch_open\speedstart.m
?????文件???????4726??2008-06-19?11:27??NaSch_open\test.m
?????文件?????????50??2008-06-11?17:03??NaSch_open\新建?文本文檔.txt
?????目錄??????????0??2017-07-07?10:29??NaSch_open
-----------?---------??----------?-----??----
???????????????291288????????????????????14
- 上一篇:粒子濾波綜述
- 下一篇:PSP USB驅動 Type B
評論
共有 條評論