# A Lookahead Behavior Model for Multi-Agent Hybrid Simulation
## 4 The Lookahead Behavior Model
### Time Window-Based Lookahead  
The time window-based lookahead is proposed to solve the RI problem. The core of the problem is how to accurately predict the resynchronization interval that may occur between agents in the context of hybrid simulations. In order to fully exploit the efficiency of DES in the background of a military decision-making system, our work is founded on the implicit modeling-based discrete approach. Thus, the issue becomes how to accurately predict the interaction between the implicit models of the two agents. Further, the interaction events that occur between the implicit models are related to the action being performed by the agent. The change of the internal implicit model corresponds to the change of the internal state transition function of the model. This change is determined only by the action of the model itself. Before the performance of a certain action, the time interval and the corresponding state transition function can be obtained. Therefore, the lookahead process should be finished before each action, in order to predict the interaction between the corresponding internal models of two agents. The basic idea of the time window-based lookahead is to provide a time window determined by the duration affected by the action and to use the internal model related to the action to determine when the interaction events may happen during that period. The time window and interaction event are defined as follows:  
**Definition 2**. : _(Time window): A time window \(T_{window}\) in a lookahead step of an agent agent\({}_{k}\) can be defined as:_  
\[T_{window}=[t_{current},t_{current}+t_{duration}(a_{0}^{k})]\]  
_where \(t_{current}\) is the current simulation time which satisfies \(t_{current}=t_{start}(a_{0}^{k})\). This means that action \(a_{0}^{k}\) is the next action to be performed at once for agent\({}_{k}\), \(t_{duration}(a_{0}^{k})\) is the duration of the next action for agent\({}_{k}\), and \(t_{current}+t_{duration}(a_{1}^{k})\) is the end time of the time window, which is also the end time of the next action for the agent._  
**Definition 3**. : _(Interaction event): An interaction event \(Event_{k}\) for two agents (referred to as agent\({}_{k}\) and agent\({}_{l}\)) is structured as:_  
\[Event_{k,l}=<agent_{sender},agent_{receiver},t_{create},t_{occur},interaction _{k,l}>\]  
Figure 4: The “sense-think-lookahead-act” behavior model. _where:_  
\(agent_{\text{sender}}\) _is the sender of_ \(Event_{k}\) _interaction event, and can be agent_\({}_{k}\) _or agent_\({}_{l}\)_;_  
\(agent_{\text{receiver}}\) _is the receiver of_ \(Event_{k}\)_, and is an alternative choice;_  
\(t_{create}\) _is the creating time of_ \(Event_{k}\)_;_  
\(t_{occur}\) _is the occurring time of_ \(Event_{k}\)_; and_  
\(interaction_{k,l}\) _represents the corresponding interaction._  
In Definition 3, the sender and the receiver of the event can be specified according to the specific kind of interaction, facilitating the sender to trigger the state transition of the receiver. When a primary updating agent \(agent_{k}\) is going to perform its next action \(a_{1}^{k}\), there can be two situations for the state change during the performing of \(a_{1}^{k}\). The first one refers to the situation where no other agents interact with the primary updating agent during \(a_{1}^{k}\). It is known that action \(a_{1}^{k}\) initiates a process of internal state transition \(\delta_{\text{int}}^{k}\), which means the agent will spend time on performing \(a_{1}^{k}\). At this point, the state of the primary updating agent can be described as being driven by two events, specifically, the start of the \"action\" and the end of the \"action\". Other state transitions for this action are implied in the internal state transition function \(\delta_{\text{int}}^{k}\). For example, in a military simulation of the Anglo-Zulu War [8], Zulu agents can be initialized with a preset movement vector to straight in the direct of the British line.