Keywords

1 Introduction

One of the critical points in the construction of artificial intelligent systems, capable of solving practical problems without significantly simplifying them, is modeling the teamwork of specialists. The need for such modeling is caused by both the inherent features of the problem (opacity, heterogeneity, polypersonality, etc.) [26, 29], and the impossibility of building an omniscient centralized intelligent system with all the necessary resources, knowledge and tools to solve various problems [9].

In order to simulate the work of a team of specialists in solving problems “at a round table”, an approach based on hybrid intelligent multi-agent systems (HIMAS) is proposed in [11]. The elements of such systems are agents, i.e. relatively autonomous software entities, characterized by proactivity, reactivity and social behavior [7, 31]. The distinctive features of HIMAS’s agents are goal-setting mechanisms, and developed domain models necessary to imitate the intelligent activity of specialists in solving a problem and its parts, as well as methods of various intelligent technologies. Thus, HIMAS combines the advantages of two technologies: hybrid intelligent systems (HIS) [11] and multi-agent systems (MAS) [7, 31]. HIMAS, by analogy with HIS, makes it possible to integrate methods for solving problems of various intelligent technologies into a single system, synthesizing from them a hybrid method that is relevant to the complexity of the problem posed. As in MAS, in HIMAS, the general behavior of the system is determined by the interaction of relatively autonomous agents, the interaction protocol and the roles of which are determined during the problem-solving, allowing to model group macro-level processes.

The HIMAS agents proposed in [11] had a common domain model and communication protocol, and their goals were determined by the developers at the design stage and did not change while solving the problem. This approach is relevant to a situation, when all HIMAS agents are designed by one development team to solve a relatively simple, “model” problem. If the problem is so complex that it is required to gather agents built by different developers, it takes significant labor to combine them into a single system. To simplify this procedure, cohesive hybrid intelligent multi-agent systems (CHIMAS) are proposed in [15], agents of which independently agree on their goals, domain model and version of the problem-solving protocol. The presence of these coordination mechanisms makes the system more relevant to a team of specialists, who, in the course of long-term joint work, develop an agreed point of view on the problem, learn to take into account each other’s goals, and develop norms of interaction in the process of solving problems. In this paper, one of the methods necessary for implementation of CHIMAS is considered, namely, measuring the consistency of versions of the problem-solving protocol, independently built by the different agents. This paper expands and complements the work [10], presented at XI International Scientific and Technical Conference “Open Semantic Technologies for Intelligent Systems” (OSTIS-2021).

2 Cohesion Phenomenon

The phenomenon of group cohesion, among other macro-level group processes, is studied in group dynamics, a direction of social psychology, created by K. Levin. According to the stratometric concept (SC) of cohesion by A.V. Petrovsky [23], team cohesion could be considered at three layers (strata), which correspond to three levels of group evolution:

  • external level, at which cohesion is caused by emotional interpersonal relationships [3, 8, 30];

  • value-orientational unity (VOU), which considers cohesion as the unity of members’ basic values, arising as a result of joint activities [1, 23, 28, 30];

  • core, at which common values causing cohesion arise because members share the team goals [20, 24, 30].

Comprehensive reviews of the current state of group cohesion research are given in [20, 25, 27]. According to them, the phenomenon of group cohesion corresponds to the emergence of a socio-psychological community and group properties, which prevent its destruction [30]. A study of different types of groups, for example, sports teams, military units, working groups for solving business problems, demonstrates an increase in the effectiveness of the group with an increase of its cohesion [5]. It should be noted, however, that the processes that ensure group cohesion can also lead to undesirable effects such as conformal behavior and groupthink, so it is important to avoid too high level of cohesion, especially based on emotional interpersonal relationships [2]. In this regard, cohesion modeling in CHIMAS is limited to VOU and core levels.

3 Cohesive Hybrid Intelligent Multi-agent System Model

The CHIMAS model is the HIMAS model [11], extended with the elements necessary to model cohesion in accordance with A.V. Petrovsky’s SC [23]:

$$\begin{aligned} chimas={<}AG,env,INT,ORG,MLP{>}, \end{aligned}$$
(1)

where AG represents the set of system’s agents, which includes the subset of agents-specialists \(AG^{sp}\), the agent-facilitator (AF) \(ag^{fc}\), and the decision-making agent \(ag^{dm}\) [15]; env is the conceptual model describing environment of the CHIMAS; INT is the set of the elements that formalizes interaction of agents (2); ORG is the set of architectures, i.e. possible states of the system with established relationships between CHIMAS agents; MLP is the three-element set of macro-level processes’ models

$$\begin{aligned} MLP=\{glng,\ ontng, protng\}, \end{aligned}$$

where glng represents agents’ goal negotiation model, ensuring cohesion at the core level of the SC; ontng is the model describing negotiation of the agents’ ontologies that corresponds to the exchange of knowledge in the team of specialists and models processes of the VOU strata; protng is the model of problem-solving protocol negotiation simulating interaction norms coordination in the real teams of specialists at the VOU level of the SC.

The set INT of the elements formalizing interactions (1) is denoted as follows:

$$\begin{aligned} INT=\{prot_{bsc},PRC,LANG,ont_{bsc},chn\}, \end{aligned}$$
(2)

where \(prot_{bsc}\) denotes basic interaction protocol describing communication acts necessary to develop a cohesive problem-solving protocol; PRC is the set of blocks (elements) used to construct problem-solving protocol by agents; LANG are the languages used by agents for coding transmitted messages; \(ont_{bsc}\) is the basic ontology (4) providing agents’ interpretation of messages’ semantics during negotiation their ontologies, goals, and protocols, as well as defining basic concepts for agents’ domain specific ontologies; chn is key characteristic of the CHIMAS’s state, namely the degree of its agents’ cohesion, described as follows:

$$\begin{aligned} chn={<}gls,onts,protc{>}, gls,onts,protc\in [0,1], \end{aligned}$$

where gls, and onts are the degrees of similarity of agents’ goals [16] and ontologies [18] respectively; protc is the degree of consistency of the problem-solving protocol, evaluation of which is considered in the following section. The cohesion value \(chn_{i\ j}^{ag}\) between agents \(ag_i, ag_j \in (AG^{sp}\cup \{ag^{dm}\})\) is determined by its components: \(gls_{i\ j}^{ag}\), \(onts_{i\ j}^{ag}\) and \(protc_{i\ j}^{ag}\). Agents, when negotiating goals, ontologies, and versions of problem-solving protocol, use this value as an optimality criterion. Cohesion of CHIMAS as a whole is calculated as arithmetic mean of cohesion values \(chn_{i\ j}^{ag}\) between all pairs of CHIMAS agents. This value is used by AF’s fuzzy inference model to estimate CHIMAS’s state and to choose methods of collective problem-solving relevant to it. AF tends to choose methods, increasing cohesion, when its value low, which means that CHIMAS’s agents have incompatible goals, ontologies and versions of the problem-solving protocol, and decreasing it if its value is too high to prevent conformal behavior.

The common model of an agent \(ag\in AG\) (1) is defined by the expression:

$$\begin{aligned} ag={<}id^{ag},gl^{ag},LANG^{ag},ont^{ag},OCM^{ag},ACT^{ag},prot^{ag}{>}, \end{aligned}$$
(3)

where \(id^{ag}\) is name or identifier of the agent; \(gl^{ag}\) is the fuzzy set defining goal of the agent; \(LANG^{ag} \subseteq LANG\) is the subset of available languages; \(ont^{ag}\) is the domain specific ontology of the agent (4); \(OCM^{ag}\) is the set of mappings of ontology concepts; \(ACT^{ag}\) is the set of agent’s actions or functions, which contains, among others, goal, ontology and protocol negotiation; \(prot^{ag}\) is the model of the agent’s version of the problem-solving protocol (5), which defines a scheme for information and knowledge exchange between agents [6].

The common ontology model, which describes both basic \(ont_{bsc}\) (2) and agent \(ont^{ag}\) (3) ontologies, is represented by the following expression [12]:

$$\begin{aligned} ont={<}L,C,R,AT,FC,FR,FA,H^{c},H^{r},INST{>}, \end{aligned}$$
(4)

where L is the set of lexemes subdivided into subsets of lexemes which denote concepts \(L^c\), relations \(L^r\), attributes \(L^{at}\), and their values \(L^{va}\); C is the set of concepts; \(R:C\times C\) are relations, established between concepts; \(AT:C\times L^{va}\) is the set of attributes of concepts C; \(FC:2^{L^c}\rightarrow 2^C\) is the function that links lexemes from L and concepts from C; \(FR:2^{L^r}\rightarrow 2^R\) is the function linking lexemes with relations; \(FA:L^{at}\rightarrow AT\) is the function, which links lexemes with attributes; \(H^c=C\times C\) is the taxonomic hierarchy of concepts; \(H^r=R\times R\) is the hierarchy of relations; INST is the set of instances, which are “ground-level”, specific elements of a concepts [4].

The problem-solving protocol \(prot^{ag}\) from (3) is described by the expression

$$\begin{aligned} prot^{ag}={<}ROL,MTP,MRC,sch{>}, \end{aligned}$$
(5)

where \(ROL\subseteq C\), and \(MTP\subseteq C\) are the sets of ontology concepts, which describe the agent roles of and message types respectively; MRC is the correspondence between pairs of agent roles and admissible message types; sch is the message exchange scheme model, determining the expected reaction of the agent taking the role to messages of each type.

Description of the message exchange scheme model sch (5) uses the formalism of Petri nets [22]. Petri net is a tuple, defined by the following expression:

$$\begin{aligned} pn={<}PL,TR,IR{>}, \end{aligned}$$

where \(PL\subseteq C\), and \(TR\subseteq C\) are the sets of places and transitions respectively; \(IR\subseteq (PL\times TR)\cup (TR\times PL)\) is the incidence relation between places and transitions. The message exchange scheme model is a multi-agent interaction protocol net (MIP-net), consisting of a set of synchronized Petri nets, which can be divided into two types: agent workflows net an (A-net) and interaction protocol net ipn (IP-net) [14]. A-net is a connected Petri net, in which there is a source-place, indicating the beginning of the process, and a sink-place, denoting the end of the process. IP-net is a Petri net, containing an input transition, before which there are no other elements of the network, a set of output transitions, after which there are no other elements of the network, as well as two disjoint subsets, the transitions of each of which are connected by synchronous communication elements \(tr^{SC}\in TR^{SC}\) with transitions of the A-net, corresponding to the subset, based on multiple synchronization relations \(R^{SC}\).

Thus, the message exchange scheme model sch is a multi-agent interaction protocol net (MIP-net), defined by the expression [14]

$$\begin{aligned} sch^{ag}={<}AN,IPN,TR^{SC},R^{SC},RAC,MRIPC{>}, \end{aligned}$$

where \(RAC\subseteq ROL\times AN\) is the mapping of the set of agent roles to the set of A-nets; \(MRIPC\subseteq MRC\times IPN\) is the mapping of the correspondence of pairs of agent roles and admissible types of messages for each pair to a set of IP-nets.

4 Protocol Consistency Evaluation Model

To evaluate the consistency of versions of the problem-solving protocol, developed by different agents, the similarity of the components of the tuples (5) describing them have to be calculated. For this purpose, the similarity measure of concepts have to be introduced

$$\begin{aligned} S^C(c_k,c_m)=\sqrt{LSC(c_k,c_m)TS(c_k,c_m)}, \end{aligned}$$
(6)

where LSC, and TS are the lexicographic (7) and taxonomic (9) similarity of concepts.

The lexicographic similarity of two concepts is described as follows:

$$\begin{aligned} LSC(c_k,c_m)=LSL(FC^{-1}(c_k),FC^{-1}(c_m)), \end{aligned}$$
(7)

where \(FC^{-1}:C\rightarrow L^c\) is the function, inverse to FC, which maps a concept to corresponding lexeme; LSL is the lexeme similarity, described as follows

$$\begin{aligned} LSL(l_k,l_m)=\max (0,\ 1-ed(l_k,l_m){\min (|l_k|,|l_m|)}^{-1}), \end{aligned}$$
(8)

where ed is Levenshtein’s editorial distance [13], i.e. the number of characters, which have to be changed, added or removed to make lexemes equal.

The taxonomic similarity of the concepts is the ratio of the number of common superconcepts of both concepts to the number of all their superconcepts

$$\begin{aligned} TS(c_k,c_m,H_k^c,H_m^c)=\frac{|FC^{-1}(UC(c_k,H_k^c))\cap FC^{-1}(UC(c_m,H_m^c))|}{|FC^{-1}(UC(c_k,H_k^c))\cup FC^{-1}(UC(c_m,H_m^c))|}, \end{aligned}$$
(9)

where UC is the upper cotopy [19], which is defined as follows:

$$\begin{aligned} UC(c,H^c)=\{c_k\in C|H^c(c,c_k)\vee (c=c_k)\}. \end{aligned}$$

To evaluate the similarity of the sets of agent roles \(ROL_i^{ag}\), \(ROL_j^{ag}\), a concept correspondence is formed based on the similarity measure of concepts (6) according to the following rule:

$$\begin{aligned} \begin{gathered} MRL_{i\ j}=\{(u,v)|(u,v)\in ROL_i^{ag}\times ROL_j^{ag}\wedge v=\underset{v'\in C_j}{\mathop {\arg \max }}\,{S^C}(u,v') \\ \wedge u=\underset{u'\in C_i}{\mathop {\arg \max }}\,{S^C}(u',v)\}. \end{gathered} \end{aligned}$$
(10)

Using (10), the similarity of the sets \(ROL_i^{ag}\), \(ROL_j^{ag}\) is determined as follows

$$\begin{aligned} \begin{gathered} ROLS(ROL_{i}^{ag},ROL_{j}^{ag})\\ =\left| (ROL_{i}^{ag}) \right| ^{-1}\sum \limits _{mrl\in MRL_{i\ j}}{S^C}\left( proj_1(mrl),\ proj_2(mrl)\right) . \end{gathered} \end{aligned}$$
(11)

By analogy with (10), to evaluate the similarity of the sets of message types \(MTP_i^{ag}\), \(MTP_j^{ag}\), the correspondence between them is introduced, based on the measure of similarity of concepts (6), in accordance with the expression

$$\begin{aligned} \begin{gathered} MMT_{i\ j}=\{(u,v)|(u,v)\in MTP_i^{ag}\times MTP_j^{ag}\wedge v=\underset{v'\in C_j}{\mathop {\arg \max }}\,{S^C}(u,v') \\ \wedge u=\underset{u'\in C_i}{\mathop {\arg \max }}\,{S^C}(u',v)\}. \end{gathered} \end{aligned}$$
(12)

Using the correspondence (12), the similarity of the sets \(MTP_i^{ag}\), \(MTP_j^{ag}\) is determined by the following expression:

$$\begin{aligned} \begin{gathered} MTPS(MTP_i^{ag},MTP_j^{ag})={\left| (MMT_{i}^{ag})^{-1} \right| }\\ *\sum \limits _{mmt\in MMT_{i\ j}}{{S^C}}\left( proj_1(mmt),\ proj_2(mmt)\right) . \end{gathered} \end{aligned}$$
(13)

To evaluate the similarity the third components of the tuples (5), i.e. correspondences \(MRC_i^{ag}\), \(MRC_j^{ag}\), abbreviated correspondences have to be constructed between compatible pairs of agent roles and message types

$$\begin{aligned} \begin{gathered} MRC_i^*=\{(t,u,v)|(t,u,v)\in MRC_i^{ag}\wedge t\in proj_1(MRL_{i\ j})\\ \wedge u\in proj_1(MRL_{i\ j})\wedge v\in proj_1(MMT_{i\ j})\}, \end{gathered} \end{aligned}$$
(14)
$$\begin{aligned} \begin{gathered} MRC_j^{**}=\{(MRL_{i\ j}^{-1}(t),MRL_{i\ j}^{-1}(u),MMT_{i\ j}^{-1}(v))|(t,u,v)\in MRC_j^{ag} \\ \wedge t\in proj_2(MRL_{i\ j})\wedge u\in proj_2(MRL_{i\ j})\wedge v\in proj_2(MMT_{i\ j})\}. \end{gathered} \end{aligned}$$
(15)

Using (14), (15), the similarity of correspondences \(MRC_i^{ag}\), \(MRC_j^{ag}\) between pairs of agent roles and admissible types of messages for each pair is calculated

$$\begin{aligned} MRCS(MRC_{i}^{ag},MRC_{j}^{ag})=\frac{\left| MRC_{i}^{*}\cap MRC_{j}^{**} \right| }{\left| MRC_{i}^{{}} \right| +\left| MRC_{j}^{{}} \right| -\left| MRC_{i}^{*}\cap MRC_{j}^{**} \right| }. \end{aligned}$$
(16)

The similarity of the message exchange scheme is determined on the basis of the notion of the transition adjacency relation (TAR) [21]. The TAR in a Petri net defines a set TAR of ordered pairs \({<}t{{r}_{i}},t{{r}_{j}}{>}\) of transitions that can be performed one after another. As shown in [32], the similarity of two Petri nets \(pn_i\), \(pn_j\) with TARs \(TAR_i\), \(TAR_j\) is determined by the expression

$$\begin{aligned} PS(pn_i,pn_j)={\left| TAR_i\cap TAR_j \right| }{\left| TAR_i\cup TAR_j\right| }^{-1}. \end{aligned}$$

Extension of this measure to the case, when the transitions of the compared Petri nets are defined on different ontologies, is described as follows:

$$\begin{aligned} \begin{gathered} PNS(pn_{k}^{i},pn_{l}^{j})={{\left| TR_{t\ k}^{i} \right| }^{-1}}\sum \limits _{mtr\in MTR_{t\ l\ k}^{j\ i}}{{{S}^{C}}(pro{{j}_{1}}(mtr),pro{{j}_{2}}(mtr))} \\ *{\left| TAR_{t\ k}^{i}\cap F_{j\ i}^{tr}(TAR_{t\ l}^{j},pn_{k}^{i}) \right| }{\left| TAR_{t\ k}^{i}\cup F_{j\ i}^{tr}(TAR_{t\ l}^{j},pn_{k}^{i}) \right| }^{-1}, \end{gathered} \end{aligned}$$
(17)

where \(F_{j\ i}^{tr}(TAR_{t\ l}^{j},pn_{k}^{i})\) is the function that replaces, if possible, transitions in \(TAR_{t\ l}^{j}\) to the corresponding transitions from \(pn_{k}^{i}\). It is defined by the expression

$$\begin{aligned} \begin{gathered} F_{j\ i}^{tr}(TAR_{t\ l}^{j},pn_{k}^{i})=\{{<}q,w{>}\,|\,{<}u,v{>}\in TAR_{t\ l}^{j}\wedge ((q=MTR_{t\ l\ k}^{j\ i}(u) \\ \wedge q\in pro{{j}_{1}}(MTR_{t\ l\ k}^{j\ i}))\vee (q=u\wedge q\notin pro{{j}_{1}}(MTR_{t\ l\ k}^{j\ i}))) \\ \wedge ((w=MTR_{t\ l\ k}^{j\ i}(v)\wedge w\in pro{{j}_{1}}(MTR_{t\ l\ k}^{j\ i}))\\ \vee (w=v\wedge w\notin pro{{j}_{1}}(MTR_{t\ l\ k}^{j\ i})))\}, \end{gathered} \end{aligned}$$

where \(MTR_{t\ l\ k}^{j\ i}\) is the correspondence between transitions of the nets \(pn_{l}^{j}\) and \(pn_{k}^{i}\), described by the expression

$$\begin{aligned} \begin{gathered} MTR_{t\ l\ k}^{j\ i}=\{(u,v)|(u,v)\in pro{{j}_{2}}(pn_{l}^{j})\times pro{{j}_{2}}(pn_{k}^{i})\wedge ((t=``a" \\ \wedge pn_{k}^{i}=an_{k}^{i}\wedge pn_{l}^{j}=an_{l}^{j})\vee (t=``ip"\wedge pn_{k}^{i}=ipn_{k}^{i}\wedge pn_{l}^{j}=ipn_{l}^{j})) \\ \wedge v=\underset{v'\in C_{i}^{{}}}{\mathop {\arg \max }}\,{{S}^{C}}(u,v')\wedge u=\underset{u'\in C_{j}^{{}}}{\mathop {\arg \max }}\,{{S}^{C}}(u',v)\}. \end{gathered} \end{aligned}$$

Using expression (17), the similarity of the message exchange schemes could be evaluated as follows:

$$\begin{aligned} \begin{gathered} SCHS(sch_{i}^{ag},sch_{j}^{ag})={{\left( \left| MR{{L}_{i\ j}} \right| \left| MRC_{i}^{*} \right| \right) }^{-1/2}} \\ *\sqrt{{ \sum \limits _{mrl\in MR{{L}_{i\ j}}}{PNS\text {(}RA{{C}_{i}}(pro{{j}_{1}}(mrl))\text {, }RA{{C}_{j}}(pro{{j}_{2}}(mrl))\text {)}} }} \\ \text {*}\sqrt{{\sum \limits _{mrc\in MRC_{i}^{*}}{PNS\text {(}MRIP{{C}_{i}}(mrc)\text {,}\,MRIP{{C}_{j}}(F_{i\ j}^{MRC}(mrc))\text {)}}}}\text {,} \\ \end{gathered} \end{aligned}$$
(18)

where \(F_{i\ j}^{MRC}\) is the function, intended to express elements of correspondence (14) of the agent \(ag_i\) through concepts of \(ag_j\) agent’s ontology, and defined as follows:

$$\begin{aligned} \begin{gathered} F_{i\ j}^{MRC}(mrc)=(MRL_{i\ j}(proj_1(mrc)),MRL_{i\ j}(proj_2(mrc)),\\ MMT_{i\ j}(proj_3(mrc))). \end{gathered} \end{aligned}$$

Thus, the consistency of two problem-solving protocols could be evaluated as the geometric mean of similarities of their components (5) using expressions (11), (13), (16), and (18)

$$\begin{aligned} \begin{gathered} prots_{i\ j}^{ag}=\root 4 \of {ROLS(prot_i^{ag},prot_j^{ag})MTPS(prot_i^{ag},prot_j^{ag})}\\ * \root 4 \of {MRCS(prot_i^{ag},prot_j^{ag})SCHS(prot_i^{ag},prot_j^{ag})}. \end{gathered} \end{aligned}$$
(19)

5 An Example of the Protocol Consistency Evaluation

Let us consider the use of the proposed method for evaluating the similarity of the problem-solving protocols on the example of two maximally simplified protocols (the number of agent roles and transmitted messages is reduced) of agents for planning the restoration of the power grid (Fig. 1) [17]. These protocols provide data exchange on the predicted energy consumption between the agent of operational modes, which solves the subproblem of optimizing the switching in the power grid during its recovery, and the agent of consumption prediction. The protocol \(prot_{1}^{agsp}\) assumes unconditional transmission of the results of predicting the energy consumption of nodes in a given grid configuration from the agent of consumption prediction to the agent of operational modes upon its request. The protocol \(prot_{2}^{agsp}\) assumes that the prediction is performed by the agent of consumption prediction for a reward that it sets depending on the complexity of the task, while the agents can bargain for no more than one round.

Fig. 1.
figure 1

Messaging schemes in the considered problem-solving protocols

To describe the considered protocols, ontologies \(ont_{1}^{agsp}\) and \(ont_{2}^{agsp}\) of agents \(ag_{1}^{sp}\) and \(ag_{2}^{sp}\), respectively, have been developed. For simplicity of presentation, the indices of lexemes and their corresponding concepts in these ontologies coincide. In addition, since this work is devoted to evaluating the consistency of protocols, not ontologies, they were pre-aligned. As a result, each concept of ontology \(ont_{1}^{agsp}\) corresponds to strictly one concept of ontology \(ont_{2}^{agsp}\). The ontology of agent \(ag_{1}^{sp}\) is described by the following expression:

$$\begin{aligned} ont_{1}^{agsp}={<}{{L}_{1}},{{C}_{1}},{{R}_{1}},A{{T}_{1}},F{{C}_{1}},F{{R}_{1}},F{{A}_{1}},H_{1}^{c},H_{1}^{r},INS{{T}_{1}}{>}, \end{aligned}$$

where \(L_{1}^{c}=\{\) \(l_{1\ 0}^{c}=\) “concept”, \(l_{1\ 1}^{c}=\) “agent”, \(l_{1\ 2}^{c}=\) “message”, \(l_{1\ 3}^{c}=\) “action”, \(l_{1\ 4}^{c}=\) “state”, \(l_{1\ 5}^{c}=\) “Agent of operational modes”, \(l_{1\ 6}^{c}=\) “Agent of consumption prediction”, \(l_{1\ 7}^{c}=\) “request-consumption”, \(l_{1\ 8}^{c}=\) “report-consumption”, \(l_{1\ 9}^{c}=\) “report-shutdown”, \(l_{1\ 10}^{c}=\) “Initialize power grid model”, \(l_{1\ 11}^{c}=\) “Send request-consumption”, \(l_{1\ 12}^{c}=\) “Receive report-consumption”, \(l_{1\ 13}^{c}=\) “Faults detection”, \(l_{1\ 14}^{c}=\) “Reconfigure power grid model”, \(l_{1\ 15}^{c}=\) “No faults detection”, \(l_{1\ 16}^{c}=\) “Send report-shutdown”, \(l_{1\ 17}^{c}=\) “Initialization”, \(l_{1\ 18}^{c}=\) “Receive request-consumption”, \(l_{1\ 19}^{c}=\) “Consumption prediction”, \(l_{1\ 20}^{c}=\) “Send report-consumption”, \(l_{1\ 21}^{c}=\) “Receive report-shutdown”, \(l_{1\ 22}^{c}=\) “in_aom”, \(l_{1\text { 23}}^{c}=\) “out_aom”, \(l_{1\ 24}^{c}=\) “in_acp”, \(l_{1\ 25}^{c}=\) “out_acp”, \(l_{1\ 26}^{c}=\) “Need to update consumption”, \(l_{1\ 27}^{c}=\) “Wait for solution”, \(l_{1\ 28}^{c}=\) “Need to check faults”, \(l_{1\ 29}^{c}=\) “Grid have to be reconfigured”, \(l_{1\ 30}^{c}=\) “Grid is functional”, \(l_{1\ 31}^{c}=\) “Wait”, \(l_{1\ 32}^{c}=\) “Wait for request-consumption”, \(l_{1\ 33}^{c}=\) “Got consumption prediction request”, \(l_{1\ 34}^{c}=\) “Prediction results are obtained”, \(l_{1\ 35}^{c}=\) “fusion”\(\}\), \(L_{1}^{r}=\{l_{1\ 1}^{r}=\) “type of”\(\}\), \({{C}_{1}}=\{{{c}_{1\ 0}}\),...,\({{c}_{1\ 35}}\}\), \({{R}_{1}}=\{{{r}_{1\ 1}}=\{({{c}_{1\ 1}},{{c}_{1\ 0}}),...,({{c}_{1\ 4}},{{c}_{1\ 0}}),\) \(({{c}_{1\ 5}},{{c}_{1\ 1}}),\) \(({{c}_{1\ 6}},\) \({{c}_{1\ 1}}),\) \(({{c}_{1\ 7}},{{c}_{1\ 2}}),\) \(({{c}_{1\ 8}},{{c}_{1\ 2}}),\) \(({{c}_{1\ 9}},{{c}_{1\ 2}}),\) \(({{c}_{1\ 10}},{{c}_{1\ 3}}),...,({{c}_{1\ 21}},{{c}_{1\ 3}}),\) \(({{c}_{1\ 22}},{{c}_{1\ 4}}),\) \(...,({{c}_{1\ 34}},{{c}_{1\ 4}}),\) \(({{c}_{1\ 35}},{{c}_{1\ 0}})\}\}\), \(A{{T}_{1}}=\emptyset \), \(F{{C}_{1}}=\{(l_{1\ 0}^{c},{{c}_{1\ 0}}),...,(l_{1\ 35}^{c},{{c}_{1\ 35}})\}\), \(F{{R}_{1}}=\{(l_{1\ 1}^{r},{{r}_{1\ 1}})\}\), \(FA_1=\emptyset \), \(H_{1}^{c}={{r}_{1\ 1}}\), \(H_{1}^{r}=\emptyset \), \(INS{{T}_{1}}=\emptyset \).

The ontology of agent \(ag_{2}^{sp}\) is represented by the tuple

$$\begin{aligned} ont_{2}^{agsp}={<}{{L}_{2}},{{C}_{2}},{{R}_{2}},A{{T}_{2}},F{{C}_{2}},F{{R}_{2}},F{{A}_{2}},H_{2}^{c},H_{2}^{r},INS{{T}_{2}}{>}, \end{aligned}$$

where \(L_{2}^{c}=\{\) \(l_{2\ 0}^{c}=\) “concept”, \(l_{2\ 1}^{c}=\) “agent”, \(l_{2\ 2}^{c}=\) “message”, \(l_{2\ 3}^{c}=\) “action”, \(l_{2\ 4}^{c}=\) “state”, \(l_{2\ 5}^{c}=\) “Agent of operational modes”, \(l_{2\ 6}^{c}=\) “Agent of consumption prediction”, \(l_{2\ 7}^{c}=\) “request-consumption”, \(l_{2\ 8}^{c}=\) “report-consumption”, \(l_{2\ 9}^{c}=\) “report-shutdown”, \(l_{2\ 10}^{c}=\) “request-payment”, \(l_{2\ 11}^{c}=\) “payment”, \(l_{2\ 12}^{c}=\) “offer-price”, \(l_{2\ 13}^{c}=\) “accept-proposal”, \(l_{2\ 14}^{c}=\) “reject-proposal”, \(l_{2\ 15}^{c}=\) “Initialize power grid model”, \(l_{2\ 16}^{c}=\) “Send request-consumption”, \(l_{2\ 17}^{c}=\) “Receive report-consumption”, \(l_{2\ 18}^{c}=\) “Faults detection”, \(l_{2\ 19}^{c}=\) “Reconfigure power grid model”, \(l_{2\ 20}^{c}=\) “No faults detection”, \(l_{2\ 21}^{c}=\) “Send report-shutdown”, \(l_{2\ 22}^{c}=\) “Initialization”, \(l_{2\ 23}^{c}=\) “Receive request-consumption”, \(l_{2\ 24}^{c}=\) “Consumption prediction”, \(l_{2\ 25}^{c}=\) “Send report-consumption”, \(l_{2\ 26}^{c}=\) “Receive report-shutdown”, \(l_{2\ 27}^{c}=\) “Receive request-payment”, \(l_{2\ 28}^{c}=\) “Check if price is acceptable”, \(l_{2\text { 29}}^{c}=\) “Send payment”, \(l_{2\ 30}^{c}=\) “Check if price is not acceptable”, \(l_{2\ 31}^{c}=\) “Send price offer”, \(l_{2\ 32}^{c}=\) “Receive accept-proposal”, \(l_{2\ 33}^{c}=\) “Receive reject-proposal”, \(l_{2\ 34}^{c}=\) “Price estimation”, \(l_{2\ 35}^{c}=\) “Send request-payment”, \(l_{2\ 36}^{c}=\) “Receive payment”, \(l_{2\ 37}^{c}=\) “Receive price offer”, \(l_{2\ 38}^{c}=\) “Send accept-proposal”, \(l_{2\ 39}^{c}=\) “Send reject-proposal”, \(l_{2\ 40}^{c}=\) “in_aom”, \(l_{2\text { 41}}^{c}=\) “out_aom”, \(l_{2\ 42}^{c}=\) “in_acp”, \(l_{2\ 43}^{c}=\) “out_acp”, \(l_{2\ 44}^{c}=\) “Need to update consumption”, \(l_{2\ 45}^{c}=\) “Wait for solution”, \(l_{2\ 46}^{c}=\) “Need to check faults”, \(l_{2\ 47}^{c}=\) “Grid have to be reconfigured”, \(l_{2\ 48}^{c}=\) “Grid is functional”, \(l_{2\ 49}^{c}=\) “Wait”, \(l_{2\ 50}^{c}=\) “Wait for request-consumption”, \(l_{2\ 51}^{c}=\) “Got consumption prediction request”, \(l_{2\ 52}^{c}=\) “Prediction results are obtained”, \(l_{2\ 53}^{c}=\) “Wait for payment request”, \(l_{2\ 54}^{c}=\) “Got payment request”, \(l_{2\ 55}^{c}=\) “Price negotiated”, \(l_{2\ 56}^{c}=\) “Price offer prepared”, \(l_{2\ 57}^{c}=\) “Wait for response to the offer”, \(l_{2\ 58}^{c}=\) “Price not agreed”, \(l_{2\ 59}^{c}=\) “Price estimated”, \(l_{2\ 60}^{c}=\) “Wait for message”, \(l_{2\ 61}^{c}=\) “Consumption prediction request is paid”, \(l_{2\ 62}^{c}=\) “Got price offer”, \(l_{2\ 63}^{c}=\) “Price accepted”, \(l_{2\ 64}^{c}=\) “Price rejected”, \(l_{2\ 65}^{c}=\) “fusion”\(\}\), \(L_{2}^{r}=\{\) \(l_{2\ 1}^{r}=\) “type of”\(\}\), \({{C}_{2}}=\{\) \({{c}_{2\ 0}}\), ..., \({{c}_{2\ 65}}\) \(\}\), \({{R}_{2}}=\{{{r}_{2\ 1}}=\{({{c}_{2\ 1}},{{c}_{2\ 0}}),...,({{c}_{2\ 4}},{{c}_{2\ 0}}),\) \(({{c}_{2\ 5}},{{c}_{2\ 1}}),\) \(({{c}_{2\ 6}},{{c}_{2\ 1}}),({{c}_{2\ 7}},{{c}_{2\ 2}}),...,({{c}_{2\ 14}},{{c}_{2\ 2}}),\) \(({{c}_{2\ 15}},{{c}_{2\ 3}}),...,({{c}_{2\ 39}},{{c}_{2\ 3}}),({{c}_{2\ 40}},{{c}_{2\ 4}}),...,\) \(({{c}_{2\ 64}},{{c}_{2\ 4}}),\) \(({{c}_{2\ 65}},{{c}_{2\ 0}})\}\}\), \(A{{T}_{2}}=\emptyset \), \(F{{R}_{2}}=\{(l_{2\ 1}^{r},{{r}_{2\ 1}})\}\), \(F{{A}_{2}}=\emptyset \), \(H_{2}^{c}={{r}_{2\ 1}}\), \(H_{2}^{r}=\emptyset \), \(INS{{T}_{2}}=\emptyset \).

The protocol \(prot_{1}^{agsp}\) (Fig. 1) is defined using ontology \(ont_{1}^{agsp}\) concepts by the following expression:

$$\begin{aligned} prot_1^{agsp}={<}ROL^1,MTP^1,MRC^1,sch^1{>}, \end{aligned}$$

where \(ROL^{1}=\{rol_{1}^{1}={{c}_{1\ 5}},rol_{2}^{1}={{c}_{1\ 6}}\}\), \(MTP_{{}}^{1}=\{mtp_{1}^{1}={{c}_{1\ 7}},\) \(mtp_{2}^{1}={{c}_{1\ 8}},\) \(mtp_{3}^{1}={{c}_{1\ 9}}\}\), \(MRC_{{}}^{1}=\{((rol_{1}^{1},rol_{2}^{1}),mtp_{1}^{1}),\) \(((rol_{1}^{1},rol_{2}^{1}),mtp_{2}^{1}),\) \(((rol_{1}^{1},rol_{2}^{1}),mtp_{3}^{1})\}\), and scheme \(sc{{h}^{1}}\), graphically shown in Fig. 2, is formally defined by the expression

$$\begin{aligned} sc{{h}^{1}}={<}A{{N}^{1}},IP{{N}^{1}},T{{R}^{SC}}^{1},{{R}^{SC}}^{1},RA{{C}^{1}},MRIP{{C}^{1}}{>}, \end{aligned}$$

where \(A{{N}^{1}}=\{an_{1}^{1},an_{2}^{1}\}\), \(IP{{N}^{1}}=\{ipn_{1}^{1}\}\), \(TR^{SC1}=\{tr_{1}^{SC1}={{c}_{1\ 35}}\}\), \(R^{SC1}=\{(tr_{1}^{SC1},tr_{i1\ 1}^{1},tr_{a1\ 2}^{1}),\) \((tr_{1}^{SC1\ 1},tr_{i1\ 2}^{1},tr_{a2\ 2}^{1}),\) \((tr_{1}^{SC1\ 1},tr_{i1\ 3}^{1},tr_{a2\ 4}^{1}),\) \((tr_{1}^{SC1\ 1},tr_{i1\ 4}^{1},tr_{a1\ 3}^{1}),\) \((tr_{1}^{SC1\ 1},tr_{i1\ 5}^{1},tr_{a1\ 7}^{1}),\) \((tr_{1}^{SC1\ 1},tr_{i1\ 6}^{1},tr_{a2\ 5}^{1})\}\), \(RAC^{1}=\{(rol_{1}^{1},an_{1}^{1}),(rol_{2}^{1},an_{2}^{1})\}\), \(MRIPC^{1}=\) \(\{(((rol_{1}^{1},rol_{2}^{1}),mrc_{1}^{1}),ipn_{1}^{1}),\) \((((rol_{1}^{1},rol_{2}^{1}),mrc_{2}^{1}),ipn_{1}^{1}),\) \((((rol_{1}^{1},rol_{2}^{1}),mrc_{3}^{1}),ipn_{1}^{1})\}\).

Fig. 2.
figure 2

Multi-agent interaction protocol \(prot_{1}^{agsp}\) net

A-net \(an_{1}^{1}\in AN_{{}}^{1}\) corresponding to the role \(rol_{1}^{1}\) of agent of operational modes in the protocol \(prot_{1}^{agsp}\) is defined by the expression

$$\begin{aligned} an_{1}^{1}={<}PL_{a1}^{1},TR_{a1}^{1},IR_{a1}^{1}{>}, \end{aligned}$$

where \(PL_{a1}^{1}=\{pl_{a1\ 1}^{1}={{c}_{1\text { 22}}},\) \(pl_{a1\ 2}^{1}={{c}_{1\text { 26}}},\) \(pl_{a1\ 3}^{1}={{c}_{1\text { 27}}},\) \(pl_{a1\ 4}^{1}={{c}_{1\text { 28}}},\) \(pl_{a1\ 5}^{1}={{c}_{1\text { 29}}},\) \(pl_{a1\ 6}^{1}={{c}_{1\text { 30}}},\) \(pl_{a1\ 7}^{1}={{c}_{1\text { 23}}}\},\) \(TR_{a1}^{1}=\{tr_{a1\ 1}^{1}={{c}_{1\text { 10}}},\) \(tr_{a1\ 2}^{1}={{c}_{1\text { 11}}},\) \(tr_{a1\ 3}^{1}={{c}_{1\text { 12}}},\) \(tr_{a1\ 4}^{1}={{c}_{1\text { 13}}},\) \(tr_{a1\ 5}^{1}={{c}_{1\text { 14}}},\) \(tr_{a1\ 6}^{1}={{c}_{1\text { 15}}},\) \(tr_{a1\ 7}^{1}={{c}_{1\text { 16}}}\},\) \(IR_{a1}^{1}=\{(pl_{a1\ 1}^{1},tr_{a1\ 1}^{1}),\) \((tr_{a1\ 1}^{1},pl_{a1\ 2}^{1}),\) \((pl_{a1\ 2}^{1},tr_{a1\ 2}^{1}),\) \((tr_{a1\ 2}^{1},pl_{a1\ 3}^{1}),\) \((pl_{a1\ 3}^{1},tr_{a1\ 3}^{1}),\) \((tr_{a1\ 3}^{1},pl_{a1\ 4}^{1}),\) \((pl_{a1\ 4}^{1},tr_{a1\ 4}^{1}),\) \((tr_{a1\ 4}^{1},pl_{a1\ 5}^{1}),\) \((pl_{a1\ 5}^{1},tr_{a1\ 5}^{1}),\) \((tr_{a1\ 5}^{1},pl_{a1\ 2}^{1}),\) \((pl_{a1\ 4}^{1},tr_{a1\ 6}^{1}),\) \((tr_{a1\ 6}^{1},pl_{a1\ 6}^{1}),\) \((pl_{a1\ 6}^{1},tr_{a1\ 7}^{1}),\) \((tr_{a1\ 7}^{1},pl_{a1\ 7}^{1})\}\).

A-net \(an_{2}^{1}\in AN_{{}}^{1}\) corresponding to the role \(rol_{2}^{1}\) of agent of consumption prediction in the protocol \(prot_{1}^{agsp}\) is defined by the expression

$$\begin{aligned} an_{2}^{1}={<}PL_{a2}^{1},TR_{a2}^{1},IR_{a2}^{1}{>}, \end{aligned}$$

where \(PL_{a2}^{1}=\{pl_{a2\ 1}^{1}={{c}_{1\text { 24}}},\) \(pl_{a2\ 2}^{1}={{c}_{1\text { 32}}},\) \(pl_{a2\ 3}^{1}={{c}_{1\text { 33}}},\) \(pl_{a2\ 4}^{1}={{c}_{1\text { 34}}},\) \(pl_{a2\ 5}^{1}={{c}_{1\text { 25}}}\},\) \(TR_{a2}^{1}=\{tr_{a2\ 1}^{1}={{c}_{1\text { 17}}},\) \(tr_{a2\ 2}^{1}={{c}_{1\text { 18}}},\) \(tr_{a2\ 3}^{1}={{c}_{1\text { 19}}},\) \(tr_{a2\ 4}^{1}={{c}_{1\text { 20}}},\) \(tr_{a2\ 5}^{1}={{c}_{1\text { 21}}}\},\) \(IR_{a2}^{1}=\{(pl_{a2\ 1}^{1},tr_{a2\ 1}^{1}),\) \((tr_{a2\ 1}^{1},pl_{a2\ 2}^{1}),\) \((pl_{a2\ 2}^{1},tr_{a2\ 2}^{1}),\) \((tr_{a2\ 2}^{1},pl_{a2\ 3}^{1}),\) \((pl_{a2\ 3}^{1},tr_{a2\ 3}^{1}),\) \((tr_{a2\ 3}^{1},pl_{a2\ 4}^{1}),\) \((pl_{a2\ 4}^{1},tr_{a2\ 4}^{1}),\) \((tr_{a2\ 4}^{1},pl_{a2\ 2}^{1}),\) \((pl_{a2\ 2}^{1},tr_{a2\ 5}^{1}),\) \((tr_{a2\ 5}^{1},pl_{a2\ 5}^{1})\}\). IP-net \(ipn_{1}^{1}\in IPN_{{}}^{1}\) in the protocol \(prot_{1}^{agsp}\) is defined by the expression

$$\begin{aligned} ipn_{1}^{1}={<}PL_{i1}^{1},TR_{i1}^{1},IR_{i1}^{1}{>}, \end{aligned}$$

where \(PL_{i1}^{1}=\{pl_{i1\ 1}^{1}={{c}_{1\ 7}},\) \(pl_{i1\ 2}^{1}={{c}_{1\text { 31}}},\) \(pl_{i1\ 3}^{1}={{c}_{1\ 8}},\) \(pl_{i1\ 4}^{1}={{c}_{1\text { 31}}},\) \(pl_{i1\ 5}^{1}={{c}_{1\ 9}}\},\) \(TR_{i1}^{1}=\{tr_{i1\ 1}^{1}={{c}_{1\text { 11}}},\) \(tr_{i1\ 2}^{1}={{c}_{1\text { 18}}},\) \(tr_{i1\ 3}^{1}={{c}_{1\text { 20}}},\) \(tr_{i1\ 4}^{1}={{c}_{1\text { 12}}},\) \(tr_{i1\ 5}^{1}={{c}_{1\text { 16}}},\) \(tr_{i1\ 6}^{1}={{c}_{1\text { 21}}}\},\) \(IR_{i1}^{1}=\{(tr_{i1\ 1}^{1},pl_{i1\ 1}^{1}),\) \((pl_{i1\ 1}^{1},tr_{i1\ 2}^{1}),\) \((tr_{i1\ 2}^{1},pl_{i1\ 2}^{1}),\) \((pl_{i1\ 2}^{1},tr_{i1\ 3}^{1}),\) \((tr_{i1\ 3}^{1},pl_{i1\ 3}^{1}),\) \((pl_{i1\ 3}^{1},tr_{i1\ 4}^{1}),\) \((tr_{i1\ 4}^{1},pl_{i1\ 4}^{1}),\) \((pl_{i1\ 4}^{1},tr_{i1\ 5}^{1}),\) \((tr_{i1\ 5}^{1},pl_{i1\ 5}^{1}),\) \((pl_{i1\ 5}^{1},tr_{i1\ 6}^{1})\}\)

The protocol \(prot_{2}^{agsp}\) (Fig. 1) is defined using ontology \(ont_{2}^{agsp}\) concepts by the following expression:

$$\begin{aligned} prot_{2}^{agsp}={<}ROL_{{}}^{2},MTP_{{}}^{2},MRC_{{}}^{2},sch_{{}}^{2}{>}, \end{aligned}$$

where \(ROL_{{}}^{2}=\{rol_{1}^{2}={{c}_{2\ 5}},rol_{2}^{2}={{c}_{2\ 6}}\}\), \(MTP_{{}}^{2}=\{mtp_{1}^{2}={{c}_{2\ 7}},\) \(mtp_{2}^{2}={{c}_{2\ 8}},\) \(mtp_{3}^{2}={{c}_{2\ 9}},\) \(mtp_{4}^{2}={{c}_{2\ 10}},\) \(mtp_{5}^{2}={{c}_{2\ 11}},\) \(mtp_{6}^{2}={{c}_{2\ 12}},\) \(mtp_{7}^{2}={{c}_{2\ 13}},\) \(mtp_{8}^{2}={{c}_{2\ 14}}\}\), \(MRC_{{}}^{2}=\{((rol_{1}^{2},rol_{2}^{2}),mtp_{1}^{2}),\) \(((rol_{1}^{2},rol_{2}^{2}),mtp_{2}^{2}),\) \(((rol_{1}^{2},rol_{2}^{2}),mtp_{3}^{2}),\) \(((rol_{1}^{2},rol_{2}^{2}),mtp_{4}^{2}),\) \(((rol_{1}^{2},rol_{2}^{2}),mtp_{5}^{2}),\) \(((rol_{1}^{2},rol_{2}^{2}),mtp_{6}^{2}),\) \(((rol_{1}^{2},rol_{2}^{2}),mtp_{7}^{2}),\) \(((rol_{1}^{2},rol_{2}^{2}),mtp_{8}^{2})\}\), and scheme \(sc{{h}^{\text {2 1}}}\), graphically shown in Fig. 3, is formally defined by the expression

$$\begin{aligned} sc{{h}^{2}}={<}A{{N}^{2}},IP{{N}^{2}},T{{R}^{SC}}^{2},{{R}^{SC}}^{2},RA{{C}^{2}},MRIP{{C}^{2}}{>}, \end{aligned}$$

where \(A{{N}^{2}}=\{an_{1}^{2},an_{2}^{2}\}\), \(IP{{N}^{2}}=\{ipn_{1}^{2}\}\), \(T{{R}^{SC}}^{2}=\{{{c}_{2\text { 65}}}\}\), \({{R}^{SC}}^{2}=\{(tr_{1}^{SC2},tr_{i1\ 1}^{2},tr_{a1\ 2}^{2}),\) \((tr_{1}^{SC2},tr_{i1\ 2}^{2},tr_{a2\ 2}^{2}),\) \((tr_{1}^{SC2},tr_{i1\ 3}^{2},tr_{a2\ 4}^{2}),\) \((tr_{1}^{SC2},tr_{i1\ 4}^{2},tr_{a1\ 3}^{2}),\) \((tr_{1}^{SC2},tr_{i1\ 5}^{2},tr_{a1\ 5}^{2}),\) \((tr_{1}^{SC2},tr_{i1\ 6}^{2},tr_{a2\ 5}^{2}),\) \((tr_{1}^{SC2},tr_{i1\ 7}^{2},tr_{a1\ 7}^{2}),\) \((tr_{1}^{SC2},tr_{i1\ 8}^{2},tr_{a2\ 6}^{2}),\) \((tr_{1}^{SC2},tr_{i1\ 9}^{2},tr_{a2\ 8}^{2}),\) \((tr_{1}^{SC2},tr_{i1\text { 10}}^{2},tr_{a1\ 8}^{2}),\) \((tr_{1}^{SC2},tr_{i1\text { 11}}^{2},tr_{a2\text { 10}}^{2}),\) \((tr_{1}^{SC2},tr_{i1\text { 12}}^{2},tr_{a1\ 9}^{2}),\) \((tr_{1}^{SC2},tr_{i1\text { 13}}^{2},tr_{a2\text { 12}}^{2}),\) \((tr_{1}^{SC2},tr_{i1\text { 14}}^{2},tr_{a1\text { 10}}^{2}),\) \((tr_{1}^{SC2},tr_{i1\text { 15}}^{2},tr_{a1\text { 14}}^{2}),\) \((tr_{1}^{SC2},tr_{i1\text { 16}}^{2},tr_{a2\text { 13}}^{2})\}\), \(RA{{C}^{2}}=\{(rol_{1}^{2},an_{1}^{2}),(rol_{2}^{2},an_{2}^{2})\}\), \(MRIP{{C}^{2}}=\) \(\{(((rol_{1}^{2},rol_{2}^{2}),mrc_{1}^{2}),ipn_{1}^{2}),\) ..., \((((rol_{1}^{2},rol_{2}^{2}),mrc_{8}^{2}),ipn_{1}^{2})\}\).

Fig. 3.
figure 3

Multi-agent interaction protocol \(prot_{2}^{agsp}\) net

A-net \(an_{1}^{2}\in AN_{{}}^{2}\) corresponding to the role \(rol_{1}^{2}\) of agent of operational modes in the protocol \(prot_{\text {2 1}}^{agsp}\) is defined by the expression

$$\begin{aligned} an_{1}^{2}={<}PL_{a1}^{2},TR_{a1}^{2},IR_{a1}^{2}{>}, \end{aligned}$$

where \(PL_{a1}^{2}=\{pl_{a1\ 1}^{2}={{c}_{2\text { 40}}},\) \(pl_{a1\ 2}^{2}={{c}_{2\text { 44}}},\) \(pl_{a1\ 3}^{2}={{c}_{2\text { 53}}},\) \(pl_{a1\ 4}^{2}={{c}_{2\text { 54}}},\) \(pl_{a1\ 5}^{2}={{c}_{2\text { 55}}},\) \(pl_{a1\ 6}^{2}={{c}_{2\text { 56}}},\) \(pl_{a1\ 7}^{2}={{c}_{2\text { 57}}},\) \(pl_{a1\ 8}^{2}={{c}_{2\text { 58}}},\) \(pl_{a1\ 9}^{2}={{c}_{2\text { 45}}},\) \(pl_{a1\text { 10}}^{2}={{c}_{2\text { 46}}},\) \(pl_{a1\text { 11}}^{2}={{c}_{2\text { 47}}},\) \(pl_{a1\text { 12}}^{2}={{c}_{2\text { 48}}},\) \(pl_{a1\text { 13}}^{2}={{c}_{2\text { 41}}}\},\) \(TR_{a1}^{2}=\{tr_{a1\ 1}^{2}={{c}_{2\text { 15}}},\) \(tr_{a1\ 2}^{2}={{c}_{2\text { 16}}},\) \(tr_{a1\ 3}^{2}={{c}_{2\text { 27}}},\) \(tr_{a1\ 4}^{2}={{c}_{2\text { 28}}},\) \(tr_{a1\ 5}^{2}={{c}_{2\text { 29}}},\) \(tr_{a1\ 6}^{2}={{c}_{2\text { 30}}},\) \(tr_{a1\ 7}^{2}={{c}_{2\text { 31}}},\) \(tr_{a1\ 8}^{2}={{c}_{2\text { 32}}},\) \(tr_{a1\ 9}^{2}={{c}_{2\text { 33}}},\) \(tr_{a1\text { 10}}^{2}={{c}_{2\text { 17}}},\) \(tr_{a1\text { 11}}^{2}={{c}_{2\text { 18}}},\) \(tr_{a1\text { 12}}^{2}={{c}_{2\text { 19}}},\) \(tr_{a1\text { 13}}^{2}={{c}_{2\text { 20}}},\) \(tr_{a1\text { 14}}^{2}={{c}_{2\text { 21}}}\},\) \(IR_{a1}^{2}=\{(pl_{a1\ 1}^{2},tr_{a1\ 1}^{2}),\) \((tr_{a1\ 1}^{2},pl_{a1\ 2}^{2}),\) \((pl_{a1\ 2}^{2},tr_{a1\ 2}^{2}),\) \((tr_{a1\ 2}^{2},pl_{a1\ 3}^{2}),\) \((pl_{a1\ 3}^{2},tr_{a1\ 3}^{2}),\) \((tr_{a1\ 3}^{2},pl_{a1\ 4}^{2}),\) \((pl_{a1\ 4}^{2},tr_{a1\ 4}^{2}),\) \((tr_{a1\ 4}^{2},pl_{a1\ 5}^{2}),\) \((pl_{a1\ 5}^{2},tr_{a1\ 5}^{2}),\) \((tr_{a1\ 5}^{2},pl_{a1\ 9}^{2}),\) \((pl_{a1\ 9}^{2},tr_{a1\text { 10}}^{2}),\) \((tr_{a1\text { 10}}^{2},pl_{a1\text { 10}}^{2}),\) \((pl_{a1\text { 10}}^{2},tr_{a1\text { 11}}^{2}),\) \((tr_{a1\text { 11}}^{2},pl_{a1\text { 11}}^{2}),\) \((pl_{a1\text { 11}}^{2},tr_{a1\text { 12}}^{2}),\) \((tr_{a1\text { 12}}^{2},pl_{a1\ 2}^{2}),\) \((pl_{a1\text { 10}}^{2},tr_{a1\text { 13}}^{2}),\) \((tr_{a1\text { 13}}^{2},pl_{a1\text { 12}}^{2}),\) \((pl_{a1\text { 12}}^{2},tr_{a1\text { 14}}^{2}),\) \((pl_{a1\ 4}^{2},tr_{a1\ 6}^{2}),\) \((tr_{a1\ 6}^{2},pl_{a1\ 6}^{2}),\) \((pl_{a1\ 6}^{2},tr_{a1\ 7}^{2}),\) \((tr_{a1\ 7}^{2},pl_{a1\ 7}^{2}),\) \((pl_{a1\ 7}^{2},tr_{a1\ 8}^{2}),\) \((tr_{a1\ 8}^{2},pl_{a1\ 5}^{2}),\) \((pl_{a1\ 7}^{2},tr_{a1\ 9}^{2}),\) \((tr_{a1\ 9}^{2},pl_{a1\ 8}^{2}),\) \((pl_{a1\ 8}^{2},tr_{a1\text { 14}}^{2}),\) \((tr_{a1\text { 14}}^{2},pl_{a1\text { 13}}^{2})\}\).

