基于时空预留方案的十字路口交通自动调节智能交通管理系统附matlab代码

简介: 基于时空预留方案的十字路口交通自动调节智能交通管理系统附matlab代码

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法       神经网络预测       雷达通信      无线传感器        电力系统

信号处理              图像处理               路径规划       元胞自动机        无人机

⛄ 内容介绍

本文介绍了一种应用于十字路口交通自动调节的智能交通管理系统的传统算法。遗留算法的应用使智能交叉口能够容纳低比例的、没有装备或V2V和V2I通信有问题的车辆。所开发的智能交通管理技术是基于时空预留方案的,旨在最大限度地减少事故、交通拥堵以及由此产生的道路交通环境成本。三种智能交通管理算法应用于道路交叉口、环形交叉口和十字路口,其性能得到了分析。与传统的交通管理技术相比,使用所开发的智能交通管理技术的模拟结果表明,交通输出流量可以增加,交通流率可以提高,穿越交叉口的平均时间可以显著减少。当交通流量大时,这种减少更为明显。所进行的研究表明,在使用传统算法的智能交叉口中纳入低比例的未装备或有故障的V2V和V2I通信的车辆,对交通流的影响很小。

⛄ 部分代码

%--------------------------------------------------------------------------

%                           ISR-TrafSim v2.0


%

%--------------------------------------------------------------------------

% This Matlab file is part of the ISR-TrafSim: a Matlab

% library for traffic simulation and pose estimation in Urban environments,

% namely roundabouts and crossroads.

%

% http://www.isr.uc.pt/~conde/isr-trafsim/

%

%-CITATION---------------------------------------------------------------------------

% If you use this software please cite one of the following papers:

% 1) L.C.Bento, R.Parafita, S.Santos and U.Nunes, An Intelligent Traffic Management

% at Intersections legacy mode for vehicles not equipped with V2V and V2I Communications,

% 16th IEEE Int.Conf. Intelligent Transportation Systems, Netherlands, 2013.

% 2) L.C.Bento, R.Parafita and U.Nunes, Inter-vehicle sensor fusion for accurate vehicle

% localization supported by V2V and V2I communications, 15th IEEE Int.Conf. Intelligent

% Transportation Systems, USA, 2012.

% 3) L.C.Bento, R.Parafita and U.Nunes, Intelligent traffic management at intersections

% supported by V2V and V2I communications, 15th IEEE Int.Conf. Intelligent

% Transportation Systems, USA, 2012.

%

%-DESCRIPTION--------------------------------------------------------------

%

% Roundabout gestion module

%

%-DISCLAIMER---------------------------------------------------------------

% This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY;

% without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

% You can use this source code without licensing fees only for NON-COMMERCIAL research

% and EDUCATIONAL purposes only.

% You cannot repost this file without prior written permission from the authors.

%

%-AUTHORS------------------------------------------------------------------

%   Urbano Nunes*

%   Luis Conde Bento**

%   Ricardo Parafita*

%   Sergio Santos*

%

%  *Institute of Systems and Robotics   - University of Coimbra

% **School of Technology and Management - Polytechnic Institute of Leiria

%--------------------------------------------------------------------------


function [] = round_gest_isr_trafsim()

global s c

% s.round_notify_list -> [id ; node ; state; time; posx; posy; inroad; outroad; currentVel; maxVel; carType, CurrentRoad, timeoflastnotify]


% Delete layers if are no longer necessary

delete_layer_isr_trafsim();


% Add car to s.round_notify_list if car is not in there (no commu)

add_car_notify_round_isr_trafsim();


% Delete car withot V2I from list s.rg_count_tab & s.list_round_already_reserve

if(s.time>s.time_round_without_commu && s.time_round_without_commu~=-1)

   %keyboard

   id=s.car_round_without_commu;

   s.time_round_without_commu=-1;

   s.car_round_without_commu=[];

   for i=1:size(s.rg_count_tab,2)

       for p=3:10

           if(isnan(s.rg_count_tab(p,i)))

               s.rg_count_tab(p,i)=0;

               s.rg_count_tab(2,i)=s.rg_count_tab(2,i)-1;

               break

           end

       end

   end

   for i=2:size(s.list_round_already_reserve,1)

       if(~isempty(find(s.list_round_already_reserve(i,:)==id)))

           s.list_round_already_reserve(i,:)=[];

           break

       end

   end

   if(ismember(id,c.listactive))

       pos=find(c.listactive==id);

       road=find(s.rg_count_tab(1,:)==c.car(pos).rar);

       for p=3:10

           if(s.rg_count_tab(p,road)==0)

               s.rg_count_tab(p,road)=id;

               s.rg_count_tab(2,road)=s.rg_count_tab(2,road)+1;

               break

           end

       end

   end

end


% Process Algoritm

Exist_Car_withot_V2I=~isempty(s.list_round_without_commu);  % Doesn't exist car without communication on the list

Exist_Notification=size(s.round_notify_list,2)>1;        % Exist notifications


if(s.pause==1)

   s.pause=0;  % to pause only once

   keyboard

end


if(Exist_Notification && ~Exist_Car_withot_V2I)

   

   aux=2;                                          % aux starts in 2 because first notification is NaN

   while( aux <= size(s.round_notify_list,2) )     % For each new notification

       cond1=s.round_notify_list(3,aux)==-1;

       cond2=s.time>s.round_notify_list(4,aux)+2;

       cond3=(dist_isr_trafsim(50,50,s.round_notify_list(5,aux),s.round_notify_list(6,aux)))<s.control_radius_round;

       if(cond1 && cond2 && cond3)

           id=s.round_notify_list(1,aux);                  % Car Id

           n=find(c.listactive==id);                       % Car place on c.listactive

           CarCommu=~isnan(s.round_notify_list(9,aux));    % If car have communications

           if(CarCommu)

               % Generate trajectory

               traj=gen_traj_isr_trafsim(s.round_notify_list(7,aux),s.round_notify_list(8,aux));

               

               % View road after roundabout

               rafter=check_road_after_roundabout_isr_trafsim(traj);

               

               % Try generate a velocity profile

               vel_prof=reserve_space_isr_trafsim(round2(s.time,0.001),s.round_notify_list(5,aux),s.round_notify_list(6,aux),s.round_notify_list(9,aux),s.round_notify_list(10,aux),s.round_notify_list(11,aux),traj,rafter,n,'round',s.round_method);

               

               % Order to send velocity profile

               if(~isnan(vel_prof))

                   send_velocity_profile_isr_trafsim(n,aux,id,vel_prof,rafter,'round');

                   if(vel_prof(1,end)>s.round_last_time_used)  % Store last time used by round gest mode

                       s.round_last_time_used=vel_prof(1,end);

                       %last_used_round=vel_prof(1,end)

                   end

                   %viewM(s.ocmap2,s.layer,0,s.occup_res2)

                   break

               end

               

           else

               exist_exit_full=0;

               if(s.round_notify_list(12,aux)==13 || s.round_notify_list(12,aux)==14)

                   for i=3:size(s.rg_count_tab,2)

                       if(s.rg_count_tab(2,i)>s.rg_car_limit)

                           exist_exit_full=1;

                       end

                   end

               else

                   for i=1:size(s.rg_count_tab,2)

                       if(s.rg_count_tab(2,i)>s.rg_car_limit)

                           exist_exit_full=1;

                       end

                   end

               end

               previous_withouV2I_exit=s.time_round_without_commu==-1;

               % To dont send cars when one of exits is already full

               if(~exist_exit_full && previous_withouV2I_exit)

                   

                   

                   % Reserve space

                   [M,L]=reserve_all_paths_isr_trafsim(s.round_notify_list(12,aux),n,'wait','round');

                   

                   % Add generated matrix in correct space

                   if(s.time>s.round_last_time_used)

                       last=s.time;

                   else

                       last=s.round_last_time_used;

                   end

                   

                   for i=1:size(M,3)

                       current_layer=round2(last+L(i),0.01);  % Layer to write

                       

                       % Add layer if is necessary

                       exist_current_layer=find(s.layer==current_layer);

                       if(isempty(exist_current_layer))

                           create_layer(round2(current_layer,0.01));

                       end

                       

                       % Write layer in correct position and verify if everything is ok

                       layer_pos=find(s.layer==current_layer);

                       if(nnz(s.ocmap2(:,:,layer_pos)&M(:,:,i))>0)

                           keyboard

                       end

                       s.ocmap2(:,:,layer_pos)=s.ocmap2(:,:,layer_pos)+M(:,:,i);

                   end

                   

                   s.list_round_without_commu(end+1,:)=[id last+L(1) last+L(end) s.round_notify_list(12,aux)];

                   s.round_last_time_used=last+L(end);

                   %round=s.list_round_without_commu

                   

                   % Agend time to empty list already reserved

                   s.time_round_without_commu=s.list_round_without_commu(3);

                   s.car_round_without_commu=s.list_round_without_commu(1);

                   %s.list_round_already_reserve(end+1,:)=NaN;

                   for i=1:size(s.rg_count_tab,2)

                       for p=3:10

                           if(s.rg_count_tab(p,i)==0)

                               s.rg_count_tab(p,i)=NaN;

                               break

                           end

                       end

                   end

                   s.rg_count_tab(2,:)=s.rg_count_tab(2,:)+1;

                   

                   % To view the map (help on debug)

                   %                         viewM(s.ocmap2,s.layer,0,s.occup_res2,n,'round')

                   

                   % Delete notification

                   s.round_notify_list(:,aux)=[];

                   

                   % Driver ignores traffic rules

                   c.car(n).dri_ignore_trf_round=1;

                   %disp(['Ignore Round: ' num2str(id)]);

                   break

               end

           end

       end

       aux=aux+1;

   end

