Skip to content

Traffic light system on the road. Cars stop at a red traffic light and wait, but they pass through a green light

Notifications You must be signed in to change notification settings

APSN4/traffic-light-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

traffic-light-system

Traffic light system on the road. This project contains python code. We have a 60-unit road and a 100-unit conditional path, each car must overcome this path. There are 3 cars in the project that travel at different speeds. Cars stop at a red traffic light and wait, and pass through a green light. The class of the car contains [P] - the lane number of the road, [V] - the speed of the car, [X] - the coordinate of the car. The traffic light class consists of [length] - the length of the road, [width] - the number of lanes of the road, [tr_light_condition] - the state of the traffic light [0:green, 1:yellow, 2: red], [pos_tr_light] - the coordinate of the traffic light, [switcher] - stopwatch [0-5] seconds, [sequence_up] - the order of traffic light signals [...green-yellow-red-yellow-green...]. The code is made in the OOP style.

Перевод [Russian]

Система светофора на дороге. В этом проекте содержится python код. У нас есть дорога размером 60 единиц и путь условных 100 единиц, каждая машинка должна преодолеть этот путь. В проекте 3 машинки, которые едут с разной скоростью. Машинки останавливаются на красный сигнал светофора и ждут, а на зеленый свет проезжают. Класс машинки содержит [P] - номер полосы дороги, [V] - скорость машины, [X] - координата машины. Класс светофора состоит из [length] - длина дороги, [width] - количество полос дороги, [tr_light_condition] - состояние светофора [0:зеленый, 1:желтый, 2:красный], [pos_tr_light] - координата светофора, [switcher] - секундомер [0-5] секунд, [sequence_up] - порядок сигналов светофора [...зеленый-желтый-красный-желтый-зеленый...]. Код выполнен в стиле ООП.

Реализация на UNITY

  • [EN] What does this code look like in 3d space:
  • [RU] Как выглядит этот код в 3d пространстве:

ezgif-3-f1eea79335

About

Traffic light system on the road. Cars stop at a red traffic light and wait, but they pass through a green light

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages