Real Time Optimisation of Traffic Signals to Prioritise Public Transport

. This paper examines the optimisation of traffic signals to prioritise public transportation (busses) in real time. A novel representation for the traffic signal prioritisation problem is introduced. Through the novel representation a creative evolutionary process, while ensuring safe solutions that comply with real-world traffic signal constraints, is possible. The proposed system finds near-optimal solutions in 20 seconds, enabling real-time optimisation. The author examines a specific junction in Hamburg, Germany. Based on real-world traffic data a variety of different problem scenarios ranging from low to exceptional traffic saturations are generated. In collaboration with domain experts a fitness function is defined to reduce the journey time of a bus while maintaining an over-all stable traffic system. Candidate solutions are evaluated using the microscopic traffic simulator SUMO allowing for precise optimisation and addressing of the flow prediction problem. The results show good scaling of the proposed system, with more significant improvements in more congested scenarios. Given the re-sults, future research on bigger and multiple road junctions is motivated. This work contributes to the field in four ways. Firstly, by defining a real-world problem containing the actual intersection layout and traffic signal parameters. Secondly, by presenting a software design that integrates highly efficient SUMO simulation into an evolutionary algorithm. Thirdly, by introducing a novel representation that allows creative, unconventional solutions while ensuring compliance with traffic signal regulations at all times. Lastly, by testing the suggested approach on various problem scenarios of the real-world problem.


Introduction
Traffic signals represent one of the most crucial parts of urban infrastructure.Uniquely, in comparison to other mechanism, these control when people stop or move.Traffic signals are planned by traffic engineers, where planning in this context refers to programming an advanced logic that controls at what time signals switch between red and green to maximise traffic efficiency.The job of traffic engineers is becoming increasingly challenging.The boom of the automotive industry through the 1970s pushed civil planners to favour motorised traffic when (re)planning city districts [1].However, this approach heavily collides with the becoming increasingly more popular approach of favouring green spaces, pedestrian friendly areas and mass transit [1] which leads to less available road real estate for motorised traffic.Additionally, the rise of urbanisation results in bigger, denser cities all over the globe [2].In total, increasingly more people have to move through relatively less space to get from point A to B. Solving this problem is immensely important to improve life quality as well as economic value.
Traffic signals are highly regulated [3] and require safe systems, as a high amount of trust is globally established.This makes the adoption of new approaches challenging and requires the close attention towards real-world constraints.
The increasingly more important optimisation of public transportation presents an additional problem.Over time, a number of ways for prioritisation have been proposed.Approaches vary in their modification to the existing road infrastructures.Dedicated bus lanes require a substantial change in behaviour from existing traffic.Not as extreme, but similar are dedicated traffic signals.In terms of minimising the adjustment of existing infrastructure, simply prioritising the bus through modified green times presents the most efficient approach [4,5].
When planning signals, engineers need to take driving patterns, average speeds and legal restriction into account.Their work is usually based on punctuated data.Public authorities count traffic during different times of the day in order to obtain low, average and high traffic saturations.Depending on the existing infrastructure a logic based on limited data can be programmed by the traffic engineers.However, they can never account for all possible traffic scenarios.Instead, assumptions must be drawn and a program that works well for most scenarios is developed.However, a system that needs to work well in a large variety of circumstances can rarely perform optimal in a particular scenario.That is true, even if dedicated programs are designed to regulate traffic at certain times within a week.Additionally, traffic engineers need days or even weeks (depending on the problem) to plan and test signal plans.The task to prioritise public transportation makes this task even more challenging and rather impossible to account for all possibilities.
Through the use of real-time traffic data, it is possible to build intelligent traffic signal systems (with prioritisation).The data allows to optimise signal plans in real time to improve overall traffic efficiency as well as prioritising public transport.However, in order to provide significant improvements, signals need to be generated in a creative manner without any restrictions and their quality needs to be validated.Most importantly, the improved signals need to be safe as road users put trust in traffic lights.But simply being safe is not sufficient either as the improved signals need to vastly increase efficiency.This raises the question of how the real-time traffic data can be used to find optimised, yet safe signals in real time?
The field of traffic signal optimisation generally consists of Traffic Signal Control (TSC) and Traffic Signal Prioritisation (TSP).Whereas TSC aims to optimise the traffic in general, TSP aims to prioritise individual traffic members.In both fields, computational intelligence and in particular evolutionary algorithms have shown much promise in recent years.Additionally, for both fields, but especially for TSP, it is crucial to validate that the adjusted traffic signal program has the desired effect.Otherwise the optimisation might lead to a negative effect, which is commonly known as the flow prediction problem [6,7].Furthermore, most of the recent approaches only make small adjustments to the existing signal plan and often neglect real-world traffic signal constraints.
This research seeks to answer the research questions: 1. To what degree can an evolutionary algorithm work in real time to prioritise public transportation that tackles the flow prediction problem and complies with real-world traffic regulations?2. How can the impact of such a system be measured?
In the following, a novel approach is proposed to integrate the microscopic traffic simulator SUMO into an evolutionary algorithm in order to allow for real-time traffic signal prioritisation.This work contributes to the field by 1. Defining a real-world problem (intersection layout & traffic signal parameters) 2. Presenting a software design that integrates highly efficient SUMO simulation into an evolutionary algorithm 3. Introducing a novel representation that allows creative, unconventional solutions while ensuring compliance with traffic signal regulations at all times 4. Testing the suggested approach on various problem scenarios of the real-world problem The focus of this work lies on the novel concept which requires additional refinements in future work.

Literature Review
Traffic signal control adjustments modify the parameters of traffic signals.Research on TSC algorithms started in the mid 20th-century [8].Until today TSC remains a research field receiving close attention [8,9].Due to advancements in sensor-technology TSC methods can utilise real-time traffic data [8].Approaches utilising real-time traffic data (e.g.induction loops, cameras) differ from classic, passive TSC approaches and are classified as adaptive [7].
Even though adaptive TSC and TSP approaches are able to respond to current traffic scenarios, research is disunited if a passive or adaptive approach works better and is more likely to actually contribute in the real-world.In recent years Alba et al. focused on passive approaches, stating, "real time control of traffic-lights is not feasible because of various reasons (legal, technical, etc.), and we must instead find a highly-reliable global schedule of traffic-lights that works well in the dynamic and uncertain traffic system" [10].
Adaptive TSC approaches vary in their time criticality.While some systems might make fluent adjustments to account for traffic changes (e.g.unusual traffic caused by a sport event), others might need to react in a very short amount of time (e.g. to prioritise an emergency vehicle).In order to effectively prioritise an approaching bus, the signal needs to adapt to the current traffic situation immediately, resulting in little computational time.Of the research on traffic system control and prioritisation, only a small portion operates under short time constraints.As cycles are usually not longer than 90 seconds, short time constrains refers to adjustment calculated within one cycle.
Established commercial systems (e.g.SCOOT [11], SCATS [12], RHODES [13]) are able to prioritise public transportation under short time constrains, but the modifications to the signal plan are slight.Additionally, due to their commercial nature little to no detail on the computation of improved traffic signals is known.To the best of the authors knowledge, and indicated by an extensive study [14], the most widely used commercial systems do not use any kind of evolutionary algorithms.
Adaptive approaches derive traffic information from sensors.Depending on the distance between the sensors and the traffic signal, additional assumptions about the behaviour of the recognized vehicles must be made.Minimising the error between reality and projection will become significantly more difficult, the further away the sensors are placed.This problem is commonly referred to as flow prediction problem and is one of the main reasons why adaptive TSC/TSP approaches fail or might even worsen the signals efficiency [7].Even if the inconsistencies between real life traffic and the simulation could be minimised, it would remain extremely demanding to build a system capable of optimally adapting to any traffic scenario [15].
In passive approaches candidate solutions are often validated through the use of wellestablished traffic simulators [10,16,17].However, to the best of the authors knowledge, traffic simulators have not been integrated into real-time adaptive TSP approaches, presenting a gap in current research.
Recent research in adaptive TSC/TSP often focuses on rule-based approaches that limits the possible adjustments to the current signal plan.
Zhang et al. propose an approach that uses predefined signal plans, by making only limited adjustments [18].Another rule-based approach was proposed by Ma et al. [19].
The system utilises dynamic programming for solving the TSP as a multi-stage decision problem [19].Ahmed & Hawas introduced a virtual queue to account for passenger load in another rule-based TSP approach [20].Instead of a rule-based approach Stevanovic et al. introduced a genetic algorithm to optimise cycle length, green splits, offsets and phase sequences [21].However, the algorithm does not operate in real time and can therefore not adequately conform to current traffic situations.
Lastly, current research often neglects real-world traffic signal constraints.Whereas constraints like minimum and maximum green times are often taken into account, more advanced rules such as realistic intergreen times, early green signal for pedestrians and other, often country-specific, regulations are often disregarded.
Overall, evolutionary algorithms and computational intelligence approaches in general have proven to be highly suitable for TSC and TSP problems.However, the reviewed TSC and especially TSP approaches often • do not account for real-world traffic signal constraints, especially advanced rules like realistic intergreen times • do not validate candidate solution through well-established microscopic simulators in real time, which would make the systems more trustworthy and would allow visualisation of solutions easily • lack the possibility to drastically change the signal program.Instead, less disruptive methods, like green extension are used • are based on pre-defined rules which disallows unconventional solutions These findings motivate this research to explore the use of evolutionary algorithms to generate (disruptive) signal plans in real time, which are validated through the use of a microscopic simulator.

Methodology
This chapter starts with the presentation of a real-world intersection in Hamburg, Germany.Section 3.2 gives a short introduction to SUMO.The microscopic simulator is integrated into an evolutionary algorithm through a novel representation as presented in section 3.3.

Problem Instance
In collaboration with public authorities (domain experts) in Hamburg a simple, yet highly frequented intersection is selected.The junction consists of a main road towards the centre of Hamburg and a less used side street with residential buildings (see Fig. 2).
To model this intersection in a traffic simulator, the intersection layout files, provided by the city of Hamburg, is used.The layout files contain important information such as the lane width and the exact position of the traffic signals.Additionally, traffic signal parameters (e.g.intergreen times) is given.Therefore, the intersection portrays a realistic problem instance for the proposed approach.The intersection layout is also publicly available for future research.

Microscopic Traffic Simulation With SUMO
Throughout the literature, researchers frequently use SUMO (Simulation of Urban Mobility) [22,23].SUMO is a highly performant, open source, deterministic, microscopic traffic simulator written in C++ and developed by the Institute of Transportation Research (IVF) at the German Aerospace Centre (DLR) [22].Due to its performance and wide acceptance in similar research SUMO is chosen for this research.In this work, the use of a traffic simulator aims to tackle the flow prediction problem by validating the impact of a particular traffic signal plan.Traffic simulators are classified by their level of detail.Researchers mainly distinguish between macroscopic and microscopic models.Macroscopic simulators are more abstract, as not individual traffic, but rather traffic flows are simulated [24].A macroscopic simulator aims to answer questions about the general traffic flow, rather than providing information about individual vehicle movements.Significantly more accurate are microscopic simulators, which simulate the movement and behaviour of every vehicle at every time step.The model calculates the vehicles movement based on the vehicles physical abilities (e.g.acceleration rate) and the behaviour of the driver (e.g.reaction time, aggression level).SUMO is a microscopic traffic simulator which therefore enables realistic simulations.
A traffic simulation in SUMO mainly consists of three input files: a network file, a route file and an additional file.The network file represents the road layout.The route file contains the trips taken by road users over a given time span.The additional file can be used to place detectors or provide additional signal plans.[25] For this research the network and routes are static for a given scenario.The network file is created using the official intersection layout files provided by the city of Hamburg.The route file contains the traffic volumes as defined in section 3.3.The additional file is used to represent the signal plan (candidate solution) to evaluate.

Design of the Evolutionary Algorithm
This section describes the integration of SUMO in an evolutionary algorithm for realtime traffic signal prioritisation.In collaboration with domain experts two problem scenarios for traffic signal prioritisation are defined.These problem scenarios are used for the first experiment, presented in section 4.1.Additionally, in 4.2 a range of problems is generated from these problem scenarios to gain further insights.
In the first problem scenario a relatively low, realistic traffic volumes is defined.For the second problem scenario the network is deliberately congested (e.g.due to roadwork or a sport-event).The purpose of this is to examine how the proposed algorithm performs in drastically different situations.In both cases the algorithm is tasked to prioritise a single bus that entered the simulation after 20 seconds and would take about 10 seconds to reach the intersections in ideal conditions.In contrast to other similar approaches, the improved, generated signal plan runs for a couple of minutes and does not end with the bus reaching its destination, but rather when the last vehicle reaches its destination.This way, the algorithm can heavily prioritise the bus before giving priority to other connections.

Fitness Function.
In terms of the fitness function, other researchers usually try to minimize the average delay per vehicle/passenger [15,26] or minimize the overall journey times [17].In this research the journey time for the bus should be minimised as much as possible while maintaining a functional traffic system, meaning that other vehicles should still be able to reach their destination in a reasonable time.In collaboration with the domain experts the fitness function presented by Eq. 1 is defined, which the algorithm is tasked to minimised.The fitness is mainly affected by the arrival time of the bus ( ! ) but also by the overall simulation time for a certain number of vehicles, where  "# represents the time of the last vehicle to reach the destination.The weights 0.7 and 0.3 were set through informal experimentation.Exploring different values for  ! and  "# is not part of this research but should be explored in future work to examine how the weight effects the resulting traffic conditions.In a real-world use case, these parameters could be tuned by public authorities to easily change the priority of different traffic members and therefore enable parameterizable traffic regulation.

Solution Representation.
In this research a candidate solution represents a signal plan.A signal plan consists of  phases each with a distinct duration and a state.A candidate solution is defined by the number of phases as well as the durations and states for each phase.As pointed out most prior research tries to reduce journey times while minimising the changes to the signal plan.This approach, however, aims to find disruptive solutions through maximising evolutionary creativity.To maximise creativity, the number of phases and phase durations can take any integer value between an according minimum and maximum value.For the states the proposed system picks signals from a set of available states with only (semi-)compatible signals.This way it is ensured that all signals are (semi-)compatible, without limiting the creativity.Ensuring safety is crucial as unsafe solutions could potentially produce (lethal) accidents.
<phase ... /> <phase duration="15" state="gGgrrrrgGgrrrr"/> <phase ... /> The proposed, novel representation consists of two lists of integers.These lists must always have the same length as they represent the number of phases.The first list represents the durations ( [10,5]).The second list represents the (semi-)compatible states to use ([0, 1]).The values of the second list represent the index of a list of predefined phases with only (semi-)compatible states.Fig. 3 illustrates the representation in a simplified manner.Both durations and states are simultaneously optimised as they depend on another.Additionally, intergreen times need to be considered.Intergreen times represent the yellow and red times to transition to the next green phase and are dependent on the road layout and not on traffic conditions.Therefore, the algorithm only evolves the durations and states that are not part of a signal change (intergreen times).
For every state change a transition strategy is defined.The values of the transition strategy represent: • the duration of the phase before switching to a specific state (fixed value, not optimised by the algorithm) • a placeholder for the green time duration (dynamic value, optimised by the algorithm, represented by the placeholder of -1) • the duration of the yellow phase after the green phase and the duration of the red phase (fixed value, not optimised by the algorithm) The SUMO signal plan is generated, and the duration of the green phases are replaced by the chromosome duration values.This allows for precise configuration per intersection while given the algorithm maximum creativity (see Fig. 4. ).Given the proposed solution representation the search space  is defined as where  *+$ and  *,-represent the minimum and maximum number of phases,  the number of valid states and  the number of possible phase duration.No split-second durations are considered as these are not supported by traffic signals in Germany.
Given the problem instance the number of phases is set to a minimum of four and a maximum of eight.The phase durations are set to be between five and 60 seconds.In addition to the two valid states of giving east/west and north/south a green signal, four addition valid signals are defined.These give each direction exclusively a green signal to ensure maximum evolutionary creativity.These values result in a search space with 4.5499 × 10 '. possible solutions, demonstrating exploring even one percent of the search space will be too computational expensive given the goal of real-time prioritisation.Therefore, a fast converging evolutionary algorithm is needed.

