基于时空预留方案的十字路口交通自动调节智能交通管理系统附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电子书和数学建模资料


相关文章
|
3天前
|
算法 数据安全/隐私保护
基于AutoEncode自编码器的端到端无线通信系统matlab误码率仿真
本项目基于MATLAB 2022a实现自编码器在无线通信系统中的应用,仿真结果无水印。自编码器由编码器和解码器组成,通过最小化重构误差(如MSE)进行训练,采用Adam等优化算法。核心程序包括训练、编码、解码及误码率计算,并通过端到端训练提升系统性能,适应复杂无线环境。
99 65
|
1月前
|
机器学习/深度学习 监控 算法
基于yolov4深度学习网络的排队人数统计系统matlab仿真,带GUI界面
本项目基于YOLOv4深度学习网络,利用MATLAB 2022a实现排队人数统计的算法仿真。通过先进的计算机视觉技术,系统能自动、准确地检测和统计监控画面中的人数,适用于银行、车站等场景,优化资源分配和服务管理。核心程序包含多个回调函数,用于处理用户输入及界面交互,确保系统的高效运行。仿真结果无水印,操作步骤详见配套视频。
54 18
|
2月前
|
算法 5G 数据安全/隐私保护
基于MIMO系统的PE-AltMin混合预编码算法matlab性能仿真
本文介绍了基于交替最小化(AltMin)算法的混合预编码技术在MIMO系统中的应用。通过Matlab 2022a仿真,展示了该算法在不同信噪比下的性能表现。核心程序实现了对预编码器和组合器的优化,有效降低了硬件复杂度,同时保持了接近全数字预编码的性能。仿真结果表明,该方法具有良好的鲁棒性和收敛性。
56 8
|
3月前
|
算法 数据安全/隐私保护 索引
OFDM系统PAPR算法的MATLAB仿真,对比SLM,PTS以及CAF,对比不同傅里叶变换长度
本项目展示了在MATLAB 2022a环境下,通过选择映射(SLM)与相位截断星座图(PTS)技术有效降低OFDM系统中PAPR的算法实现。包括无水印的算法运行效果预览、核心程序及详尽的中文注释,附带操作步骤视频,适合研究与教学使用。
|
2月前
|
传感器 人工智能 监控
数字孪生与交通:智能交通系统的未来
数字孪生技术通过虚拟模型实时反映真实交通系统,提升交通规划、管理和运营效率,优化交通信号控制,增强交通安全。在北京西三环和智能网联货运车路协同项目中,数字孪生技术的应用显著提高了交通管理水平,为智能交通系统的未来发展描绘了美好蓝图。
|
3月前
|
机器学习/深度学习 算法 5G
基于MIMO系统的SDR-AltMin混合预编码算法matlab性能仿真
基于MIMO系统的SDR-AltMin混合预编码算法通过结合半定松弛和交替最小化技术,优化大规模MIMO系统的预编码矩阵,提高信号质量。Matlab 2022a仿真结果显示,该算法能有效提升系统性能并降低计算复杂度。核心程序包括预编码和接收矩阵的设计,以及不同信噪比下的性能评估。
92 3
|
4月前
|
监控 算法 数据安全/隐私保护
基于三帧差算法的运动目标检测系统FPGA实现,包含testbench和MATLAB辅助验证程序
本项目展示了基于FPGA与MATLAB实现的三帧差算法运动目标检测。使用Vivado 2019.2和MATLAB 2022a开发环境,通过对比连续三帧图像的像素值变化,有效识别运动区域。项目包括完整无水印的运行效果预览、详细中文注释的代码及操作步骤视频,适合学习和研究。
|
4月前
|
算法 5G 数据安全/隐私保护
MIMO系统中差分空间调制解调matlab误码率仿真
本项目展示了一种基于Matlab 2022a的差分空间调制(Differential Space Modulation, DMS)算法。DMS是一种应用于MIMO通信系统的信号传输技术,通过空间域的不同天线传输符号序列,并利用差分编码进行解调。项目包括算法运行效果图预览、核心代码及详细中文注释、理论概述等内容。在发送端,每次仅激活一个天线发送符号;在接收端,通过差分解调估计符号和天线选择。DMS在快速衰落信道中表现出色,尤其适用于高速移动和卫星通信系统。
|
4月前
|
算法
基于最小二乘递推算法的系统参数辨识matlab仿真
该程序基于最小二乘递推(RLS)算法实现系统参数辨识,对参数a1、b1、a2、b2进行估计并计算误差及收敛曲线,对比不同信噪比下的估计误差。在MATLAB 2022a环境下运行,结果显示了四组误差曲线。RLS算法适用于实时、连续数据流中的动态参数辨识,通过递推方式快速调整参数估计,保持较低计算复杂度。
|
4月前
|
Python
基于python-django的matlab护照识别网站系统
基于python-django的matlab护照识别网站系统
30 0