elseif(Exist_Car_withot_V2I)

   

   if(s.time>s.list_round_without_commu(2)) % s.time>s.list_round_without_commu(2) to

       % Give permission to car to advance

       n=find(c.listactive==s.list_round_without_commu(1));

       c.car(n).nostop(end+1)=(s.list_round_without_commu(4));

       

       

       % Add car to list already reserved

       if(isempty(find(s.list_round_already_reserve==s.list_round_without_commu(1))))

           [ll cc]=find(s.list_round_already_reserve(1,:)==s.list_round_without_commu(4));

           s.list_round_already_reserve(end+1,cc)=s.list_round_without_commu(1);

       end

       

       % Delete car from list

       [ll cc]=find(s.list_round_without_commu==s.list_round_without_commu(1));

       s.list_round_without_commu(ll,:)=[];

   end

end

end

⛄ 运行结果

⛄ 参考文献

1) L.C.Bento, R.Parafita, S.Santos and U.Nunes, An Intelligent Traffic Management at Intersections legacy mode for vehicles not equipped with V2V and V2I Communications, 16th IEEE Int.Conf. Intelligent Transportation Systems, Netherlands, 2013.

2) L.C.Bento, R.Parafita and U.Nunes, Inter-vehicle sensor fusion for accurate vehicle% localization supported by V2V and V2I communications, 15th IEEE Int.Conf. Intelligent Transportation Systems, USA, 2012.

3) L.C.Bento, R.Parafita and U.Nunes, Intelligent traffic management at intersections supported by V2V and V2I communications, 15th IEEE Int.Conf. Intelligent Transportation Systems, USA, 2012.

⛳️ 代码获取关注我

❤️部分理论引用网络文献,若有侵权联系博主删除
❤️ 关注我领取海量matlab电子书和数学建模资料


