资源简介
主要是智能驾驶交通灯的识别程序,主要是针对初学者!!!!
代码片段和文件信息
#include “city.h“
#include “vehicle.h“
#include “measures.h“
//Pointers for read
SCell **pr_horizontal_streets;
SCell **pr_vertical_streets;
SCell **pr_intersections;
//Pointers for write
SCell **pw_horizontal_streets;
SCell **pw_vertical_streets;
SCell **pw_intersections;
SCell **horizontal_streets_A;//Two-dimensional array representing the streets in horizontal direction
SCell **vertical_streets_A;//Two-dimensional array representing the streets in vertical direction
SCell **intersections_A;//Two dimensional array that represents the intersections between horizontal and vertical streets
SCell **horizontal_streets_Z;//Two-dimensional array representing the streets in horizontal direction
SCell **vertical_streets_Z;//Two-dimensional array representing the streets in vertical direction
SCell **intersections_Z;//Two dimensional array that represents the intersections between horizontal and vertical streets
SVehicle *pr_vehicles;
SVehicle *pw_vehicles;
SVehicle *vehicles_A;
SVehicle *vehicles_Z;
bool switch_matriz;
bool switch_vehicles;
int intersection_control;
int n_hor_streets; //An integer that represents the amount of horizontal streets
int m_ver_streets; //An integer that represents the amount of vertical streets
int d_hor_street; //horizontal distance of the streets
int d_ver_street; //vertical distance of the streets
int d_side_block; //distance of the smallest area that is surrounded by streets
int n_blocks; //An integer that represents the amount of blocks
float density;
float density_h;
float density_v;
int size_vehicles;
int total_cell;
int n_cell_h;
int n_cell_v;
int n_exp;
int n_ticks;
float size_step;
int *h_regionIntersection[2];
int *v_regionIntersection[2];
bool combination_rules[6];
//int metodo;
int inicio;
int InializedCity(int inter_control int n_h_streets int m_v_streets int d_s_block float dens_h float dens_v)
{
//PARAMETROS //////////////////////
switch_matriz = true;
if (inter_control < 1) {
qDebug() << “ERROR: inter_control“ << __PRETTY_FUNCTION__;
inter_control = 1;
}
intersection_control = inter_control;
total_cell = 0;
_velocity = 0;
flux = 0;
velocity_total = 0;
flux_total = 0;
//n_ticks = 5400;
n_hor_streets = n_h_streets; //An integer that represents the amount of horizontal streets
m_ver_streets = m_v_streets; //An integer that represents the amount of vertical streets
d_side_block = d_s_block; //distance of the smallest area that is surrounded by streets
CityBuilding(n_hor_streets m_ver_streets d_side_block);
int result = DistribuiteVehicles(dens_h dens_v);
return result;
}
//The city is set to agree to the number of horizontal and vertical streets and the distance of the blocks
int CityBuilding(int n_hor int m_ver int d_blk)
{
//Sets values valid in the numbers of horizontal and vertical streets and the distance of the blocks.
if (n_hor < 1)
n_hor_streets = 1;
else
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-01-09 04:59 Traffic-Light-master\
目录 0 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\
文件 737 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\VehicularTrafficCellularAutomatas.pro
文件 23538 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\VehicularTrafficCellularAutomatas.pro.user
文件 34868 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\city.cpp
文件 3946 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\city.h
文件 752 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\config.xm
文件 506 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\config.xm
文件 14130 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\datos.txt
文件 91 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\imagenes.qrc
文件 60057 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\logoUNAM.jpg
文件 481 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\main.cpp
文件 24481 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\mainwindow.cpp
文件 1097 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\mainwindow.h
文件 2888 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\mainwindow.ui
文件 5844 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\measures.cpp
文件 1001 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\measures.h
文件 83027 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\sensor.cpp
文件 6272 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\sensor.h
文件 18392 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\simulation.cpp
文件 961 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\simulation.h
文件 25381 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\slot_system.cpp
文件 1751 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\slot_system.h
文件 26638 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\traffic_light.cpp
文件 4777 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\traffic_light.h
文件 922 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\utilities.cpp
文件 582 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\utilities.h
文件 20167 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\vehicle.cpp
文件 1445 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\vehicle.h
文件 8383 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\vehicular_model.cpp
文件 845 2018-01-09 04:59 Traffic-Light-master\VehicularTrafficCellularAutomatas\vehicular_model.h
............此处省略0个文件信息
- 上一篇:四川大学软件学院-计算机网络作业
- 下一篇:DSP28335 AD7606 研旭
评论
共有 条评论