A-net \(an_{2}^{2}\in AN_{{}}^{2}\) corresponding to the role \(rol_{2}^{2}\) of agent of consumption prediction in the protocol \(prot_{\text {2 1}}^{agsp}\) is defined by the expression

$$\begin{aligned} an_{2}^{2}={<}PL_{a2}^{2},TR_{a2}^{2},IR_{a2}^{2}{>}, \end{aligned}$$

where \(PL_{a2}^{2}=\{pl_{a2\ 1}^{2}={{c}_{2\text { 42}}},\) \(pl_{a2\ 2}^{2}={{c}_{2\text { 50}}},\) \(pl_{a2\ 3}^{2}={{c}_{2\text { 51}}},\) \(pl_{a2\ 4}^{2}={{c}_{2\text { 59}}},\) \(pl_{a2\ 5}^{2}={{c}_{2\text { 60}}},\) \(pl_{a2\ 6}^{2}={{c}_{2\text { 61}}},\) \(pl_{a2\ 7}^{2}={{c}_{2\text { 62}}},\) \(pl_{a2\ 8}^{2}={{c}_{2\text { 63}}},\) \(pl_{a2\ 9}^{2}={{c}_{2\text { 64}}},\) \(pl_{a2\text { 10}}^{2}={{c}_{2\text { 52}}},\) \(pl_{a2\text { 11}}^{2}={{c}_{2\text { 43}}}\},\) \(TR_{a2}^{2}=\{tr_{a2\ 1}^{2}={{c}_{2\text { 22}}},\) \(tr_{a2\ 2}^{2}={{c}_{2\text { 23}}},\) \(tr_{a2\ 3}^{2}={{c}_{2\text { 34}}},\) \(tr_{a2\ 4}^{2}={{c}_{2\text { 35}}},\) \(tr_{a2\ 5}^{2}={{c}_{2\text { 36}}},\) \(tr_{a2\ 6}^{2}={{c}_{2\text { 37}}},\) \(tr_{a2\ 7}^{2}={{c}_{2\text { 28}}},\) \(tr_{a2\ 8}^{2}={{c}_{2\text { 38}}},\) \(tr_{a2\ 9}^{2}={{c}_{2\text { 30}}},\) \(tr_{a2\text { 10}}^{2}={{c}_{2\text { 39}}},\) \(tr_{a2\text { 11}}^{2}={{c}_{2\text { 24}}},\) \(tr_{a2\text { 12}}^{2}={{c}_{2\text { 25}}},\) \(tr_{a2\text { 13}}^{2}={{c}_{2\text { 26}}}\},\) \(IR_{a2}^{2}=\{(pl_{a2\ 1}^{2},tr_{a2\ 1}^{2}),\) \((tr_{a2\ 1}^{2},pl_{a2\ 2}^{2}),\) \((pl_{a2\ 2}^{2},tr_{a2\ 2}^{2}),\) \((tr_{a2\ 2}^{2},pl_{a2\ 3}^{2}),\) \((pl_{a2\ 3}^{2},tr_{a2\ 3}^{2}),\) \((tr_{a2\ 3}^{2},pl_{a2\ 4}^{2}),\) \((pl_{a2\ 4}^{2},tr_{a2\ 4}^{2}),\) \((tr_{a2\ 4}^{2},pl_{a2\ 5}^{2}),\) \((pl_{a2\ 5}^{2},tr_{a2\ 5}^{2}),\) \((tr_{a2\ 5}^{2},pl_{a2\ 6}^{2}),\) \((pl_{a2\ 6}^{2},tr_{a2\text { 11}}^{2}),\) \((tr_{a2\text { 11}}^{2},pl_{a2\text { 10}}^{2}),\) \((pl_{a2\text { 10}}^{2},tr_{a2\text { 12}}^{2}),\) \((tr_{a2\text { 12}}^{2},pl_{a2\ 2}^{2}),\) \((pl_{a2\ 2}^{2},tr_{a2\text { 13}}^{2}),\) \((tr_{a2\text { 13}}^{2},pl_{a2\text { 11}}^{2}),\) \((pl_{a2\ 5}^{2},tr_{a2\ 6}^{2}),\) \((tr_{a2\ 6}^{2},pl_{a2\ 7}^{2}),\) \((pl_{a2\ 7}^{2},tr_{a2\ 7}^{2}),\) \((tr_{a2\ 7}^{2},pl_{a2\ 8}^{2}),\) \((pl_{a2\ 8}^{2},tr_{a2\ 8}^{2}),\) \((tr_{a2\ 8}^{2},pl_{a2\ 5}^{2}),\) \((pl_{a2\ 7}^{2},tr_{a2\ 9}^{2}),\) \((tr_{a2\ 9}^{2},pl_{a2\ 9}^{2}),\) \((pl_{a2\ 9}^{2},tr_{a2\text { 10}}^{2}),\) \((tr_{a2\text { 10}}^{2},pl_{a2\ 2}^{2})\}\).

IP-net \(ipn_{1}^{2}\in IPN_{{}}^{2}\) in the protocol \(prot_{2}^{agsp}\) is defined by the expression

$$\begin{aligned} ipn_{2}^{2}={<}PL_{i1}^{2},TR_{i1}^{2},IR_{i1}^{2}{>}, \end{aligned}$$

where \(PL_{i1}^{2}=\{pl_{i1\ 1}^{2}={{c}_{2\ 7}},\) \(pl_{i1\ 2}^{2}={{c}_{2\text { 49}}},\) \(pl_{i1\ 3}^{2}={{c}_{2\text { 10}}},\) \(pl_{i1\ 4}^{2}={{c}_{2\text { 49}}},\) \(pl_{i1\ 5}^{2}={{c}_{2\text { 11}}},\) \(pl_{i1\ 6}^{2}={{c}_{2\text { 12}}},\) \(pl_{i1\ 7}^{2}={{c}_{2\text { 49}}},\) \(pl_{i1\ 8}^{2}={{c}_{2\text { 13}}},\) \(pl_{i1\ 9}^{2}={{c}_{2\text { 49}}},\) \(pl_{i1\text { 10}}^{2}={{c}_{2\text { 14}}},\) \(pl_{i1\text { 11}}^{2}={{c}_{2\text { 49}}},\) \(pl_{i1\text { 12}}^{2}={{c}_{2\text { 49}}},\) \(pl_{i1\text { 13}}^{2}={{c}_{2\ 8}},\) \(pl_{i1\text { 14}}^{2}={{c}_{2\text { 49}}},\) \(pl_{i1\text { 15}}^{2}={{c}_{2\ 9}}\},\) \(TR_{i1}^{2}=\{tr_{i1\ 1}^{2}={{c}_{2\text { 16}}},\) \(tr_{i1\ 2}^{2}={{c}_{2\text { 23}}},\) \(tr_{i1\ 3}^{2}={{c}_{2\text { 35}}},\) \(tr_{i1\ 4}^{2}={{c}_{2\text { 27}}},\) \(tr_{i1\ 5}^{2}={{c}_{2\text { 29}}},\) \(tr_{i1\ 6}^{2}={{c}_{2\text { 36}}},\) \(tr_{i1\ 7}^{2}={{c}_{2\text { 31}}},\) \(tr_{i1\ 8}^{2}={{c}_{2\text { 37}}},\) \(tr_{i1\ 9}^{2}={{c}_{2\text { 38}}},\) \(tr_{i1\text { 10}}^{2}={{c}_{2\text { 32}}},\) \(tr_{i1\text { 11}}^{2}={{c}_{2\text { 39}}},\) \(tr_{i1\text { 12}}^{2}={{c}_{2\text { 33}}},\) \(tr_{i1\text { 13}}^{2}={{c}_{2\text { 25}}},\) \(tr_{i1\text { 14}}^{2}={{c}_{2\text { 17}}},\) \(tr_{i1\text { 15}}^{2}={{c}_{2\text { 21}}},\) \(tr_{i1\text { 16}}^{2}={{c}_{2\text { 26}}}\},\) \(IR_{i1}^{2}=\{(tr_{i1\ 1}^{2},pl_{i1\ 1}^{2}),\) \((pl_{i1\ 1}^{2},tr_{i1\ 2}^{2}),\) \((tr_{i1\ 2}^{2},pl_{i1\ 2}^{2}),\) \((pl_{i1\ 2}^{2},tr_{i1\ 3}^{2}),\) \((tr_{i1\ 3}^{2},pl_{i1\ 3}^{2}),\) \((pl_{i1\ 3}^{2},tr_{i1\ 4}^{2}),\) \((tr_{i1\ 4}^{2},pl_{i1\ 4}^{2}),\) \((pl_{i1\ 4}^{2},tr_{i1\ 5}^{2}),\) \((tr_{i1\ 5}^{2},pl_{i1\ 5}^{2}),\) \((pl_{i1\ 5}^{2},tr_{i1\ 6}^{2}),\) \((tr_{i1\ 6}^{2},pl_{i1\text { 12}}^{2}),\) \((pl_{i1\text { 12}}^{2},tr_{i1\text { 13}}^{2}),\) \((tr_{i1\text { 13}}^{2},pl_{i1\text { 13}}^{2}),\) \((pl_{i1\text { 13}}^{2},tr_{i1\text { 14}}^{2}),\) \((tr_{i1\text { 14}}^{2},pl_{i1\text { 14}}^{2}),\) \((pl_{i1\text { 14}}^{2},tr_{i1\text { 15}}^{2}),\) \((tr_{i1\text { 15}}^{2},pl_{i1\text { 15}}^{2}),\) \((pl_{i1\text { 15}}^{2},tr_{i1\text { 16}}^{2}),\) \((pl_{i1\ 4}^{2},tr_{i1\ 7}^{2}),\) \((tr_{i1\ 7}^{2},pl_{i1\ 6}^{2}),\) \((pl_{i1\ 6}^{2},tr_{i1\ 8}^{2}),\) \((tr_{i1\ 8}^{2},pl_{i1\ 7}^{2}),\) \((pl_{i1\ 7}^{2},tr_{i1\ 9}^{2}),\) \((tr_{i1\ 9}^{2},pl_{i1\ 8}^{2}),\) \((pl_{i1\ 8}^{2},tr_{i1\text { 10}}^{2}),\) \((tr_{i1\text { 10}}^{2},pl_{i1\ 9}^{2}),\) \((pl_{i1\ 9}^{2},tr_{i1\ 5}^{2}),\) \((pl_{i1\ 7}^{2},tr_{i1\text { 11}}^{2}),\) \((tr_{i1\text { 11}}^{2},pl_{i1\text { 10}}^{2}),\) \((pl_{i1\text { 10}}^{2},tr_{i1\text { 12}}^{2}),\) \((tr_{i1\text { 12}}^{2},pl_{i1\text { 11}}^{2}),\) \((pl_{i1\text { 11}}^{2},tr_{i1\text { 15}}^{2})\}\).

Before considering directly the process of evaluating the similarity of the protocols for solving the problem, let us give an example of estimation the similarity of two concepts \({{c}_{1\ 12}}\) and \({{c}_{2\ 25}}\) in accordance with the expressions (6)–(8). The lexicographic similarity of concepts LSC is determined by the expression

