Hierarchical Agent-Based Modeling for Improved Tra ﬃ c Routing

: Agent-based model (ABM) simulation is a bottom–up approach that can describe the phenomena generated from actions and interactions within a multiagent system. An ABM is an improvement over model simulations which only describe the global behavior of a system. Therefore, it is an appropriate technology to analyze emergent phenomena in social sciences and complex adaptive systems such as vehicular tra ﬃ c and pedestrian crowds. In this paper, a hybrid agent-based modeling framework designed to automate decision-making processes during tra ﬃ c congestion is proposed. The model provides drivers with real-time alternative routes, computed via a decentralized multi-agent model, that tries to achieve a system-optimal tra ﬃ c distribution within an entire system, thus reducing the total travel time of all the drivers. The presented work explores a decentralized ABM technique on an autonomous microgrid that is represented through cellular automata (CA). The proposed model was applied to high-density tra ﬃ c congestion events such as car accidents or lane closures, and its e ﬀ ectiveness was analyzed. The experimental results conﬁrm the e ﬃ ciency of the proposed model in not only accurately simulating the driver behaviors and improving vehicular tra ﬃ c ﬂows during congestion but also by suggesting changes to tra ﬃ c dynamics during the simulations, such as avoiding obstacles and high-density areas and then selecting the best alternative routes. The simulation results validate the ability of the proposed model and the included decision-making sub-models to both predict and improve the behaviors and intended actions of the agents.


Introduction
A significant amount of research has addressed ways of incorporating technology to help avoid vehicle collisions and reduce road accidents [1][2][3][4][5].Traffic congestion takes place when the road system capacity is insufficient to handle the traffic flow and/or when drivers collectively fail to communicate with each other in real time.Current solutions brought in to improve traffic conditions often make life easier for a small percentage of the population while making life more difficult for others [2][3][4], such as when considerable amounts of vehicular emissions contribute to air pollution in urban networks [4].The high frequency of starting and stopping at traffic signals and intersections contributes to a higher volume of fuel consumption during rush hours as well as uncongested times when the flow of vehicles is interrupted by cyclists and pedestrians.Therefore, waiting time is created in all traffic scenarios, and this plays a crucial role in any flow analysis.
Road authorities in urban areas interested in reducing emissions need to understand the overall total time that people are spending on the road and the optimum speed at which the traffic should flow [3][4][5].A reduction in emissions occurs when the number of accelerations and decelerations decreases, and the emissions that take place in urban areas are heavily impacted by these two factors (accelerations and decelerations).Obviously, they both need to be minimized [3,4,6].
Traffic flow creates a dynamically complex system since it involves a nonlinear interaction between many independent vehicles with largely autonomous behavior.These interactions can lead to situations that produce different kinds of traffic problems.For example, traffic jams can occur when a group of vehicles are stuck behind one that is driving particularly slowly.A number of models have been developed and applied to simulate the process of vehicular dynamics causing traffic jams caused by slow-moving vehicles.The results of these studies have helped researchers develop new ways to integrate and incorporate the increasing presence of vehicles [7][8][9][10].
One particularly effective computational simulation method is an agent-based model (ABM) [11][12][13][14][15][16][17], which considers the complex system as a decentralized, multi-agent system (MAS) [11], where each agent can communicate only with its immediate neighboring agents.The ABM approach is a form of optimization of individual solutions, and it applies to systems of interacting, autonomous, and individual agents.The ABM is used to model and simulate complex systems ranging across various contexts, including biological and social systems.While agents in the decentralized system have no direct information about the global condition of the network, they do have local information about their immediate neighbors and environment [11,14].This way, they can use this knowledge to collectively construct a cooperating system.In an ABM, agents are described as unique and autonomous entities that embody the origin of the system [15,16].Instead of describing the state of whole systems, an ABM represents the system's individual components and their behaviors.Their generalized nature is able to capture complex dynamics and structures [14][15][16][17].It can be observed in the literature that both ABMs and complex networks have their roots in the theory of complex systems.The ABM approach has been successfully applied to a wide range of scenarios including military training, building evacuation, and the analysis of digital games [15,17].The implementation of agent-based frameworks for the analysis of other complex social systems, in addition to traffic dynamics, has now become more common [10,13,16].Spatial-temporal processes, such as traffic dynamics and congestions, typically require complex models.The approaches used to construct these models are those of the ABM and cellular automata (CA) [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31][32][33][34][35], which have the ability to explain the step-by-step status changes that take place within spatial cells.Both methods are capable of reflecting the emergent and complex characteristics associated with complex phenomena [21] and have significant impacts on the determination of optimum traffic flows.With this kind of a framework, it is also possible to model and simulate the complex interactions that take place between homogeneous agents, such as vehicles in road traffic [17,35].
Several mathematical models are available to simulate traffic jams and provide a clear understanding about their occurrence and consequences [23].The ones based upon the principles of CA have received a lot of attention [8,9,23,36].One of the practical applications of cellular automata is in the simulation of street traffic control.The CA model is an effective approach to explain the principles of traffic jams while building the theory from fundamentals.Cellular automata simulations of complex network dynamics provide excellent assistance and add a higher level of efficiency into the design of transportation facilities.The CA model is sufficiently advanced and complex that it has been widely used as a mathematical tool to study systems wherein there are a high numbers of agents that are constantly changing their states [23,36].An example of such a scenario is traffic on highways or places where there are too many vehicles present, which limits their movement [9].In addition, the CA modeling approach has proven useful when the rate of change in a system begins slowly and then increases over time [8], e.g., when drivers apply their brakes and cause a chain-reaction slowdown of the traffic behind them.
A large number of studies have been conducted in order to get a clear understanding of the dynamic routing-problem, which is referred to as online or real-time vehicle routing problem (VRP) [37].The problem has been analyzed from many different angles to determine if a solution can be derived.
One of the most significant decisions in the dynamic routing solution is to understand how certain decisions will be made, as well as the impact of those decisions [19,37].The primary objective of understanding the decision impact is to provide context-sensitive data and information to the drivers (e.g., via mobile phones and global positioning systems).The drivers can then prevent delays that they would otherwise experience due to a traffic congestion.
During an accident, most of the drivers on the road tend to look for alternative routes.At the time the driver seeks to select an alternative route, having a clear understanding of the existing traffic conditions on the road is extremely useful [2,5,9,23].Most drivers seek the shortest route, and the available GPS navigation applications and systems provide excellent assistance.However, during times of heavy congestion when drivers are using the same GPS navigation systems, their usefulness is mitigated because everyone is trying to follow the same detour, which results in the transference of the traffic congestion [3,6,8].To prevent this, drivers need to be alerted about alternative routes by the exchange of data among other drivers involved.As such, the decision on where the vehicle should reroute needs to be made with data gathered through sensors from the existing network.
Assisting drivers in finding the shortest possible alternative routes after an accident is just one of many objectives of traffic information systems.After the required information is made available, the drivers have an easier task deciding the most efficient route to take because they collaboratively look for alternative routes.When collaborating with each other through the same system, the group is not directed to just one specific route as an ordinary GPS system does.This routing approach/method, called dynamic or distributed routing [6,7,14,37], has been explored through a number of papers [6][7][8][9]14,23,36,37].It is an agent-based approach for modeling complex transportation networks in a manner that permits vehicles to communicate with other vehicles to gain a better assessment of the current state of nearby road networks.This communication provides drivers with real-time road data and an enhanced awareness of the road network to help them seek efficient alternative routes, thus reducing congestion [14].
In this research, the multi-level multi-stage agent-based model (MLMS-ABM) is presented, where traffic dynamics are divided into three main levels of decision making: Strategic, tactical, and operational.The pre-trip planning of the route and the destination is designed at the strategic level.At this level, no information is provided about the state of the system.At the tactical level, decisions for the short term, such as avoiding obstacles or changing routes depending on the real-time situation, are addressed.The operational level represents the agents' movement that includes interaction with other vehicles.The system overview is illustrated in Figure 1.The MLMS-ABM allows drivers to follow specific routes computed via a decentralized MAS.The model contributes toward the improved flow of traffic; thus, the drivers are able to reduce the total time that is spent on the road.The presented work investigates an MAS control-strategy on an autonomous microgrid that is represented through cellular automata.
Appl.Sci.2019, 9, x FOR PEER REVIEW 3 of 25 drivers (e.g., via mobile phones and global positioning systems).The drivers can then prevent delays that they would otherwise experience due to a traffic congestion.
During an accident, most of the drivers on the road tend to look for alternative routes.At the time the driver seeks to select an alternative route, having a clear understanding of the existing traffic conditions on the road is extremely useful [2,5,9,23].Most drivers seek the shortest route, and the available GPS navigation applications and systems provide excellent assistance.However, during times of heavy congestion when drivers are using the same GPS navigation systems, their usefulness is mitigated because everyone is trying to follow the same detour, which results in the transference of the traffic congestion [3,6,8].To prevent this, drivers need to be alerted about alternative routes by the exchange of data among other drivers involved.As such, the decision on where the vehicle should reroute needs to be made with data gathered through sensors from the existing network.
Assisting drivers in finding the shortest possible alternative routes after an accident is just one of many objectives of traffic information systems.After the required information is made available, the drivers have an easier task deciding the most efficient route to take because they collaboratively look for alternative routes.When collaborating with each other through the same system, the group is not directed to just one specific route as an ordinary GPS system does.This routing approach/method, called dynamic or distributed routing [6,7,14,37], has been explored through a number of papers [6][7][8][9]14,23,36,37].It is an agent-based approach for modeling complex transportation networks in a manner that permits vehicles to communicate with other vehicles to gain a better assessment of the current state of nearby road networks.This communication provides drivers with real-time road data and an enhanced awareness of the road network to help them seek efficient alternative routes, thus reducing congestion [14].
In this research, the multi-level multi-stage agent-based model (MLMS-ABM) is presented, where traffic dynamics are divided into three main levels of decision making: Strategic, tactical, and operational.The pre-trip planning of the route and the destination is designed at the strategic level.At this level, no information is provided about the state of the system.At the tactical level, decisions for the short term, such as avoiding obstacles or changing routes depending on the real-time situation, are addressed.The operational level represents the agents' movement that includes interaction with other vehicles.The system overview is illustrated in Figure 1.The MLMS-ABM allows drivers to follow specific routes computed via a decentralized MAS.The model contributes toward the improved flow of traffic; thus, the drivers are able to reduce the total time that is spent on the road.The presented work investigates an MAS control-strategy on an autonomous microgrid that is represented through cellular automata.The vehicles are modeled as agents that have the capability to communicate and exchange decisions with neighboring vehicles, thus enhancing the global pursuit of finding an optimal vehicle route that satisfies each driver's preferences.In the MLMS-ABM, vehicles have the ability to report information to their neighbors via telematic technology, which influences the arbitration between behaviors.The information between vehicles is exchanged through communications technology, such as vehicle-to-vehicle communication (point to point radio), onboard sensors, or mobile phone The vehicles are modeled as agents that have the capability to communicate and exchange decisions with neighboring vehicles, thus enhancing the global pursuit of finding an optimal vehicle route that satisfies each driver's preferences.In the MLMS-ABM, vehicles have the ability to report information to their neighbors via telematic technology, which influences the arbitration between behaviors.The information between vehicles is exchanged through communications technology, such as vehicle-to-vehicle communication (point to point radio), onboard sensors, or mobile phone towers.For example, vehicles are aware of their current position based on a digital map or an onboard telematic device.
The essential contribution of this work is applying the developed distributed architectures to the distributed vehicle routing-problem.The MLMS-ABM framework provides a decentralized processing approach where the key to distributed vehicle routing is the underlying interaction relationships of the vehicles themselves.The MAS contains communication constraints which make it so that agents can only communicate with their immediate neighboring agents.The vehicles share information with the other vehicles within their neighborhood.Such communication between vehicles combines the effectiveness of the macroscopic and microscopic modeling layers with the involved stages in the proposed hybrid model.As vehicles in the presented model interact and share data with one another, they choose their routes based on the selected routes of the other vehicles.By knowing the decisions of surrounding drivers, a driver will gain better situational awareness and make a more accurate decision, thereby reducing traffic congestion impact on alternative routes while improving overall travel time.This enhanced driver awareness improves decision-making about the best alternative road to take and thus ensures fewer routing delays as a result of traffic congestions.As mentioned earlier, the primary objective here is to make sure that all drivers are not taking the same alternative route.
The optimization goals for traffic networks in this work are the maximization of traffic flow, the spreading of traffic density, and the minimization of the total time spent in the system (including possible waiting time in queues), as well as the reduction of vehicular emissions and fuel consumption, subject to consistency and capacity constraints.As such, a local system-optimal distribution of traffic can be achieved.To summarize, while our general aim is to apply elements of the hybrid ABM and CA in order to structure large-scale optimization or control problems, the focus of the current work is to develop a structured, systematic solution approach for route guidance and traffic control.
This paper discusses hybrid decentralized approaches in detail and explains the benefits of applying them to determine a viable solution to the traffic routing problem.The proposed technology is analyzed in detail and evaluated.Different cases of the decentralized approach are tested to study their ability to reduce overall congestion within the traffic network.Only after this will it be possible to understand the differences that exist between the proposed models and to examine the one that is capable of delivering the best possible results.Additionally, the MLMS-ABM model addresses collision detection and avoidance in vehicular traffic networks.In order to validate and evaluate the proposed model, both hypothetical and real-road data base simulations are performed.

