# A Lookahead Behavior Model for Multi-Agent Hybrid Simulation
## 5 Case and Experiments
### Modeling of Lookahead  
In the above scenario, the manner in which the time window-based lookahead process is realized was demonstrated through the interaction between one MovingAgent and one StaticAgent, as follows:  
Two agents are in the scenario: the MovingAgent and the StaticAgent, as shown in Figure 6. Current simulation time is \(t_{1}\). The MovingAgent is fetching the first action of \(a_{move}\) from its action list, as it is going to arrive at point B linearly at constant speed at \(t_{2}\). The StaticAgent is an attacking agent located at point C. The sense model of the StaticAgent is a simplified time-delayed sense model with a detection range of R, and a delayed detection time of \(t_{D}\).  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Size of virtual space & 10,000 \(\times\) 10,000 \\ Number of agents in total & 10, 20, 30, 50, 70, 100, 200, 300, 400, 500, 600 \\ Speed of MovingAgent & Random number, 1–100 \\ Detection radius of StaticAgent & Random number, 0–50 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Experiment configurations.  
According to the sequence of events that an event scheduler processes to advance the simulation clock, the procedure of the lookahead and act of the \(a_{move}\) can be simulated as follows:  
Step 1: Perform lookahead for \(a_{move}\), current simulation time is \(t_{1}\).  
Create and schedule the endMoving event \(E_{EndMoving}\) with processing time of \(t_{2}\). Create the time window \(T_{1}=[t_{1},t_{2}]\). Then, predict the interactions between the MovingAgent and the StaticAgent during \(T_{1}\), which are \(interaction_{EnterDetection}\) and \(interaction_{ExitDetection}\), with occurring time of \(t_{3}\) and \(t_{4}\). Next, create and schedule interaction events \(E_{EnterDetection}\) and \(E_{ExitDetection}\).  
Step 2: Process event \(E_{EnterDetection}\), current simulation time is \(t_{3}\).  
In this step, the StaticAgent creates and schedules the detection event \(E_{Detection}\) at \(t_{3}+t_{D}\).  
Step 3: Process event \(E_{Detection}\), current simulation time is \(t_{3}+t_{D}\).  
The StaticAgent performs \"sense\" behavior, adds the MovingAgent into the target list, and the states are resynchronized between the MovingAgent and the StaticAgent. It is assumed that the StaticAgent decides on an attacking action \(a_{attack}\) at \(t_{5}\). Then, the lookahead event \(E_{lookaheadAttack}\) is created and scheduled at \(t_{5}\) to predict the attacking action's effect.  
Step 4: Process event \(E_{lookaheadAttack}\); current simulation time is \(t_{5}\).  
In this step, the \(E_{Attack}\) is created and scheduled attacking action at \(t_{5}\).  
Step 5: Process event \(E_{Attack}\); current simulation time is \(t_{5}\).  
Step 6: Process event \(E_{ExitDetection}\); current simulation time is \(t_{4}\).  
Create and schedule the lose detection event \(E_{LoseDetection}\) for StaticAgent at \(t_{4}\).  
Step 7: Process event \(E_{LoseDetection}\); current simulation time is \(t_{4}\).  
The StaticAgent performs \"sense\" behavior; delete the MovingAgents from the target list.  
Step 8: Process event \(E_{EndMoving}\); current simulation time is \(t_{2}\).  
The MovingAgent arrives at the destination. The procedure ends, and the action \(a_{move}\) is completely performed.  
The lookahead process in Step 1 predicts two interactions caused by detection of the StaticAgent, which results in resynchronization between the MovingAgent and the StaticAgent, and divides the moving action into several sub-motions. In Figure 7, the resynchronization between the MovingAgent and the StaticAgent occurs at simulation time \(t_{3}\), \(t_{3}+t_{D}\), \(t_{5}\), and \(t_{4}\). In the time window from \(t_{1}\) to \(t_{2}\), the state updates for the MovingAgent are skipped over without any interactions between the MovingAgent and the StaticAgent, except for those at the resynchronization point.  
Figure 6: The small scenario of the test case.