Code Monkey home page Code Monkey logo

actuatedsignalcontrol's Introduction

For English version, you can click here: README_EN.md.

感应信号控制

使用SUMO进行单个路口感应信号控制仿真

参考资料

  • <<交通管理与控制>>,徐建闽,ISBN:978-7-114-06838-6

基本流程和原理

p

探测器设在次要道路上(次要道路优先):

fc1

探测器设在主要道路上(主要道路优先):

fc2

TODO

  • 主次路半感应控制
  • 全感应控制

演示效果

演示中的卡顿是刻意所为,为了方便观察流程图,如果不希望卡顿,可以将main.py中的PAUSE变量调小甚至设置为0。

demo

快速开始

1.下载微观交通仿真软件SUMO(Simulation of Urban Mobility):SUMO

2.安装requirements.txt中所需要的包;

3.打开main.py并按照需求修改下列参数:

ori_file_path = 'data/'  # 原始xml文件,储存在data文件夹中

running_time = 3600  # 仿真时间

SIM_INTERVAL = 0.20  # 仿真步长

PAUSE = 0.25  # 流程图停滞时间

demand = {'NTOS': 0.2, 'ETON': 0.1, 'ETOS': 0.02, 'STOE': 0.1, 'STON': 0.2}  # 各方向交通需求,每秒生成车辆概率

isMajor = True  # 探测区部署在次要道路时,设置为False,否则True

# 设置探测器距离停车线距离
if isMajor:
    detector_loc = 30.0
else:
    detector_loc = 3.0  # minimum: 3m

TIME_UNIT = 2.0  # 单位绿灯延长时间

# 主次路的最短绿灯时间
MIN_GREEN_TIME_MINOR = TIME_UNIT
MIN_GREEN_TIME_MAJOR = 30.0 + TIME_UNIT

# 主次路的绿灯极限延长时间
MAX_GREEN_TIME_MINOR = 10.0
MAX_GREEN_TIME_MAJOR = 50.0
  • 随检测器位置而定的初期绿灯时间
检测器与停车线间距(m) 初期绿灯时间(s)
0~12 8
13~18 10
19~24 12
25~30 14
31~36 16

4.运行main.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.