相关文章
|
4天前
|
传感器 人工智能 自动驾驶
未来出行新纪元:智能交通系统的崛起与影响
【10月更文挑战第13天】 本文深入探讨了智能交通系统(ITS)的发展背景、关键技术及其对社会、经济和环境的深远影响。通过对现有技术的评估和未来趋势的展望,揭示了ITS在提升交通效率、减少碳排放、增强安全性和推动经济发展方面的巨大潜力。同时,也讨论了在技术实施过程中面临的挑战和潜在的解决方案。
|
8天前
|
传感器 人工智能 监控
未来出行的革新:智能交通系统的崛起
【10月更文挑战第9天】 智能交通系统(ITS)正在改变我们未来的出行方式。本文深入探讨了ITS的技术原理、关键组成部分以及其在不同领域的实际应用,并讨论了面临的挑战及未来发展的前景。通过阐述这些内容,本文揭示了智能交通系统在提升交通效率、安全性和可持续性方面的巨大潜力。
|
1月前
|
传感器 人工智能 自动驾驶
智能交通系统:自动驾驶技术的社会影响
【9月更文挑战第27天】随着科技发展,智能交通系统与自动驾驶技术正革新交通领域,从提高交通效率与安全性到优化资源分配,其影响深远。自动驾驶技术基于AI与传感器,历经五个等级演进,促进交通流畅的同时减少人为驾驶错误。然而,技术进步亦引发就业市场变化、数据隐私及道德责任等问题,城市规划需适应新技术,加建充电站等设施。尽管存在挑战,智能交通系统仍有望重塑城市面貌,提升出行体验,实现更高效、环保的城市交通体系。
|
1月前
|
传感器 人工智能 自动驾驶
智慧城市中的智能交通系统:缓解拥堵与提升出行效率
【9月更文挑战第16天】随着城市化进程加快,交通拥堵和污染等问题日益严重,成为制约城市发展的瓶颈。为此,智慧城市应运而生,其中智能交通系统(Intelligent Traffic System, ITS)作为核心部分,正逐渐成为缓解交通拥堵、提升出行效率的关键力量。本文将探讨智能交通系统如何通过信号优化、智能导航及公交调度等策略,结合实时路况监测与自动驾驶技术,为城市交通带来革命性变革。未来,随着技术进步和政策支持,智能交通系统将进一步智能化并与智慧城市其他系统深度融合,共同推动城市的可持续发展。
187 17
|
2月前
|
安全
【2023高教社杯】D题 圈养湖羊的空间利用率 问题分析、数学模型及MATLAB代码
本文介绍了2023年高教社杯数学建模竞赛D题的圈养湖羊空间利用率问题,包括问题分析、数学模型建立和MATLAB代码实现,旨在优化养殖场的生产计划和空间利用效率。
153 6
【2023高教社杯】D题 圈养湖羊的空间利用率 问题分析、数学模型及MATLAB代码
|
2月前
|
数据采集 存储 移动开发
【2023五一杯数学建模】 B题 快递需求分析问题 建模方案及MATLAB实现代码
本文介绍了2023年五一杯数学建模竞赛B题的解题方法,详细阐述了如何通过数学建模和MATLAB编程来分析快递需求、预测运输数量、优化运输成本,并估计固定和非固定需求,提供了完整的建模方案和代码实现。
79 0
【2023五一杯数学建模】 B题 快递需求分析问题 建模方案及MATLAB实现代码
|
2月前
|
存储 算法 搜索推荐
【2022年华为杯数学建模】B题 方形件组批优化问题 方案及MATLAB代码实现
本文提供了2022年华为杯数学建模竞赛B题的详细方案和MATLAB代码实现,包括方形件组批优化问题和排样优化问题,以及相关数学模型的建立和求解方法。
113 3
【2022年华为杯数学建模】B题 方形件组批优化问题 方案及MATLAB代码实现
|
5月前
|
数据安全/隐私保护
耐震时程曲线,matlab代码,自定义反应谱与地震波,优化源代码,地震波耐震时程曲线
地震波格式转换、时程转换、峰值调整、规范反应谱、计算反应谱、计算持时、生成人工波、时频域转换、数据滤波、基线校正、Arias截波、傅里叶变换、耐震时程曲线、脉冲波合成与提取、三联反应谱、地震动参数、延性反应谱、地震波缩尺、功率谱密度
基于混合整数规划的微网储能电池容量规划(matlab代码)
基于混合整数规划的微网储能电池容量规划(matlab代码)
|
5月前
|
算法 调度
含多微网租赁共享储能的配电网博弈优化调度(含matlab代码)
含多微网租赁共享储能的配电网博弈优化调度(含matlab代码)

热门文章

最新文章