Skip to content

cdvel/cop97

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

COP97: Traffic Signal Control Optimization

An implementation of the Controlled Optimization of Phases (COP) algorithm based on Sen & Head's work on traffic signal optimization. This implementation uses Dynamic Programming (DP) to optimize traffic signal timing plans.

Overview

This project implements a traffic signal control algorithm that optimizes signal timing based on various performance criteria:

  • Queue length minimization
  • Stop minimization
  • Delay minimization

The algorithm uses dynamic programming to find optimal green times for each phase while considering:

  • Vehicle arrivals
  • Queue formation and discharge
  • Phase sequencing
  • Red clearance intervals
  • Minimum and maximum green times

Project Structure

cop97/
├── src/          # Source code
├── data/         # Input data files
├── scripts/      # Shell scripts
├── docs/         # Documentation
└── tests/        # Test files

Implementation Details

Main Components

  • src/main.cpp: The primary implementation file
  • Multiple version iterations (v0 through v5) in src/
  • Shell scripts for execution and testing in scripts/
  • Test data files in data/

Performance Indices

The implementation can optimize for different objectives:

  1. QUEUES: Minimizes maximum queue length across all approaches
  2. STOPS: Minimizes total number of vehicle stops
  3. DELAY: Minimizes total vehicle delay

Key Features

  • Dynamic Programming approach for phase optimization
  • Flexible performance criteria selection
  • Consideration of queue discharge rates
  • Integration of vehicle arrival data
  • Support for multiple phases
  • Red clearance time handling

Building

Prerequisites

  • C++ compiler
  • CMake 3.10 or higher
  • Shell environment for running test scripts

Build Instructions

mkdir build
cd build
cmake ..
make

Running

Using CMake build:

./build/cop97

Using scripts:

./scripts/run.sh         # Basic execution
./scripts/parallel.sh    # Parallel execution

Input Data

The program expects traffic data files in the data/ directory:

  • data0.txt
  • data1.txt
  • data2.txt
  • dataZ.txt

Algorithm Overview

The COP algorithm works through the following steps:

  1. Initialize state variables and value function matrix
  2. For each stage (phase):
    • Calculate feasible green times
    • Evaluate performance measures for each decision
    • Update value function
    • Store optimal decisions
  3. Continue until convergence or maximum stages reached

Key optimization features:

  • Queue length minimization
  • Stop minimization
  • Delay minimization
  • Dynamic Programming approach
  • Multiple optimization criteria
  • Queue discharge consideration
  • Vehicle arrival integration
  • Multi-phase support
  • Red clearance handling

References

Based on the seminal work: Sen, S., & Head, K. L. (1997). Controlled Optimization of Phases at an Intersection. Transportation Science, 31(1), 5-17.

Contributors

Original authors retain their copyright. This implementation is for academic and research purposes.

Status

This is a research implementation and should be considered experimental. Testing and validation are ongoing.

About

C++ implementation of Sen & Head's COP (97) dynamic programming algorithm

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages