# A Novel Dynamic Approach for Risk Analysis and Simulation Using Multi-Agents Model
## 6 Generic Dynamic ABMS (GDABM) for Risk Analysis
### Behavioral Modes (BMs)  
In the field of risk analysis, the concept of agent mode defines the agent's operational behavior in the presence of failure conditions. In the same way, the _nominal agent mode_ defines the agent's operational behavior without the presence of any failure. _Behavioral modes_ (BM) define the agent's behavior in both its nominal and degraded modes. BM describes the dynamic behavior of a multi-agent system by continuously measuring the behavior of each agent in that system. As cited in Section 4, an agent is defined by a set of variables, attributes, and behavioral modes. Its dynamic movement in a behavioral mode \(M_{i}\) is defined using a set of sequential modules/blocks represented as activity blocks. Those modules can be of 4 types, as shown in Figure 5.  
1. Start Module (SM) : It is the starting point at which the agent is created and ready to process. 2. Activity Process Module (APM) : It represents the various activities to be processed by an agent **a**. It describes the interaction between a and other system agents. Such activities may include creating new agents or deleting existing ones. APM has the following characteristics, as shown in Figure 6.  
1. A mathematical relation : It can be of two types: * Discrete relations \(f_{i}\): \[x(k+1)=f_{i}(x(k),y(k),u(k),v(k)),M(f_{i});\] (1)  
Figure 4: Proposed features to be added for the classical agent model. Figure 5: Behavioral mode of an agent. * Continuous relations \(g_{i}\): \[x^{*}(k)=g_{i}(x^{*}(k),y(k),u(k),v(k)),M(g_{i});\] (2) where: \(x(k)\): finite set of agent \(\mathbf{a}\) variables; \(y(k)\): finite set of agent \(\mathbf{a}\) attributes; \(u(k)\): variables of agents in relations with \(\mathbf{a}\); \(v(k)\): attributes of agents in relations with \(\mathbf{a}\); \(M(f_{i})\): set of behavioral modes \(M(f_{i})\subseteq BM\), when \(f_{i}\) is valid; \(M(g_{i})\): set of behavioral modes \(M(g_{i})\subseteq BM\), when \(g_{i}\) is valid; \(x^{*}\): subset \(x^{*}\subseteq x\) of the agents variables; 2 A duration : It is the time required to execute the activity process; 3 Consumable Input Agents: They are consumable agents that help to generate the output agents. 4 Non-consumable Input Agents : They are non-consumable agents that should be allocated to the agent activity to perform a certain task then get released on task completion. 5 Output Agents: They are the agents produced at the end of the activity. 6 Activity Agent: It is the agent executing the activity. 7 Activity engine: It is the core of the activity process that identifies the inputs/outputs agents and controls the actions among different activity components. It describes how to generate output agents using input agents. 8 Inputs Actions: They are pre-actions that should be performed just before the execution of the APM (e.g., allocating non-consumable agents for a certain amount of time) 9 Outputs Actions: They are post-actions that should be performed once the APM is performed (e.g., deallocating non-consumable agents after the task is completed). 9 Filtering Conditions: Which precise the criteria required for consumable/non-consumable agents of the activity. 10 Decision Making Module (DMM): It is the module responsible for checking some conditions on the agent's variables. The result decides how the agent proceeds. 11 End Module (EM) : It is the point where the agent is terminated and deleted from the system. 12 Making a coffee represents an example of the Activity Process Module. In the coffee preparation process, the following assumptions are used:
* Duration is the amount of time to make a cup of coffee which is assumed to be 45 s.
* Consumable input agents are coffee powder, water, electricity, and an empty cup. * Non-consumable input agents are coffee room and the coffee table. * Output agent is the prepared cup of coffee. * Input action is the process of reserving the coffee machine/making the water temperature 65. * Output action is the process of releasing the coffee machine.