## 4 Method
### 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  
Figure 2: MLMS-ABM layers.  
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.  
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].