Intelligent Transportation Systems
In the past decade, intelligent transportation systems (ITS) have received a lot of attention [1,2,5,14,[37][38][39][40].The sophistication of the technology behind intelligent transportation systems is ever-improving.The advancements in processing capabilities, communication technology, and sensors now provide vehicles and drivers with the opportunity to figure out the conditions that exist on the road [2].As a result, there is a high possibility of increasing the efficiency of the system.For example, drivers are given the opportunity to determine the best available route to reach their destination in minimum time.However, traffic congestions are extremely dynamic.For instance, even a small accident suffices to instantly create significant traffic congestion on the road.Despite that fact, if vehicles are provided with technology to gather relevant data and process them in real time, drivers will be able to immediately identify the congestion and look for alternative routes.
The communication connectivity that clearly exists between vehicles benefits intelligent transportation systems [2,39].The acquisition of data can be considered to be one of the principal requirements behind intelligent transportation systems, since data provide the resource that is needed to make intelligent decisions.Imagine that an intelligent transportation system is assisting drivers in taking the best available route.One aspect that could be considered is the "greedy-routing issue" that can be solved with the assistance of centralized architecture.This is in contrast to a decentralized system, where all the information is being locally gathered and the data are gathered by sensors that are located on the road in the centralized architecture.Then, the data are centrally processed, and the resulting information is provided in a meaningful manner [1,38].

Decentralized Techniques
Among the methods that can be used to tackle the distributed vehicle routing-problem, the solutions based on distributed architecture have received a lot of attention [1,2,5,37,40].This is because when a decentralized network is implemented, it is possible to achieve distinct advantages over a centralized one.For example, all the vehicles that are located in a specific neighborhood work as sensors on their own, and this eventually benefits a system of sensors and data-aggregators [40].In addition, they work as independent traffic-management centers.Moreover, all the vehicles are provided with the technology to access data, which they need to refer to in order to make meaningful decisions.As a result, interfacing issues can be effectively eliminated.However, the process of making decisions can be quite challenging because the vehicles are provided with the responsibility of processing data as soon as they arrive in an asynchronous manner [38,40].

The Decentralized Architectures and Multi-Agent Systems
In decentralized architectures and multi-agent systems, each vehicle is considered a processing unit of its own [40].The term "agent" is used to determine the intelligent actor who is interacting with the environment via an actuator or a sensor.Therefore, a multi-agent system is a product composed of multiple agents interacting via this network to communicate with one another.Using a multi-agent approach within a distributed architecture is viable; however, it must have a unique combination of actions in order to solve a problem.In other words, the specific solutions used for particular issues need to be understood.However, it is not possible to compute a general solution that keeps agents who are interacting with other agents away from performing a specific task [2,40].This framework defines a method which can be used to perform the actions and account for the unplanned conditions.This unique method of communication is usually considered a vehicle-to-vehicle communication method [1,29].It has an ad hoc structure which ensures the direct communication among vehicles.
Traffic networks usually fit into a multi-agent paradigm.With the ABM method, it is possible to understand a set of rules which determine the behavior of a specific agent.This process is called the "mapping" of all the sensory inputs that can achieve a task [1,2,38,40].
Multi-agent systems use several different states.All states are designed to work in the sequence of sensing, planning, and acting [11,13].The agent first needs to gather information about the environment with the assistance of sensors, and the data collected by the sensors are used to create a model environment.Once the agent is familiar with the environment, it then develops an action plan that can be used to achieve a specific goal, which is made from multiple, smaller, sequential methods that are used to complete the desired task [11,14].When using the multi-agent approach, every vehicle acts as an agent.This way, the network is able to receive comprehensive information which is used to make a better decision.These agents are positioned to create a vehicular ad-hoc network (VANET) [14].VANETs are made from a cluster of agents who are continually moving.With the assistance of a distributed architecture method, modeling vehicles as agents to exhibit behaviors in a trend can be described in detail.However, a distributed architecture approach cannot differentiate among individual vehicles.
Inside the VANET, the agents are provided with the task of reacting according to changing conditions.To do that, they need to use behaviors that exhibit the right approach.However, behaviors in nature are usually quite reactive when the timing of the changes is unknown to agents.One of the biggest challenges that exists here is how to deal with the information in real time and process it inside the vehicle.Traditionally, an event-looping programming paradigm processes data that are being received by the observer [14].Using this system, the observer pattern is used with event-handling.As a result, the object maintains a list of dependents who are acting as observers.They are sent out with automatic notifications of the changes in status.It follows that the complexity of the system increases when it is covering larger geographical boundaries with additional agents.
In a decentralized network, data are captured from the vehicles that share information in the same local range.The exchanged data among agents include but are not limited to: Current position, route, velocity, and type [1,38,40].The data are locally processed by the vehicles.This process of communicating and exchanging data can be considered an example of a pure multi-agent system developed on the ITS framework.Several studies [6,40] have found that a distributed decentralized approach outperforms a centralized one by improving vehicles' travel times.

Related Work
A traffic distribution and routing problem can been improved dramatically by involving both a decrease in road accidents and time spent in network, as well as an increase in level of service (LOS) [9].A number of approaches and algorithms have been introduced to solve traffic routing problems (see Table 1).For example, Groot et al. [3,4] introduced an approach to minimize the total time spent in a network by influencing the traffic distribution over available roads in a network.The problem has been modeled by the means of a novel reverse Stackelberg game approach.Yuan and Wang [5] conducted a preliminary study of blockchain technology and designed an ITS-oriented model for building parallel transportation management systems.Nha et al. [7] studied and compared the performance of different route-planning algorithms in real road networks and classified them according to the mechanisms used for searching the best routes.Compared to the proposed model, these approaches did not apply an agent-based modeling approach to solve the vehicle routing problem.Because of the emergent phenomena of traffic complex systems, the ABM is an effective approach to address the question of how a system's behavior connects to the behaviors and characteristics of its individual components.Employing the adjustable ABM approach helps to simulate human perception and decision-making in complex scenarios such as traffic accidents.Therefore, the proposed agent-based model is able to accurately simulate the vehicles' behaviors and phenomena, allowing for improved decisions taken to enhance the traffic systems.On the other hand, the work presented in [6] examined and compared the effect of ITS centralized and decentralized architectures on transportation mobility when accidents occur.However, this work presented only a conventional multi-agent approach to implement a general solution for vehicles in a distributed architecture.Riaz et al. [10] utilized an ABM to model collision detection and avoidance under congested urban road traffic.Additionally, Manvi et al. [14] used MAS technology to build a vehicular information ad-hoc network.Likewise, the works in [9] and [36] introduced a model for the simulation of non-signalized road crossings where there is a direct interaction between pedestrian and vehicular traffic.The traffic was modeled by applying a continuous car following model by using the Gipps equations, and a CA model was used to simulate pedestrian motion.Biedermann et al. [22] proposed a multiscale approach to predict traffic and crowd flow during public events.Hallé et al. [40] proposed a hierarchical model to address the coordination issue for a platoon of vehicles by considering it as an MAS.Compared to the proposed MLMS-ABM model, these works considered only the conventional ABM and did model an entire complex system using multiple layers of modeling while simultaneously incorporating the agent-based and cellular automata computing approaches.By re-conceptualizing an existing agent-based modeling approach, the modeling levels and layers (scales) have been integrated to ensure the ability and robustness of the proposed model to test all scenarios for traffic complex networks and capture all traffic phenomenon during risk situations.Additionally, dissimilar from the surveyed previous researches, the proposed versatile agent-based framework combines the dynamic agents' status updates, relying on behavioral factors, with the complex system modeling.This combination offers significant contributions to existing surveyed works, which specify the agents' roles prior to the simulation beginning without considering dynamic environmental events that could occur after the simulation begins.Furthermore, in contrast to existing models, the proposed transition decision-making sub-model takes into account all factors that impact the transition of agents through the environment, such as distance to the goal, need to avoid collisions and obstacles, and density.
Implementing this theoretical principle uses an algorithm for finding the best path to the goal that considers not only the shortness of distance but also the obstacle-repulsion natural behavior.Moreover, in contrast to the conventional ABM, the MLMS-ABM provides a new solution to the problem of trustworthiness by incorporating a trustworthiness evaluation tool in modeling the communication and information exchange between agents.This assessment of the trustworthiness among agents promotes an accuracy of decisions taken by individuals in the complex system, thereby improving the system's overall performance.Overall, the presented model is distinct from all previous works in its novelty and effectiveness in simulating large-size heterogeneous complex traffic networks based on both CA and hybrid, multi-component ABM techniques.

Method
The proposed model, based on the ABM and non-homogeneous CA approaches researched in [12,41], has been exploited to provide a multi-layered decision support system in cases of accident congestions, and it develops a new simulation method to understand the movement of vehicular traffic in case of accidents and/or congestion.
In this model, the ABM approach is used where the network conducts data acquisition as well as data processing within individual vehicles.It is quite different from the traditional centralized approach in which the service recommends that the driver follows an alternative route regardless of other vehicles.This alternative route is recommended by the ABM approach to the specific vehicle, as opposed to all the vehicles on the road.The individual vehicles are able to make decisions and proceed.Since the alternative route is dependent on the decision variables of the drivers, they are provided with the most practical routes available, therefore making it an effective solution to the dynamic routing problem.It is assumed that all agents are in a position to cooperate and participate within this multi-agent system.They are doing so by providing data to their neighbors.It is also believed that the drivers are behaving cognitively and rationally.
This work represents an approach for modeling and simulating complex and dynamic vehicular systems at both the microscopic and macroscopic levels.The highest layer represents the macroscopic phenomena of the traffic network that would be difficult to model in CA frames.This layer represents the connections between intelligent guide agents that enhance the decisions for the whole system.The base layer is composed of a high determination CA framework for every open space, which shows how the agents' neighborhood moves, as well as how the development of decision-making at the microscopic level of the system is created.Figure 2 shows the two-layered structure of the proposed system.
It is assumed that all agents are in a position to cooperate and participate within this multi-agent system.They are doing so by providing data to their neighbors.It is also believed that the drivers are behaving cognitively and rationally.
This work represents an approach for modeling and simulating complex and dynamic vehicular systems at both the microscopic and macroscopic levels.The highest layer represents the macroscopic phenomena of the traffic network that would be difficult to model in CA frames.This layer represents the connections between intelligent guide agents that enhance the decisions for the whole system.The base layer is composed of a high determination CA framework for every open space, which shows how the agents' neighborhood moves, as well as how the development of decision-making at the microscopic level of the system is created.Figure 2 shows the two-layered structure of the proposed system.The MLMS-ABM simulation model consists of multiple sub-models starting with the model of how the agent selects its intermediate goal destination.The act of avoiding obstacles and collisions with nearby agents is then modeled.The hybrid version of the agent-based model includes simulating the leading and following behaviors of agents after dynamically upgrading certain agents to the "intelligent" level and enabling them to perform some sort of guidance behavior, as detailed below.Besides avoiding collisions with neighboring vehicles, the framework includes a model of avoiding high density areas in order to reduce overall travel time.

Agent Configuration
In this model, agents inside the MAS manage their behaviors based on a set of behavior rules.The agents are provided with the ability to communicate with their immediate neighbors.Each vehicle maintains a list of vehicles that are within certain range r.For the vehicles that are within that range, their current position, velocity, route, and type are shared amongst each neighbor within that range.
Each state in the finite state machine (FSM) represents a sub-model (stage) of the MLMS-ABM model, as shown in Figure 3.Each sub-model inside the model represents a particular behavior which is considered a general-purpose action or set of actions that an agent performs.The sub-model is described using a prescribed set of states and actions.An example of a general type behavior would be "follow the neighbor agent" or "follow fastest route."The information from one state in the FSM can affect the transition to another state.The decision to move from one state to another in the FSM is based on the status of the neighbor agents and local environment data.The hierarchical state is decomposed into the sub states or stages.Levels in the MLMS-ABM model are special types of behaviors specifically designed to perform a sequence of actions or behaviors.Each level performs a The MLMS-ABM simulation model consists of multiple sub-models starting with the model of how the agent selects its intermediate goal destination.The act of avoiding obstacles and collisions with nearby agents is then modeled.The hybrid version of the agent-based model includes simulating the leading and following behaviors of agents after dynamically upgrading certain agents to the "intelligent" level and enabling them to perform some sort of guidance behavior, as detailed below.Besides avoiding collisions with neighboring vehicles, the framework includes a model of avoiding high density areas in order to reduce overall travel time.

Agent Configuration
In this model, agents inside the MAS manage their behaviors based on a set of behavior rules.The agents are provided with the ability to communicate with their immediate neighbors.Each vehicle maintains a list of vehicles that are within certain range r.For the vehicles that are within that range, their current position, velocity, route, and type are shared amongst each neighbor within that range.
Each state in the finite state machine (FSM) represents a sub-model (stage) of the MLMS-ABM model, as shown in Figure 3.Each sub-model inside the model represents a particular behavior which is considered a general-purpose action or set of actions that an agent performs.The sub-model is described using a prescribed set of states and actions.An example of a general type behavior would be "follow the neighbor agent" or "follow fastest route."The information from one state in the FSM can affect the transition to another state.The decision to move from one state to another in the FSM is based on the status of the neighbor agents and local environment data.The hierarchical state is decomposed into the sub states or stages.Levels in the MLMS-ABM model are special types of behaviors specifically designed to perform a sequence of actions or behaviors.Each level performs a decision-making process based on constraints forced by the local environment and the states (characteristics) of neighbor agents.Those constraints determine how to transit between various sub-models within each level.The constraints can be constant values, such as vehicle maximum speed, or dynamic data, such as the current velocity at a specific location.
decision-making process based on constraints forced by the local environment and the states (characteristics) of neighbor agents.Those constraints determine how to transit between various submodels within each level.The constraints can be constant values, such as vehicle maximum speed, or dynamic data, such as the current velocity at a specific location.
The agents in the proposed model are randomly assigned with objective and subjective parameters at the beginning of the simulation.The drivers' characteristics, or subject parameters, include their awareness of the environment, cooperativity, adaptability, flexibility, perception of potential risks, acceptance to follow orders, and ability to access global information about the environment.On the other hand, drivers' objective characteristics include their age, health status, and communication capability.One of the main properties that is specified here is the type of vehicle.Vehicle lengths can vary from a passenger car to a two-axel truck.In the proposed model, heterogeneous vehicle classes are allowed, as vehicle type composition can vary greatly.Recognizing the differences between vehicles helps us to characterize the MAS system as a heterogeneous multi-agent system.This allows for the making of decisions that are better suited to the type of vehicle used.By taking this into account, it can be ensured that each vehicle takes the individual optimal route in case of freeway accidents.For example, according to [42], the types of vehicles in traffic flow, such as trucks, commercial vehicles, and heavy recreational vehicles, can also cause delays.
The different speeds of agents in the simulated environment were also considered to ensure the authenticity of the simulation.It has been considered that the heterogeneity of agents' movement speed is not constant.Instead, the movement is modeled as a continuously dynamic variable influenced by the surrounding density, the behavioral characteristics of the agents, and the environment's structure.In the MLMS-ABM simulation model, it is assumed that the maximum speed of vehicles is set to be s = 65 mph, that is, about 3 cells/time-stamp in the CA environment.More details about the agents' movement characteristics are addressed in detail in [12].

Transition Decision-Making Model
At every time-stamp and for each agent, a new target cell is selected from the five possible candidate cells in the Moore neighborhood [43] to define the travelling trajectory, as represented in Figure 4.This choice is based on the probabilistic calculation performed on each candidate cell, and the cell with the highest probability is selected [12].Applying the  * algorithm [44] only as a routing technique does not specify where the processing for the routes exists nor does it capture the varying conditions of congestions at any point in time.The agent  moves to the target cell which is the neighbor empty cell with the highest probability among Moore neighborhood cells in the next time- The agents in the proposed model are randomly assigned with objective and subjective parameters at the beginning of the simulation.The drivers' characteristics, or subject parameters, include their awareness of the environment, cooperativity, adaptability, flexibility, perception of potential risks, acceptance to follow orders, and ability to access global information about the environment.On the other hand, drivers' objective characteristics include their age, health status, and communication capability.
One of the main properties that is specified here is the type of vehicle.Vehicle lengths can vary from a passenger car to a two-axel truck.In the proposed model, heterogeneous vehicle classes are allowed, as vehicle type composition can vary greatly.Recognizing the differences between vehicles helps us to characterize the MAS system as a heterogeneous multi-agent system.This allows for the making of decisions that are better suited to the type of vehicle used.By taking this into account, it can be ensured that each vehicle takes the individual optimal route in case of freeway accidents.For example, according to [42], the types of vehicles in traffic flow, such as trucks, commercial vehicles, and heavy recreational vehicles, can also cause delays.
The different speeds of agents in the simulated environment were also considered to ensure the authenticity of the simulation.It has been considered that the heterogeneity of agents' movement speed is not constant.Instead, the movement is modeled as a continuously dynamic variable influenced by the surrounding density, the behavioral characteristics of the agents, and the environment's structure.In the MLMS-ABM simulation model, it is assumed that the maximum speed of vehicles is set to be s = 65 mph, that is, about 3 cells/time-stamp in the CA environment.More details about the agents' movement characteristics are addressed in detail in [12].

Transition Decision-Making Model
At every time-stamp and for each agent, a new target cell is selected from the five possible candidate cells in the Moore neighborhood [43] to define the travelling trajectory, as represented in Figure 4.This choice is based on the probabilistic calculation performed on each candidate cell, and the cell with the highest probability is selected [12].Applying the A * algorithm [44] only as a routing technique does not specify where the processing for the routes exists nor does it capture the varying conditions of congestions at any point in time.The agent a moves to the target cell which is the neighbor empty cell with the highest probability among Moore neighborhood cells in the next time-stamp.The transition probability, P(x, y), to move to an unoccupied neighbor cell (x, y) is determined by the four factors: Static target floor field (TFF), obstacles floor field (OFF) [32], dynamic floor field (DFF) [15,27], and the density around the next target cell (Den).TFF is used to indicate the distances to a destination for every agent in the environment.A TFF value is assigned to every cell to describe the distance to the earliest chosen target.The second floor field is made out of obstacle fields, which are considered repulsive forces.These two floor fields are static.The last two types of floor fields are the dynamic and density fields that give an indication of how the occupancy of every single cell surrounding the agent changes along with time in order to avoid collisions.In each time-stamp, the dynamic floor field   decays with some probability and diffuses with some probability to one of its eight neighbor cells as follows: where α is the diffusion probability that represents the randomness of an agent's movement and δ is the decay probability that reflects the agent's visible range.One of the key elements of the model is the collision avoidance sub-model.It provides the ability to calculate potential interactions between vehicles.The model is able to calculate the density around each cell.It is measured based on the number of vehicles within the specified space of range r.It insures the avoidance of collision while taking the best trajectory.The model provides an awareness of when a possible interaction between vehicles can or will occur during travel, and it enables each agent to be aware of potential interactions with other agents.
The obstacles' static potential field is calculated as follows: where  , represents the minimum distance from the obstacles and   is the maximum distance at which people are influenced by the obstacles.
For each agent   , the transition probability is calculated to each empty cell (, ) in its Moore neighborhood as follows: (, ) =  exp(−  (, ) +   (, ) +   (, ) +   (, ) +   ) , where:  is the normalization coefficient; (, ) is the target static potential field value; (, ) is the value of the dynamic floor field; (, ) is the obstacles floor field value;(, ) is the value of the density field; is the inertia parameter;  ,   ,   , and   ∈ [0, ∞) are the weight sensitivity parameters of the target, obstacles, dynamic, and density floor fields, respectively; and  is the weight sensitivity parameter of the inertia.
To solve a conflict, e.g., when more than one agent moves to the same cell, one agent is randomly chosen with equal probability and proceeds, whereas the other remains at his/her cell.If no In each time-stamp, the dynamic floor field D ij decays with some probability and diffuses with some probability to one of its eight neighbor cells as follows: where α is the diffusion probability that represents the randomness of an agent's movement and δ is the decay probability that reflects the agent's visible range.One of the key elements of the model is the collision avoidance sub-model.It provides the ability to calculate potential interactions between vehicles.The model is able to calculate the density around each cell.It is measured based on the number of vehicles within the specified space of range r.It insures the avoidance of collision while taking the best trajectory.The model provides an awareness of when a possible interaction between vehicles can or will occur during travel, and it enables each agent to be aware of potential interactions with other agents.
The obstacles' static potential field is calculated as follows: where d x,y represents the minimum distance from the obstacles and D max is the maximum distance at which people are influenced by the obstacles.
For each agent a i , the transition probability is calculated to each empty cell (x, y) in its Moore neighborhood as follows: where: N is the normalization coefficient; TFF(x, y) is the target static potential field value; DFF(x, y) is the value of the dynamic floor field; OFF(x, y) is the obstacles floor field value; Den(x, y) is the value of the density field; I is the inertia parameter; k T , k O , k D , and k den ∈ [0, ∞) are the weight sensitivity parameters of the target, obstacles, dynamic, and density floor fields, respectively; and k I is the weight sensitivity parameter of the inertia.
To solve a conflict, e.g., when more than one agent moves to the same cell, one agent is randomly chosen with equal probability and proceeds, whereas the other remains at his/her cell.If no movement is possible in any of the adjacent cells, the cell state will not change, and the agent remains motionless.
Applying this transition decision-making model ensures the shortest path that avoids obstacles and congested spots along the agent's route.This transition function enables the vehicles' projected paths to be updated to alleviate collision and thus improves cooperation between vehicles.Additionally, this sub-model helps each agent to check for possible interactions with other agents.A more detailed analysis of this sub-model is carried out in [12].

Agent Status Upgrading Model
The third stage in the ABM simulation classifies the different types of agents in the environment.The agent-based model here represents two sets of drivers: The first set is familiar with the road network structure, and the other one is not.In the proposed model, this is a major stage when the agents' expected behaviors are examined.The expectation is dependent on the intelligence level during different situations and scenarios.The classification is done based on subjective and objective characteristics of the individual agents, as mentioned above.
In the proposed ABM implementation, the environment CA grid is evenly divided into square regions to estimate the density at each region (if it is more than a predefined threshold).Regional density is measured by counting all agents in the region and then dividing this number by the region area.At the regions with higher density, the objective and subjective parameters are examined for each agent in that region.If these two parameters meet the condition for an intelligent agent based on a predefined threshold, then that agent's status is upgraded to that of an intelligent agent, as shown in Algorithm 1.The intelligent agents in the MLMS-ABM model are considered to be the decision makers because they are able to evaluate the exchanged information and make decisions about their current route in order to improve total travel time while reducing traffic congestion.In the proposed model, the number of intelligent agents is not constant, and it depends on the density of traffic.Additionally, the position of the intelligent agents could be in front of or lateral to (left, right, center) follower vehicles, but it could not be behind.All the agents are looking for faster routes while concurrently following the intelligent agent in a group of other vehicles.At the same time, they are ensuring that they stay away from high density/congestion within the surrounding neighborhood, which could potentially decrease delay time.
In the MLMS-ABM model, the upgrading stage is dynamic, i.e., the status of the agents changes throughout the simulation.The status alteration depends on changes in the surroundings or changes in the agent's objective parameters.The status of an agent could change, either up to intelligence layer or down to a normal layer, during the simulation.An upgrading/downgrading procedure enables the proposed model to cover all the individuals' behaviors under all situations.
The velocity of agents in MAS is an essential issue that needs to be addressed.The intelligent agents have to report their current velocity to the follower agents.The intelligent agents are ahead of follower agents, and if the intelligent agent continues his/her movement with a sufficient velocity, then the follower agents keep their current route.On the other hand, if the intelligent agent's velocity is insufficient, based on a predefined velocity threshold, then the followers change their assigned intelligent agent and look for another intelligent agent among the neighbors for another route but within a specific velocity range.If the agent cannot find another intelligent agent on different alternative routes that meets the velocity threshold, then the agent status is "solitary," and he/she selects the best available route.Algorithm 2 illustrates the status upgrade process based on speed.The intelligent agents have the ability to communicate their knowledge of the network to the drivers (the followers) via onboard devices.The fundamental characteristic of the ITS is that each individual driver can be reached through a medium such as an onboard device or computer which is used to collect the main information about the vehicles, including origin-destination and travel time.Additionally, it is assumed that the traffic authority communicates with the intelligent agents via an onboard device to provide them with the fundamental information about the network.The intelligent agents have access to global data about the environment to support their decision and to enhance their decision generated from local data exchange.As such, the MLMS-ABM model includes a centralized ITS approach where the information about the network routes is provided from a central traffic management center (TMC).
The proposed model is generalized by increasing the variety in the statuses/rankings of intelligence possible for the agents instead of having only two levels of agents.The classification is based on the subjective parameter of intelligent agents.The interactions and communication behaviors between agents is based on intelligence ranking.For instance, if two agents with different intelligence rankings meet at the same point and have different decisions, then the lower-ranked agent follows the higher-ranked one.Algorithm 3 illustrates the classification of intelligence ranks based on the subjective parameter that is assigned to agents at the beginning of the simulation.

Trustworthiness Model
The term trustworthiness is used here to measure the trust level a follower agent has in the intelligent agent in making a correct decision about the next target.An agent is considered trustworthy if he/she has a high probability of performing a particular action about the next goal [12].Particularly, before agent a decides to follow the actions taken by intelligent agent p, agent a needs to evaluate the trustworthiness probability about the decision q provided by agent p.The trustworthiness probability about the decision q is calculated as follows: ξ is the normalizing factor, P(q|a i ) is the certainty factor that an agent a i has on decision q.That means an agent a i thinks q is correct with probability P(q|a i ), p(a j i ) is the reliability factor of an agent a i .Therefore, the agent's probability of following a decision process is based on the greatest certainty value of P(q).In other words, agent a trusts intelligent agent p only if trustworthiness probability value is greater than or equal to a predefined threshold.Thus, the trustworthiness model helps to decide which information source to consider in case of receiving conflicting information.
The first stage (sub-model) of the MLMS-ABM routing modelling system is the design of the rules that governs the decision-making process for agents to choose an intermediate target to reach in order to reroute around the accident.The model automates the process of extracting decision rules by adapting gene expression programming to find optimal decision rules from objective behaviors.A more detailed analysis of this sub-model was carried out in [12].
All proposed stages and sub-models of the three levels of the MLMS-ABM model are performed in the microscopic layer because they are implementation components of the layer.However, when the agent status upgrading sub-model is performed, the intelligent agents are generated, and the macroscopic layer is thusly generated.The communication and trustworthiness evaluation stage is performed in both the microscopic and macroscopic layers.

Experimentation and Analysis
The above described modeling framework was executed independently in three different versions of the proposed model.First, in the case of deterministic behavior, the MLMS-ABM model was applied to a scenario where all agents should follow the intelligent agent in their region.Thus, in this case, there was no implementation of the trustworthiness sub-model.Second was the non-deterministic technique, where agents in a region have a choice to follow or not to follow the intelligent agent in that region.That means some of the agents are in the solitary mode.Here, two cases are examined: In the first sub-case, it has been specified that only 50% of the vehicles are able to communicate with each other and intelligent agents in their region, while in the second sub-case, the percentage of agents who have the ability to communicate is specified based on the trustworthiness of the sub-model.
In order to perform an analysis of the different forms of the agent-based distributed routing algorithms, the dynamics of the road network are simulated without any form of ITS.In other words, the non-MLMS-ABM approach was implemented as a baseline of the experiments, where only the traditional agent-based simulation was implemented without involving the tactical level.This means that in this simulation, there was no application of status upgrading and trustworthiness sub-models.In this case, there was no knowledge of the condition of the road network, and the only best route was considered the shortest distance path toward the destination.As such, the agents do not communicate and have no information about the alternative routes.Comparing the proposed MLMS-ABM approaches and the non-MLMS-ABM approach helps us to see the advantages of developing the MLMS-ABM and distributed environment approaches to solve the traffic issues.
In order to investigate the performance of the proposed decentralized routing model, it was analyzed in two different simulation scenarios: (i) Hypothetical simulation and (ii) real-world simulation based on real road network data.Many experiments were performed on those two simulation scenarios to test the ability of the presented model to improve the vehicular traffic flow during congestion.In order to perform the hypothetical analysis, a typical virtual road network was constructed.A road network was considered in which several road segments were shared by different routes associated with the same, as well as different origin and destination pairs.In this simulation, the accident was generated at a predefined time.For instance, in the experiment, the accident was generated at the tenth timestamp in the simulation.Additionally, the location of the accident was predefined in the input file of the simulation environment.In the simulation, it was assumed that the freeway accident did not completely close all lanes; one lane remained open.Additionally, it was assumed that average daily traffic (ADT) on the main freeway was approximately ~100,000 total across all lanes, or about 5000 VPH (vehicles per hour) on the main freeway.
In order to validate the previous hypothetical network, the proposed model was tested on a real-world network.The traffic in Denver County was selected for this study, since it has the highest number of total crashes according to the Colorado Department of Transportation (CDOT) [42].A very typical road network is the I-25 Interstate Freeway in Denver County, which often exhibits traffic accidents [42,45,46].
Data obtained from the CDOT database were used to model the routes in the I-25 freeway.The segment that was investigated includes arterial roads that intersect with the I-25 State Freeway and play an important role as different alternatives.In addition, these arterial alternative roads themselves can have local traffic congestions.Using the data provided by CDOT, the simulation was performed at approximately ~4400 VPH traffic load on the freeway across all five lanes.The traffic volume data were based on data captured during 2009 [46].In this scenario, the accident was generated just as it was in the hypothetical scenario.Based on the data from CDOT, the location of the accident was predefined in the input file.The time of generating the accident was also predetermined in the code.Thus, the demand-loading pattern on all roads, the accident setting, and the environment settings in this real-world scenario were set according to real datasets [46].Figure 5 shows the map of the typical road networks.For each simulation scenario, the traffic on the arterial roads was modeled using different load values to observe the impact of the alternate route(s) on various flows by measuring the LOS and the travel time on the freeway.In the simulation, four different loads for arterial flow rates were considered: The maximum arterial load (1600 VPH), the medium arterial load (800 VPH), the minimum arterial load (400 VPH), and no arterial load.Additionally, to cover the whole range of densities, a number of simulations with variable population sizes (vehicle volumes/densities) were conducted.
As stated in the model description, each vehicle communicates, through VANET-based communications, with other vehicles within a predefined range.In this simulation, the range between agents to be considered neighbors was set to 500 meters.The intelligent agents use the V2V (vehicleto-vehicle) information to assess road conditions and alternate road attributes.When the vehicles approach the accident on the main road, each conveys its state information to other neighboring vehicles.As the highway may become congested, the model calculates alternative routes to avoid congestion.For each agent, to travel along its route, the best intermediate cell that ensures the best travel time is chosen based on the probability transition function (1).

Results and Discussion
The MLMS-ABM model provides runtime analytics that provide users with a wealth of feedback about what is happening inside the model as the simulation takes place.Runtime analytics help query speed, density, travel time, and LOS [53], which is used to classify the comfort of urban facilities from the perspective of drivers.The level of service can be considered a mechanism to determine the effectiveness of a transport facility from the perspective of a traveler.It determines how a specific service is being offered.In general, six different levels of service are defined.They range from A to F, with A representing the best operating conditions and F representing the worst.It can be used as an effective measure to evaluate the overall quality of service [47].
The goal of the model is to divert the traffic flow around a freeway accident onto the nearby city road so that the congestion is reduced while each vehicle takes its best individual route.The primary objective of this approach is to minimize traffic congestion, thus improving travel times.
In addition, the MLMS-ABM model provides output statistics that enable users to store data from many simulations and do comparisons between multiple findings.Comparing different scenarios also enables users to get the average of many runs.In order to validate the proposed model, implementation was performed using a custom imperative programming approach.Figure 6 shows a screenshot of the simulation illustrating the agents' movement in the hypothetical road network.It also shows the freeway and city arterial roads and where an accident occurs on the freeway (the red circle).For each simulation scenario, the traffic on the arterial roads was modeled using different load values to observe the impact of the alternate route(s) on various flows by measuring the LOS and the travel time on the freeway.In the simulation, four different loads for arterial flow rates were considered: The maximum arterial load (1600 VPH), the medium arterial load (800 VPH), the minimum arterial load (400 VPH), and no arterial load.Additionally, to cover the whole range of densities, a number of simulations with variable population sizes (vehicle volumes/densities) were conducted.
As stated in the model description, each vehicle communicates, through VANET-based communications, with other vehicles within a predefined range.In this simulation, the range between agents to be considered neighbors was set to 500 meters.The intelligent agents use the V2V (vehicle-to-vehicle) information to assess road conditions and alternate road attributes.When the vehicles approach the accident on the main road, each conveys its state information to other neighboring vehicles.As the highway may become congested, the model calculates alternative routes to avoid congestion.For each agent, to travel along its route, the best intermediate cell that ensures the best travel time is chosen based on the probability transition function (1).

Results and Discussion
The MLMS-ABM model provides runtime analytics that provide users with a wealth of feedback about what is happening inside the model as the simulation takes place.Runtime analytics help query speed, density, travel time, and LOS [9,47], which is used to classify the comfort of urban facilities from the perspective of drivers.The level of service can be considered a mechanism to determine the effectiveness of a transport facility from the perspective of a traveler.It determines how a specific service is being offered.In general, six different levels of service are defined.They range from A to F, with A representing the best operating conditions and F representing the worst.It can be used as an effective measure to evaluate the overall quality of service [47].
The goal of the model is to divert the traffic flow around a freeway accident onto the nearby city road so that the congestion is reduced while each vehicle takes its best individual route.The primary objective of this approach is to minimize traffic congestion, thus improving travel times.
In addition, the MLMS-ABM model provides output statistics that enable users to store data from many simulations and do comparisons between multiple findings.Comparing different scenarios also enables users to get the average of many runs.In order to validate the proposed model, implementation was performed using a custom imperative programming approach.Figure 6 shows a screenshot of the simulation illustrating the agents' movement in the hypothetical road network.It also shows the freeway and city arterial roads and where an accident occurs on the freeway (the red circle).In order to investigate the performance of the model, many experiments were conducted.The values of the weight sensitivity parameters in all experiments were set to:   = 2.0,   = 0.3,   = 0.5,   = 0.02, and   = 0.5 for the target, obstacles, dynamic, density floor fields, and inertia, respectively.Simulations for both the hypothetical and the real I-25 road were performed and captured the time of travel for the vehicles to reroute around the accident.Travel time variability is an important measure of model performance.Every agent's decision regarding the optimal route is based on minimizing the desired travel time to reach the desired destination.
The first simulation was related to demonstrating the model's efficiency in promoting the overall traffic travel time during the accident in the hypothetical road network.This experiment was run with 5000 VPH on the main highway with varying arterial traffic loads.In this experiment, the total travel time was calculated for all agents, as shown in Figure 7.The results illustrate that the MLMS-ABM routing model provides the quickest route times regardless of the value of the arterial road loads.With non-deterministic behavior, some agents conflict in their paths with others, as some of them do not follow intelligent agents.These collisions increase the travel time because agents sometimes stop due to the participation of some agents who do not follow intelligent agents.As a result, travel time increases despite having a portion of traffic following the intelligent agents.The non-MLMS-ABM spent the longest time rerouting.The results show that vehicles in the baseline case were either remaining on the freeway or exiting the freeway using the first exit.This result confirms the ability to rely on an intelligent agent to improve the overall travel time.The second finding illustrates the model's ability to improve vehicular traffic flow.The experiment was run on a minimum traffic load with 400 VPH in the arterial roads and 5000 VPH on the main highway.Figure 8 shows that traffic flow rate was the worst in the non-MLMS-ABM, whereas it was almost the same in all MLMS-ABM model cases, since the difference between the three cases was insignificant at the first 40 time-stamps of the simulation.However, as the simulation In order to investigate the performance of the model, many experiments were conducted.The values of the weight sensitivity parameters in all experiments were set to: k T = 2.0, k O = 0.3, k D = 0.5, k den = 0.02, and k I = 0.5 for the target, obstacles, dynamic, density floor fields, and inertia, respectively.Simulations for both the hypothetical and the real I-25 road were performed and captured the time of travel for the vehicles to reroute around the accident.Travel time variability is an important measure of model performance.Every agent's decision regarding the optimal route is based on minimizing the desired travel time to reach the desired destination.
The first simulation was related to demonstrating the model's efficiency in promoting the overall traffic travel time during the accident in the hypothetical road network.This experiment was run with 5000 VPH on the main highway with varying arterial traffic loads.In this experiment, the total travel time was calculated for all agents, as shown in Figure 7.The results illustrate that the MLMS-ABM routing model provides the quickest route times regardless of the value of the arterial road loads.With non-deterministic behavior, some agents conflict in their paths with others, as some of them do not follow intelligent agents.These collisions increase the travel time because agents sometimes stop due to the participation of some agents who do not follow intelligent agents.As a result, travel time increases despite having a portion of traffic following the intelligent agents.The non-MLMS-ABM spent the longest time rerouting.The results show that vehicles in the baseline case were either remaining on the freeway or exiting the freeway using the first exit.This result confirms the ability to rely on an intelligent agent to improve the overall travel time.In order to investigate the performance of the model, many experiments were conducted.The values of the weight sensitivity parameters in all experiments were set to:   = 2.0,   = 0.3,   = 0.5,   = 0.02, and   = 0.5 for the target, obstacles, dynamic, density floor fields, and inertia, respectively.Simulations for both the hypothetical and the real I-25 road were performed and captured the time of travel for the vehicles to reroute around the accident.Travel time variability is an important measure of model performance.Every agent's decision regarding the optimal route is based on minimizing the desired travel time to reach the desired destination.
The first simulation was related to demonstrating the model's efficiency in promoting the overall traffic travel time during the accident in the hypothetical road network.This experiment was run with 5000 VPH on the main highway with varying arterial traffic loads.In this experiment, the total travel time was calculated for all agents, as shown in Figure 7.The results illustrate that the MLMS-ABM routing model provides the quickest route times regardless of the value of the arterial road loads.With non-deterministic behavior, some agents conflict in their paths with others, as some of them do not follow intelligent agents.These collisions increase the travel time because agents sometimes stop due to the participation of some agents who do not follow intelligent agents.As a result, travel time increases despite having a portion of traffic following the intelligent agents.The non-MLMS-ABM spent the longest time rerouting.The results show that vehicles in the baseline case were either remaining on the freeway or exiting the freeway using the first exit.This result confirms the ability to rely on an intelligent agent to improve the overall travel time.The second finding illustrates the model's ability to improve vehicular traffic flow.The experiment was run on a minimum traffic load with 400 VPH in the arterial roads and 5000 VPH on the main highway.Figure 8 shows that traffic flow rate was the worst in the non-MLMS-ABM, whereas it was almost the same in all MLMS-ABM model cases, since the difference between the three cases was insignificant at the first 40 time-stamps of the simulation.However, as the simulation The second finding illustrates the model's ability to improve vehicular traffic flow.The experiment was run on a minimum traffic load with 400 VPH in the arterial roads and 5000 VPH on the main highway.Figure 8 shows that traffic flow rate was the worst in the non-MLMS-ABM, whereas it was almost the same in all MLMS-ABM model cases, since the difference between the three cases was insignificant at the first 40 time-stamps of the simulation.However, as the simulation time progressed, the non-deterministic cases of the proposed model overcame the deterministic ones in the traffic flow rate.That could be due to the independence of some agents to choose their own route.In the general, the result indicates the ability of the model to improve overall traffic flow during accidents.
Appl.Sci.2019, 9, x FOR PEER REVIEW 11 of 25 time progressed, the non-deterministic cases of the proposed model overcame the deterministic ones in the traffic flow rate.That could be due to the independence of some agents to choose their own route.In the general, the result indicates the ability of the model to improve overall traffic flow during accidents.Figure 9 illustrates a histogram of travel time for rerouting around accidents with varying loads along the main highway and varying arterial traffic.In these simulations, the impact of the number of agents (vehicles) on the journey time was tested.The experiment was run on the MLMS-ABM model with varying traffic volumes along the main highway.Four traffic volumes were tested in this experiment: 4000, 5000, 6000, and 7000 VPH.This experiment was run for each traffic volume under four different arterial traffic loads.As can be seen from the histogram, the number of vehicles on the main road has a significant effect on the vehicles' travel time.As expected, there was a direct correlation between the travel time and the traffic volume on the main highway; when traffic volume increased on the main highway, the total travel time increased (see Figure 9).The fourth simulation performed was to examine the traffic throughput, i.e., the number of vehicles reaching their destinations as a function of time.Figure 10 shows that the number of agents exiting the simulation environment, which means reaching their destinations, was higher during the MLMS-ABM simulation than in the non-MLMS-ABM run.This confirms the ability of the proposed model to improve the throughput.Figure 9 illustrates a histogram of travel time for rerouting around accidents with varying loads along the main highway and varying arterial traffic.In these simulations, the impact of the number of agents (vehicles) on the journey time was tested.The experiment was run on the MLMS-ABM model with varying traffic volumes along the main highway.Four traffic volumes were tested in this experiment: 4000, 5000, 6000, and 7000 VPH.This experiment was run for each traffic volume under four different arterial traffic loads.As can be seen from the histogram, the number of vehicles on the main road has a significant effect on the vehicles' travel time.As expected, there was a direct correlation between the travel time and the traffic volume on the main highway; when traffic volume increased on the main highway, the total travel time increased (see Figure 9).Figure 9 illustrates a histogram of travel time for rerouting around accidents with varying loads along the main highway and varying arterial traffic.In these simulations, the impact of the number of agents (vehicles) on the journey time was tested.The experiment was run on the MLMS-ABM model with varying traffic volumes along the main highway.Four traffic volumes were tested in this experiment: 4000, 5000, 6000, and 7000 VPH.This experiment was run for each traffic volume under four different arterial traffic loads.As can be seen from the histogram, the number of vehicles on the main road has a significant effect on the vehicles' travel time.As expected, there was a direct correlation between the travel time and the traffic volume on the main highway; when traffic volume increased on the main highway, the total travel time increased (see Figure 9).The fourth simulation performed was to examine the traffic throughput, i.e., the number of vehicles reaching their destinations as a function of time.Figure 10 shows that the number of agents exiting the simulation environment, which means reaching their destinations, was higher during the MLMS-ABM simulation than in the non-MLMS-ABM run.This confirms the ability of the proposed model to improve the throughput.The fourth simulation performed was to examine the traffic throughput, i.e., the number of vehicles reaching their destinations as a function of time.Figure 10 shows that the number of agents exiting the simulation environment, which means reaching their destinations, was higher during the MLMS-ABM simulation than in the non-MLMS-ABM run.This confirms the ability of the proposed model to improve the throughput.The vehicular speeds for the same agent from the same distance in different scenarios (traffic loads) were compared, as shown in Figure 11.That agent under examination was chosen randomly.The histogram shows that the agent's average speed was higher during the application of the MLMS-ABM model than during the non-MLMS-ABM application regardless of the traffic loads on the arterial roads.Additionally, as shown in Figure 11, the average vehicle speeds were significantly higher for all cases of the MLMS-ABM model with no or minimum arterial loads compared to the medium and maximum load scenarios.This result shows the impact of the arterial roads' volume of traffic on the speed of vehicles during traveling over alternative routes in the case of an accident.In the other simulation scenarios, the routes along the I-25 were modeled.In the first experiment where travel time was measured, the proposed model had the best performance among other methods in the simulation of the I-25 routes.Looking at the data from the decentralized approaches, in both the deterministic and non-deterministic cases, it can be seen that the overall travel time to reroute around an accident was improved over the non-ITS method.Additionally, in the first case of the non-deterministic agent-based model, where only 50% of the vehicles were able to communicate with each other and the intelligent agents in their region regarding the best alternative routes to take, The vehicular speeds for the same agent from the same distance in different scenarios (traffic loads) were compared, as shown in Figure 11.That agent under examination was chosen randomly.The histogram shows that the agent's average speed was higher during the application of the MLMS-ABM model than during the non-MLMS-ABM application regardless of the traffic loads on the arterial roads.Additionally, as shown in Figure 11, the average vehicle speeds were significantly higher for all cases of the MLMS-ABM model with no or minimum arterial loads compared to the medium and maximum load scenarios.This result shows the impact of the arterial roads' volume of traffic on the speed of vehicles during traveling over alternative routes in the case of an accident.The vehicular speeds for the same agent from the same distance in different scenarios (traffic loads) were compared, as shown in Figure 11.That agent under examination was chosen randomly.The histogram shows that the agent's average speed was higher during the application of the MLMS-ABM model than during the non-MLMS-ABM application regardless of the traffic loads on the arterial roads.Additionally, as shown in Figure 11, the average vehicle speeds were significantly higher for all cases of the MLMS-ABM model with no or minimum arterial loads compared to the medium and maximum load scenarios.This result shows the impact of the arterial roads' volume of traffic on the speed of vehicles during traveling over alternative routes in the case of an accident.In the other simulation scenarios, the routes along the I-25 were modeled.In the first experiment where travel time was measured, the proposed model had the best performance among other methods in the simulation of the I-25 routes.Looking at the data from the decentralized approaches, in both the deterministic and non-deterministic cases, it can be seen that the overall travel time to reroute around an accident was improved over the non-ITS method.Additionally, in the first case of the non-deterministic agent-based model, where only 50% of the vehicles were able to communicate with each other and the intelligent agents in their region regarding the best alternative routes to take, In the other simulation scenarios, the routes along the I-25 were modeled.In the first experiment where travel time was measured, the proposed model had the best performance among other methods in the simulation of the I-25 routes.Looking at the data from the decentralized approaches, in both the deterministic and non-deterministic cases, it can be seen that the overall travel time to reroute around an accident was improved over the non-ITS method.Additionally, in the first case of the non-deterministic agent-based model, where only 50% of the vehicles were able to communicate with each other and the intelligent agents in their region regarding the best alternative routes to take, the overall travel time was better compared to the second case of the non-deterministic method.The travel time histogram is shown in Figure 12.
Appl.Sci.2019, 9, x FOR PEER REVIEW 13 of 25 the overall travel time was better compared to the second case of the non-deterministic method.The travel time histogram is shown in Figure 12. Figure 13 illustrates the model's capability to improve the vehicular traffic flow.The experiment ran on the maximum traffic load case with 1600 VPH in the arterial roads and ~4400 VPH on the main highway.The result shows the ability of our model to improve overall traffic flow during accidents.Figure 13 shows that the traffic flow rate at the beginning of the simulation was the worst in the non-MLMS-ABM, whereas the difference between the three MLMS-ABM model cases was insignificant.The vehicular speeds for the same vehicle from the same distance during different traffic loads on arterial roads were compared, as shown in Figure 14.The vehicle was randomly chosen for this experiment.The histogram shows that the agent's average speed was higher during the application of the MLMS-ABM model compared to the non-MLMS-ABM application for all arterial traffic loads.However, the difference between speeds was modest during the maximum arterial traffic loads.Additionally, vehicles' average speeds were significantly higher during the application of all cases of the MLMS-ABM model with no or minimum arterial loads than during the medium and maximum load scenarios.As shown in Figure 14, the highest average vehicle's speed was recorded in the application of the deterministic case of the MLMS-ABM model.This result denotes the ability of the proposed model to improve the speed of vehicles.Figure 13 illustrates the model's capability to improve the vehicular traffic flow.The experiment ran on the maximum traffic load case with 1600 VPH in the arterial roads and ~4400 VPH on the main highway.The result shows the ability of our model to improve overall traffic flow during accidents.Figure 13 shows that the traffic flow rate at the beginning of the simulation was the worst in the non-MLMS-ABM, whereas the difference between the three MLMS-ABM model cases was insignificant.
Appl.Sci.2019, 9, x FOR PEER REVIEW 13 of 25 the overall travel time was better compared to the second case of the non-deterministic method.The travel time histogram is shown in Figure 12. Figure 13 illustrates the model's capability to improve the vehicular traffic flow.The experiment ran on the maximum traffic load case with 1600 VPH in the arterial roads and ~4400 VPH on the main highway.The result shows the ability of our model to improve overall traffic flow during accidents.Figure 13 shows that the traffic flow rate at the beginning of the simulation was the worst in the non-MLMS-ABM, whereas the difference between the three MLMS-ABM model cases was insignificant.The vehicular speeds for the same vehicle from the same distance during different traffic loads on arterial roads were compared, as shown in Figure 14.The vehicle was randomly chosen for this experiment.The histogram shows that the agent's average speed was higher during the application of the MLMS-ABM model compared to the non-MLMS-ABM application for all arterial traffic loads.However, the difference between speeds was modest during the maximum arterial traffic loads.Additionally, vehicles' average speeds were significantly higher during the application of all cases of the MLMS-ABM model with no or minimum arterial loads than during the medium and maximum load scenarios.As shown in Figure 14, the highest average vehicle's speed was recorded in the application of the deterministic case of the MLMS-ABM model.This result denotes the ability of the proposed model to improve the speed of vehicles.The vehicular speeds for the same vehicle from the same distance during different traffic loads on arterial roads were compared, as shown in Figure 14.The vehicle was randomly chosen for this experiment.The histogram shows that the agent's average speed was higher during the application of the MLMS-ABM model compared to the non-MLMS-ABM application for all arterial traffic loads.However, the difference between speeds was modest during the maximum arterial traffic loads.Additionally, vehicles' average speeds were significantly higher during the application of all cases of the MLMS-ABM model with no or minimum arterial loads than during the medium and maximum load scenarios.As shown in Figure 14, the highest average vehicle's speed was recorded in the application of the deterministic case of the MLMS-ABM model.This result denotes the ability of the proposed model to improve the speed of vehicles.Tables 2-4 show the proportionality of the vehicular travel time, flow rates, and average speed values, respectively, between the hypothetical road network and the I-25 road network with different loads on arterial roads.It can be seen that the average values are 0.9 in the first and second tables, and the average value is 1.5 in the third table except for the simulations with maximum arterial load.It can be concluded from the three tables that there was consistency between the two simulations.0.9 0.9 0.9 0.9 400 VPH 0.8 0.9 0.8 0.9 800 VPH 1.0 1.0 0.9 0.9 1600 VPH 0.9 0.9 0.

MLMS-ABM
0 VPH 0.9 1.1 1.0 0.9 400 VPH 0.9 1.0 1.0 0.9 800 VPH 1.0 0.9 0.9 0.9 1600 VPH 0.9 0.9 1.0 0.9 Tables 2-4 show the proportionality of the vehicular travel time, flow rates, and average speed values, respectively, between the hypothetical road network and the I-25 road network with different loads on arterial roads.It can be seen that the average values are 0.9 in the first and second tables, and the average value is 1.5 in the third table except for the simulations with maximum arterial load.It can be concluded from the three tables that there was consistency between the two simulations.0.9 0.9 0.9 0.9 400 VPH 0.8 0.9 0.8 0.9 800 VPH 1.0 1.0 0.9 0.9 1600 VPH 0.9 0.9 0.8 1.0 Table 3. Comparing flow rates for the hypothetical road network and the I-25 road network.

MLMS-ABM (Non-Deterministic) (Case 2)
Non_ MLMS-ABM 0 VPH 0.9 1.1 1.0 0.9 400 VPH 0.9 1.0 1.0 0.9 800 VPH 1.0 0.9 0.9 0.9 1600 VPH 0.9 0.9 1.0 0.9 As expected, the results, in general, show that the two versions of the MLMS-ABM routing model (deterministic and nondeterministic cases) always overcame the non-MLMS-ABM model under all experiments in the two traffic network scenarios (hypothetical and a real-world networks).The deterministic case of the MLMS-ABM routing model provided the quickest route times and best performance of improving the throughput.On the other hand, the non-deterministic cases of the proposed model overcame the deterministic one in improving the traffic flow rate.Additionally, the overall results show that the difference between the two cases of the MLMS-ABM model was insignificant when considering the vehicles' average speed for all arterial traffic loads.

Conclusions
In this paper, an integrated platform for modeling a complete range of real-world traffic problems has been proposed.The problem of achieving a system-optimal traffic flow has been addressed.One possible criteria to evaluate our model is the minimization of the total travel time of vehicles in a network by influencing the traffic distribution over open roads in a network.It is a difficult task to direct specific vehicles to specific paths in real time to avoid congestion or traffic jams when a massive number of vehicles are simultaneously involved.The proposed model was adapted for mass traffic congestion-scenarios by using concepts of static and dynamic floor fields.Additionally, a transition function of agent movement has been developed and adapted according to specific representations of individuals.Hypothetical and a real-world traffic networks based on data from the CDOT were investigated, and the results from both scenarios were compared to ensure that the data captured between both road networks for the different situations were consistent.
The results presented here demonstrate the applicability of our models to accurately simulate the events that occur during traffic congestion.The achieved results include both macroscopic and microscopic indicators.Various simulation scenarios were run that demonstrate different features of the proposed model.Considerable changes of traffic dynamics were detected during the simulations.These included avoiding obstacles and high-density areas and then selecting the best alternative route.A significant improvement of traffic flows during simulations was observed when compared to those observed with a non-ITS approach.These observations could influence multiple aspects of how traffic management is planned.Additionally, the MLMS-ABM model and the included decision-making sub-models were able to address the behaviors and intended behaviors of all agents.Taken together, the results show that the proposed multi-leveled multi-staged agent-based model has the ability to improve traffic dynamics during high density simulation.
Traffic modelling basically includes two observation levels: "Micro," which represents individual vehicles, and "macro," which represents groups of vehicles.The effectiveness of the model was confirmed by its ability to simulate large-size heterogeneous road network-coupling micro and macro models based on the ABM and CA techniques.The model also ensures the consistency of simulations in this coupling.The proposed dynamic hybrid simulation of traffic flow can dynamically partition a macro space into a set of micro agents.Additionally, the model enables dynamical switching between a macro representation and a micro representation of a traffic system.The behaviors of macro level components in the hybrid model are defined as the result of the behaviors of micro agents; at the same time, it is possible to define feedbacks from macro agents to micro.
The generality of the proposed model shows in how it handles agents in a homogeneous way.It allows the same agents, in the same simulation, to belong to different observation levels or different organizations.Whether the agents are "normal" or (as the result of an upgrading process) "intelligent," they are all managed by the model in the same way.The model provides all agents with appropriate and consistent behaviors.
The multi-level multi-stage modeling experiments confirmed the applicability of the model to for simulations of very complex systems.Communications, interactions, and information exchanges in the model are bidirectional between agents from a micro-macro couple, as well as between agents from each of these levels.Additionally, the upgrading/downgrading process simultaneously involves agents from both the micro and macro levels.
The structural characteristics of the MLMS-ABM model achieved the desired functional goals.Those goals include introducing abstraction levels in the model, visualizing interesting collective and/or individual behaviors, understanding coupling between micro-macro levels, and easily extending the model.In addition, the model meets the aim of dynamically adapting the level of detail of the simulation in order to improve computational efficiency.
The model may play an advisory role in traffic management because the MLMS-ABM model is able to explain the most technical aspects of the multi-level simulation that are not specific to an application domain.It can be generically applied, as it represents abstract and domain-free situations that are mainly characterized by the capacity of agents to execute their behavioral rules.
The MLMS-ABM model may provide support to urban and traffic decision-makers and managers, as it helps users to address different aspects of traffic management.By modeling individual vehicle's movement in complex road networks, the simulator provides transportation professionals with a clear picture of road network operation.The model covers both microscopic and macroscopic points of view, as each vehicle is individually modelled in its own route as well as groups of neighboring agents.The method described here is scalable to support the everyday activities of decision makers in other domains such as road network designers, crowd managers, and organizers of events in large, constrained areas.
Future improvement of the model includes the development of the CA model and the communication rules between agents, as well as the improvement of sub-procedures to enhance the decision-making process in traffic management.This would involve performing a similar body of work, capturing different applications of vehicle interaction such as intersection management.Another major perspective of future improvements of this work involves advanced collision avoidance strategies and the capturing of different applications of vehicle interactions.

Figure 3 .
Figure 3.An finite state machine (FSM) representation corresponding to state transition of the agent's behavior.

Figure 3 .
Figure 3.A finite state machine (FSM) representation corresponding to state transition of the agent's behavior.
Appl.Sci.2019, 9, x FOR PEER REVIEW 4 of 25 stamp.The transition probability, (, ) , to move to an unoccupied neighbor cell (, ) is determined by the four factors: Static target floor field (TFF), obstacles floor field (OFF) [32], dynamic floor field (DFF) [15,27], and the density around the next target cell (Den).TFF is used to indicate the distances to a destination for every agent in the environment.A TFF value is assigned to every cell to describe the distance to the earliest chosen target.The second floor field is made out of obstacle fields, which are considered repulsive forces.These two floor fields are static.The last two types of floor fields are the dynamic and density fields that give an indication of how the occupancy of every single cell surrounding the agent changes along with time in order to avoid collisions.

Figure 4 .
Figure 4.The next time-stamp target cells.

Figure 4 .
Figure 4.The next time-stamp target cells.

Figure 5 .
Figure 5.The segment of the real road network in Denver County.

Figure 5 .
Figure 5.The segment of the real road network in Denver County.

Figure 6 .
Figure 6.Screenshot of the simulation environment of the hypothetical road network.

Figure 7 .
Figure 7.Total travel time for rerouting around accident with different arterial loads.

Figure 6 .
Figure 6.Screenshot of the simulation environment of the hypothetical road network.

25 Figure 6 .
Figure 6.Screenshot of the simulation environment of the hypothetical road network.

Figure 7 .
Figure 7.Total travel time for rerouting around accident with different arterial loads.

Figure 7 .
Figure 7.Total travel time for rerouting around accident with different arterial loads.

Figure 8 .
Figure 8. Traffic flow during simulation time (hypothetical road network).

Figure 9 .
Figure 9.Total travel time for rerouting around accident during different traffic volumes with different arterial loads.

Figure 8 .
Figure 8. Traffic flow during simulation time (hypothetical road network).
Appl.Sci.2019, 9, x FOR PEER REVIEW 11 of 25 time progressed, the non-deterministic cases of the proposed model overcame the deterministic ones in the traffic flow rate.That could be due to the independence of some agents to choose their own route.In the general, the result indicates the ability of the model to improve overall traffic flow during accidents.

Figure 8 .
Figure 8. Traffic flow during simulation time (hypothetical road network).

Figure 9 .
Figure 9.Total travel time for rerouting around accident during different traffic volumes with different arterial loads.

Figure 9 .
Figure 9.Total travel time for rerouting around accident during different traffic volumes with different arterial loads.

Figure 10 .
Figure 10.Traffic throughput during simulation with different arterial loads.

Figure 11 .
Figure 11.Average vehicle speeds with different arterial loads (hypothetical road network).

Figure 10 .
Figure 10.Traffic throughput during simulation with different arterial loads.

Figure 10 .
Figure 10.Traffic throughput during simulation with different arterial loads.

Figure 11 .
Figure 11.Average vehicle speeds with different arterial loads (hypothetical road network).

Figure 11 .
Figure 11.Average vehicle speeds with different arterial loads (hypothetical road network).

Figure 12 .
Figure 12.Total travel time through the I-25 freeway in different methods with different traffic loads.

Figure 12 .
Figure 12.Total travel time through the I-25 freeway in different methods with different traffic loads.

Figure 12 .
Figure 12.Total travel time through the I-25 freeway in different methods with different traffic loads.

Figure 14 .
Figure 14.Vehicle's average speed with different arterial loads (real-world network).

Table 2 .Table 3 .
Comparing the total travel time for the hypothetical road network and the I-25 road network.Comparing flow rates for the hypothetical road network and the I-25 road network.

Table 4 .
Comparing the average vehicle speed for the hypothetical road network and the I-25 road network.

Figure 14 .
Figure 14.Vehicle's average speed with different arterial loads (real-world network).

Table 2 .
Comparing the total travel time for the hypothetical road network and the I-25 road network.

Table 4 .
Comparing the average vehicle speed for the hypothetical road network and the I-25 road network.

Table 1 .
Comparing the MLMS-ABM model and other selected intelligent transportation systems (ITS) models.