# The Environmental Impact of Inland Empty Container Movements Within Two-Depot Systems
## 4. ABM Formulation
### Entities and State Variables  
The following tables outline key entities and state variables in the NetLogo simulation model, including trucks, depots, ports, customers, and links. In Table 1, each entity is defined by specific attributes that govern its role. Additionally, the core sets representing agents and network elements are listed in Table 2, while the associated system parameters relevant to container flows, demand, and emissions are detailed in Table 3. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Agent** & **Attribute** & **Type** & **Description** \\ \hline \multirow{6}{*}{**Trucks**} & _Loaded_? & Boolean & Whether carrying a full container or empty one \\ \cline{2-4}  & _MPath_ & List & Sequence of nodes defining the current route. \\ \cline{2-4}  & _MDestination_ & Agent & Target (port, depot, or customer). \\ \cline{2-4}  & _MEmission_ & Number (kg) & Cumulative CO\({}_{2}\) emissions. \\ \cline{2-4}  & _MNode_ & Node & Current location in the road network. \\ \hline \multirow{6}{*}{**Depots**} & _DepName_ & String & Depot ID. \\ \cline{2-4}  & _StorageCap_ & Number (container) & The maximum number of containers (default: 1000). \\ \cline{2-4}  & _StorageSts_ & Number (container) & The number of containers in stock. \\ \cline{2-4}  & _MNode_ & Node & Nearest road network node. \\ \hline \multirow{2}{*}{**Ports**} & _MNode_ & Node & Fixed location in the road network. \\ \hline \multirow{6}{*}{**Customers**} & _CusID_ & Number & Unique identifier for each customer. \\ \cline{2-4}  & _DemandFreq_ & Number (days) & Days between container requests from 1 to 6. \\ \cline{2-4}  & _TDemand_ & Number & Unmet requests. \\ \cline{2-4}  & _WaitDays_ & Number (days) & Number of days waiting for fulfillment. \\ \cline{2-4}  & _MNode_ & Node & Nearest road network node. \\ \hline \multirow{2}{*}{**Links**} & _Node/Location_ & GIS Coordinates & Spatial position. \\ \cline{2-4}  & _FnodeLnode_ & Boolean & Flags for route endpoints. \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Agents. \begin{table}
\begin{tabular}{c c} \hline \hline
**Set** & **Description** \\ \hline \(N=\{\text{JIP},\text{RSGT},\text{OHT},C_{1},C_{2},\dots,C_{m}\}\) & Set of nodes, where \(C_{i}\) represents customer locations. \\ \hline \(T=\{1,2,\dots,|T|\}\) & Set of trucks, indexed by \(t\). \\ \hline \(K=\{1,2,\dots,|K|\}\) & Set of time periods (e.g., minutes or days, depending on granularity), indexed by \(k\). \\ \hline \(A=\{(i,j)\mid i,j\in N\}\) & Set of directed arcs, representing possible truck routes between nodes. \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Sets. Table 1 shows several types of agents that represent the key components of the simulation model. The port agent type signifies the main location represented in Jeddah Islamic Port where trucks load and unload containers. The truck agent type represents the vehicles transporting 20-foot containers, each with parameters like _Loaded?_ (indicating whether the truck is carrying a load), _MDestination_ (the current target location), and _MPath_ (the route to follow). Depots are agents that hold storage capacity for containers and current storage levels, facilitating the management of container inventory. The first depot is Red Sea Gateway Terminal (RSGT) and the second one is Mansour Al Otaibi & Partners Group (OHT). Customers represent various client locations, characterized by parameters such as _TDemand_, which tracks the number of containers needed, and _Demand_Freq_, determining how often they request shipments. Lastly, nodes act as intermediate points on the truck routes, helping to define the geographical structure of the road network. The model's global parameters, including total emission and time-tracking variables (current-minute, current-hour, current-day, and current-year), support the simulation by providing essential data on emissions and the progression of time within the model.