Complex Template7
2015-11-13 15:53:27 0 举报
matlab
作者其他创作
大纲/内容
Analyze road rage
Difficult degree of changing the lane
Release the throttle
Too close
Maximum acceleration
Add random number of new cars According to poisson distribution
Input the information of the first car
Change lane due to construction
Cars entering every second
R=R+1
Calculate the minimum distanceaccording to
Compare P with a random number
If a driver is exceeded
Whether time is over
Car length
Far
One car is created
Two cars are created
Create one car in a random position at each lane
P is smaller
Start
Generate the imformation of the car
Deceleration of the rapid brake
The position in the beginning
Delete the cars that passed
Find the location and the crazy degree of the previous and later car car on another lane
R=R-0.5
Calculate the distance with the previous cars
for every car in the matrix
Generate the final information of the car
Input the information of the road
The length between the warning and the counstruction
Slam the brakes on
Fine turn the distance
End
If a driver exceeded others
Whether all the cars has been generated
Else
Push all the cars forward
Change lane due to traffic jam
Change the lane
Deceleration when releasing the throttle
No car is created
Calculate the time of those cars to pass
No
If Lg0
If 0.5*Dmin=Lg0
Find the cars that passed
Add the information into the matrix
If Lg=Dmin
Road rage
Don't change the lane
Maximum speed
P is larger
P=Dif*(p1+p2)
Calculate the average time spent
Yes
Create the car in a random position at one of the lanes
Plot the cars on the road
The length of the counstruction
P=Dif*p1
Accelerate
Keep moving
收藏
0 条评论
下一页