Complex Template
2015-11-13 15:53:27 0 举报
matlab
作者其他创作
大纲/内容
Calculate the minimum distance
Difficult degree of changing the lane
Release the throttle
The maximum acceleration
Possibility is smaller
Find out the cars that passed
Else
Calculate the maximum speed according to the crazy degree
Input the information of the cars
The cars entering every second
Increase his angry degree
Calculate the time of the car to pass
Multiple the possibility of each situation and compare it with a random number
Change lane due to construction
Create one car on each lane
Plot the cars on the road
Possibility is larger
Change the lane
Create the imformation of the car (Except the maximum speed)
End
dif=h(
The deceleration of the rapid brake
The distance in the beginning
Find the location and the crazy degree of the previous and later car car on another lane
Reduce his angry degree
Calculate the real distance between two cars
Too close
Generate the final information of the cars
Follow the steps every 0.5 seconds for 1000 times
If a driver is exceeded
Begin to create the cars randomly
Push the cars forward
The length between the warning and the counstruction
Input the information of the road
Slam the brakes on
Fine turn the distance
Delete the cars that passed
The deceleration when releasing the throttle
Generate the lane of the previous car
Add the information of the car into the matrix
Road rage
Start
Don't change the lane
If Lg0
Only one car is created
The maximum speed
Change lane due to traffic jam
P=dif*(p1+p2)
If a driver exceeded others
Calculate the average time it takes for every car to pass
Far
Two cars are created (More than two cars wil be regarded as two cars)
If Lg=Dmin
Create the car on one of the lanes
The length of the counstruction
Calculate the average angry degree
Calculate the acceleration using those formulas
If 0.5*Dmin=Lg0
Acclerate
Keep moving
收藏
0 条评论
下一页