CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - 4-way traffic light control system
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - 4-way traffic light control system - List
[
JSP/Java
]
traffic1
DL : 0
模拟实现十字路口的交通灯管理系统逻辑,具体需求如下: 1、异步随机生成按照各个路线行驶的车辆。 例如: 由南向而来去往北向的车辆---- 直行车辆 由西向而来去往南向的车辆---- 右转车辆 由东向而来去往南向的车辆---- 左转车辆 。。。 2、 信号灯忽略黄灯,只考虑红灯和绿灯。 ·3、应考虑左转车辆控制信号灯,右转车辆不受信号灯控制。 ·4、具体信号灯控制逻辑与现实生活中普通交通灯控制逻辑相同,不考虑特殊情况下的控制逻辑。 注:南北向车辆与东西向车辆交替放行,同方向等待车辆应先放行直行车辆而后放行左转车辆。 ·5、每辆车通过路口时间为1秒(提示:可通过线程Sleep的方式模拟)。 ·6、随机生成车辆时间间隔以及红绿灯交换时间间隔自定,可以设置。 ·7、不要求实现GUI,只考虑系统逻辑实现,可通过Log方式展现程序运行结果。-Simulation realize intersection traffic management system logic, specific requirements as follows: 1, asynchronous randomly generated according to each route traffic. For example: From south to north and the vehicle- straight vehicles And by the west to the southbound vehicles- turn right vehicles From the east to and to the southbound vehicles-- to turn vehicles ... 2, semaphore yellow lights, considering only ignoring red lights and green. · 3, should consider left vehicle control lights, turn right vehicle not controlled by the traffic. · 4, specific light control logic and real life ordinary traffic control logic is same, not consider special situations of control logic. Note: north-south and east-west vehicles, vehicle alternate release in waiting vehicles should first clears go straight vehicles and then release left vehicles. · 5, every car through the intersection time for 1 second (hint: can Sleep through threads of simulated) way. · 6, randomly ge
Date
: 2025-12-24
Size
: 96kb
User
:
jirihua
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.