$$\begin{aligned} \begin{gathered} LSC(c_{1\ 12},c_{2\ 25})=LSL(FC^{-1}({{c}_{1\ 12}}),F{{C}^{-1}}({{c}_{2\ 25}}))=LSL(l_{1\ 12}^{c},l_{2\ 25}^{c})\\ =\max (0,\ 1-\frac{ed(l_{1\ 12}^{c},l_{2\ 25}^{c})}{\min (|l_{1\ 12}^{c}|,|l_{2\ 25}^{c}|)})=\max (0,\ 1-\frac{6}{\min (26,23)})=0,74. \end{gathered} \end{aligned}$$

The taxonomic similarity of concepts \({{c}_{1\ 12}}\) and \({{c}_{2\ 25}}\), using their upper cotopy values \(UC({{c}_{1\ 12}},H_{1}^{c})=\{{{c}_{1\ 12}},{{c}_{1\ 2}},{{c}_{1\ 0}}\},\ UC({{c}_{2\ 25}},H_{2}^{c})=\{{{c}_{2\ 25}},{{c}_{2\ 2}},{{c}_{2\ 0}}\}\) is determined by expression:

$$\begin{aligned} \begin{gathered} TS({{c}_{1\ 12}},{{c}_{2\ 25}},H_{1}^{c},H_{2}^{c})=\frac{|F{{C}^{-1}}(UC({{c}_{1\ 12}},H_{1}^{c})\cap F{{C}^{-1}}(UC({{c}_{2\ 25}},H_{2}^{c}))|}{|F{{C}^{-1}}(UC({{c}_{1\ 12}},H_{1}^{c})\cup F{{C}^{-1}}(UC({{c}_{2\ 25}},H_{2}^{c}))|} \\ =\frac{|\{l_{1\ 12}^{c},l_{1\ 2}^{c},l_{1\text { 0}}^{c}\}\cap \{l_{2\ 25}^{c},l_{2\ 2}^{c},l_{2\text { 0}}^{c}\}|}{|\{l_{1\ 12}^{c},l_{1\ 2}^{c},l_{1\text { 0}}^{c}\}\cup \{l_{2\ 25}^{c},l_{2\ 2}^{c},l_{2\text { 0}}^{c}\}|}=\frac{2}{4}=0,5. \end{gathered} \end{aligned}$$

As a result the of similarity of two concepts is

$$\begin{aligned} {{S}^{C}}({{c}_{1\ 12}},{{c}_{2\ 25}})=\sqrt{LSC({{c}_{1\ 12}},{{c}_{2\ 25}})TS({{c}_{1\ 12}},{{c}_{2\ 25}})}=0,6. \end{aligned}$$

This similarity measure of concepts from different ontologies makes it possible to form correspondence between the roles, used in the description of the protocol by each agent, using expression (10), as follows:

$$\begin{aligned} \begin{gathered} MR{{L}_{1\ 2}}=\{(u,v)|(u,v)\in ROL_{1}^{ag}\times ROL_{2}^{ag}\wedge v=\underset{v'\in C_{2}^{{}}}{\mathop {\arg \max }}\,{{S}^{C}}(u,v') \\ \wedge u=\underset{u'\in C_{1}^{{}}}{\mathop {\arg \max }}\,{{S}^{C}}(u',v)\}=\{({{c}_{1\ 5}},{{c}_{2\ 5}}),({{c}_{1\ 6}},{{c}_{2\ 6}})\}, \end{gathered} \end{aligned}$$

based on which the similarity of the sets of concept-roles is calculated according to (11) as follows

$$\begin{aligned} \begin{gathered} ROLS(ROL_{1}^{ag},ROL_{2}^{ag})\\ ={{\left| ROL_{1}^{ag} \right| }^{-1}}\sum \limits _{mrl\in MR{{L}_{1\ 2}}}{{{S}^{C}}}{(}pro{{j}_{1}}{(}mrl{)}{, }\ pro{{j}_{2}}{(}mrl{))} \\ ={{\left| ROL_{1}^{ag} \right| }^{-1}}({{S}^{C}}({{c}_{1\ 5}},{{c}_{2\ 5}})+{{S}^{C}}({{c}_{1\ 6}},{{c}_{2\ 6}}))=1. \end{gathered} \end{aligned}$$

In the considered example \(ROLS(ROL_{2}^{ag},ROL_{1}^{ag})=1\) also, as the agent roles sets are equal. The similarity of the sets \(MTP_{1}^{ag},\ MTP_{2}^{ag}\) is calculated similarly, using expressions (12), (13):

$$\begin{aligned} \begin{gathered} MM{{T}_{1\ 2}}=\{({{c}_{1\ 7}},{{c}_{2\ 7}}),({{c}_{1\ 8}},{{c}_{2\ 8}}),({{c}_{1\ 9}},{{c}_{2\ 9}})\},\\ MTPS(MTP_{1}^{ag},MTP_{2}^{ag})\\ ={{\left| MTP_{1}^{ag} \right| }^{-1}}\sum \limits _{mmt\in MM{{T}_{1\ 2}}}{{{S}^{C}}}{(}pro{{j}_{1}}{(}mmt{)}{, }\ pro{{j}_{2}}{(}mmt{))} \\ ={{\left| MTP_{1}^{ag} \right| }^{-1}}({{S}^{C}}({{c}_{1\ 7}},{{c}_{2\ 7}})+{{S}^{C}}({{c}_{1\ 8}},{{c}_{2\ 8}})+{{S}^{C}}({{c}_{1\ 9}},{{c}_{2\ 9}}))=1, \\ MTPS(MTP_{2}^{ag},MTP_{1}^{ag})=0,375. \end{gathered} \end{aligned}$$

As can be seen in this case \(MTPS(MTP_{1}^{ag},MTP_{2}^{ag})\ne MTPS(MTP_{2}^{ag},MTP_{1}^{ag})\), since, in fact, \(MTP_{2}^{ag}\) includes \(MTP_{1}^{ag}\).

To evaluate the degree of similarity of correspondences \(MRC_{1}^{ag},\ MRC_{2}^{ag}\) the abbreviated correspondences using expressions (14), (15) should be formed as follows:

$$\begin{aligned} \begin{gathered} MRC_{1}^{*}=\{(t,u,v)|(t,u,v)\in MRC_{1}^{ag}\wedge t\in pro{{j}_{1}}(MR{{L}_{1\ 2}})\\ \wedge u\in pro{{j}_{1}}(MR{{L}_{1\ 2}})\wedge v\in pro{{j}_{1}}(MM{{T}_{1\ 2}})\} \\ =\{(({{c}_{1\ 5}},{{c}_{1\ 6}}),{{c}_{1\ 7}}),(({{c}_{1\ 5}},{{c}_{1\ 6}}),{{c}_{1\ 8}}),(({{c}_{1\ 5}},{{c}_{1\ 6}}),{{c}_{1\ 9}})\},\\ MRC_{2}^{**}=\{((MRL_{1\ 2}^{-1}(t),MRL_{1\ 2}^{-1}(u),MMT_{1\ 2}^{-1}(v)))|(t,u,v)\in MRC_{2}^{ag}\\ \wedge t\in pro{{j}_{2}}(MR{{L}_{1\ 2}})\wedge u\in pro{{j}_{2}}(MR{{L}_{1\ 2}})\wedge v\in pro{{j}_{2}}(MM{{T}_{1\ 2}})\} \\ =\{(({{c}_{1\ 5}},{{c}_{1\ 6}}),{{c}_{1\ 7}}),(({{c}_{1\ 5}},{{c}_{1\ 6}}),{{c}_{1\ 8}}),(({{c}_{1\ 5}},{{c}_{1\ 6}}),{{c}_{1\ 9}})\}. \end{gathered} \end{aligned}$$

Thus, using expression (16), the similarity of correspondences \(MRC_{1}^{ag},\ MRC_{2}^{ag}\) is calculated in accordance with the expression

$$\begin{aligned} \begin{gathered} MRCS(MRC_{1}^{ag},MRC_{2}^{ag}) \\ =\frac{\left| MRC_{1}^{*}\cap MRC_{2}^{**} \right| }{\left| MRC_{1}^{{}} \right| +\left| MRC_{2}^{{}} \right| -\left| MRC_{1}^{*}\cap MRC_{2}^{**} \right| }=0,375,\\ MRCS(MRC_{2}^{ag},MRC_{1}^{ag})=0,375. \\ \end{gathered} \end{aligned}$$

Before considering the computation of the similarity of the message exchange schemes, let us demonstrate the computation of the similarity of two Petri nets, defined on the concepts of different ontologies using the example of nets \(an_{1}^{1}\) and \(an_{1}^{2}\). At the first stage, a TAR should be formed based on the corresponding incidence relations \(IR_{a1}^{1}\) and \(IR_{a1}^{2}\), as well as the sets of concepts \(C_1\) and \(C_2\)

$$\begin{aligned} \begin{gathered} TAR_{a\ 1}^{1}=\{(tr_{a1\ 1}^{1},tr_{a1\ 2}^{1}),(tr_{a1\ 2}^{1},tr_{a1\ 3}^{1}),(tr_{a1\ 3}^{1},tr_{a1\ 4}^{1}),(tr_{a1\ 4}^{1},tr_{a1\ 5}^{1}), \\ (tr_{a1\ 3}^{1},tr_{a1\ 6}^{1}),(tr_{a1\ 5}^{1},tr_{a1\ 2}^{1}),(tr_{a1\ 6}^{1},tr_{a1\ 7}^{1})\} \\ =\{({{c}_{1\ 10}},{{c}_{1\ 11}}),({{c}_{1\ 11}},{{c}_{1\ 12}}),({{c}_{1\ 12}},{{c}_{1\ 13}}),({{c}_{1\ 13}},{{c}_{1\ 14}}),({{c}_{1\ 12}},{{c}_{1\ 15}}),\\ ({{c}_{1\ 14}},{{c}_{1\ 11}}),({{c}_{1\ 15}},{{c}_{1\ 16}})\}, \\ TAR_{a\ 1}^{2}=\{(tr_{a1\ 1}^{2},tr_{a1\ 2}^{2}),(tr_{a1\ 2}^{2},tr_{a1\ 3}^{2}),(tr_{a1\ 3}^{2},tr_{a1\ 4}^{2}),(tr_{a1\ 4}^{2},tr_{a1\ 5}^{2}), \\ (tr_{a1\ 5}^{2},tr_{a1\ 10}^{2}),(tr_{a1\ 10}^{2},tr_{a1\ 11}^{2}),(tr_{a1\ 11}^{2},tr_{a1\ 12}^{2}),(tr_{a1\ 12}^{2},tr_{a1\ 2}^{2}),\\ (tr_{a1\ 10}^{2},tr_{a1\ 13}^{2}),(tr_{a1\ 13}^{2},tr_{a1\ 14}^{2}),(tr_{a1\ 3}^{2},tr_{a1\ 6}^{2}),(tr_{a1\ 6}^{2},tr_{a1\ 7}^{2}), \\ (tr_{a1\ 7}^{2},tr_{a1\ 8}^{2}),(tr_{a1\ 8}^{2},tr_{a1\ 5}^{2}),(tr_{a1\ 7}^{2},tr_{a1\ 9}^{2}),(tr_{a1\ 9}^{2},tr_{a1\ 14}^{2})\} \\ =\{({{c}_{2\ 15}},{{c}_{2\ 16}}),({{c}_{2\ 16}},{{c}_{2\ 27}}),({{c}_{2\ 27}},{{c}_{2\ 28}}),({{c}_{2\ 28}},{{c}_{2\ 29}}),({{c}_{2\ 29}},{{c}_{2\ 17}}), \\ ({{c}_{2\ 17}},{{c}_{2\ 18}}),({{c}_{2\ 18}},{{c}_{2\ 19}}),({{c}_{2\ 19}},{{c}_{2\ 16}}),({{c}_{2\ 17}},{{c}_{2\ 20}}),({{c}_{2\ 20}},{{c}_{2\ 21}}), \\ ({{c}_{2\ 27}},{{c}_{2\ 30}}),({{c}_{2\ 30}},{{c}_{2\ 31}}),({{c}_{2\ 31}},{{c}_{2\ 32}}),({{c}_{2\ 32}},{{c}_{2\ 29}}), \\ ({{c}_{2\ 31}},{{c}_{2\ 33}}),({{c}_{2\ 33}},{{c}_{2\ 21}})\}. \end{gathered} \end{aligned}$$

In the next step, a correspondence is established between sets of transitions \(TR_{a1}^{1}\) and \(TR_{a1}^{2}\) as follows:

$$\begin{aligned} \begin{gathered} MTR_{a\ 1\ 1}^{2\ 1}=\{(u,v)|(u,v)\in pro{{j}_{2}}(pn_{1}^{2})\times pro{{j}_{2}}(pn_{1}^{1})\wedge \wedge pn_{1}^{1}=an_{1}^{1} \\ \wedge pn_{1}^{2}=an_{1}^{2}\wedge v=\underset{v'\in C_{1}^{{}}}{\mathop {\arg \max }}\,{{S}^{C}}(u,v')\wedge u=\underset{u'\in C_{2}^{{}}}{\mathop {\arg \max }}\,{{S}^{C}}(u',v)\} \\ =\{({{c}_{2\ 15}},{{c}_{1\ 10}}),({{c}_{2\ 16}},{{c}_{1\ 11}}),({{c}_{2\ 17}},{{c}_{1\ 12}}),({{c}_{2\ 18}},{{c}_{1\ 13}}),({{c}_{2\ 19}},{{c}_{1\ 14}}),\\ ({{c}_{2\ 20}},{{c}_{1\ 14}}),({{c}_{2\ 21}},{{c}_{1\ 15}})\}, \end{gathered} \end{aligned}$$

after which some of the concepts in \(TAR_{a1}^{2}\) can be replaced by the corresponding concepts of the \(a{{g}_{1}}\) agent’s ontology

$$\begin{aligned} \begin{gathered} F_{2\ 1}^{tr}(TAR_{a\ 1}^{2},an_{1}^{1})=\{{<}q,w{>}\,|\,{<}u,v{>}\in TAR_{a\ 1}^{2}\wedge ((q=MTR_{a\ 1\ 1}^{2\ 1}(u) \\ \wedge q\in pro{{j}_{1}}(MTR_{a\ 1\ 1}^{2\ 1}))\vee (q=u\wedge q\notin pro{{j}_{1}}(MTR_{a\ 1\ 1}^{2\ 1}))) \\ \wedge ((w=MTR_{a\ 1\ 1}^{2\ 1}(v)\wedge w\in pro{{j}_{1}}(MTR_{a\ 1\ 1}^{2\ 1}))\\ \vee (w=v\wedge w\notin pro{{j}_{1}}(MTR_{a\ 1\ 1}^{2\ 1})))\} \\ =\{({{c}_{1\ 10}},{{c}_{1\ 11}}),({{c}_{1\ 11}},{{c}_{2\ 27}}),({{c}_{2\ 27}},{{c}_{2\ 28}}),({{c}_{2\ 28}},{{c}_{2\ 29}}),({{c}_{2\ 29}},{{c}_{1\ 12}}), \\ ({{c}_{1\ 12}},{{c}_{1\ 13}}),({{c}_{1\ 13}},{{c}_{1\ 14}}),({{c}_{1\ 14}},{{c}_{1\ 11}}),({{c}_{1\ 12}},{{c}_{1\ 15}}),({{c}_{1\ 15}},{{c}_{1\ 16}}), \\ ({{c}_{2\ 27}},{{c}_{2\ 30}}),({{c}_{2\ 30}},{{c}_{2\ 31}}),({{c}_{2\ 31}},{{c}_{2\ 32}}),({{c}_{2\ 32}},{{c}_{2\ 29}}),({{c}_{2\ 31}},{{c}_{2\ 33}}),\\ ({{c}_{2\ 33}},{{c}_{1\ 16}})\}. \\ \end{gathered} \end{aligned}$$

Thus, the following elements of the expression (17) can be evaluated:

$$\begin{aligned} \begin{gathered} TAR_{a\ 1}^{1}\cap F_{2\ 1}^{tr}(TAR_{a\ 1}^{2},an_{1}^{1})=\{({{c}_{1\ 10}},{{c}_{1\ 11}}),({{c}_{1\ 12}},{{c}_{1\ 13}}),({{c}_{1\ 13}},{{c}_{1\ 14}}),\\ ({{c}_{1\ 12}},{{c}_{1\ 15}}),({{c}_{1\ 14}},{{c}_{1\ 11}}),({{c}_{1\ 15}},{{c}_{1\ 16}})\}, \\ TAR_{a\ 1}^{1}\cup F_{2\ 1}^{tr}(TAR_{a\ 1}^{2},an_{1}^{1})=\{({{c}_{1\ 10}},{{c}_{1\ 11}}),({{c}_{1\ 11}},{{c}_{1\ 12}}),({{c}_{1\ 12}},{{c}_{1\ 13}}),\\ ({{c}_{1\ 13}},{{c}_{1\ 14}}),({{c}_{1\ 12}},{{c}_{1\ 15}}),({{c}_{1\ 14}},{{c}_{1\ 11}}),({{c}_{1\ 15}},{{c}_{1\ 16}}),({{c}_{1\ 11}},{{c}_{2\ 27}}), \\ ({{c}_{2\ 27}},{{c}_{2\ 28}}),({{c}_{2\ 28}},{{c}_{2\ 29}}),({{c}_{2\ 29}},{{c}_{1\ 12}}),({{c}_{2\ 27}},{{c}_{2\ 30}}),({{c}_{2\ 30}},{{c}_{2\ 31}}), \\ ({{c}_{2\ 31}},{{c}_{2\ 32}}),({{c}_{2\ 32}},{{c}_{2\ 29}}),({{c}_{2\ 31}},{{c}_{2\ 33}}),({{c}_{2\ 33}},{{c}_{1\ 16}})\}, \end{gathered} \end{aligned}$$

as well as the expression (17) as a whole

$$\begin{aligned} \begin{gathered} PNS(an_{1}^{1},an_{1}^{2})={{\left| TR_{a\ 1}^{1} \right| }^{-1}}\sum \limits _{mtr\in MTR_{a\ 1\ 1}^{2\ 1}}{{{S}^{C}}(pro{{j}_{1}}(mtr),pro{{j}_{2}}(mtr))}\\ * \frac{\left| TAR_{a\ 1}^{1}\cap F_{2\ 1}^{tr}(TAR_{a\ 1}^{2},pn_{1}^{1}) \right| }{\left| TAR_{a\ 1}^{1}\cup F_{2\ 1}^{tr}(TAR_{a\ 1}^{2},pn_{1}^{1}) \right| }=\frac{7}{7}\cdot \frac{6}{17}=0,35. \end{gathered} \end{aligned}$$

Using this value, as well as the similarity values \(PNS(an_{2}^{1},an_{2}^{2})=0,26\) and \(PNS(ipn_{1}^{1},ipn_{1}^{2})=0,22\) calculated in a similar way, the similarity of the message exchange schemes \(sch_{i}^{ag}\) and \(sch_{j}^{ag}\) is evaluated in accordance with the expression (18)

$$\begin{aligned} \begin{gathered} SCHS(sch_{1}^{ag},sch_{2}^{ag})= \left( {{\left| MR{{L}_{1\ 2}} \right| }}{{\left| MRC_{1}^{*} \right| }}\right) ^{-1/2}\\ *{{\left( \left( PNS\text {(}an_{1}^{1}\text {, }an_{1}^{2}\text {)+}PNS\text {(}an_{2}^{1}\text {, }an_{2}^{2}\text {)} \right) \left( 3*PNS\text {(}ipn_{1}^{1}\text {,}ipn_{1}^{2}\text {)} \right) \right) }^{1/2}} \\ ={{\left( {{\left| 2 \right| }^{-1}}{{\left| 3 \right| }^{-1}}\left( 0,35\text {+}0,26 \right) \left( 3\cdot 0,22 \right) \right) }^{1/2}}=0,26. \end{gathered} \end{aligned}$$

The similarity of the message exchange schemes \(SCHS(sch_{j}^{ag},sch_{i}^{ag})=0,11\) using the similarity values of Petri nets \(PNS(an_{1}^{2},an_{1}^{1})=0,18\), \(PNS(an_{2}^{2},an_{2}^{1})=0,1\), and \(PNS(ipn_{1}^{2},ipn_{1}^{1})=0,08\) is calculated analogically. Thus, the consistency of the problem-solving protocol \(prot_{1}^{ag}\) with \(prot_{2}^{ag}\) can be evaluated using expression (19)

$$\begin{aligned} \begin{gathered} prots_{1\ 2}^{ag}=\root 4 \of {ROLS(prot_{1}^{ag},prot_{2}^{ag})MTPS(prot_{1}^{ag},prot_{2}^{ag})} \\ *\root 4 \of {MRCS(prot_{1}^{ag},prot_{2}^{ag})SCHS(prot_{1}^{ag},prot_{2}^{ag})}=\root 4 \of {1\cdot 1\cdot 0,375\cdot 0,26}\\ =0,56. \end{gathered} \end{aligned}$$

Similarly the consistency of the problem-solving protocol \(prot_{2}^{ag}\) with \(prot_{1}^{ag}\) is \(prots_{2\ 1}^{ag}=0,35\). Consistency of two copies of the same problem-solving protocol is expectedly equal to one.

Thus, despite the fact that the roles of agents in the protocols under consideration completely coincide, as well as lexemes describing the same types of messages, the proposed measure of protocol consistency demonstrates that the protocols are seriously different and need to be negotiated before starting joint work on solving the problem. In addition, this measure can be used as an indirect indicator of the relative “complexity” (the number of actions, agent roles, and interactions between them) of protocols in a pair of agents: the consistency of a more complex protocol with a less complex one is lower than vice versa.

6 Conclusion

The paper discusses the features of building hybrid intelligent multi-agent systems for solving practical problems and difficulties arising from the integration of intelligent agents created by various developers. The necessity of modeling the mechanisms of cohesion of teams of specialists and the transition to CHIMAS is shown. The formal CHIMAS model is considered, and one of the methods necessary for its implementation is described in detail, namely the evaluation of the consistency of problem-solving protocols developed by the agents. Modeling cohesion mechanisms allows to overcome disagreements caused by differences in the agents’ goals, problem’s models, and ways of its solution. As a result, CHIMAS relevantly model the problem-solving by long-existing teams of specialists.