Evolutionary Algorithm Parameterization.
Based on similar research and in order to quickly converge to good solutions, the following parameters and operators are used.The population size is set rather low to allow for a high number of generations within the 20 seconds time limit.The algorithm is referred to as EA-FC throughout the paper.Over the course of this research four additional evolutionary algorithms were defined that favoured exploration over exploitation.Furthermore, two particle swarm optimisers were tested.Overall, the presented EA-FC performed best in a variety of experiments, hence other algorithms are not presented here.
Evaluation Process and Software Architecture.
Ideally, the proposed system would be compared to existing bus prioritisation systems.However, this is not possible for this research.Instead the algorithm is compared to the real-world fixed-time signal plan as well as a standard adaptive signal plan in SUMO that utilises on-road detectors.Future work should address the issue of neither plans prioritising the bus.The experiments presented here do however provide a valuable starting point.
The proposed system is programmed in Java.The entire code is publicly accessible on GitLab (see 3.4).One virtual server with 6vcpus (approx.3GHz per core), 16GB of RAM and an SSD is used.This configuration drastically exceeds what is possible locally at the traffic controller but could easily be achieved on a central server.As the algorithm is limited by time and the solution space is tremendously large, the number of solutions that can be evaluated is key for the overall performance.The most computationally expensive tasks are the evaluation of a single chromosome, the evaluation of the entire population and the creation of a new child.These tasks are executed simultaneously in multiple threads.The number of threads equals the number of chromosomes to evaluate/children to create.

Reproducibility
As previously noted, the intersection layout and traffic data modelled in SUMO is publicly available on GitLab.Additionally, the source code, a runnable java application and information for reproducing the presented experiments can be found in the repository. 2

Results
Two experiments are conducted.The first experiment demonstrates the performance of proposed algorithm in the two problem scenarios.The second experiment explores the algorithms robustness.

First Experiment
As evolutionary algorithms are non-deterministic, the EA-FC is executed 100 times per problem scenario.In the first scenario a relatively low, realistic traffic volumes is used.
The results are shown in Fig. 5. .EA-FC is sometimes able to find solutions better than the fixed/adaptive signal plan.At best, the algorithms fitness is approximately one percent better and at worst, approximately three percent worse than the fixed/adaptive plan.Noticeably, the journey time of the bus could not be optimised, therefore the fitness improves due to slight reductions of about three seconds for the overall journey time ( "# ).The results show that the proposed algorithm does work but is limited to minor improvements.In the second scenario a scenario with deliberate high traffic volumes is defined.results, as presented in Fig. 6.The fixed plan has a fitness of 685.5 and the adaptive plan of 373.5.EA-FC significantly outperforms the fixed plan by up to 78% and the adaptive plan by up to 55%.The journey time of the bus could be reduced by up to 472 seconds for the fixed and up to 214 seconds for the adaptive plan.Additionally, the overall journey time could be improved by up to 677 seconds for the fixed and up to 119 seconds for the adaptive plan.The results demonstrate, that with increasing traffic volumes more significant improvements can be achieved.The improvements are especially significant as the EA only evaluates about 1,000 candidate solution within the 20 second time limit.The EA is able to perform just as good or better than the standard plans, while validating the quality of each candidate solution through the simulation in SUMO in real time.

Second Experiment
The second experiment aims to examine if the EAs are able to find good solutions regardless of the traffic scenario.Beginning with the first problem scenario and linearly increasing traffic volumes up to the second problem scenario, 100 problem scenarios are generated. 3In this experiment the evolutionary algorithm is only run once per scenario.
Additionally, to further address the flow prediction problem, each candidate solution is evaluated multiple times on slightly different scenarios.This approach was inspired by Ferrer et al. [10].Candidate solutions are evaluated once on the standard traffic scenario and then on two additional scenarios that slightly vary.This is achieved through the random flag in SUMO.
3 Due to the fact that the bus takes a different route in the two scenarios the first problem is modified, leading to different fitness values for the standard signal plans.The results, as shown in Fig. 7, indicate that the EAs perform significantly better than the standard plan with increased traffic scenario.Additionally, it is shown that the adaptive, and especially the fixed plan are highly unreliable.The EA manages to reliably find good solutions with little variance.

Conclusion
Traffic engineers face the near impossible task to develop near-optimal signal plans to ensure efficient urban mobility with steadily increasing population density.The increasing need for smarter traffic signals to prioritise public transport through the use of emerging sensors and evolutionary algorithms motivated this research.
This research seeks to answer the research questions: 1. To what degree can an evolutionary algorithm work in real time to prioritise public transportation that tackles the flow prediction problem and complies with real-world traffic regulations?2. How can the impact of such a system be measured?
The flow prediction problem is often addressed the use of a microscopic traffic simulator.However, to the best of the authors knowledge such simulators have not been implemented in real time approaches.The proposed system utilises SUMO to evaluate candidate solutions in real time in order to address the flow prediction problem.Due to the enormous size of the solution space, evolutionary algorithms are used to find near optimal solutions in only 20 seconds.This research introduces a novel representation to allow for creative solutions while complying to real-world traffic signal constraints.
The conducted experiments demonstrate that the proposed approach is able to find optimised signal plans under short time constraints.Improvements could be achieved reliably, increasingly significant in scenarios with higher traffic saturations.
First experiments of representing pedestrians in the simulation as well as further reducing the time limit to 10 seconds has shown much promise and should be further addressed.
The proposed algorithm should be tested on additional problem scenarios to further explore its usefulness.Bigger intersections should be tackled as well as more complex layouts (e.g.bike lanes, dedicated lanes for turning traffic).To compare the results, the approach should be directly compared with other research and existing real-world prioritisation systems.Additionally, a field test should be conducted to measure the performance of the proposed system in the real-world.Algorithmic (e.g.population size) and domain specific (e.g.fitness weights) factors remained mostly fixed throughout this research and should also be further addressed in future work.Furthermore, the results should be discussed with traffic engineer, as these could include flaws that are spotted by the domain experts or could be inspirational for the traffic engineer.
Comparing the results in terms of reduced journey time of this research to similar researchers presents a challenging task.Firstly, this problem encompasses many variables that will differ in existing research -even if the research appears similar in nature (e.g.computational time, junction layout, traffic simulator).Secondly, the fitness function varies (e.g.minimising delay, minimising journey time).Thirdly, even if results could be compared, the results only present simulated values.A key strength of the conducted research is that real-world constraints were accounted for and the flow prediction problem was minimised through the use of real-time traffic data, a well-established microscopic traffic simulator and multiple evaluates per candidate solution.Simply, comparing the achieved improvement in journey time does not give an indication about how the system would perform in the real-world.Nevertheless, future work should make direct comparisons between the proposed system and similar research.On a meta level, to the best of the authors knowledge, the conducted research proposes a truly novel approach.Some researchers have shown the vast potential of evolutionary algorithms for TSC and TSP in combination with a microscopic simulator.Other researchers demonstrated that it is also possible to make real-time adjustments under short time-constraints.However, to the best of the authors knowledge, the use of evolutionary algorithms to optimise signal plans in real time through validation by a microscopic has not been conducted yet.Therefore, this research addressed an important gap and proved that realistic factors do not have be neglected in order to improve signal plans in real time.
Through the proposed approach in this article, traffic engineers could gain a powerful tool to ensure the efficiency of urban mobility.On a broader level, this presents a shift in paradigm, as traffic engineers focus on optimising a system that produces optimised signal plan, instead of spending days programming complex logic for a single intersection.The traffic engineer does not rely on historic traffic data as the proposed system adapts in real time.In addition to stationary hardware (e.g.infrared sensors), vehicle communication is on the horizon.With increasingly more real-time traffic data becoming available, systems that incorporate real-time traffic data become more appealing.In conclusion, this novel approach presents a realistic solution to tackle the task of developing near-optimal signal plans to ensure efficient urban mobility in times of steadily increasing population density.

Fig. 2 .
Fig. 2. Signal Plan Representation in SUMO Where the State of a Phase is Mapped to Specific Lanes of the Given Intersection

Fig. 3 .
Fig. 3. Solution Representation (Simplified) Where the States Refer to a of Predefined Phases with Only (Semi-)Compatible States

Fig. 4 .
Fig. 4. Genotype to Phenotype Conversion Where Intergreen Times are Inserted for Every Transition

Fig. 5 .
Fig. 5. First Scenario with Relatively Low Traffic Volumes

Table 1 .
Parameters for EA-FC